Пример #1
0
        public static void Shutdown()
        {
            if (server == null)
                return;

            server.Stop();
            server = null;
            channels = null;
            authorization = null;
            permissions = null;
            settings = null;
        }
Пример #2
0
        private static void Start(object s)
        {
            var key = (RSAAsymmetricKey)s;

            lock (Sync) {
                if (IsRunning)
                    return;

                channels = new LobbyChannelProvider();
                authorization = new GuestUserProvider { FirstUserIsAdmin = true };
                permissions = new GuestPermissionProvider();
                settings = new ServerSettings();

                server = new GablarskiServer (settings, authorization, permissions, channels);
                server.AddConnectionProvider (new UdpConnectionProvider (GablarskiProtocol.Port, GablarskiProtocol.Instance, key), ExecutionMode.GlobalOrder);

                server.Start();
            }
        }