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 (); }
public static void Shutdown() { if (server == null) return; server.Stop(); server = null; channels = null; authorization = null; permissions = null; settings = null; }
public void ServerTestCleanup() { this.server.Stop(); this.server = null; this.provider = null; this.users = null; this.channels = null; this.permissions = null; this.settings = null; }
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(); } }