Exemple #1
0
    public static Goods_SearchEquipDetailReturnProto GetProto(byte[] buffer)
    {
        Goods_SearchEquipDetailReturnProto proto = new Goods_SearchEquipDetailReturnProto();
        MMO_MemoryStream ms = GameEntry.Socket.SocketReceiveMS;

        ms.SetLength(0);
        ms.Write(buffer, 0, buffer.Length);
        ms.Position = 0;

        proto.EnchantLevel   = ms.ReadInt();
        proto.BaseAttr1Type  = (byte)ms.ReadByte();
        proto.BaseAttr1Value = ms.ReadInt();
        proto.BaseAttr2Type  = (byte)ms.ReadByte();
        proto.BaseAttr2Value = ms.ReadInt();
        proto.HP             = ms.ReadInt();
        proto.MP             = ms.ReadInt();
        proto.Attack         = ms.ReadInt();
        proto.Defense        = ms.ReadInt();
        proto.Hit            = ms.ReadInt();
        proto.Dodge          = ms.ReadInt();
        proto.Cri            = ms.ReadInt();
        proto.Res            = ms.ReadInt();
        proto.IsPutOn        = (byte)ms.ReadByte();

        return(proto);
    }
    public static void OnGoods_SearchEquipDetailReturn(byte[] buffer)
    {
        Goods_SearchEquipDetailReturnProto proto = Goods_SearchEquipDetailReturnProto.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
    }
Exemple #3
0
    public static Goods_SearchEquipDetailReturnProto GetProto(byte[] buffer, bool isChild = false)
    {
        Goods_SearchEquipDetailReturnProto proto = new Goods_SearchEquipDetailReturnProto();

        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.EnchantLevel   = ms.ReadInt();
        proto.BaseAttr1Type  = (byte)ms.ReadByte();
        proto.BaseAttr1Value = ms.ReadInt();
        proto.BaseAttr2Type  = (byte)ms.ReadByte();
        proto.BaseAttr2Value = ms.ReadInt();
        proto.HP             = ms.ReadInt();
        proto.MP             = ms.ReadInt();
        proto.Attack         = ms.ReadInt();
        proto.Defense        = ms.ReadInt();
        proto.Hit            = ms.ReadInt();
        proto.Dodge          = ms.ReadInt();
        proto.Cri            = ms.ReadInt();
        proto.Res            = ms.ReadInt();
        proto.IsPutOn        = (byte)ms.ReadByte();

        if (isChild)
        {
            GameEntry.Pool.EnqueueClassObject(ms);
        }
        return(proto);
    }
    public static Goods_SearchEquipDetailReturnProto GetProto(byte[] buffer)
    {
        Goods_SearchEquipDetailReturnProto proto = new Goods_SearchEquipDetailReturnProto();

        using (MMO_MemoryStream ms = new MMO_MemoryStream(buffer))
        {
            proto.EnchantLevel   = ms.ReadInt();
            proto.BaseAttr1Type  = (byte)ms.ReadByte();
            proto.BaseAttr1Value = ms.ReadInt();
            proto.BaseAttr2Type  = (byte)ms.ReadByte();
            proto.BaseAttr2Value = ms.ReadInt();
            proto.HP             = ms.ReadInt();
            proto.MP             = ms.ReadInt();
            proto.Attack         = ms.ReadInt();
            proto.Defense        = ms.ReadInt();
            proto.Hit            = ms.ReadInt();
            proto.Dodge          = ms.ReadInt();
            proto.Cri            = ms.ReadInt();
            proto.Res            = ms.ReadInt();
            proto.IsPutOn        = (byte)ms.ReadByte();
        }
        return(proto);
    }