예제 #1
0
        public void TestServerReactor()
        {
            var server  = new LocalServerInterface();
            var reactor = new ServerReactor(server);

            bool messageHandlerCalled = false;

            reactor.AddHandler(1, (Connection connection, BitReader bs) => {
                messageHandlerCalled = true;
            });

            var message = new BitWriter();

            message.WriteByte((byte)1);
            server.EnqueueMessage(Connection.Invalid, message);

            server.Update();

            Assert.IsTrue(messageHandlerCalled);
        }
예제 #2
0
 public void SetServer(LocalServerInterface server)
 {
     this.server = server;
     this.server.AddClient(this);
 }
예제 #3
0
 public LocalClientInterface(LocalServerInterface server)
 {
     this.server = server;
     this.server.AddClient(this);
 }