void c_ClientUnitConnectionInfo(object sender, ClientUnitConnectionInfoEventArgs e) { if (ClientUnitConnection != null) { ClientUnitConnection(sender, e); } Client c = (Client)sender; UnitLogin u = e.UnitLoginDetails; int accountId = u.AccountID; if (accountManager.ConnectVerification(accountId)) { byte[] bufferUniLoginState = PacketManager.SendUnitLoginState(LoginState.Success, u.CharacterID); c.Send(bufferUniLoginState); } else { Client[] otherPlayer = clients.Where(x => (x.AccountID == u.AccountID) && (x != c)).ToArray(); for (int i = 0; i < otherPlayer.Length; i++) { otherPlayer[i].Send(PacketManager.SendUnitLoginState(LoginState.OtherConnecting, 0)); otherPlayer[i].Dispose(); } byte[] bufferUniLoginState = PacketManager.SendUnitLoginState(LoginState.Success, u.CharacterID); c.Send(bufferUniLoginState); } }
private void HandleRecvUnitLogin(Packet parsed) { UnitLogin u = PacketManager.RecvUnitLogin(parsed); this.accountId = u.AccountID; if (ClientUnitConnectionInfo != null) { ClientUnitConnectionInfo(this, new ClientUnitConnectionInfoEventArgs(u, parsed)); } }
void c_ClientUnitConnectionInfo(object sender, ClientUnitConnectionInfoEventArgs e) { if (ClientUnitConnection != null) { ClientUnitConnection(sender, e); } Client c = (Client)sender; UnitLogin u = e.UnitLoginDetails; int accountId = u.AccountID; byte[] bufferUniLoginState = PacketManager.SendUnitLoginState(LoginState.Success, u.CharacterID); c.Send(bufferUniLoginState); Character[] charList = characterManager.GetAllCharactersByAccountId(accountId); byte[] bufferCharacterList = PacketManager.SendCharacterList(charList); c.Send(bufferCharacterList); }
public ClientUnitConnectionInfoEventArgs(UnitLogin unitLoginDetails, Packet p) { this.unitlogin = unitLoginDetails; }