@Override
protected void runImpl()
{
_log.info("Trying to register gameserver: " + requestId + " [" + getGameServer().getConnection().getIpAddress() + "]");
int failReason = 0;
GameServer gs = getGameServer();
if (GameServerManager.getInstance().registerGameServer(requestId, gs))
{
gs.setPorts(ports);
gs.setExternalHost(externalIp);
gs.setInternalHost(internalIp);
gs.setMaxPlayers(maxOnline);
gs.setPvp(_pvp);
gs.setServerType(_serverType);
gs.setShowingBrackets(_brackets);
gs.setGmOnly(_gmOnly);
gs.setAgeLimit(_ageLimit);
gs.setProtocol(_protocolVersion);
gs.setAuthed(true);
gs.getConnection().startPingTask();
}
else if (acceptAlternateID)
{
if (GameServerManager.getInstance().registerGameServer(gs = getGameServer()))
{
gs.setPorts(ports);
gs.setExternalHost(externalIp);
gs.setInternalHost(internalIp);
gs.setMaxPlayers(maxOnline);
gs.setPvp(_pvp);
gs.setServerType(_serverType);
gs.setShowingBrackets(_brackets);
gs.setGmOnly(_gmOnly);
gs.setAgeLimit(_ageLimit);
gs.setProtocol(_protocolVersion);
gs.setAuthed(true);
gs.getConnection().startPingTask();
}
else
{
failReason = LoginServerFail.REASON_NO_FREE_ID;
}