"Server Full" Msg
Here this will reserve slots for admins
@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
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;
}
}
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
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
also set maxclients to 3 and test if you can enter with a ranked account
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 

I posted a reserved slot instead so now it reserves slots for the admin
Here this will reserve slots for admins
@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
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;
}
}
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]
just messing around
- - - Updated - - -
with the code @DimitriSavage posted
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;
}
}
- - - Updated - - -
with the code @DimitriSavage posted
Similar Threads
Selling Accounts/Keys/ItemsFull info, Msg 1 with permas for sale(Combat arms)
5 Minecraft Server AdvertisingTriple A's Server-[Full Economy]-[Bukkit]-[Hamachi]-[Whitelist]
6 CrossFire Europe HelpServer Full ProblemAZ 4 Minecraft Server AdvertisingTriple A's Server-[Full Economy]-[Bukkit]-[No-Hamachi]-[Whitelist]-[Forums]
12 GeneralWhen I quote people it quotes in my colour?
2
