public static CharacterListRequestPacket Read(PacketHeader header, BinaryReader br) { CharacterListRequestPacket clrp = new CharacterListRequestPacket(); clrp.AuthKey = Utils.ReadByteString(br, (int)(br.BaseStream.Length - br.BaseStream.Position)); return(clrp); }
void CharacterList_Fetch_Handler(Task t) { CharacterListRequestPacket clrp = (CharacterListRequestPacket)t.Args; int expectedAccount = _server.GetExpectedConnection(clrp.AuthKey); if (expectedAccount <= 0) { // Unexpected, kill the connection t.Client.SendPacket(new ErrorMessagePacket("Unauthorized access attempt. The police have been notified!")); t.Client.Disconnect(); } else { t.Client.AccountID = expectedAccount; string sql = string.Format("SELECT * FROM characters WHERE account_id={0};", expectedAccount); t.Type = Task.TaskType.CharacterList_Process; AddDBQuery(sql, t); // Send login response t.Client.SendPacket(new LoginResponsePacket(clrp.AuthKey)); } }
private void Client_OnCharacterListRequest(object sender, CharacterListRequestPacket e) { TaskProcessor.AddTask(new Task(Task.TaskType.CharacterList_Fetch, (Connection)sender, e)); }
public static CharacterListRequestPacket Read(PacketHeader header, BinaryReader br) { CharacterListRequestPacket clrp = new CharacterListRequestPacket(); clrp.AuthKey = Utils.ReadByteString(br, (int)(br.BaseStream.Length - br.BaseStream.Position)); return clrp; }
void CharacterListRequest_Handler(PacketHeader header, BinaryReader br) { OnCharacterListRequest(this, CharacterListRequestPacket.Read(header, br)); }