Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[FIX]User limit in room [BcStorm]

Status
Not open for further replies.
Experienced Elementalist
Joined
Oct 5, 2010
Messages
260
Reaction score
109
Hello RaGEZONE,

Today brought to you a fix that limits users to the room!

Open --> HabboHotel/Rooms/Room.cs

Find:
Code:
internal void SetMaxUsers(int MaxUsers)

You should find this:
Code:
internal void SetMaxUsers(int MaxUsers)
        {
            this.UsersMax = MaxUsers;
            using (IQueryAdapter adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
            {
                adapter.runFastQuery(string.Concat(new object[] { "UPDATE rooms SET users_max = ", MaxUsers, " WHERE id = ", this.RoomId }));
            }
        }

Replace with:
Code:
public void SetMaxUsers(int MaxUsers)
        {
            this.UsersMax = 5000;
            using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
                dbClient.runFastQuery("UPDATE rooms SET users_max = " + MaxUsers + " WHERE id = " + RoomId);
        }

Credits:
Wabbo.ban - CSHP Fórum (Brazillian Forum)
I - bring forth
 
Last edited:
Run, but I'll find you.
Joined
Jan 29, 2011
Messages
777
Reaction score
327
Is this for the setting in Room Settings? Or a fix if a user enters a room that is already full?

Either way, nice release ;D
 
Banned
Banned
Joined
May 6, 2009
Messages
531
Reaction score
165
But, tell me the reason for put this number in my code instead the user choose... ?
 
Initiate Mage
Joined
Nov 26, 2012
Messages
36
Reaction score
9
Yaaay! we love lagg!
Code:
public void SetMaxUsers(int MaxUsers)
        {
            this.UsersMax = 5000;
            using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
                dbClient.runFastQuery("UPDATE rooms SET users_max = " + MaxUsers + " WHERE id = " + RoomId);
        }

Whut no lagg? :(
Code:
        public void SetMaxUsers(int MaxUsers)
        {
            this.UsersMax = MaxUsers;
            using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.runFastQuery("UPDATE rooms SET users_max = " + MaxUsers + " WHERE id = " + this.RoomId);
            }
        }
 
Banned
Banned
Joined
May 6, 2009
Messages
531
Reaction score
165
He told me, it's a fix for the invisible bug... kkkkk
Don't kind with me man ¬¬
 
Initiate Mage
Joined
Aug 20, 2012
Messages
25
Reaction score
4
Pure shenanigans, I just read the script please tell me if I am wrong but if I added this the maximum would be 5000 in a room, so if I chosen 25 in a room. I then called all my users, say I got 120 online like I did when I first owned Wired, they would all be able to get in? Also this is incorrect code. You need an outgoing packet ;3 to show the alert that room is full.
 
Status
Not open for further replies.
Back
Top