コード例 #1
0
        public void parse(GameClient Session, ClientPacket Packet)
        {
            uint Id = Packet.PopWiredUInt();

            RoomData Data = UberEnvironment.GetGame().GetRoomManager().GenerateRoomData(Id);

            if (Data == null || Session.GetHabbo().FavoriteRooms.Count >= 30 || Session.GetHabbo().FavoriteRooms.Contains(Id) || Data.Type == "public")
            {
                ServerPacket packet = new ServerPacket(33);
                packet.AppendInt32(-9001);
                Session.SendPacket(packet);

                return;
            }

            ServerPacket _packet = new ServerPacket(459);
            _packet.AppendUInt(Id);
            _packet.AppendBoolean(true);
            Session.SendPacket(_packet);

            Session.GetHabbo().FavoriteRooms.Add(Id);

            using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
            {
                dbClient.ExecuteQuery("INSERT INTO user_favorites (user_id,room_id) VALUES ('" + Session.GetHabbo().Id + "','" + Id + "')");
            }
        }
コード例 #2
0
 public void DeliverInstantMessage(string Message, uint ConversationId)
 {
     ServerPacket InstantMessage = new ServerPacket(134);
     InstantMessage.AppendUInt(ConversationId);
     InstantMessage.AppendString(Message);
     GetClient().SendPacket(InstantMessage);
 }
コード例 #3
0
        public void parse(GameClient Session, ClientPacket Packet)
        {
            ServerPacket packet = new ServerPacket(267);
            packet.AppendBoolean(Session.GetHabbo().HasFuse("fuse_use_wardrobe"));

            if (Session.GetHabbo().HasFuse("fuse_use_wardrobe"))
            {
                DataTable WardrobeData = null;

                using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
                {
                    dbClient.AddParamWithValue("userid", Session.GetHabbo().Id);
                    WardrobeData = dbClient.ReadDataTable("SELECT * FROM user_wardrobe WHERE user_id = @userid");
                }

                if (WardrobeData == null)
                {
                    packet.AppendInt32(0);
                }
                else
                {
                    packet.AppendInt32(WardrobeData.Rows.Count);

                    foreach (DataRow Row in WardrobeData.Rows)
                    {
                        packet.AppendUInt((uint)Row["slot_id"]);
                        packet.AppendStringWithBreak((string)Row["look"]);
                        packet.AppendStringWithBreak((string)Row["gender"]);
                    }
                }
            }
            Session.SendPacket(packet);
        }
コード例 #4
0
        public void parse(GameClient Session, ClientPacket Packet)
        {
            CatalogPage Page = UberEnvironment.GetGame().GetCatalog().GetPage(Packet.PopWiredInt32());

            if (Page == null || !Page.Enabled || !Page.Visible || Page.ComingSoon || Page.MinRank > Session.GetHabbo().Rank)
            {
                return;
            }

            if (Page.ClubOnly && !Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club"))
            {
                Session.SendNotif("This page is for Club members only!");
                return;
            }

            Session.SendPacket(UberEnvironment.GetGame().GetCatalog().SerializePage(Page));

            if (Page.Layout == "recycler")
            {
                ServerPacket message = new ServerPacket(507);
                message.AppendBoolean(true);
                message.AppendBoolean(false);
                Session.SendPacket(message);
            }
        }
コード例 #5
0
        public void parse(GameClient Session, ClientPacket Packet)
        {
            Room Room = UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (Room == null || Session.GetHabbo().DailyRespectPoints <= 0)
            {
                return;
            }

            RoomUser User = Room.GetRoomUserByHabbo(Packet.PopWiredUInt());

            if (User == null || User.GetClient().GetHabbo().Id == Session.GetHabbo().Id || User.IsBot)
            {
                return;
            }

            Session.GetHabbo().DailyRespectPoints--;
            User.GetClient().GetHabbo().Respect++;

            using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
            {
                dbClient.ExecuteQuery("UPDATE users SET respect = respect + 1 WHERE id = '" + User.GetClient().GetHabbo().Id + "' LIMIT 1");
                dbClient.ExecuteQuery("UPDATE users SET daily_respect_points = daily_respect_points - 1 WHERE id = '" + Session.GetHabbo().Id + "' LIMIT 1");
            }

            // FxkqUzYP_
            ServerPacket Message = new ServerPacket(440);
            Message.AppendUInt(User.GetClient().GetHabbo().Id);
            Message.AppendInt32(User.GetClient().GetHabbo().Respect);
            Room.SendMessage(Message);
        }
コード例 #6
0
        public void parse(GameClient Session, ClientPacket Packet)
        {
            Session.GetHabbo().GetBadgeComponent().ResetSlots();

            using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
            {
                dbClient.ExecuteQuery("UPDATE user_badges SET badge_slot = '0' WHERE user_id = '" + Session.GetHabbo().Id + "'");
            }

            while (Packet.RemainingLength > 0)
            {
                int Slot = Packet.PopWiredInt32();
                string Badge = Packet.PopFixedString();

                if (Badge.Length == 0)
                {
                    continue;
                }

                if (!Session.GetHabbo().GetBadgeComponent().HasBadge(Badge) || Slot < 1 || Slot > 5)
                {
                    // zomg haxx0r
                    return;
                }

                Session.GetHabbo().GetBadgeComponent().GetBadge(Badge).Slot = Slot;

                using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
                {
                    dbClient.AddParamWithValue("slotid", Slot);
                    dbClient.AddParamWithValue("badge", Badge);
                    dbClient.AddParamWithValue("userid", Session.GetHabbo().Id);
                    dbClient.ExecuteQuery("UPDATE user_badges SET badge_slot = @slotid WHERE badge_id = @badge AND user_id = @userid LIMIT 1");
                }
            }

            ServerPacket Message = new ServerPacket(228);
            Message.AppendUInt(Session.GetHabbo().Id);
            Message.AppendInt32(Session.GetHabbo().GetBadgeComponent().EquippedCount);

            foreach (Badge Badge in Session.GetHabbo().GetBadgeComponent().BadgeList)
            {
                if (Badge.Slot <= 0)
                {
                    continue;
                }

                Message.AppendInt32(Badge.Slot);
                Message.AppendStringWithBreak(Badge.Code);
            }

            if (Session.GetHabbo().InRoom && UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId) != null)
            {
                UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId).SendMessage(Message);
            }
            else
            {
                Session.SendPacket(Message);
            }
        }
コード例 #7
0
        public void parse(GameClient Session, ClientPacket Packet)
        {
            Room Room = UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (Room == null)
            {
                return;
            }

            RoomUser User = Room.GetRoomUserByHabbo(Packet.PopWiredUInt());

            if (User == null || User.IsBot)
            {
                return;
            }
            ServerPacket packet = new ServerPacket(228);
            packet.AppendUInt(User.GetClient().GetHabbo().Id);
            packet.AppendInt32(User.GetClient().GetHabbo().GetBadgeComponent().EquippedCount);

            foreach (Badge Badge in User.GetClient().GetHabbo().GetBadgeComponent().BadgeList)
            {
                if (Badge.Slot <= 0)
                {
                    continue;
                }

                packet.AppendInt32(Badge.Slot);
                packet.AppendStringWithBreak(Badge.Code);
            }

            Session.SendPacket(packet);
        }
コード例 #8
0
        public void parse(GameClient Session, ClientPacket Packet)
        {
            Room Room = UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (Room == null)
            {
                return;
            }

            RoomUser User = Room.GetRoomUserByHabbo(Packet.PopWiredUInt());

            if (User == null || User.IsBot)
            {
                return;
            }

            ServerPacket packet = new ServerPacket(350);
            packet.AppendUInt(User.GetClient().GetHabbo().Id);
            packet.AppendInt32(User.GetClient().GetHabbo().Tags.Count);

            foreach (string Tag in User.GetClient().GetHabbo().Tags)
            {
                packet.AppendStringWithBreak(Tag);
            }

            Session.SendPacket(packet);
        }
コード例 #9
0
        public void Serialize(ServerPacket Message)
        {
            // PMYoNktchn_stovesKHI[bKIM

            if (IsDeal)
            {
                // 8 328 deal01 [] 5 0 2 s [] 26 [] 3 -1
                // PBXRAdeal01QAHJsRFKMsQEIM

                throw new NotImplementedException("Multipile item ids set for catalog item #" + Id + ", but this is usupported at this point");
            }
            else
            {
                Message.AppendUInt(Id);
                Message.AppendStringWithBreak(Name);
                Message.AppendInt32(CreditsCost);
                Message.AppendInt32(PixelsCost);
                Message.AppendInt32(0); // R63 fix
                Message.AppendInt32(1);
                Message.AppendStringWithBreak(GetBaseItem().Type);
                Message.AppendInt32(GetBaseItem().SpriteId);
                Message.AppendStringWithBreak("");
                Message.AppendInt32(Amount);
                Message.AppendInt32(-1);
            }
        }
コード例 #10
0
 public void parse(GameClient Session, ClientPacket Packet)
 {
     ServerPacket packet = new ServerPacket(611);
     packet.AppendBoolean(true);
     packet.AppendInt32(99999);
     Session.SendPacket(packet);
 }
コード例 #11
0
ファイル: Trade.cs プロジェクト: habb0/uberEmu-stabilized
        public Trade(uint UserOneId, uint UserTwoId, uint RoomId)
        {
            this.oneId = UserOneId;
            this.twoId = UserTwoId;

            this.Users = new List<TradeUser>(2);
            this.Users.Add(new TradeUser(UserOneId, RoomId));
            this.Users.Add(new TradeUser(UserTwoId, RoomId));
            this.TradeStage = 1;
            this.RoomId = RoomId;

            foreach (TradeUser User in Users)
            {
                if (!User.GetRoomUser().Statusses.ContainsKey("trd"))
                {
                    User.GetRoomUser().AddStatus("trd", "");
                    User.GetRoomUser().UpdateNeeded = true;
                }
            }

            ServerPacket Message = new ServerPacket(104);
            Message.AppendUInt(UserOneId);
            Message.AppendBoolean(true);
            Message.AppendUInt(UserTwoId);
            Message.AppendBoolean(true);
            SendMessageToUsers(Message);
        }
コード例 #12
0
        public void parse(GameClient Session, ClientPacket Packet)
        {
            Room Room = UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (Room == null || !Room.CheckRights(Session, true))
            {
                return;
            }

            foreach (uint UserId in Room.UsersWithRights)
            {
                RoomUser User = Room.GetRoomUserByHabbo(UserId);

                if (User != null && !User.IsBot)
                {
                    User.GetClient().SendPacket(new ServerPacket(43));
                }

                ServerPacket packet = new ServerPacket(511);
                packet.AppendUInt(Room.RoomId);
                packet.AppendUInt(UserId);
                Session.SendPacket(packet);
            }

            using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
            {
                dbClient.ExecuteQuery("DELETE FROM room_rights WHERE room_id = '" + Room.RoomId + "'");
            }

            Room.UsersWithRights.Clear();
        }
コード例 #13
0
        public void parse(GameClient Session, ClientPacket Packet)
        {
            int count = Packet.PopWiredInt32();

            List<uint> UserIds = new List<uint>();

            for (int i = 0; i < count; i++)
            {
                UserIds.Add(Packet.PopWiredUInt());
            }

            string message = UberEnvironment.FilterInjectionChars(Packet.PopFixedString(), true);

            ServerPacket Message = new ServerPacket(135);
            Message.AppendUInt(Session.GetHabbo().Id);
            Message.AppendStringWithBreak(message);

            foreach (uint Id in UserIds)
            {
                if (!Session.GetHabbo().GetMessenger().FriendshipExists(Session.GetHabbo().Id, Id))
                {
                    continue;
                }

                GameClient Client = UberEnvironment.GetGame().GetClientManager().GetClientByHabbo(Id);

                if (Client == null)
                {
                    return;
                }

                Client.SendPacket(Message);
            }
        }
コード例 #14
0
        public void parse(GameClient Session, ClientPacket Packet)
        {
            uint _id = Packet.PopWiredUInt();
            DataRow Row = null;

            using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
            {
                Row = dbClient.ReadDataRow("SELECT * FROM catalog_marketplace_offers WHERE offer_id = '" + _id + "' LIMIT 1");
            }

            if (Row == null || (uint)Row["user_id"] != Session.GetHabbo().Id || (string)Row["state"] != "1")
            {
                return;
            }

            Item Item = UberEnvironment.GetGame().GetItemManager().GetItem((uint)Row["item_id"]);

            if (Item == null)
            {
                return;
            }

            UberEnvironment.GetGame().GetCatalog().DeliverItems(Session, Item, 1, (string)Row["extra_data"]);

            using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
            {
                dbClient.ExecuteQuery("DELETE FROM catalog_marketplace_offers WHERE offer_id = '" + _id + "' LIMIT 1");
            }

            ServerPacket packet = new ServerPacket(614);
            packet.AppendUInt((uint)Row["offer_id"]);
            packet.AppendBoolean(true);
            Session.SendPacket(packet);
        }
コード例 #15
0
        public void SellItem(GameClient Session, uint ItemId, int SellingPrice)
        {
            UserItem Item = Session.GetHabbo().GetInventoryComponent().GetItem(ItemId);

            if (Item == null || SellingPrice > 10000 || !CanSellItem(Item))
            {
                ServerPacket packet = new ServerPacket(610);
                packet.AppendBoolean(false);
                Session.SendPacket(packet);

                return;
            }

            int Comission = CalculateComissionPrice(SellingPrice);
            int TotalPrice = SellingPrice + Comission;
            int ItemType = 1;

            if (Item.GetBaseItem().Type == "i")
            {
                ItemType++;
            }

            using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
            {
                dbClient.AddParamWithValue("public_name", Item.GetBaseItem().PublicName);
                dbClient.AddParamWithValue("extra_data", Item.ExtraData);
                dbClient.ExecuteQuery("INSERT INTO catalog_marketplace_offers (item_id,user_id,asking_price,total_price,public_name,sprite_id,item_type,timestamp,extra_data) VALUES ('" + Item.BaseItem + "','" + Session.GetHabbo().Id + "','" + SellingPrice + "','" + TotalPrice + "',@public_name,'" + Item.GetBaseItem().SpriteId + "','" + ItemType + "','" + UberEnvironment.GetUnixTimestamp() + "',@extra_data)");
            }

            Session.GetHabbo().GetInventoryComponent().RemoveItem(ItemId);

            ServerPacket p610 = new ServerPacket(610);
            p610.AppendBoolean(true);
            Session.SendPacket(p610);
        }
コード例 #16
0
        public void parse(GameClient Session, ClientPacket Packet)
        {
            if (Session.GetHabbo().MutantPenalty)
            {
                Session.SendNotif("Because of a penalty or restriction on your account, you are not allowed to change your look.");
                return;
            }

            string Gender = Packet.PopFixedString().ToUpper();
            string Look = UberEnvironment.FilterInjectionChars(Packet.PopFixedString());

            if (!AntiMutant.ValidateLook(Look, Gender))
            {
                return;
            }

            Session.GetHabbo().Look = Look;
            Session.GetHabbo().Gender = Gender.ToLower();

            using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
            {
                dbClient.AddParamWithValue("look", Look);
                dbClient.AddParamWithValue("gender", Gender);
                dbClient.ExecuteQuery("UPDATE users SET look = @look, gender = @gender WHERE id = '" + Session.GetHabbo().Id + "' LIMIT 1");
            }

            UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 1, 1);

            ServerPacket packet = new ServerPacket(266);
            packet.AppendInt32(-1);
            packet.AppendStringWithBreak(Session.GetHabbo().Look);
            packet.AppendStringWithBreak(Session.GetHabbo().Gender.ToLower());
            packet.AppendStringWithBreak(Session.GetHabbo().Motto);
            Session.SendPacket(packet);

            if (Session.GetHabbo().InRoom)
            {
                Room Room = Session.GetHabbo().CurrentRoom;

                if (Room == null)
                {
                    return;
                }

                RoomUser User = Room.GetRoomUserByHabbo(Session.GetHabbo().Id);

                if (User == null)
                {
                    return;
                }

                ServerPacket RoomUpdate = new ServerPacket(266);
                RoomUpdate.AppendInt32(User.VirtualId);
                RoomUpdate.AppendStringWithBreak(Session.GetHabbo().Look);
                RoomUpdate.AppendStringWithBreak(Session.GetHabbo().Gender.ToLower());
                RoomUpdate.AppendStringWithBreak(Session.GetHabbo().Motto);
                Room.SendMessage(RoomUpdate);
            }
        }
コード例 #17
0
        public void Serialize(ServerPacket Request)
        {
            // BDhqu@UMeth0d1322033860

            Request.AppendUInt(FromUser);
            Request.AppendStringWithBreak(SenderUsername);
            Request.AppendStringWithBreak(FromUser.ToString());
        }
コード例 #18
0
        public void parse(GameClient Session, ClientPacket Packet)
        {
            ServerPacket packet = new ServerPacket(512);
            packet.AppendBoolean(false); // true = show error with number below
            packet.AppendInt32(99999);
            Session.SendPacket(packet);

            // todo: room limit
        }
コード例 #19
0
        public void parse(GameClient Session, ClientPacket Packet)
        {
            Room Room = UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (Room == null || !Room.CheckRights(Session, true))
            {
                return;
            }

            UserItem Item = Session.GetHabbo().GetInventoryComponent().GetItem(Packet.PopWiredUInt());

            if (Item == null)
            {
                return;
            }

            string type = "floor";

            if (Item.GetBaseItem().Name.ToLower().Contains("wallpaper"))
            {
                type = "wallpaper";
            }
            else if (Item.GetBaseItem().Name.ToLower().Contains("landscape"))
            {
                type = "landscape";
            }

            switch (type)
            {
                case "floor":

                    Room.Floor = Item.ExtraData;
                    break;

                case "wallpaper":

                    Room.Wallpaper = Item.ExtraData;
                    break;

                case "landscape":

                    Room.Landscape = Item.ExtraData;
                    break;
            }

            using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
            {
                dbClient.ExecuteQuery("UPDATE rooms SET " + type + " = '" + Item.ExtraData + "' WHERE id = '" + Room.RoomId + "' LIMIT 1");
            }

            Session.GetHabbo().GetInventoryComponent().RemoveItem(Item.Id);

            ServerPacket Message = new ServerPacket(46);
            Message.AppendStringWithBreak(type);
            Message.AppendStringWithBreak(Item.ExtraData);
            Room.SendMessage(Message);
        }
コード例 #20
0
        public void parse(GameClient Session, ClientPacket Packet)
        {
            Room Room = UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (Room == null || !Room.CheckRights(Session, true))
            {
                return;
            }

            RoomItem Present = Room.GetItem(Packet.PopWiredUInt());

            if (Present == null)
            {
                return;
            }

            DataRow Data = null;

            using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
            {
                Data = dbClient.ReadDataRow("SELECT base_id,amount,extra_data FROM user_presents WHERE item_id = '" + Present.Id + "' LIMIT 1");
            }

            if (Data == null)
            {
                return;
            }

            Item BaseItem = UberEnvironment.GetGame().GetItemManager().GetItem((uint)Data["base_id"]);

            if (BaseItem == null)
            {
                return;
            }

            Room.RemoveFurniture(Session, Present.Id);

            ServerPacket packet = new ServerPacket(219);
            packet.AppendUInt(Present.Id);
            Session.SendPacket(packet);

            packet = new ServerPacket(129);
            packet.AppendStringWithBreak(BaseItem.Type);
            packet.AppendInt32(BaseItem.SpriteId);
            packet.AppendStringWithBreak(BaseItem.Name);
            Session.SendPacket(packet);

            using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
            {
                dbClient.ExecuteQuery("DELETE FROM user_presents WHERE item_id = '" + Present.Id + "' LIMIT 1");
            }

            UberEnvironment.GetGame().GetCatalog().DeliverItems(Session, BaseItem, (int)Data["amount"], (string)Data["extra_data"]);
        }
コード例 #21
0
        public void parse(GameClient Session, ClientPacket Packet)
        {
            if (Session.GetHabbo().LoadingRoom <= 0)
            {
                return;
            }

            ServerPacket packet = new ServerPacket(297);
            packet.AppendInt32(0);
            Session.SendPacket(packet);
        }
コード例 #22
0
ファイル: RoomIcon.cs プロジェクト: habb0/uberEmu-stabilized
        public void Serialize(ServerPacket Message)
        {
            Message.AppendInt32(BackgroundImage);
            Message.AppendInt32(ForegroundImage);
            Message.AppendInt32(Items.Count);

            foreach (KeyValuePair<int, int> Item in Items)
            {
                Message.AppendInt32(Item.Key);
                Message.AppendInt32(Item.Value);
            }
        }
コード例 #23
0
        public void parse(GameClient Session, ClientPacket Packet)
        {
            if (!UberEnvironment.GetGame().GetModerationTool().UsersHasPendingTicket(Session.GetHabbo().Id))
            {
                return;
            }

            UberEnvironment.GetGame().GetModerationTool().DeletePendingTicketForUser(Session.GetHabbo().Id);

            ServerPacket packet = new ServerPacket(320);
            Session.SendPacket(packet);
        }
コード例 #24
0
        public void parse(GameClient Session, ClientPacket Packet)
        {
            uint ItemId = Packet.PopWiredUInt();
            DataRow Row = null;

            using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
            {
                Row = dbClient.ReadDataRow("SELECT * FROM catalog_marketplace_offers WHERE offer_id = '" + ItemId + "' LIMIT 1");
            }

            if (Row == null || (string)Row["state"] != "1" || (double)Row["timestamp"] <= UberEnvironment.GetGame().GetCatalog().GetMarketplace().FormatTimestamp())
            {
                Session.SendNotif("Sorry, this offer has expired.");
                return;
            }

            Item Item = UberEnvironment.GetGame().GetItemManager().GetItem((uint)Row["item_id"]);

            if (Item == null)
            {
                return;
            }

            if ((int)Row["total_price"] >= 1)
            {
                Session.GetHabbo().Credits -= (int)Row["total_price"];
                Session.GetHabbo().UpdateCreditsBalance(true);
            }

            UberEnvironment.GetGame().GetCatalog().DeliverItems(Session, Item, 1, (string)Row["extra_data"]);

            using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
            {
                dbClient.ExecuteQuery("UPDATE catalog_marketplace_offers SET state = '2' WHERE offer_id = '" + ItemId + "' LIMIT 1");
            }

            ServerPacket packet = new ServerPacket(67);
            packet.AppendUInt(Item.ItemId);
            packet.AppendStringWithBreak(Item.Name);
            packet.AppendInt32(0);
            packet.AppendInt32(0);
            packet.AppendInt32(1);
            packet.AppendStringWithBreak(Item.Type.ToLower());
            packet.AppendInt32(Item.SpriteId);
            packet.AppendStringWithBreak("");
            packet.AppendInt32(1);
            packet.AppendInt32(-1);
            packet.AppendStringWithBreak("");
            Session.SendPacket(packet);

            Session.SendPacket(UberEnvironment.GetGame().GetCatalog().GetMarketplace().SerializeOffers(-1, -1, "", 1));
        }
コード例 #25
0
        public void AddEffect(int EffectId, int Duration)
        {
            using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
            {
                dbClient.ExecuteQuery("INSERT INTO user_effects (user_id,effect_id,total_duration,is_activated,activated_stamp) VALUES ('" + UserId + "','" + EffectId + "','" + Duration + "','0','0')");
            }

            Effects.Add(new AvatarEffect(EffectId, Duration, false, 0));

            ServerPacket packet = new ServerPacket(461);
            packet.AppendInt32(EffectId);
            packet.AppendInt32(Duration);
            GetClient().SendPacket(packet);
        }
コード例 #26
0
        public void parse(GameClient Session, ClientPacket Packet)
        {
            Room Room = UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (Room == null || !Room.CheckRights(Session, true) || Room.Event == null)
            {
                return;
            }

            Room.Event = null;

            ServerPacket Message = new ServerPacket(370);
            Message.AppendStringWithBreak("-1");
            Room.SendMessage(Message);
        }
コード例 #27
0
        public void parse(GameClient Session, ClientPacket Packet)
        {
            uint Id = Packet.PopWiredUInt();

            Session.GetHabbo().FavoriteRooms.Remove(Id);

            ServerPacket packet = new ServerPacket(459);
            packet.AppendUInt(Id);
            packet.AppendBoolean(false);
            Session.SendPacket(packet);

            using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
            {
                dbClient.ExecuteQuery("DELETE FROM user_favorites WHERE user_id = '" + Session.GetHabbo().Id + "' AND room_id = '" + Id + "' LIMIT 1");
            }
        }
コード例 #28
0
        public void parse(GameClient Session, ClientPacket Packet)
        {
            string RoomName = UberEnvironment.FilterInjectionChars(Packet.PopFixedString());
            string ModelName = Packet.PopFixedString();
            string RoomState = Packet.PopFixedString(); // unused, room open by default on creation. may be added in later build of Habbo?

            RoomData NewRoom = UberEnvironment.GetGame().GetRoomManager().CreateRoom(Session, RoomName, ModelName);

            if (NewRoom != null)
            {
                ServerPacket packet = new ServerPacket(59);
                packet.AppendUInt(NewRoom.Id);
                packet.AppendStringWithBreak(NewRoom.Name);
                Session.SendPacket(packet);
            }
        }
コード例 #29
0
        public void parse(GameClient Session, ClientPacket Packet)
        {
            uint Id = Packet.PopWiredUInt();

            CatalogItem Item = UberEnvironment.GetGame().GetCatalog().FindItem(Id);

            if (Item == null)
            {
                return;
            }

            ServerPacket packet = new ServerPacket(622);
            packet.AppendUInt(Item.Id);
            packet.AppendBoolean(Item.GetBaseItem().AllowGift);
            Session.SendPacket(packet);
        }
コード例 #30
0
        public void parse(GameClient Session, ClientPacket Packet)
        {
            uint Id = Packet.PopWiredUInt();

            RoomData Data = UberEnvironment.GetGame().GetRoomManager().GenerateRoomData(Id);

            if (Data == null || Data.Type != "public")
            {
                return;
            }

            ServerPacket packet = new ServerPacket(453);
            packet.AppendUInt(Data.Id);
            packet.AppendStringWithBreak(Data.CCTs);
            packet.AppendUInt(Data.Id);
            Session.SendPacket(packet);
        }