mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-20 13:30:27 -07:00
Fixed a critical bug with the Management Server (no more lockouts weeee)
This commit is contained in:
parent
cc3b7546d4
commit
127ebc242e
6 changed files with 68 additions and 6 deletions
|
|
@ -7,6 +7,7 @@ import ms.net.IoSession;
|
|||
import ms.net.packet.IoBuffer;
|
||||
import ms.world.info.CountryFlag;
|
||||
import ms.world.info.WorldInfo;
|
||||
import ms09.MSLogger;
|
||||
|
||||
/**
|
||||
* Holds all the world servers.
|
||||
|
|
@ -148,9 +149,25 @@ public class WorldDatabase {
|
|||
throw new IllegalStateException("World " + info.getWorldId() + " is already registered!");
|
||||
}
|
||||
flagUpdate();
|
||||
System.out.println("Registered world - [id=" + info.getWorldId() + ", ip=" + info.getAddress() + ", country=" + info.getCountry().name().toLowerCase() + ", revision=" + info.getRevision() + "]!");
|
||||
MSLogger.logInfo("Registered world - [id=" + info.getWorldId() + ", ip=" + info.getAddress() + ", country=" + info.getCountry().name().toLowerCase() + ", revision=" + info.getRevision() + "]!");
|
||||
return DATABASE[info.getWorldId()] = new GameServer(info);
|
||||
}
|
||||
|
||||
public static void unRegister(GameServer server){
|
||||
int index = -1;
|
||||
for(int i = 0; i < DATABASE.length; i++){
|
||||
GameServer s = DATABASE[i];
|
||||
if(s == server){
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(index != -1){
|
||||
DATABASE[index] = null;
|
||||
WorldInfo info = server.getInfo();
|
||||
MSLogger.logInfo("Unregistered world - [id=" + info.getWorldId() + ", ip=" + info.getAddress() + ", country=" + info.getCountry().name().toLowerCase() + ", revision=" + info.getRevision() + "]!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the world id of the player.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue