public void Setup() { permissions = new MockPermissionsProvider(); users = new MockUserProvider(); provider = new MockConnectionProvider (GablarskiProtocol.Instance); context = new MockServerContext (provider) { Settings = new ServerSettings(), UserProvider = users, PermissionsProvider = permissions, ChannelsProvider = new LobbyChannelProvider(), }; context.Sources = new ServerSourceHandler (context, new ServerSourceManager (context)); context.Channels = new ServerChannelHandler (context); context.UserManager = new ServerUserManager(); context.Users = handler = new ServerUserHandler (context, context.UserManager); context.Start(); var cs = provider.GetConnections (GablarskiProtocol.Instance); server = new ServerConnectionBuffer (cs.Item2); client = new ConnectionBuffer (cs.Item1); var observers = provider.GetConnections (GablarskiProtocol.Instance); sobserver = observers.Item2; observer = new ConnectionBuffer (observers.Item1); }
private void SetupHandlers() { this.userManager = new ServerUserManager(); var userHandler = new ServerUserHandler(this, this.userManager); this.users = userHandler; var sourceHandler = new ServerSourceHandler(this, new ServerSourceManager(this)); this.sources = sourceHandler; var channelHandler = new ServerChannelHandler(this); this.channels = channelHandler; RegisterConnectionlessMessageHandler(GablarskiProtocol.Instance, (ushort)GablarskiMessageType.QueryServer, ClientQueryServer); }
private void SetupHandlers() { this.userManager = new ServerUserManager(); var userHandler = new ServerUserHandler (this, this.userManager); this.users = userHandler; var sourceHandler = new ServerSourceHandler (this, new ServerSourceManager (this)); this.sources = sourceHandler; var channelHandler = new ServerChannelHandler (this); this.channels = channelHandler; RegisterConnectionlessMessageHandler (GablarskiProtocol.Instance, (ushort)GablarskiMessageType.QueryServer, ClientQueryServer); }
public void Teardown() { handler = null; server = null; observer = null; context = null; }