PlusEMU Support thread.

Status
Not open for further replies.

Damien

Don't need glasses if you can C#
Feb 26, 2012
434
647
No the `pet_id` is the speach it. So "speech.pet15".

Either way just run this:
Code:
-- ----------------------------
-- Table structure for `bots_pet_responses`
-- ----------------------------
DROP TABLE IF EXISTS `bots_pet_responses`;
CREATE TABLE `bots_pet_responses` (
  `pet_id` varchar(255) NOT NULL,
  `responses` text NOT NULL,
  PRIMARY KEY (`pet_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Records of bots_pet_responses
-- ----------------------------
INSERT INTO `bots_pet_responses` VALUES ('pet.lazy', '*sigh*;*refuses*; ... ;Who do you think you are?;you do it;Grr!;*laughs*;Why?;');
INSERT INTO `bots_pet_responses` VALUES ('pet.respected', 'was respected');
INSERT INTO `bots_pet_responses` VALUES ('pet.tired', 'ZzZzzzzz;*sleeps*;Tired... *sleeps*;ZzZzZZzzzZZz;zzZzzZzzz;... Yawnn ..;ZzZzzZ;');
INSERT INTO `bots_pet_responses` VALUES ('pet.unknowncommand', '*confused*;What?;Huh?;What is that?;hmm..?;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet0', 'woof woof woof!!!;hooooowl;wooooof!;Woof Woof!;sit;lay;snf;Woof;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet1', 'meow;meow...meOW;muew..muew;lay;sit;lay;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet10', 'Grrr;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet11', 'Grrr;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet12', 'Grrr;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet13', 'Horse;Goes;Neyyyy;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet14', 'Grrr;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet15', 'neiiigh;*trots around*;Neeeigh;*looks at*;*flicks tail*;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet2', 'Rrrr....Grrrrrg....;*Mellow*;Tick tock tick....;*feels like eating my owner*;Nom Nom Nom;.. Yawwnn!;snf;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet26', 'Grrr;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet28', 'Grrr;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet29', 'Grrr;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet3', 'woof woof woof!!!;hooooowl;wooooof!;Woof Woof!;sit;lay;snf;Woof;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet30', 'Grrr;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet4', '*pack of fresh salmon please*;Rawrrr!;*sniff sniff*;Yawnnnn..;Rawr! ... Rawrrrrr?;snf;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet5', 'Oink Oink..;*Mellow*;Sniff... Sniff..;snf;Oink!;snf;lay;oink;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet6', 'Grrr;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet7', 'Grrr;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet8', 'Grrr;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet9', 'Grrr;');
 

Lex12

New Member
Nov 15, 2014
17
0
INSERT INTO `bots_pet_responses` VALUES ('pet.lazy', '*sigh*;*refuses*; ... ;Who do you think you are?;you do it;Grr!;*laughs*;Why?;');
INSERT INTO `bots_pet_responses` VALUES ('pet.respected', 'was respected');
INSERT INTO `bots_pet_responses` VALUES ('pet.tired', 'ZzZzzzzz;*sleeps*;Tired... *sleeps*;ZzZzZZzzzZZz;zzZzzZzzz;... Yawnn ..;ZzZzzZ;');
INSERT INTO `bots_pet_responses` VALUES ('pet.unknowncommand', '*confused*;What?;Huh?;What is that?;hmm..?;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet0', 'woof woof woof!!!;hooooowl;wooooof!;Woof Woof!;sit;lay;snf;Woof;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet1', 'meow;meow...meOW;muew..muew;lay;sit;lay;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet10', 'Grrr;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet11', 'Grrr;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet12', 'Grrr;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet13', 'Horse;Goes;Neyyyy;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet14', 'Grrr;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet15', 'neiiigh;*trots around*;Neeeigh;*looks at*;*flicks tail*;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet2', 'Rrrr....Grrrrrg....;*Mellow*;Tick tock tick....;*feels like eating my owner*;Nom Nom Nom;.. Yawwnn!;snf;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet26', 'Grrr;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet28', 'Grrr;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet29', 'Grrr;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet3', 'woof woof woof!!!;hooooowl;wooooof!;Woof Woof!;sit;lay;snf;Woof;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet30', 'Grrr;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet4', '*pack of fresh salmon please*;Rawrrr!;*sniff sniff*;Yawnnnn..;Rawr! ... Rawrrrrr?;snf;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet5', 'Oink Oink..;*Mellow*;Sniff... Sniff..;snf;Oink!;snf;lay;oink;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet6', 'Grrr;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet7', 'Grrr;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet8', 'Grrr;');
INSERT INTO `bots_pet_responses` VALUES ('speech.pet9', 'Grrr;');
Thanks :)
 

Meap

Don't need glasses if you C#
Nov 7, 2010
1,045
296
gonna sound like a noob but can someone explain how this works in a bit of detail so I can understand it more
## Client configuration
client.ping.enabled=1
client.ping.interval=20000
client.maxrequests=300
 

kristianbib

New Member
Apr 12, 2013
8
1
Hello
When i'm opening my client, it fully loads into the hotel, but when i'm in the main menu, my avatar is blank and then it reconnects me.
Every other image is loaded, except the avatar.

I tried looking through the SWFS, but I can't seem to find it.
 

Rain

c
Mar 13, 2015
563
251
gonna sound like a noob but can someone explain how this works in a bit of detail so I can understand it more
## Client configuration
client.ping.enabled=1
client.ping.interval=20000
client.maxrequests=300
I'm pretty sure it pings the client to make sure their connection active, and if it isn't, then it disconnected them?
And the ping interval is hong often it does it?
Don't take my word for it, but I think that's it..

Client max requests is the max users online i think
 

Meap

Don't need glasses if you C#
Nov 7, 2010
1,045
296
yeah I recently found out theres some sort of memory leak or something, this guy came on and did something that made my emulator use 2.3gb RAM, emulator said there was like 100+ users online and the hotel was lagging to shit, I have no idea what he did
anyone else experienced this or
 

Hablet

New Member
Apr 13, 2012
14
2
Anyone know how to set it so that rank 3 or above receive staff alerts and not rank 2, cant seem to find anything in database and StaffAlertCommand.cs
 

Lex12

New Member
Nov 15, 2014
17
0
Hi,
Do you know the code for :massbadge, masscredits and massduckets? Seems like they are not working when i do type in the command.
Thanks,
 
Any got the fix for group badges? plenty of people are saying they have and will post it later but no one really want to release it..

and i just can't get group badges to show up at all..
What's wrong with your group badges, are the symbols missing?
 

Meap

Don't need glasses if you C#
Nov 7, 2010
1,045
296
Hi,
Do you know the code for :massbadge, masscredits and massduckets? Seems like they are not working when i do type in the command.
Thanks,
 

What's wrong with your group badges, are the symbols missing?
pretty sure its :massgive credits,duckets etc same with globalgive
 

Rain

c
Mar 13, 2015
563
251
yeah I recently found out theres some sort of memory leak or something, this guy came on and did something that made my emulator use 2.3gb RAM, emulator said there was like 100+ users online and the hotel was lagging to shit, I have no idea what he did
anyone else experienced this or
When I hit 200 online, it only used 400 ish mb. Do you know he did it, or did it happen and he claimed he did it?
 

Meap

Don't need glasses if you C#
Nov 7, 2010
1,045
296
When I hit 200 online, it only used 400 ish mb. Do you know he did it, or did it happen and he claimed he did it?
He asked me if he could test it and I said sure, literally like 10 seconds after , boom the hotel completely lagged and the ram usage went through the roof, he claimed there was memory leaks
 

Rain

c
Mar 13, 2015
563
251
He asked me if he could test it and I said sure, literally like 10 seconds after , boom the hotel completely lagged and the ram usage went through the roof, he claimed there was memory leaks
Shiiit, I woke up to MySQL having crashed a few times.. I think it was because I was transferring a 15gb database tho (MySQL was always at 90%usage, down to 2%ish now)
 

Damien

Don't need glasses if you can C#
Feb 26, 2012
434
647
So I found another exploit today, that was brought to my attention by some Swedish hotel owners. Which allowed scripters to remove furniture from the room and replace it with gnomes.. What?
Yeah.. I know. But here's how to fix it :)

In CheckGnomeNameEvent.cs look for this:
Code:
if (Item == null || Item.Data == null)

And replace it with this:
Code:
if (Item == null || Item.Data == null || Item.UserID != Session.GetHabbo().Id || Item.Data.InteractionType != InteractionType.GNOME_BOX)

What happens here is when the user creates a Gnome pet, it removes the box from the room it came in, but there is no check to see if the box belongs to the user executing the event. So this means if the scripter is able to find out the itemId of a furniture they can replace it with a gnome, even if they don't have permission too.

Here's a little screenshot of it in action:
13254174_582686448565815_2494028787572578499_n.jpg

Hopefully the explanation made sense and you was all able to patch it okay :)
 
Last edited by a moderator:

Muff

Member
Aug 5, 2015
252
129
Hello for those we don't have the ,magic stack tool
fix that was released on the rival forums,

go to Plus\HabboHotel\Rooms\RoomItemHandling.cs find
Code:
public bool SetFloorItem(GameClient Session, Item Item, int newX, int newY, int newRot, bool newItem, bool OnRoller, bool sendMessage, bool updateRoomUserStatuses = false)

Change the entire void to
Code:
        public bool SetFloorItem(GameClient Session, Item Item, int newX, int newY, int newRot, bool newItem, bool OnRoller, bool sendMessage, bool updateRoomUserStatuses = false)
        {
            // Questions -> Skype: keiz.er
            bool NeedsReAdd = false;


            if (newItem)
                if (Item.IsWired)
                    if (Item.GetBaseItem().WiredType == WiredBoxType.EffectRegenerateMaps && _room.GetRoomItemHandler().GetFloor.Where(x => x.GetBaseItem().WiredType == WiredBoxType.EffectRegenerateMaps).Count() > 0)
                        return false;


            List<Item> ItemsOnTile = GetFurniObjects(newX, newY);
            if (Item.GetBaseItem().InteractionType == InteractionType.ROLLER && ItemsOnTile.Where(x => x.GetBaseItem().InteractionType == InteractionType.ROLLER && x.Id != Item.Id).Count() > 0)
                return false;


            if (!newItem)
                NeedsReAdd = _room.GetGameMap().RemoveFromMap(Item);


            Dictionary<int, ThreeDCoord> AffectedTiles = Gamemap.GetAffectedTiles(Item.GetBaseItem().Length, Item.GetBaseItem().Width, newX, newY, newRot);


            if (!_room.GetGameMap().ValidTile(newX, newY) || _room.GetGameMap().SquareHasUsers(newX, newY) && !Item.GetBaseItem().IsSeat)
            {
                if (NeedsReAdd)
                    _room.GetGameMap().AddToMap(Item);
                return false;
            }


            foreach (ThreeDCoord Tile in AffectedTiles.Values)
            {
                if (!_room.GetGameMap().ValidTile(Tile.X, Tile.Y) ||
                    (_room.GetGameMap().SquareHasUsers(Tile.X, Tile.Y) && !Item.GetBaseItem().IsSeat))
                {
                    if (NeedsReAdd)
                    {
                        _room.GetGameMap().AddToMap(Item);
                    }
                    return false;
                }
            }
         
            Double newZ = _room.GetGameMap().Model.SqFloorHeight[newX, newY];


            if (!OnRoller)
            {
                if (_room.GetGameMap().Model.SqState[newX, newY] != SquareState.OPEN && !Item.GetBaseItem().IsSeat)
                {
                    return false;
                }


                foreach (ThreeDCoord Tile in AffectedTiles.Values)
                {
                    if (_room.GetGameMap().Model.SqState[Tile.X, Tile.Y] != SquareState.OPEN &&
                        !Item.GetBaseItem().IsSeat)
                    {
                        if (NeedsReAdd)
                        {
                            //AddItem(Item);
                            _room.GetGameMap().AddToMap(Item);
                        }
                        return false;
                    }
                }
             
                if (!Item.GetBaseItem().IsSeat && !Item.IsRoller)
                {
                    foreach (ThreeDCoord Tile in AffectedTiles.Values)
                    {
                        if (_room.GetGameMap().GetRoomUsers(new Point(Tile.X, Tile.Y)).Count > 0)
                        {
                            if (NeedsReAdd)
                                _room.GetGameMap().AddToMap(Item);
                            return false;
                        }
                    }
                }
            }


            // Find affected objects
            var ItemsAffected = new List<Item>();
            var ItemsComplete = new List<Item>();


            foreach (ThreeDCoord Tile in AffectedTiles.Values.ToList())
            {
                List<Item> Temp = GetFurniObjects(Tile.X, Tile.Y);


                if (Temp != null)
                {
                    ItemsAffected.AddRange(Temp);
                }
            }




            ItemsComplete.AddRange(ItemsOnTile);
            ItemsComplete.AddRange(ItemsAffected);


            if (!OnRoller)
            {
                foreach (Item I in ItemsComplete.ToList())
                {
                    if (I == null)
                        continue;


                    if (I.Id == Item.Id)
                        continue;


                    if (I.GetBaseItem() == null)
                        continue;


                }
            }
         
            {
                if (Item.Rotation != newRot && Item.GetX == newX && Item.GetY == newY)
                    newZ = Item.GetZ;
             
                foreach (Item I in ItemsComplete.ToList())
                {
                    if (I == null)
                        continue;
                    if (I.Id == Item.Id)
                        continue;


                    if (I.GetBaseItem().InteractionType == InteractionType.STACKTOOL)
                    { // Basically the core of the fix
                        // Questions -> Skype: keiz.er
                        newZ = I.GetZ;
                        break;
                    }


                    if (I.TotalHeight > newZ)
                    {
                        newZ = I.TotalHeight;
                    }


                }
            }
         
            if (newRot != 0 && newRot != 2 && newRot != 4 && newRot != 6 && newRot != 8 && !Item.GetBaseItem().ExtraRot)
                newRot = 0;


            Item.Rotation = newRot;
            int oldX = Item.GetX;
            int oldY = Item.GetY;
            Item.SetState(newX, newY, newZ, AffectedTiles);


            if (!OnRoller && Session != null)
                Item.Interactor.OnPlace(Session, Item);




            if (newItem)
            {
                if (_floorItems.ContainsKey(Item.Id))
                {
                    if (Session != null)
                        Session.SendNotification(PlusEnvironment.GetGame().GetLanguageLocale().TryGetValue("room_item_placed"));
                    _room.GetGameMap().RemoveFromMap(Item);
                    return true;
                }


                if (Item.IsFloorItem && !_floorItems.ContainsKey(Item.Id))
                    _floorItems.TryAdd(Item.Id, Item);
                else if (Item.IsWallItem && !_wallItems.ContainsKey(Item.Id))
                    _wallItems.TryAdd(Item.Id, Item);


                if (sendMessage)
                    _room.SendMessage(new ObjectAddComposer(Item, _room));
            }
            else
            {
                UpdateItem(Item);
                if (!OnRoller && sendMessage)
                    _room.SendMessage(new ObjectUpdateComposer(Item, _room.OwnerId));
            }
            _room.GetGameMap().AddToMap(Item);


            if (Item.GetBaseItem().IsSeat)
                updateRoomUserStatuses = true;


            if (updateRoomUserStatuses)
                _room.GetRoomUserManager().UpdateUserStatusses();


            if (Item.GetBaseItem().InteractionType == InteractionType.TENT || Item.GetBaseItem().InteractionType == InteractionType.TENT_SMALL)
            {
                _room.RemoveTent(Item.Id, Item);
                _room.AddTent(Item.Id);
            }


            using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.RunQuery("UPDATE `items` SET `room_id` = '" + _room.RoomId + "', `x` = '" + Item.GetX + "', `y` = '" + Item.GetY + "', `z` = '" + Item.GetZ + "', `rot` = '" + Item.Rotation + "' WHERE `id` = '" + Item.Id + "' LIMIT 1");
            }
            return true;
        }
credits go to keiz.
 

Rain

c
Mar 13, 2015
563
251
So I found another exploit today, that was brought to my attention by some Swedish hotel owners. Which allowed scripters to remove furniture from the room and replace it with gnomes.. What?
Yeah.. I know. But here's how to fix it :)

In CheckGnomeNameEvent.cs look for this:
Code:
if (Item == null || Item.Data == null)

And replace it with this:
Code:
if (Item == null || Item.Data == null || Item.UserID != Session.GetHabbo().Id || Item.Data.InteractionType != InteractionType.GNOME_BOX)

What happens here is when the user creates a Gnome pet, it removes the box from the room it came in, but there is no check to see if the box belongs to the user executing the event. So this means if the scripter is able to find out the itemId of a furniture they can replace it with a gnome, even if they don't have permission too.

Here's a little screenshot of it in action:
13254174_582686448565815_2494028787572578499_n.jpg

Hopefully the explanation made sense and you was all able to patch it okay :)
thanks! just applied it.

Hello for those we don't have the ,magic stack tool
fix that was released on the rival forums,

go to Plus\HabboHotel\Rooms\RoomItemHandling.cs find
Code:
public bool SetFloorItem(GameClient Session, Item Item, int newX, int newY, int newRot, bool newItem, bool OnRoller, bool sendMessage, bool updateRoomUserStatuses = false)

Change the entire void to
Code:
        public bool SetFloorItem(GameClient Session, Item Item, int newX, int newY, int newRot, bool newItem, bool OnRoller, bool sendMessage, bool updateRoomUserStatuses = false)
        {
            // Questions -> Skype: keiz.er
            bool NeedsReAdd = false;


            if (newItem)
                if (Item.IsWired)
                    if (Item.GetBaseItem().WiredType == WiredBoxType.EffectRegenerateMaps && _room.GetRoomItemHandler().GetFloor.Where(x => x.GetBaseItem().WiredType == WiredBoxType.EffectRegenerateMaps).Count() > 0)
                        return false;


            List<Item> ItemsOnTile = GetFurniObjects(newX, newY);
            if (Item.GetBaseItem().InteractionType == InteractionType.ROLLER && ItemsOnTile.Where(x => x.GetBaseItem().InteractionType == InteractionType.ROLLER && x.Id != Item.Id).Count() > 0)
                return false;


            if (!newItem)
                NeedsReAdd = _room.GetGameMap().RemoveFromMap(Item);


            Dictionary<int, ThreeDCoord> AffectedTiles = Gamemap.GetAffectedTiles(Item.GetBaseItem().Length, Item.GetBaseItem().Width, newX, newY, newRot);


            if (!_room.GetGameMap().ValidTile(newX, newY) || _room.GetGameMap().SquareHasUsers(newX, newY) && !Item.GetBaseItem().IsSeat)
            {
                if (NeedsReAdd)
                    _room.GetGameMap().AddToMap(Item);
                return false;
            }


            foreach (ThreeDCoord Tile in AffectedTiles.Values)
            {
                if (!_room.GetGameMap().ValidTile(Tile.X, Tile.Y) ||
                    (_room.GetGameMap().SquareHasUsers(Tile.X, Tile.Y) && !Item.GetBaseItem().IsSeat))
                {
                    if (NeedsReAdd)
                    {
                        _room.GetGameMap().AddToMap(Item);
                    }
                    return false;
                }
            }
       
            Double newZ = _room.GetGameMap().Model.SqFloorHeight[newX, newY];


            if (!OnRoller)
            {
                if (_room.GetGameMap().Model.SqState[newX, newY] != SquareState.OPEN && !Item.GetBaseItem().IsSeat)
                {
                    return false;
                }


                foreach (ThreeDCoord Tile in AffectedTiles.Values)
                {
                    if (_room.GetGameMap().Model.SqState[Tile.X, Tile.Y] != SquareState.OPEN &&
                        !Item.GetBaseItem().IsSeat)
                    {
                        if (NeedsReAdd)
                        {
                            //AddItem(Item);
                            _room.GetGameMap().AddToMap(Item);
                        }
                        return false;
                    }
                }
           
                if (!Item.GetBaseItem().IsSeat && !Item.IsRoller)
                {
                    foreach (ThreeDCoord Tile in AffectedTiles.Values)
                    {
                        if (_room.GetGameMap().GetRoomUsers(new Point(Tile.X, Tile.Y)).Count > 0)
                        {
                            if (NeedsReAdd)
                                _room.GetGameMap().AddToMap(Item);
                            return false;
                        }
                    }
                }
            }


            // Find affected objects
            var ItemsAffected = new List<Item>();
            var ItemsComplete = new List<Item>();


            foreach (ThreeDCoord Tile in AffectedTiles.Values.ToList())
            {
                List<Item> Temp = GetFurniObjects(Tile.X, Tile.Y);


                if (Temp != null)
                {
                    ItemsAffected.AddRange(Temp);
                }
            }




            ItemsComplete.AddRange(ItemsOnTile);
            ItemsComplete.AddRange(ItemsAffected);


            if (!OnRoller)
            {
                foreach (Item I in ItemsComplete.ToList())
                {
                    if (I == null)
                        continue;


                    if (I.Id == Item.Id)
                        continue;


                    if (I.GetBaseItem() == null)
                        continue;


                }
            }
       
            {
                if (Item.Rotation != newRot && Item.GetX == newX && Item.GetY == newY)
                    newZ = Item.GetZ;
           
                foreach (Item I in ItemsComplete.ToList())
                {
                    if (I == null)
                        continue;
                    if (I.Id == Item.Id)
                        continue;


                    if (I.GetBaseItem().InteractionType == InteractionType.STACKTOOL)
                    { // Basically the core of the fix
                        // Questions -> Skype: keiz.er
                        newZ = I.GetZ;
                        break;
                    }


                    if (I.TotalHeight > newZ)
                    {
                        newZ = I.TotalHeight;
                    }


                }
            }
       
            if (newRot != 0 && newRot != 2 && newRot != 4 && newRot != 6 && newRot != 8 && !Item.GetBaseItem().ExtraRot)
                newRot = 0;


            Item.Rotation = newRot;
            int oldX = Item.GetX;
            int oldY = Item.GetY;
            Item.SetState(newX, newY, newZ, AffectedTiles);


            if (!OnRoller && Session != null)
                Item.Interactor.OnPlace(Session, Item);




            if (newItem)
            {
                if (_floorItems.ContainsKey(Item.Id))
                {
                    if (Session != null)
                        Session.SendNotification(PlusEnvironment.GetGame().GetLanguageLocale().TryGetValue("room_item_placed"));
                    _room.GetGameMap().RemoveFromMap(Item);
                    return true;
                }


                if (Item.IsFloorItem && !_floorItems.ContainsKey(Item.Id))
                    _floorItems.TryAdd(Item.Id, Item);
                else if (Item.IsWallItem && !_wallItems.ContainsKey(Item.Id))
                    _wallItems.TryAdd(Item.Id, Item);


                if (sendMessage)
                    _room.SendMessage(new ObjectAddComposer(Item, _room));
            }
            else
            {
                UpdateItem(Item);
                if (!OnRoller && sendMessage)
                    _room.SendMessage(new ObjectUpdateComposer(Item, _room.OwnerId));
            }
            _room.GetGameMap().AddToMap(Item);


            if (Item.GetBaseItem().IsSeat)
                updateRoomUserStatuses = true;


            if (updateRoomUserStatuses)
                _room.GetRoomUserManager().UpdateUserStatusses();


            if (Item.GetBaseItem().InteractionType == InteractionType.TENT || Item.GetBaseItem().InteractionType == InteractionType.TENT_SMALL)
            {
                _room.RemoveTent(Item.Id, Item);
                _room.AddTent(Item.Id);
            }


            using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.RunQuery("UPDATE `items` SET `room_id` = '" + _room.RoomId + "', `x` = '" + Item.GetX + "', `y` = '" + Item.GetY + "', `z` = '" + Item.GetZ + "', `rot` = '" + Item.Rotation + "' WHERE `id` = '" + Item.Id + "' LIMIT 1");
            }
            return true;
        }
credits go to keiz.
ooo nice
 

Muff

Member
Aug 5, 2015
252
129
hello here's another fix,which makes it possible to send queries, drop tables and what not,this spotted by user
" " so credits to him on the rival forums for this fix.

1). HabboHotel\Items\Wired\Boxes\Effects\BotChangesClothesBox.cs
find
Code:
using (QueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.RunQuery("UPDATE `bots` SET `look` = '" + User.BotData.Look + "', `gender` = '" + User.BotData.Gender + "' WHERE `id` = '" + User.BotData.Id + "' LIMIT 1");
}
Replace:
Code:
using (QueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("UPDATE `bots` SET `look` = @look, `gender` = '" + User.BotData.Gender + "' WHERE `id` = '" + User.BotData.Id + "' LIMIT 1");
dbClient.AddParameter("look", User.BotData.Look);
dbClient.RunQuery();
}
And be sure to also find :

2). Communication\Packets\Incoming\Rooms\AI\Bots\SaveBotActionEvent.cs

Find:
Code:
using (QueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.RunQuery("UPDATE `bots` SET `look` = '" + Session.GetHabbo().Look + "', `gender` = '" + Session.GetHabbo().Gender + "' WHERE `id` = '" + Bot.BotData.Id + "' LIMIT 1");
}
Replace:
Code:
using (QueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("UPDATE `bots` SET `look` = @look, `gender` = '" + Session.GetHabbo().Gender + "' WHERE `id` = '" + Bot.BotData.Id + "' LIMIT 1");
dbClient.AddParameter("look", Session.GetHabbo().Look);
dbClient.RunQuery();
}

 
Status
Not open for further replies.

Users who are viewing this thread

Top