public override async Task Initialize(TcpClient client) { await base.Initialize(client); this.addressToClientBuildMap = this.accountService.GetClientBuildFromAddress(this.Address, this.Port); if (this.addressToClientBuildMap is null) { this.logger.LogWarning($"Could not find client build for {this.Address}:{this.Port - 1}."); this.Build = ClientBuild.Vanilla; } else { this.Build = this.addressToClientBuildMap.ClientBuild; } this.logger.LogDebug($"{this.ClientInfo} - connected"); ServerPacketBase <Opcode> message = this.Build switch { ClientBuild.Vanilla or ClientBuild.TBC => SMSG_AUTH_CHALLENGE.VanillaTBC(), ClientBuild.WotLK => SMSG_AUTH_CHALLENGE.WotLK(), _ => throw new NotImplementedException($"SMSG_AUTH_CHALLENGE(build: {this.Build})"), }; await Send(message.Get()); this.logger.LogTrace($"{this.ClientInfo} - Sent {message.Opcode}"); await HandleConnection(); }
public void DeleteAddressToClientBuildMap(AddressToClientBuildMap map) => this.addressBuildMap.Delete(map.Id);