public InputProcessor(NetworkStream stream, Connection connection, PacketHandlerStorage handlers) { this._connection = connection; this._stream = stream; this.Handlers = handlers; Reader = new BinaryReader(this._stream); this._started = false; }
public Client(string ip, int port, PacketHandlerStorage handlers, IAuthen auth,AfterConnected conn, List<Connection.prefabid> RemotesPrototypes) { this._tcpClient = new TcpClient(ip, port); this._connection = new Connection(this._tcpClient, handlers, auth, conn); this._connection.Context = this; this._connection.RunClient(RemotesPrototypes); }
/// <summary> /// Initializes a new instance of the <see cref="gamelib.Common.Connection"/> class. /// </summary> /// <param name='client'> /// Client. /// </param> /// <param name='handlers'> /// Handlers. /// </param> public Connection(TcpClient client, PacketHandlerStorage handlers, IAuthen auth, AfterConnected connected) { this._aftercon = connected; this._auth = auth; this._client = client; this.Stream = this._client.GetStream(); //проверка кто сервер а кто клиент if(handlers != null) { this._outputProccessor = new OutputProccessor(this.Stream); this._inputProccessor = new InputProcessor(this.Stream, this, handlers); } this._reader = new BinaryReader(this.Stream); this._writer = new BinaryWriter(this.Stream); }