Example #1
0
        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);
        }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="gamelib.Server.Server"/> class.
 /// </summary>
 /// <param name='port'>
 /// Port.
 /// </param>
 /// <param name='contextFactory'>
 /// Context factory.
 /// </param>
 /// <param name='Handlers'>
 /// Handlers.
 /// </param>
 /// <param name='auth'>
 /// Auth.
 /// </param>
 public Server(int port, ClientContextFactory contextFactory, IAuthen _auth, AfterConnected afterconn)
 {
     this._aftercon = afterconn;
     this._auth = _auth;
     this.Port = port;
     this.Started = false;
     this._contextFactory = contextFactory;
     this._connectios = new List<Connection>();
 }
Example #3
0
        /// <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);
        }
Example #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="authen"></param>
 public AuthenController(IAuthen authen, ILogger <AuthenController> logger)
 {
     _authen = authen;
     _logger = logger;
 }
Example #5
0
 public UsersController(IUsers serv, IAuthen serv1, IWorks serv2)
 {
     autServ  = serv1;
     userServ = serv;
     workServ = serv2;
 }