public int    GameServerId; //游戏大区的Id号

    public byte[] ToArray()
    {
        using (MemoryStreamUtil ms = new MemoryStreamUtil())
        {
            ms.WriteUShort(ProtoCode);
            ms.WriteInt(RoleId);
            ms.WriteInt(ChannelId);
            return(ms.ToArray());
        }
    }
    public int    GameServerId; //区服ID

    public byte[] ToArray()
    {
        using (MemoryStreamUtil ms = new MemoryStreamUtil())
        {
            ms.WriteUShort(ProtoCode);
            ms.WriteInt(AccountId);
            ms.WriteInt(GameServerId);
            return(ms.ToArray());
        }
    }
 public byte[] ToArray()
 {
     using (MemoryStreamUtil ms = new MemoryStreamUtil())
     {
         ms.WriteUShort(ProtoCode);
         ms.WriteInt(RoleCount);
         for (int i = 0; i < RoleCount; i++)
         {
             ms.WriteInt(RoleList[i].RoleId);
             ms.WriteUTF8String(RoleList[i].RoleNickName);
             ms.WriteByte(RoleList[i].RoleClass);
             ms.WriteInt(RoleList[i].RoleLevel);
         }
         return(ms.ToArray());
     }
 }
Exemplo n.º 4
0
    public int    GameServerId; //角色所在区服ID

    public byte[] ToArray()
    {
        using (MemoryStreamUtil ms = new MemoryStreamUtil())
        {
            ms.WriteUShort(ProtoCode);
            ms.WriteByte(ClassId);
            ms.WriteUTF8String(RoleNickName);
            ms.WriteInt(GameServerId);
            return(ms.ToArray());
        }
    }
    public int    MsgCode;   //消息码

    public byte[] ToArray()
    {
        using (MemoryStreamUtil ms = new MemoryStreamUtil())
        {
            ms.WriteUShort(ProtoCode);
            ms.WriteBool(IsSuccess);
            if (!IsSuccess)
            {
                ms.WriteInt(MsgCode);
            }
            return(ms.ToArray());
        }
    }
    public int    Equip_RingTableId;     //穿戴戒指

    public byte[] ToArray()
    {
        using (MemoryStreamUtil ms = new MemoryStreamUtil())
        {
            ms.WriteUShort(ProtoCode);
            ms.WriteBool(IsSuccess);
            if (IsSuccess)
            {
                ms.WriteInt(RoldId);
                ms.WriteUTF8String(RoleNickName);
                ms.WriteByte(ClassId);
                ms.WriteInt(Level);
                ms.WriteInt(VIPLevel);
                ms.WriteInt(TotalRechargeGem);
                ms.WriteInt(Gem);
                ms.WriteInt(Gold);
                ms.WriteInt(CurrEnergy);
                ms.WriteInt(MaxEnergy);
                ms.WriteInt(Exp);
                ms.WriteInt(MaxHP);
                ms.WriteInt(MaxMP);
                ms.WriteInt(CurrHP);
                ms.WriteInt(CurrMP);
                ms.WriteInt(Attack);
                ms.WriteInt(Defense);
                ms.WriteInt(Hit);
                ms.WriteInt(Dodge);
                ms.WriteInt(Cri);
                ms.WriteInt(Res);
                ms.WriteInt(SumDPS);
                ms.WriteInt(LastPassGameQuestId);
                ms.WriteInt(LastInWorldMapId);
                ms.WriteUTF8String(LastInWorldMapPos);
                ms.WriteInt(Equip_Weapon);
                ms.WriteInt(Equip_Pants);
                ms.WriteInt(Equip_Clothes);
                ms.WriteInt(Equip_Belt);
                ms.WriteInt(Equip_Cuff);
                ms.WriteInt(Equip_Necklace);
                ms.WriteInt(Equip_Shoe);
                ms.WriteInt(Equip_Ring);
                ms.WriteInt(Equip_WeaponTableId);
                ms.WriteInt(Equip_PantsTableId);
                ms.WriteInt(Equip_ClothesTableId);
                ms.WriteInt(Equip_BeltTableId);
                ms.WriteInt(Equip_CuffTableId);
                ms.WriteInt(Equip_NecklaceTableId);
                ms.WriteInt(Equip_ShoeTableId);
                ms.WriteInt(Equip_RingTableId);
            }
            else
            {
                ms.WriteInt(MsgCode);
            }
            return(ms.ToArray());
        }
    }