Exemplo n.º 1
0
    public static RoleData_GoldChangeReturnProto GetProto(byte[] buffer)
    {
        RoleData_GoldChangeReturnProto proto = new RoleData_GoldChangeReturnProto();

        using (MMO_MemoryStream ms = new MMO_MemoryStream(buffer))
        {
            proto.OldGold    = ms.ReadInt();
            proto.CurrGold   = ms.ReadInt();
            proto.ChangeType = (byte)ms.ReadByte();
            proto.AddType    = (byte)ms.ReadByte();
            proto.ReduceType = (byte)ms.ReadByte();
            proto.GoodsType  = (byte)ms.ReadByte();
            proto.GoodsId    = ms.ReadInt();
        }
        return(proto);
    }
Exemplo n.º 2
0
    public static RoleData_GoldChangeReturnProto GetProto(MMO_MemoryStream ms, byte[] buffer)
    {
        RoleData_GoldChangeReturnProto proto = new RoleData_GoldChangeReturnProto();

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

        proto.OldGold    = ms.ReadInt();
        proto.CurrGold   = ms.ReadInt();
        proto.ChangeType = (byte)ms.ReadByte();
        proto.AddType    = (byte)ms.ReadByte();
        proto.ReduceType = (byte)ms.ReadByte();
        proto.GoodsType  = (byte)ms.ReadByte();
        proto.GoodsId    = ms.ReadInt();

        return(proto);
    }