示例#1
0
 protected GroupInfo(IReadOnlyPacket packet)
 {
     Id             = packet.ReadLegacyLong();
     Name           = packet.ReadString();
     BadgeCode      = packet.ReadString();
     PrimaryColor   = packet.ReadString();
     SecondaryColor = packet.ReadString();
     IsFavorite     = packet.ReadBool();
     OwnerId        = packet.ReadLegacyLong();
     HasForum       = packet.ReadBool();
 }
示例#2
0
 protected UserSearchResult(IReadOnlyPacket packet)
 {
     Id             = packet.ReadLegacyLong();
     Name           = packet.ReadString();
     Motto          = packet.ReadString();
     Online         = packet.ReadBool();
     UnknownBoolA   = packet.ReadBool();
     UnknownStringA = packet.ReadString();
     UnknownLongA   = packet.ReadLegacyLong();
     Figure         = packet.ReadString();
     RealName       = packet.ReadString();
 }
示例#3
0
        protected RollerUpdate(IReadOnlyPacket packet)
            : this()
        {
            LocationX = packet.ReadInt();
            LocationY = packet.ReadInt();
            TargetX   = packet.ReadInt();
            TargetY   = packet.ReadInt();

            int n = packet.ReadLegacyShort();

            for (int i = 0; i < n; i++)
            {
                ObjectUpdates.Add(RollerObjectUpdate.Parse(packet));
            }

            RollerId = packet.ReadLegacyLong();

            if (packet.Available > 0)
            {
                Type = (RollerUpdateType)packet.ReadInt();
                if (Type == RollerUpdateType.MovingEntity ||
                    Type == RollerUpdateType.StationaryEntity)
                {
                    if (packet.Protocol == ClientType.Unity)
                    {
                        packet.ReadInt();
                    }
                    // Entity index may have changed to long here
                    // but it's int everywhere else ???
                    EntityIndex     = packet.ReadInt();
                    EntityLocationZ = packet.ReadLegacyFloat();
                    EntityTargetZ   = packet.ReadLegacyFloat();
                }
            }
        }
示例#4
0
 protected GroupMember(IReadOnlyPacket packet)
 {
     Type   = (GroupMemberType)packet.ReadInt();
     Id     = packet.ReadLegacyLong();
     Name   = packet.ReadString();
     Figure = packet.ReadString();
     Joined = DateTime.Parse(packet.ReadString());
 }
示例#5
0
        protected RoomInfo(IReadOnlyPacket packet)
            : this()
        {
            Id          = packet.ReadLegacyLong();
            Name        = packet.ReadString();
            OwnerId     = packet.ReadLegacyLong();
            OwnerName   = packet.ReadString();
            Access      = (RoomAccess)packet.ReadInt();
            Users       = packet.ReadInt();
            MaxUsers    = packet.ReadInt();
            Description = packet.ReadString();
            Trading     = (TradePermissions)packet.ReadInt();
            Score       = packet.ReadInt();
            Ranking     = packet.ReadInt();
            Category    = (RoomCategory)packet.ReadInt();

            int n = packet.ReadLegacyShort();

            for (int i = 0; i < n; i++)
            {
                Tags.Add(packet.ReadString());
            }

            Flags = (RoomFlags)packet.ReadInt();

            if (Flags.HasFlag(RoomFlags.HasOfficialRoomPic))
            {
                OfficialRoomPicRef = packet.ReadString();
            }

            if (Flags.HasFlag(RoomFlags.IsGroupHomeRoom))
            {
                GroupId    = packet.ReadLegacyLong();
                GroupName  = packet.ReadString();
                GroupBadge = packet.ReadString();
            }

            if (Flags.HasFlag(RoomFlags.HasEvent))
            {
                EventName        = packet.ReadString();
                EventDescription = packet.ReadString();
                EventMinutesLeft = packet.ReadInt();
            }
        }
示例#6
0
 internal RoomUser(long id, int index, IReadOnlyPacket packet)
     : this(id, index)
 {
     Gender           = H.ToGender(packet.ReadString());
     GroupId          = packet.ReadLegacyLong();
     Int8             = packet.ReadInt();
     GroupName        = packet.ReadString();
     FigureExtra      = packet.ReadString();
     AchievementScore = packet.ReadInt();
     Bool1            = packet.ReadBool();
 }
示例#7
0
文件: Pet.cs 项目: b7c/Xabbo.Core
 internal Pet(long id, int index, IReadOnlyPacket packet)
     : this(id, index)
 {
     Breed       = packet.ReadInt();
     OwnerId     = packet.ReadLegacyLong();
     OwnerName   = packet.ReadString();
     RarityLevel = packet.ReadInt();
     Bool1       = packet.ReadBool();
     Bool2       = packet.ReadBool();
     Bool3       = packet.ReadBool();
     Bool4       = packet.ReadBool();
     Bool5       = packet.ReadBool();
     Bool6       = packet.ReadBool();
     Level       = packet.ReadInt();
     Stance      = packet.ReadString();
 }
示例#8
0
        public Bot(EntityType type, long id, int index, IReadOnlyPacket packet)
            : this(type, id, index)
        {
            if (type == EntityType.PrivateBot)
            {
                Gender    = H.ToGender(packet.ReadString());
                OwnerId   = packet.ReadLegacyLong();
                OwnerName = packet.ReadString();

                short n = packet.ReadLegacyShort();
                for (int i = 0; i < n; i++)
                {
                    Data.Add(packet.ReadShort());
                }
            }
        }
示例#9
0
 protected UserData(IReadOnlyPacket packet)
 {
     Id               = packet.ReadLegacyLong();
     Name             = packet.ReadString();
     Figure           = packet.ReadString();
     Gender           = H.ToGender(packet.ReadString());
     Motto            = packet.ReadString();
     String4          = packet.ReadString();
     Bool1            = packet.ReadBool();
     TotalRespects    = packet.ReadInt();
     RespectsLeft     = packet.ReadInt();
     ScratchesLeft    = packet.ReadInt();
     Bool2            = packet.ReadBool();
     LastLogin        = packet.ReadString();
     IsNameChangeable = packet.ReadBool();
     IsSafetyLocked   = packet.ReadBool();
     Bool3            = packet.ReadBool();
 }
示例#10
0
        protected MarketplaceItem(IReadOnlyPacket packet)
        {
            Id          = packet.ReadLegacyLong();
            UnknownInt2 = packet.ReadInt();

            int itemType = packet.ReadInt();

            switch (itemType)
            {
            case 1:
                Type = ItemType.Floor;
                Kind = packet.ReadInt();
                Data = StuffData.Parse(packet);
                break;

            case 2:
                Type = ItemType.Wall;
                Kind = packet.ReadInt();
                Data = new LegacyData()
                {
                    Value = packet.ReadString()
                };
                break;

            case 3:
                Type = ItemType.Floor;
                Kind = packet.ReadInt();
                Data = new LegacyData()
                {
                    Flags         = ItemDataFlags.IsLimitedRare,
                    LimitedNumber = packet.ReadInt(),
                    LimitedTotal  = packet.ReadInt()
                };
                break;

            default: throw new Exception($"Unknown MarketplaceItem type: {itemType}");
            }

            Price         = packet.ReadInt();
            TimeRemaining = packet.ReadInt();
            Average       = packet.ReadInt();
            Offers        = packet.ReadInt();
        }
示例#11
0
        protected InventoryItem(IReadOnlyPacket packet)
            : this()
        {
            ItemId = packet.ReadLegacyLong();

            if (packet.Protocol == ClientType.Flash)
            {
                Type = H.ToItemType(packet.ReadString());
            }
            else
            {
                Type = H.ToItemType(packet.ReadShort());
            }

            Id                   = packet.ReadLegacyLong();
            Kind                 = packet.ReadInt();
            Category             = (FurniCategory)packet.ReadInt();
            Data                 = StuffData.Parse(packet);
            _Bool1               = packet.ReadBool();
            IsTradeable          = packet.ReadBool();
            IsGroupable          = packet.ReadBool();
            IsSellable           = packet.ReadBool();
            SecondsToExpiration  = packet.ReadInt();
            HasRentPeriodStarted = packet.ReadBool();
            RoomId               = packet.ReadLegacyLong();

            if (packet.Protocol == ClientType.Unity)
            {
                // - Seems to be consistent
                _String1 = packet.ReadString(); // string ""
                _String2 = packet.ReadString(); // string "r" / "s"
                _Int3    = packet.ReadInt();    // int 1187551480
            }

            if (Type == ItemType.Floor)
            {
                if (packet.Protocol == ClientType.Flash)
                {
                    _String2 = packet.ReadString();
                    Extra    = packet.ReadInt();
                }
                else
                {
                    // 10 bytes ?
                    _String3 = packet.ReadString();
                    Extra    = packet.ReadInt();
                    _Int5    = packet.ReadInt();
                }
            }
            else
            {
                _String3 = string.Empty;
            }

            /*if (clientType == ClientType.Flash)
             * {
             *  ItemId = packet.ReadInt();
             *  Type = H.ToItemType(packet.ReadString());
             *  Id = packet.ReadInt();
             *  Kind = packet.ReadInt();
             *  Category = (FurniCategory)packet.ReadInt();
             *  Data = StuffData.Parse(packet, clientType);
             *  _Bool1 = packet.ReadBool();
             *  IsTradeable = packet.ReadBool();
             *  IsGroupable = packet.ReadBool();
             *  IsSellable = packet.ReadBool();
             *  SecondsToExpiration = packet.ReadInt();
             *  HasRentPeriodStarted = packet.ReadBool();
             *  RoomId = packet.ReadInt();
             *
             *  if (Type == ItemType.Floor)
             *  {
             *      _String2 = packet.ReadString();
             *      Extra = packet.ReadInt();
             *  }
             * }
             * else
             * {
             *  ItemId = packet.ReadLong();
             *  Type = H.ToItemType(packet.ReadShort());
             *  Id = packet.ReadLong();
             *  Kind = packet.ReadInt();
             *  Category = (FurniCategory)packet.ReadInt();
             *  Data = StuffData.Parse(packet, clientType);
             *  _Bool1 = packet.ReadBool();
             *  IsTradeable = packet.ReadBool();
             *  IsGroupable = packet.ReadBool();
             *  IsSellable = packet.ReadBool();
             *  SecondsToExpiration = packet.ReadInt();
             *  HasRentPeriodStarted = packet.ReadBool();
             *  RoomId = packet.ReadLong();
             *
             *  // - Seems to be consistent
             *  _String1 = packet.ReadString(); // string ""
             *  _String2 = packet.ReadString(); // string "r" / "s"
             *  _Int3 = packet.ReadInt(); // int 1187551480
             *
             *  if (Type == ItemType.Floor)
             *  {
             *      // 10 bytes ?
             *      _String3 = packet.ReadString();
             *      Extra = packet.ReadInt();
             *      _Int5 = packet.ReadInt();
             *  }
             *  else
             *  {
             *      _String3 = string.Empty;
             *  }
             * }*/
        }
示例#12
0
 protected RollerObjectUpdate(IReadOnlyPacket packet)
 {
     Id        = packet.ReadLegacyLong();
     LocationZ = packet.ReadLegacyFloat();
     TargetZ   = packet.ReadLegacyFloat();
 }