Beispiel #1
0
        private static void DisposeServer()
        {
            _server.Dispose();
            _server = null;

            Logger.Info("Server has been disposed");
        }
Beispiel #2
0
        private static void ProcessInputLine(string input)
        {
            switch (input)
            {
            case "start":
            {
                if (_server == null)
                {
                    _server = new ServerHandler(new DummyClientFactory(), new VoiceServerConfiguration("localhost", 23332, "S1u8otSWS/L/V1luEkMnupTwgeA=", 130, "123"));
                }

                Logger.Info("Starting JustAnotherVoiceChat DummyServer...");

                try
                {
                    _server.Start();
                }
                catch (VoiceServerAlreadyStartedException)
                {
                    Logger.Info("Server is already started!");
                    return;
                }

                Logger.Info("JustAnotherVoiceChat DummyServer started!");
                break;
            }

            case "stop":
            {
                StopServer();
                break;
            }

            case "dispose":
            {
                DisposeServer();
                break;
            }

            case "stress":
            {
                Logger.Info("Serverstress started");

                _server.StartStresstest();
                break;
            }

            case "client":
            {
                var client = _server.PrepareClient();

                _lastClient = client;

                Logger.Info("Prepared new client-slot: " + client.Handle.Identifer);
                break;
            }

            case "exit":
            {
                ExitApplication();
                break;
            }
            }
        }