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); }
public void SetServer(LocalServerInterface server) { this.server = server; this.server.AddClient(this); }
public LocalClientInterface(LocalServerInterface server) { this.server = server; this.server.AddClient(this); }