private static void Handle_AccountInfoReceived(LoginConnection net, PacketReader reader) { //Set Account Info Account account = new Account(); account.AccountId = reader.ReadInt32(); account.AccessLevel = reader.ReadByte(); account.Membership = reader.ReadByte(); account.Name = reader.ReadDynamicString(); //account.Password = reader.ReadDynamicString(); account.Session = reader.ReadInt32(); account.LastEnteredTime = reader.ReadInt64(); account.LastIp = reader.ReadDynamicString(); Console.WriteLine(account.Session); if (ClientConnection.CurrentAccounts.ContainsKey(account.Session)) { //Already Account acc = ClientConnection.CurrentAccounts[account.Session]; if (acc.Connection != null) { acc.Connection.Dispose(); //Disconenct Logger.Trace("Account " + acc.Name + " Was Forcibly Disconnected"); } else { ClientConnection.CurrentAccounts.Remove(account.Session); } } else { Logger.Trace("Account {0}: Authorized", account.Name); ClientConnection.CurrentAccounts.Add(account.Session, account); } }
private static void Handle_UpdateCharacters(GameConnection net, PacketReader reader) { int accountId = reader.ReadInt32(); int characters = reader.ReadInt32(); Account currentAc = AccountHolder.AccountList.FirstOrDefault(n => n.AccountId == accountId); currentAc.Characters = characters; }