Start() public method

public Start ( MessageTypes types ) : void
types MessageTypes
return void
Beispiel #1
0
        public void Setup()
        {
            provider = new MockConnectionProvider(protocol);
            provider.Start(MessageTypes.Reliable);

            connection = new MockClientConnection(provider);
            client     = new TempestClient(connection, MessageTypes.All);
        }
        public void RemoveNotAddedConnectionProvider()
        {
            var p = new MockConnectionProvider(protocol);

            p.Start(MessageTypes.Reliable);
            Assert.IsTrue(p.IsRunning);

            var server = new TempestServer(provider, MessageTypes.Reliable);

            server.RemoveConnectionProvider(p);
            Assert.IsTrue(p.IsRunning);
        }
        public void ServerConnectionConnected()
        {
            var provider = new MockConnectionProvider (MockProtocol.Instance);
            provider.Start (MessageTypes.Reliable);

            var test = new AsyncTest<ConnectionMadeEventArgs> (e => Assert.AreEqual (true, e.Connection.IsConnected));
            provider.ConnectionMade += test.PassHandler;

            var client = provider.GetClientConnection (MockProtocol.Instance);
            client.ConnectAsync (new Target (Target.AnyIP, 0), MessageTypes.Reliable);

            test.Assert (5000);
        }
Beispiel #4
0
        public void ServerConnectionConnected()
        {
            var provider = new MockConnectionProvider(MockProtocol.Instance);

            provider.Start(MessageTypes.Reliable);

            var test = new AsyncTest <ConnectionMadeEventArgs> (e => Assert.AreEqual(true, e.Connection.IsConnected));

            provider.ConnectionMade += test.PassHandler;

            var client = provider.GetClientConnection(MockProtocol.Instance);

            client.ConnectAsync(new Target(Target.AnyIP, 0), MessageTypes.Reliable);

            test.Assert(5000);
        }
Beispiel #5
0
		public void Setup()
		{
			var provider = new MockConnectionProvider (SocialProtocol.Instance);
			provider.ConnectionMade += (sender, args) => server = new ConnectionBuffer (args.Connection);
			provider.Start (MessageTypes.Reliable);

			var c = new MockClientConnection (provider);
			client = new ConnectionBuffer (c);

			clientContext = new SerializationContext (c, new Dictionary<byte, Protocol> { { 2, SocialProtocol.Instance } });

			var context = new TempestClient (c, MessageTypes.Reliable);
			context.ConnectAsync (new Target (Target.LoopbackIP, 1)).Wait();

			list = new WatchList (context);
		}
Beispiel #6
0
        public void LoginResult()
        {
            LoginResultState state = LoginResultState.Success;
            var msg = new LoginResultMessage (new LoginResult (UserId, state));

            Assert.IsTrue (msg.Result.Succeeded);
            Assert.AreEqual (state, msg.Result.ResultState);
            Assert.AreEqual (UserId, msg.Result.UserId);

            var provider = new MockConnectionProvider (GablarskiProtocol.Instance);
            provider.Start (MessageTypes.All);

            var cs = provider.GetConnections (GablarskiProtocol.Instance);

            this.clientContext = new SerializationContext (cs.Item1, new Dictionary<byte, Protocol> { { 42, GablarskiProtocol.Instance } });
            this.serverContext = new SerializationContext (cs.Item2, new Dictionary<byte, Protocol> { { 42, GablarskiProtocol.Instance } });
        }
Beispiel #7
0
        public void Setup()
        {
            provider = new MockConnectionProvider (protocol);
            provider.Start (MessageTypes.Reliable);

            connection = new MockClientConnection (provider);
            client = new TempestClient (connection, MessageTypes.All);
        }
Beispiel #8
0
        public void RemoveNotAddedConnectionProvider()
        {
            var p = new MockConnectionProvider (protocol);
            p.Start (MessageTypes.Reliable);
            Assert.IsTrue (p.IsRunning);

            var server = new MockServer (provider, MessageTypes.Reliable);
            server.RemoveConnectionProvider (p);
            Assert.IsTrue (p.IsRunning);
        }
        public void Setup()
        {
            user = new UserInfo ("Nickname", "Phonetic", "Username", 1, 2, true);
            manager = new ServerUserManager();

            provider = new MockConnectionProvider (GablarskiProtocol.Instance);
            provider.Start (MessageTypes.All);

            var cs = provider.GetConnections (GablarskiProtocol.Instance);
            server = cs.Item2;
            client = cs.Item1;
        }