Beispiel #1
0
    public ServerTest()
    {
        _server = new PlanetServer();

        _server.EventDispatcher.ConnectionEvent     += OnConnection;
        _server.EventDispatcher.ConnectionLostEvent += OnConnectionLost;
        _server.EventDispatcher.LoginEvent          += OnLogin;
        _server.EventDispatcher.ExtensionEvent      += OnResponse;

        _server.Connect("127.0.0.1", 8000);

        ServerThread worker = new ServerThread(_server);
        Thread       thread = new Thread(worker.Update);

        while (!thread.IsAlive)
        {
            worker.Update();

            Thread.Sleep(1);
        }
    }
    public ServerTest()
    {
        _server = new PlanetServer();

        _server.EventDispatcher.ConnectionEvent += OnConnection;
        _server.EventDispatcher.ConnectionLostEvent += OnConnectionLost;
        _server.EventDispatcher.LoginEvent += OnLogin;
        _server.EventDispatcher.ExtensionEvent += OnResponse;

        _server.Connect("127.0.0.1", 8000);

        ServerThread worker = new ServerThread(_server);
        Thread thread = new Thread(worker.Update);

        while (!thread.IsAlive)
        {
            worker.Update();
      
            Thread.Sleep(1);
        }
    }