示例#1
0
        private void InitializeNetwork()
        {
            _logger = new TextLogger(rtbLog);
            AppLogger.Initialize(_logger);
            NetLogger.Initialize(_logger);
            NetProtocol.Initialize(new Protocol_12());

            _netClient = new TeamPainterNetClient();

            _netClient.ConnectEvent    += OnClientConnectHandler;
            _netClient.DisconnectEvent += OnClientDisconnectHandler;
            _traffic = new TrafficCounter(100, 0);

            InitializeCommands();
        }
示例#2
0
        private void InitializeNetwork()
        {
            _logger = new TextLogger(rtbLog);
            AppLogger.Initialize(_logger);
            NetLogger.Initialize(_logger);
            NetProtocol.Initialize(new Protocol_12());

            tbIP.Text   = _config.TCPListenAddress.Address.ToString();
            tbPort.Text = _config.TCPListenAddress.Port.ToString();

            _autorizator = new TPHostAutorizator(_config.MaxClients);
            _worker      = new TPWorkHost(_config.MaxClients);

            _autorizator.Listener.StartEvent += OnStartListener;
            _autorizator.Listener.StopEvent  += OnStopListener;

            _autorizator.DisconnectEvent    += OnDisconnectEventHandler;
            _autorizator.NewConnectionEvent += OnNewTCPConnectionEventHandler;
            _worker.DisconnectEvent         += OnDisconnectEventHandler;
        }