internal static void LoginGame(AionConnection client, byte serverId) { GameInfo value = null; if (gameservers.TryGetValue(serverId, out value)) { if (!value.IsOnline()) { client.SendPacket(new SM_PLAY_FAIL(AionAuthResponse.SERVER_DOWN)); return; } if (value.IsFull()) { client.SendPacket(new SM_PLAY_FAIL(AionAuthResponse.SERVER_FULL)); return; } client.JoinGS = true; client.SendPacket(new SM_PLAY_OK(client.SessionKey, serverId)); log.InfoFormat("登陆账号: {0} 进入 #{1}号游戏服务器!", (object)client.Account.Name, (object)serverId); } else { log.WarnFormat("来自: {0} 的用户尝试进入不存在的游戏服务器({1})!", (object)client.Account.Name, (object)serverId); } }
internal static void AuthReconnectingAccount(int accountId, int loginOk, int rekey, AionConnection client) { ReConnectionAccount value = null; if (reconnectingAccounts.TryGetValue(accountId, out value) && value.ReKey == rekey) { reconnectingAccounts.Remove(accountId); client.Account = value.Account; accountOnLS.Add(value.Account.Id, client); client.State = State.AUTHED_LOGIN; client.SessionKey = new SessionKey(client.Account); client.SendPacket(new SM_UPDATE_SESSION(client.SessionKey)); } else { client.Disconnect(); } }