|
@@ -33,13 +33,11 @@ import java.sql.ResultSet;
|
|
import java.sql.SQLException;
|
|
import java.sql.SQLException;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
-import java.util.Map;
|
|
|
|
import java.util.logging.Level;
|
|
import java.util.logging.Level;
|
|
import java.util.logging.LogRecord;
|
|
import java.util.logging.LogRecord;
|
|
import java.util.logging.Logger;
|
|
import java.util.logging.Logger;
|
|
|
|
|
|
import javolution.util.FastList;
|
|
import javolution.util.FastList;
|
|
-import javolution.util.FastMap;
|
|
|
|
|
|
|
|
import com.l2jserver.Config;
|
|
import com.l2jserver.Config;
|
|
import com.l2jserver.L2DatabaseFactory;
|
|
import com.l2jserver.L2DatabaseFactory;
|
|
@@ -70,6 +68,7 @@ import com.l2jserver.gameserver.network.loginserverpackets.RequestCharacters;
|
|
import com.l2jserver.gameserver.network.serverpackets.CharSelectionInfo;
|
|
import com.l2jserver.gameserver.network.serverpackets.CharSelectionInfo;
|
|
import com.l2jserver.gameserver.network.serverpackets.LoginFail;
|
|
import com.l2jserver.gameserver.network.serverpackets.LoginFail;
|
|
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
|
|
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
|
|
|
|
+import com.l2jserver.gameserver.util.L2TIntObjectHashMap;
|
|
import com.l2jserver.util.Util;
|
|
import com.l2jserver.util.Util;
|
|
import com.l2jserver.util.crypt.NewCrypt;
|
|
import com.l2jserver.util.crypt.NewCrypt;
|
|
import com.l2jserver.util.network.BaseSendablePacket;
|
|
import com.l2jserver.util.network.BaseSendablePacket;
|
|
@@ -109,7 +108,7 @@ public class LoginServerThread extends Thread
|
|
private final boolean _reserveHost;
|
|
private final boolean _reserveHost;
|
|
private int _maxPlayer;
|
|
private int _maxPlayer;
|
|
private final List<WaitingClient> _waitingClients;
|
|
private final List<WaitingClient> _waitingClients;
|
|
- private final Map<String, L2GameClient> _accountsInGameServer;
|
|
|
|
|
|
+ private final L2TIntObjectHashMap<L2GameClient> _accountsInGameServer;
|
|
private int _status;
|
|
private int _status;
|
|
private String _serverName;
|
|
private String _serverName;
|
|
private final String[] _subnets;
|
|
private final String[] _subnets;
|
|
@@ -136,7 +135,7 @@ public class LoginServerThread extends Thread
|
|
_subnets = Config.GAME_SERVER_SUBNETS;
|
|
_subnets = Config.GAME_SERVER_SUBNETS;
|
|
_hosts = Config.GAME_SERVER_HOSTS;
|
|
_hosts = Config.GAME_SERVER_HOSTS;
|
|
_waitingClients = new FastList<WaitingClient>();
|
|
_waitingClients = new FastList<WaitingClient>();
|
|
- _accountsInGameServer = new FastMap<String, L2GameClient>().shared();
|
|
|
|
|
|
+ _accountsInGameServer = new L2TIntObjectHashMap<L2GameClient>();
|
|
_maxPlayer = Config.MAXIMUM_ONLINE_USERS;
|
|
_maxPlayer = Config.MAXIMUM_ONLINE_USERS;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -337,7 +336,7 @@ public class LoginServerThread extends Thread
|
|
_log.warning("Session key is not correct. Closing connection for account " + wcToRemove.account + ".");
|
|
_log.warning("Session key is not correct. Closing connection for account " + wcToRemove.account + ".");
|
|
//wcToRemove.gameClient.getConnection().sendPacket(new LoginFail(LoginFail.SYSTEM_ERROR_LOGIN_LATER));
|
|
//wcToRemove.gameClient.getConnection().sendPacket(new LoginFail(LoginFail.SYSTEM_ERROR_LOGIN_LATER));
|
|
wcToRemove.gameClient.close(new LoginFail(LoginFail.SYSTEM_ERROR_LOGIN_LATER));
|
|
wcToRemove.gameClient.close(new LoginFail(LoginFail.SYSTEM_ERROR_LOGIN_LATER));
|
|
- _accountsInGameServer.remove(wcToRemove.account);
|
|
|
|
|
|
+ _accountsInGameServer.remove(wcToRemove.account.hashCode());
|
|
}
|
|
}
|
|
_waitingClients.remove(wcToRemove);
|
|
_waitingClients.remove(wcToRemove);
|
|
}
|
|
}
|
|
@@ -450,13 +449,13 @@ public class LoginServerThread extends Thread
|
|
}
|
|
}
|
|
finally
|
|
finally
|
|
{
|
|
{
|
|
- _accountsInGameServer.remove(account);
|
|
|
|
|
|
+ _accountsInGameServer.remove(account.hashCode());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
public void addGameServerLogin(String account, L2GameClient client)
|
|
public void addGameServerLogin(String account, L2GameClient client)
|
|
{
|
|
{
|
|
- _accountsInGameServer.put(account, client);
|
|
|
|
|
|
+ _accountsInGameServer.put(account.hashCode(), client);
|
|
}
|
|
}
|
|
|
|
|
|
public void sendAccessLevel(String account, int level)
|
|
public void sendAccessLevel(String account, int level)
|
|
@@ -522,7 +521,7 @@ public class LoginServerThread extends Thread
|
|
|
|
|
|
public void doKickPlayer(String account)
|
|
public void doKickPlayer(String account)
|
|
{
|
|
{
|
|
- L2GameClient client = _accountsInGameServer.get(account);
|
|
|
|
|
|
+ L2GameClient client = _accountsInGameServer.get(account.hashCode());
|
|
if (client != null)
|
|
if (client != null)
|
|
{
|
|
{
|
|
LogRecord record = new LogRecord(Level.WARNING, "Kicked by login");
|
|
LogRecord record = new LogRecord(Level.WARNING, "Kicked by login");
|