public static Goods_EquipPutReturnProto GetProto(byte[] buffer, bool isChild = false) { Goods_EquipPutReturnProto proto = new Goods_EquipPutReturnProto(); MMO_MemoryStream ms = null; if (!isChild) { ms = GameEntry.Socket.SocketSendMS; } else { ms = GameEntry.Pool.DequeueClassObject<MMO_MemoryStream>(); } ms.SetLength(0); ms.Write(buffer, 0, buffer.Length); ms.Position = 0; proto.IsSuccess = ms.ReadBool(); if (proto.IsSuccess) { proto.Type = (byte)ms.ReadByte(); proto.GoodsId = ms.ReadInt(); proto.GoodsServerId = ms.ReadInt(); } else { } proto.MsgCode = ms.ReadInt(); if (isChild) { GameEntry.Pool.EnqueueClassObject(ms); } return proto; }
public static void OnGoods_EquipPutReturn(byte[] buffer) { Goods_EquipPutReturnProto proto = Goods_EquipPutReturnProto.GetProto(buffer); #if DEBUG_LOG_PROTO Debug.Log("<color=#00eaff>接收消息:</color><color=#00ff9c>" + proto.ProtoEnName + " " + proto.ProtoCode + "</color>"); Debug.Log("<color=#c5e1dc>==>>" + JsonUtility.ToJson(proto) + "</color>"); #endif }
public static Goods_EquipPutReturnProto GetProto(byte[] buffer) { Goods_EquipPutReturnProto proto = new Goods_EquipPutReturnProto(); using (MMO_MemoryStream ms = new MMO_MemoryStream(buffer)) { proto.IsSuccess = ms.ReadBool(); if (proto.IsSuccess) { proto.Type = (byte)ms.ReadByte(); proto.GoodsId = ms.ReadInt(); proto.GoodsServerId = ms.ReadInt(); } else { } proto.MsgCode = ms.ReadInt(); } return(proto); }
public static Goods_EquipPutReturnProto GetProto(MMO_MemoryStream ms, byte[] buffer) { Goods_EquipPutReturnProto proto = new Goods_EquipPutReturnProto(); ms.SetLength(0); ms.Write(buffer, 0, buffer.Length); ms.Position = 0; proto.IsSuccess = ms.ReadBool(); if (proto.IsSuccess) { proto.Type = (byte)ms.ReadByte(); proto.GoodsId = ms.ReadInt(); proto.GoodsServerId = ms.ReadInt(); } else { } proto.MsgCode = ms.ReadInt(); return(proto); }