public RoomSettingsDataComposer(Room Room)
            : base(ServerPacketHeader.RoomSettingsDataMessageComposer)
        {
            base.WriteInteger(Room.RoomId);
            base.WriteString(Room.Name);
            base.WriteString(Room.Description);
            base.WriteInteger(RoomAccessUtility.GetRoomAccessPacketNum(Room.Access));
            base.WriteInteger(Room.Category);
            base.WriteInteger(Room.UsersMax);
            //base.WriteInteger(((Room.RoomData.Model.MapSizeX * Room.RoomData.Model.MapSizeY) > 100) ? 50 : 25);
            base.WriteInteger(75);

            base.WriteInteger(Room.Tags.Count);
            foreach (string Tag in Room.Tags.ToArray())
            {
                base.WriteString(Tag);
            }

            base.WriteInteger(Room.TradeSettings);   //Trade
            base.WriteInteger(Room.AllowPets);       // allows pets in room - pet system lacking, so always off
            base.WriteInteger(Room.AllowPetsEating); // allows pets to eat your food - pet system lacking, so always off
            base.WriteInteger(Room.RoomBlockingEnabled);
            base.WriteInteger(Room.Hidewall);
            base.WriteInteger(Room.WallThickness);
            base.WriteInteger(Room.FloorThickness);

            base.WriteInteger(Room.chatMode);     //Chat mode
            base.WriteInteger(Room.chatSize);     //Chat size
            base.WriteInteger(Room.chatSpeed);    //Chat speed
            base.WriteInteger(Room.chatDistance); //Hearing Distance
            base.WriteInteger(Room.extraFlood);   //Additional Flood

            base.WriteBoolean(true);

            base.WriteInteger(Room.WhoCanMute); // who can mute
            base.WriteInteger(Room.WhoCanKick); // who can kick
            base.WriteInteger(Room.WhoCanBan);  // who can ban
        }
Exemple #2
0
        public override void Compose(ServerPacket packet)
        {
            packet.WriteInteger(Room.RoomId);
            packet.WriteString(Room.Name);
            packet.WriteString(Room.Description);
            packet.WriteInteger(RoomAccessUtility.GetRoomAccessPacketNum(Room.Access));
            packet.WriteInteger(Room.Category);
            packet.WriteInteger(Room.UsersMax);
            packet.WriteInteger(((Room.Model.MapSizeX * Room.Model.MapSizeY) > 100) ? 50 : 25);

            packet.WriteInteger(Room.Tags.Count);
            foreach (string Tag in Room.Tags.ToArray())
            {
                packet.WriteString(Tag);
            }

            packet.WriteInteger(Room.TradeSettings);   //Trade
            packet.WriteInteger(Room.AllowPets);       // allows pets in room - pet system lacking, so always off
            packet.WriteInteger(Room.AllowPetsEating); // allows pets to eat your food - pet system lacking, so always off
            packet.WriteInteger(Room.RoomBlockingEnabled);
            packet.WriteInteger(Room.Hidewall);
            packet.WriteInteger(Room.WallThickness);
            packet.WriteInteger(Room.FloorThickness);

            packet.WriteInteger(Room.ChatMode);     //Chat mode
            packet.WriteInteger(Room.ChatSize);     //Chat size
            packet.WriteInteger(Room.ChatSpeed);    //Chat speed
            packet.WriteInteger(Room.ChatDistance); //Hearing Distance
            packet.WriteInteger(Room.ExtraFlood);   //Additional Flood

            packet.WriteBoolean(true);

            packet.WriteInteger(Room.WhoCanMute); // who can mute
            packet.WriteInteger(Room.WhoCanKick); // who can kick
            packet.WriteInteger(Room.WhoCanBan);  // who can ban
        }
        public GetGuestRoomResultComposer(GameClient session, RoomData data, bool isLoading, bool checkEntry)
            : base(ServerPacketHeader.GetGuestRoomResultMessageComposer)
        {
            WriteBoolean(isLoading);
            WriteInteger(data.Id);
            WriteString(data.Name);
            WriteInteger(data.OwnerId);
            WriteString(data.OwnerName);
            WriteInteger(RoomAccessUtility.GetRoomAccessPacketNum(data.Access));
            WriteInteger(data.UsersNow);
            WriteInteger(data.UsersMax);
            WriteString(data.Description);
            WriteInteger(data.TradeSettings);
            WriteInteger(data.Score);
            WriteInteger(0);//Top rated room rank.
            WriteInteger(data.Category);

            WriteInteger(data.Tags.Count);
            foreach (string tag in data.Tags)
            {
                WriteString(tag);
            }

            if (data.Group != null && data.Promotion != null)
            {
                WriteInteger(62);

                WriteInteger(data.Group == null ? 0 : data.Group.Id);
                WriteString(data.Group == null ? "" : data.Group.Name);
                WriteString(data.Group == null ? "" : data.Group.Badge);

                WriteString(data.Promotion != null ? data.Promotion.Name : "");
                WriteString(data.Promotion != null ? data.Promotion.Description : "");
                WriteInteger(data.Promotion != null ? data.Promotion.MinutesLeft : 0);
            }
            else if (data.Group != null && data.Promotion == null)
            {
                WriteInteger(58);
                WriteInteger(data.Group == null ? 0 : data.Group.Id);
                WriteString(data.Group == null ? "" : data.Group.Name);
                WriteString(data.Group == null ? "" : data.Group.Badge);
            }
            else if (data.Group == null && data.Promotion != null)
            {
                WriteInteger(60);
                WriteString(data.Promotion != null ? data.Promotion.Name : "");
                WriteString(data.Promotion != null ? data.Promotion.Description : "");
                WriteInteger(data.Promotion != null ? data.Promotion.MinutesLeft : 0);
            }
            else
            {
                WriteInteger(56);
            }


            WriteBoolean(checkEntry);
            WriteBoolean(false);
            WriteBoolean(false);
            WriteBoolean(false);

            WriteInteger(data.WhoCanMute);
            WriteInteger(data.WhoCanKick);
            WriteInteger(data.WhoCanBan);

            WriteBoolean(session.Habbo.GetPermissions().HasRight("mod_tool") || data.OwnerName == session.Habbo.Username);
            WriteInteger(data.ChatMode);
            WriteInteger(data.ChatSize);
            WriteInteger(data.ChatSpeed);
            WriteInteger(data.ExtraFlood);
            WriteInteger(data.ChatDistance);
        }
        public GetGuestRoomResultComposer(GameClient Session, RoomData Data, Boolean isLoading, Boolean checkEntry)
            : base(ServerPacketHeader.GetGuestRoomResultMessageComposer)
        {
            WriteBoolean(isLoading);
            WriteInteger(Data.Id);
            WriteString(Data.Name);
            WriteInteger(Data.OwnerId);
            WriteString(Data.OwnerName);
            WriteInteger(RoomAccessUtility.GetRoomAccessPacketNum(Data.Access));
            WriteInteger(Data.UsersNow);
            WriteInteger(Data.UsersMax);
            WriteString(Data.Description);
            WriteInteger(Data.TradeSettings);
            WriteInteger(Data.Score);
            WriteInteger(0);            //Top rated room rank.
            WriteInteger(Data.Category);

            WriteInteger(Data.Tags.Count);
            foreach (string Tag in Data.Tags)
            {
                WriteString(Tag);
            }

            if (Data.Group != null && Data.Promotion != null)
            {
                WriteInteger(62);                //What?

                WriteInteger(Data.Group == null ? 0 : Data.Group.Id);
                WriteString(Data.Group == null ? "" : Data.Group.Name);
                WriteString(Data.Group == null ? "" : Data.Group.Badge);

                WriteString(Data.Promotion != null ? Data.Promotion.Name : "");
                WriteString(Data.Promotion != null ? Data.Promotion.Description : "");
                WriteInteger(Data.Promotion != null ? Data.Promotion.MinutesLeft : 0);
            }
            else if (Data.Group != null && Data.Promotion == null)
            {
                WriteInteger(58);                //What?
                WriteInteger(Data.Group == null ? 0 : Data.Group.Id);
                WriteString(Data.Group == null ? "" : Data.Group.Name);
                WriteString(Data.Group == null ? "" : Data.Group.Badge);
            }
            else if (Data.Group == null && Data.Promotion != null)
            {
                WriteInteger(60);                //What?
                WriteString(Data.Promotion != null ? Data.Promotion.Name : "");
                WriteString(Data.Promotion != null ? Data.Promotion.Description : "");
                WriteInteger(Data.Promotion != null ? Data.Promotion.MinutesLeft : 0);
            }
            else
            {
                WriteInteger(56);                //What?
            }


            WriteBoolean(checkEntry);
            StaffPick staffPick = null;

            if (!CloudServer.GetGame().GetNavigator().TryGetStaffPickedRoom(Data.Id, out staffPick))
            {
                WriteBoolean(false);
            }
            else
            {
                WriteBoolean(true);
            }
            WriteBoolean(false);
            WriteBoolean(false);

            WriteInteger(Data.WhoCanMute);
            WriteInteger(Data.WhoCanKick);
            WriteInteger(Data.WhoCanBan);

            WriteBoolean(Session.GetHabbo().GetPermissions().HasRight("mod_tool") || Data.OwnerName == Session.GetHabbo().Username);            //Room muting.
            WriteInteger(Data.chatMode);
            WriteInteger(Data.chatSize);
            WriteInteger(Data.chatSpeed);
            WriteInteger(Data.extraFlood);            //Hearing distance
            WriteInteger(Data.chatDistance);          //Flood!!
        }
        public GetGuestRoomResultComposer(GameClient Session, RoomData Data, Boolean isLoading, Boolean checkEntry)
            : base(ServerPacketHeader.GetGuestRoomResultMessageComposer)
        {
            base.WriteBoolean(isLoading);
            base.WriteInteger(Data.Id);
            base.WriteString(Data.Name);
            base.WriteInteger(Data.OwnerId);
            base.WriteString(Data.OwnerName);
            base.WriteInteger(RoomAccessUtility.GetRoomAccessPacketNum(Data.Access));
            base.WriteInteger(Data.UsersNow);
            base.WriteInteger(Data.UsersMax);
            base.WriteString(Data.Description);
            base.WriteInteger(Data.TradeSettings);
            base.WriteInteger(Data.Score);
            base.WriteInteger(0);//Top rated room rank.
            base.WriteInteger(Data.Category);

            base.WriteInteger(Data.Tags.Count);
            foreach (string Tag in Data.Tags)
            {
                base.WriteString(Tag);
            }

            if (Data.Group != null && Data.Promotion != null)
            {
                base.WriteInteger(62);//What?

                base.WriteInteger(Data.Group == null ? 0 : Data.Group.Id);
                base.WriteString(Data.Group == null ? "" : Data.Group.Name);
                base.WriteString(Data.Group == null ? "" : Data.Group.Badge);

                base.WriteString(Data.Promotion != null ? Data.Promotion.Name : "");
                base.WriteString(Data.Promotion != null ? Data.Promotion.Description : "");
                base.WriteInteger(Data.Promotion != null ? Data.Promotion.MinutesLeft : 0);
            }
            else if (Data.Group != null && Data.Promotion == null)
            {
                base.WriteInteger(58);//What?
                base.WriteInteger(Data.Group == null ? 0 : Data.Group.Id);
                base.WriteString(Data.Group == null ? "" : Data.Group.Name);
                base.WriteString(Data.Group == null ? "" : Data.Group.Badge);
            }
            else if (Data.Group == null && Data.Promotion != null)
            {
                base.WriteInteger(60);//What?
                base.WriteString(Data.Promotion != null ? Data.Promotion.Name : "");
                base.WriteString(Data.Promotion != null ? Data.Promotion.Description : "");
                base.WriteInteger(Data.Promotion != null ? Data.Promotion.MinutesLeft : 0);
            }
            else
            {
                base.WriteInteger(56);//What?
            }


            base.WriteBoolean(checkEntry);
            base.WriteBoolean(false);
            base.WriteBoolean(false);
            base.WriteBoolean(false);

            base.WriteInteger(Data.WhoCanMute);
            base.WriteInteger(Data.WhoCanKick);
            base.WriteInteger(Data.WhoCanBan);

            bool HasRights = false;

            if (Session != null && Session.GetHabbo() != null && Session.GetHabbo().GetPermissions() != null)
            {
                if (Session.GetHabbo().GetPermissions().HasRight("mod_tool"))
                {
                    HasRights = true;
                }

                if (Data.OwnerId == Session.GetHabbo().Id)
                {
                    HasRights = true;
                }
            }

            base.WriteBoolean(HasRights);
            base.WriteInteger(Data.chatMode);
            base.WriteInteger(Data.chatSize);
            base.WriteInteger(Data.chatSpeed);
            base.WriteInteger(Data.extraFlood);   //Flood!!
            base.WriteInteger(Data.chatDistance); //Hearing distance
        }
Exemple #6
0
        public override void Compose(ServerPacket packet)
        {
            packet.WriteBoolean(IsLoading);
            packet.WriteInteger(Data.Id);
            packet.WriteString(Data.Name);
            packet.WriteInteger(Data.OwnerId);
            packet.WriteString(Data.OwnerName);
            packet.WriteInteger(RoomAccessUtility.GetRoomAccessPacketNum(Data.Access));
            packet.WriteInteger(Data.UsersNow);
            packet.WriteInteger(Data.UsersMax);
            packet.WriteString(Data.Description);
            packet.WriteInteger(Data.TradeSettings);
            packet.WriteInteger(Data.Score);
            packet.WriteInteger(0);//Top rated room rank.
            packet.WriteInteger(Data.Category);

            packet.WriteInteger(Data.Tags.Count);
            foreach (string tag in Data.Tags)
            {
                packet.WriteString(tag);
            }

            if (Data.Group != null && Data.Promotion != null)
            {
                packet.WriteInteger(62);

                packet.WriteInteger(Data.Group == null ? 0 : Data.Group.Id);
                packet.WriteString(Data.Group == null ? "" : Data.Group.Name);
                packet.WriteString(Data.Group == null ? "" : Data.Group.Badge);

                packet.WriteString(Data.Promotion != null ? Data.Promotion.Name : "");
                packet.WriteString(Data.Promotion != null ? Data.Promotion.Description : "");
                packet.WriteInteger(Data.Promotion != null ? Data.Promotion.MinutesLeft : 0);
            }
            else if (Data.Group != null && Data.Promotion == null)
            {
                packet.WriteInteger(58);
                packet.WriteInteger(Data.Group == null ? 0 : Data.Group.Id);
                packet.WriteString(Data.Group == null ? "" : Data.Group.Name);
                packet.WriteString(Data.Group == null ? "" : Data.Group.Badge);
            }
            else if (Data.Group == null && Data.Promotion != null)
            {
                packet.WriteInteger(60);
                packet.WriteString(Data.Promotion != null ? Data.Promotion.Name : "");
                packet.WriteString(Data.Promotion != null ? Data.Promotion.Description : "");
                packet.WriteInteger(Data.Promotion != null ? Data.Promotion.MinutesLeft : 0);
            }
            else
            {
                packet.WriteInteger(56);
            }


            packet.WriteBoolean(CheckEntry);
            packet.WriteBoolean(false);
            packet.WriteBoolean(false);
            packet.WriteBoolean(false);

            packet.WriteInteger(Data.WhoCanMute);
            packet.WriteInteger(Data.WhoCanKick);
            packet.WriteInteger(Data.WhoCanBan);

            packet.WriteBoolean(Habbo.GetPermissions().HasRight("mod_tool") || Data.OwnerName == Habbo.Username);
            packet.WriteInteger(Data.ChatMode);
            packet.WriteInteger(Data.ChatSize);
            packet.WriteInteger(Data.ChatSpeed);
            packet.WriteInteger(Data.ExtraFlood);
            packet.WriteInteger(Data.ChatDistance);
        }