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; manager = null; context = null; server = null; permissions = null; }
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 Setup() { permissions = new MockPermissionsProvider(); LobbyChannelProvider channels = new LobbyChannelProvider(); channels.SaveChannel (new ChannelInfo { Name = "Channel 2" }); this.provider = new MockConnectionProvider (GablarskiProtocol.Instance); this.provider.Start (MessageTypes.All); userManager = new ServerUserManager(); MockServerContext c; context = c = new MockServerContext (provider) { Settings = new ServerSettings { Name = "Server", DefaultAudioBitrate = defaultBitrate, MaximumAudioBitrate = maxBitrate, MinimumAudioBitrate = minBitrate }, UserManager = userManager, PermissionsProvider = permissions, ChannelsProvider = channels }; c.Users = new ServerUserHandler (context, userManager); manager = new ServerSourceManager (context); handler = new ServerSourceHandler (context, manager); user = UserInfoTests.GetTestUser (1, 1, false); var cs = provider.GetConnections (GablarskiProtocol.Instance); client = new ConnectionBuffer (cs.Item1); server = cs.Item2; userManager.Connect (server); userManager.Join (server, user); }