| 1234567891011121314151617181920212223242526272829 | using System;using System.Collections;using System.Collections.Generic;using MemoryPack;using NetCore.Protocol;using NetCore.Protocol.MemoryPack;using Protocol.Protocol.MemoryPack.MemoryMessage;using UnityEngine;public class ClientMemoryWrap : IProtocol{    public object Deserialize(byte[] data)    {        MemoryResponse serialize = MemoryPackSerializer.Deserialize<MemoryResponse>(data);        return serialize;    }    public byte[] Serialize(object serializeObject)    {        MemoryRequest serialize = serializeObject as MemoryRequest;        byte[] data = MemoryPackSerializer.Serialize(serialize);        byte[] sendType = BitConverter.GetBytes((int)ServerType.GameServer);        byte[] sendData = new byte[data.Length + sendType.Length];        Array.Copy(sendType, 0, sendData, 0, sendType.Length);        Array.Copy(data, 0, sendData, 4, data.Length);        return sendData;    }}
 |