Esempio n. 1
0
        public ServerMessage Handle(ValueHolder valueHolder = null)
        {
            ServerMessage AuthOK = BasicUtilies.GetRevisionServerMessage(Revision.RELEASE63_201211141113_913728051);

            AuthOK.Init(r63bOutgoing.AuthenicationOK);
            return(AuthOK);
        }
        public void Handle(GameClient session, ClientMessage message)
        {
            Room room = session.GetHabbo().GetRoomSession().GetRoom();

            if (room != null && room.HaveOwnerRights(session))
            {
                if (room.RoomItemManager.Jukebox != null && room.RoomItemManager.Jukebox.Playlist.Count < room.RoomItemManager.Jukebox.PlaylistCapacity)
                {
                    uint          itemId = message.PopWiredUInt();
                    InventoryItem item   = session.GetHabbo().GetInventoryManager().TryGetFloorItem(itemId);
                    if (item != null && item.GetItem() != null && item.GetItem().InteractionType == "musicdisk")
                    {
                        int songId = 0;
                        if (int.TryParse(item.ExtraData, out songId))
                        {
                            session.GetHabbo().GetInventoryManager().RemoveItemFromHand(itemId, true);
                            room.RoomItemManager.Jukebox.AddDisc(new MusicDisc(itemId, item.BaseItem, songId));

                            ServerMessage message_ = BasicUtilies.GetRevisionServerMessage(Revision.RELEASE63_35255_34886_201108111108);
                            message_.Init(r63aOutgoing.JukeboxPlaylist);
                            message_.AppendInt32(room.RoomItemManager.Jukebox.PlaylistCapacity);
                            message_.AppendInt32(room.RoomItemManager.Jukebox.Playlist.Count);
                            foreach (MusicDisc disc in room.RoomItemManager.Jukebox.Playlist)
                            {
                                message_.AppendUInt(disc.ItemId);
                                message_.AppendInt32(disc.SongID);
                            }
                            session.SendMessage(message_);
                        }
                    }
                }
            }
        }
Esempio n. 3
0
        public void OnRespect()
        {
            this.PetData.Respect++;
            this.PetData.Happiness += 10;
            if (this.PetData.Happiness > this.PetData.MaxHappiness)
            {
                this.PetData.Happiness = this.PetData.MaxHappiness;
            }
            this.PetData.NeedUpdate = true;

            this.AddExpirience(10);

            ServerMessage message = BasicUtilies.GetRevisionServerMessage(Revision.RELEASE63_35255_34886_201108111108);

            message.Init(r63aOutgoing.PetGainRespect);
            message.AppendInt32(this.PetData.Respect);
            message.AppendInt32(0); //not used
            message.AppendUInt(this.PetData.ID);
            message.AppendString(this.PetData.Name);
            message.AppendInt32(this.PetData.Type);
            message.AppendInt32(int.Parse(this.PetData.Race));
            message.AppendString(this.PetData.Color);
            this.Room.SendToAll(message);

            GameClient owner = Skylight.GetGame().GetGameClientManager().GetGameClientById(this.PetData.OwnerID);

            if (owner != null)
            {
                owner.GetHabbo().Pets[this.PetData.ID] = this.PetData;
                owner.GetHabbo().GetUserAchievements().CheckAchievement("PetRespectReceiver");
            }
        }
Esempio n. 4
0
        public void Handle(GameClient session, ClientMessage message)
        {
            if (session != null && session.GetHabbo() != null)
            {
                if (session.GetHabbo().UserRooms.Count <= ServerConfiguration.MaxRoomsPerUser)
                {
                    string[] data = message.PopStringUntilBreak(null).Split('/');
                    if (data[0] == "" && data[1] == "first floor")
                    {
                        string roomName = data[2];
                        string roomModel = data[3];
                        RoomStateType state = data[4] == "open" ? RoomStateType.OPEN : data[4] == "closed" ? RoomStateType.LOCKED : RoomStateType.PASSWORD;
                        string showName = data[5];

                        RoomData roomData = Skylight.GetGame().GetRoomManager().CreateRoom(session, roomName, "", roomModel, 0, 25, 0, state);
                        if (roomData != null)
                        {
                            ServerMessage message_ = BasicUtilies.GetRevisionServerMessage(Revision.R26_20080915_0408_7984_61ccb5f8b8797a3aba62c1fa2ca80169);
                            message_.Init(r26Outgoing.CreatedRoom);
                            message_.AppendString(roomData.ID.ToString(), 13);
                            message_.AppendString(roomData.Name);
                            session.SendMessage(message_);
                        }
                    }
                }
            }
        }
        public void Handle(GameClient session, ClientMessage message)
        {
            string machineId    = message.PopFixedString();
            string newMachineId = message.PopFixedString(); //We don't care about this
            string someData     = message.PopFixedString();

            Guid guid;

            if (!Guid.TryParse(machineId.Split(':')[0], out guid))
            {
                string idByte = "";
                foreach (byte byte_ in TimeUtilies.GetUnixTimestamp().ToString())
                {
                    idByte += byte_;
                }

                long ipId = 0;
                foreach (byte byte_ in session.GetIP().ToString())
                {
                    ipId += (int)byte_;
                }

                machineId = Guid.NewGuid() + ":" + idByte + ":" + ipId;

                ServerMessage message_ = BasicUtilies.GetRevisionServerMessage(Revision.PRODUCTION_201601012205_226667486);
                message_.Init(r63cOutgoing.MachineID);
                message_.AppendString(machineId);
                session.SendMessage(message_);
            }

            session.MachineID = machineId;
        }
 public void Handle(GameClient session, ClientMessage message)
 {
     if (ServerConfiguration.EnableCrypto)
     {
         int cryptoType = message.PopWiredInt32();
         if (cryptoType == 0 && ServerConfiguration.CryptoType == 0) //banner data requested & server using this type encryption
         {
             ServerMessage message_ = BasicUtilies.GetRevisionServerMessage(Revision.RELEASE63_201211141113_913728051);
             message_.Init(r63bOutgoing.Crypto);
             message_.AppendString(Skylight.GetPublicToken());
             message_.AppendBoolean(true);
             session.SendMessage(message_);
         }
         else
         {
             session.Stop("Invalid crypto type");
         }
     }
     else
     {
         ServerMessage message_ = BasicUtilies.GetRevisionServerMessage(Revision.RELEASE63_201211141113_913728051);
         message_.Init(r63bOutgoing.Crypto);
         message_.AppendString(Skylight.GetPublicToken());
         message_.AppendBoolean(false);
         session.SendMessage(message_);
     }
 }
Esempio n. 7
0
        public ServerMessage Handle(ValueHolder valueHolder = null)
        {
            List <MessengerCategory> categorys = valueHolder.GetValueOrDefault <List <MessengerCategory> >("Categorys");
            List <MessengerFriend>   friends   = valueHolder.GetValue <List <MessengerFriend> >("Friends");

            ServerMessage Message = BasicUtilies.GetRevisionServerMessage(Revision.RELEASE63_35255_34886_201108111108);

            Message.Init(r63aOutgoing.MessengerFriends);
            Message.AppendInt32(6000);
            Message.AppendInt32(200);
            Message.AppendInt32(6000);
            Message.AppendInt32(900);
            if (categorys != null)
            {
                Message.AppendInt32(categorys.Count);
                foreach (MessengerCategory category in categorys)
                {
                    Message.AppendInt32(category.Id);
                    Message.AppendString(category.Name);
                }
            }
            else
            {
                Message.AppendInt32(0);
            }

            Message.AppendInt32(friends.Count);
            foreach (MessengerFriend friend in friends)
            {
                friend.Serialize(Message, true);
            }
            return(Message);
        }
Esempio n. 8
0
        public void Handle(GameClient session, ClientMessage message)
        {
            Room room = session.GetHabbo().GetRoomSession().GetRoom();

            if (room != null)
            {
                string       username = message.PopFixedString();
                RoomUnitUser user     = room.RoomUserManager.GetUserByName(username);
                if (user != null && !user.Session.GetHabbo().HasPermission("acc_unignorable"))
                {
                    uint userId = user.Session.GetHabbo().ID;
                    if (!session.GetHabbo().IgnoredUsers.Contains(userId))
                    {
                        session.GetHabbo().IgnoredUsers.Add(userId);

                        using (DatabaseClient dbClient = Skylight.GetDatabaseManager().GetClient())
                        {
                            dbClient.AddParamWithValue("userId", session.GetHabbo().ID);
                            dbClient.AddParamWithValue("targetId", userId);
                            dbClient.ExecuteQuery("INSERT INTO user_ignores(user_id, ignored_id) VALUES(@userId, @targetId)");
                        }

                        ServerMessage message_ = BasicUtilies.GetRevisionServerMessage(Revision.RELEASE63_35255_34886_201108111108);
                        message_.Init(r63aOutgoing.IgnoreStatus);
                        message_.AppendInt32(1);
                        session.SendMessage(message_);
                    }
                }
            }
        }
Esempio n. 9
0
        public ServerMessage Handle(ValueHolder valueHolder = null)
        {
            ServerMessage roomOwner = BasicUtilies.GetRevisionServerMessage(Revision.PRODUCTION_201601012205_226667486);

            roomOwner.Init(r63cOutgoing.IsRoomOwner);
            return(roomOwner);
        }
Esempio n. 10
0
        public void Handle(GameClient session, ClientMessage message)
        {
            ServerMessage message_ = BasicUtilies.GetRevisionServerMessage(Revision.RELEASE63_201211141113_913728051);

            message_.Init(r63bOutgoing.PublicRooms);

            Dictionary <int, PublicItem> .ValueCollection items = Skylight.GetGame().GetNavigatorManager().GetPublicRoomItems();
            message_.AppendInt32(items.Count);
            foreach (PublicItem item in items)
            {
                if (item.Type == PublicItemType.CATEGORY)
                {
                    item.Serialize(message_);
                    foreach (PublicItem item_ in items)
                    {
                        if (item_.ParentCategoryID == item.ID)
                        {
                            item_.Serialize(message_);
                        }
                    }
                }
                else
                {
                    if (item.ParentCategoryID == 0 || item.ParentCategoryID == -1)
                    {
                        item.Serialize(message_);
                    }
                }
            }
            message_.AppendInt32(0);
            message_.AppendInt32(0);
            session.SendMessage(message_);
        }
Esempio n. 11
0
        public ServerMessage Handle(ValueHolder valueHolder = null)
        {
            ServerMessage AuthOK = BasicUtilies.GetRevisionServerMessage(Revision.PRODUCTION_201601012205_226667486);

            AuthOK.Init(r63cOutgoing.AuthenicationOK);
            return(AuthOK);
        }
Esempio n. 12
0
        public void Handle(GameClient session, ClientMessage message)
        {
            if (session != null && session.GetHabbo() != null && session.GetHabbo().GetRoomSession() != null)
            {
                Room room = session.GetHabbo().GetRoomSession().GetRoom();
                if (room != null)
                {
                    RoomItem item = room.RoomItemManager.TryGetFloorItem(message.PopWiredUInt());
                    if (room.GaveRoomRights(session))
                    {
                        if (item != null)
                        {
                            int x   = message.PopWiredInt32();
                            int y   = message.PopWiredInt32();
                            int rot = message.PopWiredInt32();

                            if (room.RoomItemManager.MoveFloorItemOnRoom(session, item, x, y, rot))
                            {
                                return;
                            }
                        }
                    }

                    //ServerMessage msg = BasicUtilies.GetRevisionServerMessage(Revision.PRODUCTION_201601012205_226667486);
                    //msg.Init(2419);
                    //msg.AppendString("furni_placement_error");
                    //msg.AppendInt32(1);
                    //msg.AppendString("message");
                    //msg.AppendString("${room.error.cant_set_item}");
                    //session.SendMessage(msg);
                    session.SendMessage(BasicUtilies.GetRevisionPacketManager(session.Revision).GetOutgoing(OutgoingPacketsEnum.UpdateFloorItem).Handle(new ValueHolder("Item", item)));
                }
            }
        }
Esempio n. 13
0
        public ServerMessage Handle(ValueHolder valueHolder = null)
        {
            Achievement      achievement  = valueHolder.GetValue <Achievement>("Achievement");
            AchievementLevel nextLevel    = valueHolder.GetValue <AchievementLevel>("NextLevel");
            AchievementLevel currentLevel = valueHolder.GetValue <AchievementLevel>("CurrentLevel");

            ServerMessage message = BasicUtilies.GetRevisionServerMessage(Revision.PRODUCTION_201601012205_226667486);

            message.Init(r63cOutgoing.AchievementUnlocked);
            message.AppendInt32(achievement.ID);
            message.AppendInt32(nextLevel.Level);
            message.AppendInt32(1337); //idk
            message.AppendString(nextLevel.LevelBadge);
            message.AppendInt32(nextLevel.Score);
            message.AppendInt32(nextLevel.ActivityPoints);
            message.AppendInt32(nextLevel.ActivityPointsType);
            message.AppendInt32(0); //fb(?)
            message.AppendInt32(0); //fb(?)
            if (currentLevel != null)
            {
                message.AppendString(currentLevel.LevelBadge);
            }
            else
            {
                message.AppendString("");
            }
            message.AppendString(achievement.Category);
            message.AppendBoolean(true);
            return(message);
        }
Esempio n. 14
0
        public override bool OnUse(GameClient session, string[] args)
        {
            if (session.GetHabbo().HasPermission("cmd_update_catalog"))
            {
                using (DatabaseClient dbClient = Skylight.GetDatabaseManager().GetClient())
                {
                    Skylight.GetGame().GetCatalogManager().LoadCatalogItems(dbClient);
                    Skylight.GetGame().GetCatalogManager().LoadCatalogPages(dbClient);
                    Skylight.GetGame().GetCatalogManager().LoadPetRaces(dbClient);
                    Skylight.GetGame().GetCatalogManager().LoadPresents(dbClient);
                }

                ServerMessage message = BasicUtilies.GetRevisionServerMessage(Revision.RELEASE63_35255_34886_201108111108);
                message.Init(r63aOutgoing.UpdateCatalog);
                byte[] data = message.GetBytes();

                foreach (GameClient session_ in Skylight.GetGame().GetGameClientManager().GetClients())
                {
                    session_.SendData(data);
                }
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 15
0
        public ServerMessage Handle(ValueHolder valueHolder = null)
        {
            ServerMessage Message = BasicUtilies.GetRevisionServerMessage(Revision.RELEASE63_35255_34886_201108111108);

            Message.Init(r63aOutgoing.LeaveRoom);
            return(Message);
        }
        public ServerMessage Handle(ValueHolder valueHolder = null)
        {
            ServerMessage message = BasicUtilies.GetRevisionServerMessage(Revision.R26_20080915_0408_7984_61ccb5f8b8797a3aba62c1fa2ca80169);

            message.Init(r26Outgoing.EnterPrivateRoom);
            return(message);
        }
Esempio n. 17
0
        public ServerMessage Handle(T handler)
        {
            ServerMessage message = BasicUtilies.GetRevisionServerMessage(Revision.PRODUCTION_201601012205_226667486, r63cOutgoing.NewbieIdentity);

            message.AppendInt32(handler.IsNewbie ? 1 : 0);
            return(message);
        }
Esempio n. 18
0
        public ServerMessage SerializeUserInfo(uint userId)
        {
            DataRow    dataRow = null;
            GameClient target  = Skylight.GetGame().GetGameClientManager().GetGameClientById(userId);

            if (target != null && target.GetHabbo() != null)
            {
                dataRow = target.GetHabbo().GetUserDataFactory().GetUserData();
            }
            else
            {
                using (DatabaseClient dbClient = Skylight.GetDatabaseManager().GetClient())
                {
                    dbClient.AddParamWithValue("userId", userId);
                    dataRow = dbClient.ReadDataRow("SELECT username, account_created, last_online, ip_last FROM users WHERE id = @userId LIMIT 1");
                }
            }

            ServerMessage message = BasicUtilies.GetRevisionServerMessage(Revision.RELEASE63_35255_34886_201108111108);

            message.Init(r63aOutgoing.ModToolUserInfo);
            message.AppendUInt(userId);
            message.AppendString((string)dataRow["username"]);
            message.AppendInt32((int)Math.Ceiling((TimeUtilies.GetUnixTimestamp() - (double)dataRow["account_created"]) / 60.0));                //minutes since account created
            message.AppendInt32((int)Math.Ceiling((TimeUtilies.GetUnixTimestamp() - (double)dataRow["last_online"]) / 60.0));                    //minutes since last login
            message.AppendBoolean(target != null);
            message.AppendInt32(this.SupportTickets.Values.Where(t => t.SenderID == userId).Count());                                            //cfhs
            message.AppendInt32(this.SupportTickets.Values.Where(t => t.Status == SupportTicketStatus.Abusive && t.SenderID == userId).Count()); //cfhs abusive
            message.AppendInt32(Skylight.GetGame().GetCautionManager().GetCauctionsByUserID(userId));                                            //cauctions
            message.AppendInt32(Skylight.GetGame().GetBanManager().GetBanCountByUserID(userId));                                                 //bans
            return(message);
        }
Esempio n. 19
0
        public ServerMessage Handle(ValueHolder valueHolder = null)
        {
            ServerMessage message = BasicUtilies.GetRevisionServerMessage(Revision.PRODUCTION_201601012205_226667486);

            message.Init(r63cOutgoing.EnterPrivateRoom);
            return(message);
        }
Esempio n. 20
0
        public ServerMessage GetRoomChatlog(uint roomId)
        {
            RoomData roomData = Skylight.GetGame().GetRoomManager().TryGetAndLoadRoomData(roomId);

            ServerMessage message = BasicUtilies.GetRevisionServerMessage(Revision.RELEASE63_35255_34886_201108111108);

            message.Init(r63aOutgoing.ModeratorRoomChatlog);
            message.AppendBoolean(roomData != null ? roomData.IsPublicRoom : false);
            message.AppendUInt(roomId);
            message.AppendString(roomData != null ? roomData.Name : "![UNABLE TO FIND ROOM]!");

            List <RoomMessage> chatlog = Skylight.GetGame().GetChatlogManager().GetRoomChatlog(roomId);

            message.AppendInt32(chatlog.Count);
            foreach (RoomMessage msg in chatlog)
            {
                DateTime time = msg.GetDate();
                message.AppendInt32(time.Hour);
                message.AppendInt32(time.Minute);
                message.AppendUInt(msg.UserID);
                message.AppendString(msg.Username);
                if (!msg.Message.StartsWith("Whisper" + (char)9))
                {
                    message.AppendString(msg.Message);
                }
                else
                {
                    string[] data = msg.Message.Split((char)9);
                    message.AppendString("<Whisper to " + Skylight.GetGame().GetGameClientManager().GetUsernameByID(uint.Parse(data[1])) + ">: " + data[2]);
                }
            }
            return(message);
        }
        public ServerMessage Handle(T handler)
        {
            ServerMessage message = BasicUtilies.GetRevisionServerMessage(Revision.PRODUCTION_201601012205_226667486, r63cOutgoing.GuideSessionEnd);

            message.AppendInt32((int)handler.Code);
            return(message);
        }
Esempio n. 22
0
        public ServerMessage GetPublicRooms()
        {
            ServerMessage Message = BasicUtilies.GetRevisionServerMessage(Revision.RELEASE63_35255_34886_201108111108);

            Message.Init(r63aOutgoing.PublicRooms);
            Message.AppendInt32(this.PublicRooms.Count);
            foreach (PublicItem item in this.PublicRooms.Values.ToList())
            {
                if (item.Type == PublicItemType.CATEGORY)
                {
                    item.Serialize(Message);
                    foreach (PublicItem item_ in this.PublicRooms.Values.ToList())
                    {
                        if (item_.ParentCategoryID == item.ID)
                        {
                            item_.Serialize(Message);
                        }
                    }
                }
                else
                {
                    if (item.ParentCategoryID == 0 || item.ParentCategoryID == -1)
                    {
                        item.Serialize(Message);
                    }
                }
            }
            Message.AppendInt32(0);
            return(Message);
        }
Esempio n. 23
0
        public void Handle(GameClient session, ClientMessage message)
        {
            uint roomId = message.PopWiredUInt();

            if (session.GetHabbo().HomeRoom != roomId)
            {
                RoomData roomData = Skylight.GetGame().GetRoomManager().TryGetAndLoadRoomData(roomId);
                if (roomData != null && roomData.OwnerID == session.GetHabbo().ID)
                {
                    session.GetHabbo().HomeRoom = roomId;

                    using (DatabaseClient dbClient = Skylight.GetDatabaseManager().GetClient())
                    {
                        dbClient.AddParamWithValue("roomId", roomId);
                        dbClient.AddParamWithValue("userId", session.GetHabbo().ID);
                        dbClient.ExecuteQuery("UPDATE users SET home_room = @roomId WHERE id = @userId LIMIT 1");
                    }

                    ServerMessage message_ = BasicUtilies.GetRevisionServerMessage(Revision.RELEASE63_35255_34886_201108111108);
                    message_.Init(r63aOutgoing.HomeRoom);
                    message_.AppendUInt(roomId);
                    session.SendMessage(message_);
                }
            }
        }
Esempio n. 24
0
        public ServerMessage GetEvents(int type)
        {
            ServerMessage events = BasicUtilies.GetRevisionServerMessage(Revision.RELEASE63_35255_34886_201108111108);

            events.Init(r63aOutgoing.Navigator);
            events.AppendInt32(type);
            events.AppendString("");

            List <Room> rooms = Skylight.GetGame().GetRoomManager().GetLoadedRooms().Where(r => r != null && r.RoomData != null && r.RoomEvent != null && (type == -1 || r.RoomEvent.Category == type)).OrderByDescending(r => r.RoomData.UsersNow).Take(50).ToList();

            events.AppendInt32(rooms.Count);
            foreach (Room room in rooms)
            {
                room.RoomData.Serialize(events, true);
            }

            if (this.PublicRooms.Count > 0)
            {
                events.AppendBoolean(true);
                this.PublicRooms.Values.ElementAt(new Random().Next(0, this.PublicRooms.Count)).Serialize(events);
            }
            else
            {
                events.AppendBoolean(false);
            }
            return(events);
        }
        public void Handle(GameClient session, ClientMessage message)
        {
            Room room = session.GetHabbo().GetRoomSession().GetRoom();

            if (room != null && room.HaveOwnerRights(session))
            {
                foreach (uint userId in room.UsersWithRights)
                {
                    RoomUnitUser user = room.RoomUserManager.GetUserByID(userId);
                    if (user != null)
                    {
                        user.RemoveStatus("flatctrl");

                        ServerMessage roomRights = BasicUtilies.GetRevisionServerMessage(Revision.RELEASE63_35255_34886_201108111108);
                        roomRights.Init(r63aOutgoing.RemoveRoomRights);
                        user.Session.SendMessage(roomRights);
                    }

                    ServerMessage message_ = BasicUtilies.GetRevisionServerMessage(Revision.RELEASE63_35255_34886_201108111108);
                    message_.Init(r63aOutgoing.LostRights);
                    message_.AppendUInt(room.ID);
                    message_.AppendUInt(userId);
                    session.SendMessage(message_);
                }

                room.UsersWithRights.Clear();

                using (DatabaseClient dbClient = Skylight.GetDatabaseManager().GetClient())
                {
                    dbClient.AddParamWithValue("roomId", room.ID);
                    dbClient.ExecuteQuery("DELETE FROM room_rights WHERE room_id = @roomId");
                }
            }
        }
Esempio n. 26
0
        public ServerMessage GetPopularRoomTags()
        {
            ServerMessage Message = BasicUtilies.GetRevisionServerMessage(Revision.RELEASE63_35255_34886_201108111108);

            Message.Init(r63aOutgoing.PopularRoomTags);

            List <RoomData>          rooms = Skylight.GetGame().GetRoomManager().GetLoadedRooms().Where(r => r.RoomData.Type == "private" && r.RoomData.UsersNow > 0 && r.RoomData.Tags.Count > 0).OrderByDescending(r => r.RoomData.UsersNow).Take(50).Select(r => r.RoomData).ToList();
            Dictionary <string, int> tags  = new Dictionary <string, int>();

            foreach (RoomData room in rooms)
            {
                foreach (string tag in room.Tags)
                {
                    if (tags.ContainsKey(tag))
                    {
                        tags[tag] += room.UsersNow;
                    }
                    else
                    {
                        tags[tag] = room.UsersNow;
                    }
                }
            }

            Message.AppendInt32(tags.Count);
            foreach (KeyValuePair <string, int> tag in tags)
            {
                Message.AppendString(tag.Key);
                Message.AppendInt32(tag.Value);
            }
            return(Message);
        }
        public override void OnUse(GameClient session, RoomItem item, int request, bool userHasRights)
        {
            if (userHasRights)
            {
                ServerMessage message = BasicUtilies.GetRevisionServerMessage(Revision.RELEASE63_35255_34886_201108111108);
                message.Init(r63aOutgoing.WiredAction);
                message.AppendBoolean(false);                                  //check box toggling
                message.AppendInt32(session.GetHabbo().GetWiredActionLimit()); //furni limit
                message.AppendInt32(this.SelectedItems.Count);                 //furni count
                foreach (RoomItem item_ in this.SelectedItems)
                {
                    message.AppendUInt(item_.ID);
                }

                message.AppendInt32(this.GetBaseItem().SpriteID); //sprite id, show the help thing
                message.AppendUInt(this.ID);                      //item id
                message.AppendString("");                         //data
                message.AppendInt32(0);                           //extra data count
                message.AppendInt32(0);                           //delay, not work with this wired

                message.AppendInt32(0);                           //type
                message.AppendInt32(this.Delay);                  //delay
                message.AppendInt32(0);                           //conflicts count
                session.SendMessage(message);
            }
        }
        public ServerMessage Handle(ValueHolder valueHolder = null)
        {
            List <DataRow> friends      = valueHolder.GetValueOrDefault <List <DataRow> >("Friends");
            List <DataRow> randomPeople = valueHolder.GetValueOrDefault <List <DataRow> >("RandomPeople");

            ServerMessage message = BasicUtilies.GetRevisionServerMessage(Revision.R26_20080915_0408_7984_61ccb5f8b8797a3aba62c1fa2ca80169);

            message.Init(r26Outgoing.MessengerSearchResult);
            if (friends != null)
            {
                message.AppendInt32(friends.Count);
                foreach (DataRow dataRow in friends)
                {
                    //new MessengerFriend((uint)dataRow["Id"], (int)((long)dataRow["category"]), (string)dataRow["look"], (string)dataRow["motto"], (double)dataRow["last_online"]).Serialize(message, false);
                }
            }
            else
            {
                message.AppendInt32(0);
            }

            if (randomPeople != null)
            {
                message.AppendInt32(randomPeople.Count);
                foreach (DataRow dataRow in randomPeople)
                {
                    //new MessengerFriend((uint)dataRow["Id"], 0, (string)dataRow["look"], (string)dataRow["motto"], (double)dataRow["last_online"]).Serialize(message, false);
                }
            }
            else
            {
                message.AppendInt32(0);
            }
            return(message);
        }
Esempio n. 29
0
        public void AddExpirience(int amount, bool showExp = true)
        {
            GameClient owner = null;

            if (this.PetData.Expirience + amount >= this.PetData.ExpirienceGoal && this.PetData.Level != this.PetData.MaxLevel) //level up
            {
                this.Speak("*leveled up to level " + (this.PetData.Level + 1) + "*", false);

                owner = Skylight.GetGame().GetGameClientManager().GetGameClientById(this.PetData.OwnerID);
            }

            this.PetData.Expirience += amount;
            this.PetData.NeedUpdate  = true;

            if (owner != null)
            {
                owner.GetHabbo().Pets[this.PetData.ID] = this.PetData;
                owner.GetHabbo().GetUserAchievements().CheckAchievement("PetTrainer");
            }

            if (showExp)
            {
                ServerMessage message = BasicUtilies.GetRevisionServerMessage(Revision.RELEASE63_35255_34886_201108111108);
                message.Init(r63aOutgoing.PetGainExpirience);
                message.AppendUInt(this.PetData.ID);
                message.AppendInt32(this.VirtualID);
                message.AppendInt32(amount);
                this.Room.SendToAll(message);
            }
        }
Esempio n. 30
0
        public ServerMessage Handle(ValueHolder valueHolder = null)
        {
            ServerMessage message = BasicUtilies.GetRevisionServerMessage(Revision.PRODUCTION_201611291003_338511768);

            message.Init(r63ccOutgoing.NewNavigatorMetaData);
            message.AppendInt32(4); //count

            message.AppendString("official_view");
            message.AppendInt32(0); //saved search

            /*message.AppendInt32(1); //saved search
             * message.AppendInt32(1); //ID
             * message.AppendString("adw"); //code, IDK
             * message.AppendString("adw"); //filter, IDK
             * message.AppendString("adw"); //localization, IDK*/


            message.AppendString("hotel_view");
            message.AppendInt32(0); //saved search

            message.AppendString("roomads_view");
            message.AppendInt32(0); //saved search

            message.AppendString("myworld_view");
            message.AppendInt32(0); //saved search
            return(message);
        }