Inheritance: IServerUserHandler
コード例 #1
0
		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);
		}
コード例 #2
0
ファイル: GablarskiServer.cs プロジェクト: ermau/Gablarski
        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);
        }
コード例 #3
0
ファイル: GablarskiServer.cs プロジェクト: ermau/Gablarski
        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);
        }
コード例 #4
0
		public void Teardown()
		{
			handler = null;
			server = null;
			observer = null;
			context = null;
		}