Inheritance: Tempest.TempestServer, IGablarskiServerContext
Exemple #1
0
 public void ServerTestInitialize()
 {
     this.settings = new ServerSettings {Name = "Test Server", Description = "Test Server"};
     this.permissions = new GuestPermissionProvider ();
     this.channels = new LobbyChannelProvider();
     this.users = new GuestUserProvider();
     this.server = new GablarskiServer (this.settings, this.users, this.permissions, this.channels);
     this.server.AddConnectionProvider (this.provider = new MockConnectionProvider (GablarskiProtocol.Instance), ExecutionMode.GlobalOrder);
     this.server.Start ();
 }
Exemple #2
0
        public static void Shutdown()
        {
            if (server == null)
                return;

            server.Stop();
            server = null;
            channels = null;
            authorization = null;
            permissions = null;
            settings = null;
        }
Exemple #3
0
 public void ServerTestCleanup()
 {
     this.server.Stop();
     this.server = null;
     this.provider = null;
     this.users = null;
     this.channels = null;
     this.permissions = null;
     this.settings = null;
 }
Exemple #4
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();
            }
        }