"Server Full" Msg

Posts 16–27 of 27 · Page 2 of 2
Quote Originally Posted by Masternx View Post
I'm not 100% sure, but I'm quite positive if Max Client is well, maxed. The client can't actually connect, so I don't think it bypasses. :/
Well if players could connect if the server was full then this is almost useless but just telling players that its full...BUT I can add a smaller cap to it so it will hold spaces for the admins
Quote Originally Posted by DimitriSavage View Post
Well if players could connect if the server was full then this is almost useless but just telling players that its full...BUT I can add a smaller cap to it so it will hold spaces for the admins
What if, might be a stupid idea, but maybe just make the Max Player cap infinite overall, but if rank = 0 or below w/e you want it to be, it equals something. I think that be a bit easier then other way round. I don't know tho. :3
Here this will reserve slots for admins
Code:
                int reserved = Manager.MaxClients - 3;
                if (Manager.Clients.Count >= reserved)
                {
                    if (client.Account.Rank < 3)
                    {
                        client.SendPacket(new FailurePacket
                        {
                            ErrorId = 0,
                            ErrorDescription = "Server Full"
                        });
                        client.Disconnect();
                        return;
                    }
                }
@Luis use this if the other doesn't work out as planned

this will kick players that try to enter if its full - 3 slots so there will always be 3 available slots

so if the max is 100 players then it will save 3 slots for the admins

if there is 97 players online and 1 player tries to connect then they will be autokicked

if there is 97 players online and an admin tries to connect then they will be accepted
Quote Originally Posted by Masternx View Post
I'm not 100% sure, but I'm quite positive if Max Client is well, maxed. The client can't actually connect, so I don't think it bypasses. :/
yep, to let certain rank bypass it you would have to edit the lines in realmmanager.cs where it says return if clients >= maxclients
Quote Originally Posted by Riigged View Post
yep, to let certain rank bypass it you would have to edit the lines in realmmanager.cs where it says return if clients >= maxclients
I got pizza so I am ready to start compiling anything lol
Quote Originally Posted by DimitriSavage View Post
I got pizza so I am ready to start compiling anything lol
btw if you want to easily test the codes you try to make it bypass if certain rank, just set maxclients to 0 and then connect as rank 0 and then try again as rank # for example
Quote Originally Posted by Riigged View Post
btw if you want to easily test the codes you try to make it bypass if certain rank, just set maxclients to 0 and then connect as rank 0 and then try again as rank 3 for example
Personally I don't own a server XD i just make code and guess off of the years of coding(not just rotmg) experience I have lol the only time I have tested coding was with Bear so I could get used to things so hopefully luis or someone tests it

also set maxclients to 3 and test if you can enter with a ranked account
Quote Originally Posted by Luis View Post
Any way to add an exception if the rank is higher?
Well you can't do a exception in this case. You know it only sends this message whenever the limit of players in-game is reached. But you could do so. Limit for ranks below 1 is 40 for an example and then total space is 50 players. The 10 remaining player slots will be for admins, otherwise it says Server full! -Just a idea
Quote Originally Posted by lkdjnfoskjednfblksjdfn View Post
Well you can't do a exception in this case. You know it only sends this message whenever the limit of players in-game is reached. But you could do so. Limit for ranks below 1 is 40 for an example and then total space is 50 players. The 10 remaining player slots will be for admins, otherwise it says Server full! -Just a idea
MAX_CLIENT = 20 thing, wouldn't it work by just simply doing this, if client account rank = X max_client = 333333333333333333333 else MAX_CLIENT = 20
Quote Originally Posted by Masternx View Post
I'm not 100% sure, but I'm quite positive if Max Client is well, maxed. The client can't actually connect, so I don't think it bypasses. :/
you are right, this won't work lol
Quote Originally Posted by Transferred View Post


you are right, this won't work lol
I posted a reserved slot instead so now it reserves slots for the admin

Here this will reserve slots for admins
Code:
                int reserved = Manager.MaxClients - 3;
                if (Manager.Clients.Count >= reserved)
                {
                    if (client.Account.Rank < 3)
                    {
                        client.SendPacket(new FailurePacket
                        {
                            ErrorId = 0,
                            ErrorDescription = "Server Full"
                        });
                        client.Disconnect();
                        return;
                    }
                }
@Luis use this if the other doesn't work out as planned

this will kick players that try to enter if its full - 3 slots so there will always be 3 available slots

so if the max is 100 players then it will save 3 slots for the admins

if there is 97 players online and 1 player tries to connect then they will be autokicked

if there is 97 players online and an admin tries to connect then they will be accepted
[QUOTE=DimitriSavage;11618238]
Code:
                int reserved = Manager.MaxClients - 111111;
                if (Manager.Clients.Count >= reserved)
                {
                    if (client.Account.Rank < 2)
                    {
                        client.SendPacket(new FailurePacket
                        {
                            ErrorId = 1,
                            ErrorDescription = "Server Full, please try again later"
                        });
                        client.Disconnect();
                        return;
                    }
                }
just messing around

- - - Updated - - -

with the code @DimitriSavage posted
Posts 16–27 of 27 · Page 2 of 2

Post a Reply

Similar Threads

Talk with us