public GameClient(TcpClient selfClient, Guid onlineId, IClientKiller killer, ChatManager manager, GameLoop game) { _self = selfClient; _self.NoDelay = true; _self.Client.NoDelay = true; _reader = new BinaryReader(_self.GetStream()); _writer = new BinaryWriter(_self.GetStream()); _clientKiller = killer; _game = game; ChatManager chatManager = manager; chatManager.Join(this); _auth = AuthorisationManager.Resolve(); _packetReader = PacketReader.Resolve<ServerPacketReader>(); _packetReader.InitialiseMapping(); OnlineId = onlineId; _active = true; _subs = new List<PacketSubscriber> { this, _game, chatManager }; Task.Factory.StartNew(Receive); }
private Connection(string server, int port) { _port = port; _server = server; _packetReader = PacketReader.Resolve<ClientPacketReader>(); _packetReader.InitialiseMapping(); _subs = new List<PacketSubscriber>(); AddSubscriber(this); }