Inheritance: IServerChannelHandler
		public void Setup()
		{
			manager = new ServerUserManager();
			permissions = new MockPermissionsProvider();
			channels = new LobbyChannelProvider();

			MockServerContext mcontext;
			context = mcontext = new MockServerContext
			{
				ChannelsProvider = channels,
				PermissionsProvider = permissions,
				UserManager = new ServerUserManager (),
				Settings = new ServerSettings { Name = "Test Server" }
			};

			mcontext.Users = new ServerUserHandler (context, manager);
			mcontext.Channels = handler = new ServerChannelHandler (context);

			user = UserInfoTests.GetTestUser (1, 1, false);

			provider = new MockConnectionProvider (GablarskiProtocol.Instance);
			mcontext.AddConnectionProvider (provider);
			mcontext.Start();

			var connections = provider.GetConnections (GablarskiProtocol.Instance);
			client = new ConnectionBuffer (connections.Item1);
			server = connections.Item2;

			manager.Connect (server);
			manager.Join (server, user);
		}
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }