
Originally Posted by
Transferred
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