コード例 #1
0
ファイル: PlayerInfo.cs プロジェクト: ly774508966/u3dArpgDemo
    public override void Parse(BinaryReader reader)
    {
        _uid = reader.ReadInt32();

        _nickname = NetResponse.ReadString(reader);

        _role = (EnumRole)reader.ReadByte();

        byte propNum = reader.ReadByte();

        for (int key = 0; key < propNum; ++key)
        {
            int   value      = reader.ReadInt32();
            float floatvalue = value / (FCConst.PropFactor((PlayerPropKey)key) * 1.0f);
            _props.Add((PlayerPropKey)key, floatvalue);
        }

        byte propBattleNum = reader.ReadByte();

        for (int key = 32; key < 32 + propBattleNum; ++key)
        {
            int   value      = reader.ReadInt32();
            float floatValue = value / (FCConst.PropFactor((PlayerPropKey)key) * 1.0f);
            _props.Add((PlayerPropKey)key, floatValue);
        }

        _equippedInventory = new PlayerInventory();
        _equippedInventory.Parse(reader);
    }
コード例 #2
0
    public override void Decode(BinaryReader reader)
    {
        errorCode = reader.ReadInt16();

        if (Succeeded)
        {
            itemId     = NetResponse.ReadString(reader);
            updateData = UpdateInforResponseHandler.Instance.UpdateOperation(reader);
        }
    }
コード例 #3
0
    public override void Parse(System.IO.BinaryReader reader)
    {
        _item_GUID = reader.ReadInt64();
        _itemID    = NetResponse.ReadString(reader);
        _count     = reader.ReadInt16();

        byte itemPropNum = reader.ReadByte();

        for (int i = 0; i < itemPropNum; i++)
        {
            FC_EQUIP_EXTEND_ATTRIBUTE attKey = (FC_EQUIP_EXTEND_ATTRIBUTE)reader.ReadInt32();
            int attValue = reader.ReadInt32();

            if (_extendAttributes.ContainsKey(attKey))
            {
                _extendAttributes[attKey] = attValue;
            }
            else
            {
                _extendAttributes.Add(attKey, attValue);
            }
        }
    }