Package org.menacheri.jetserver.app

Examples of org.menacheri.jetserver.app.PlayerSession.onEvent()


    gameRoom.disconnectSession(playerSession);
    JetlangEventDispatcher gameDispatcher = (JetlangEventDispatcher) gameRoomSession
        .getEventDispatcher();
    assertNoListeners(gameDispatcher);
    Event event = Events.event(null, Events.SESSION_MESSAGE);
    playerSession.onEvent(event);
    assertFalse(latch.await(500, TimeUnit.MILLISECONDS));

    // Connect to another game room
    sessionBuilder.gameRoomName("Zombie_ROOM_2");
View Full Code Here


        latch);
    GameRoom gameRoom2 = (GameRoom) gameRoomSession2;
    gameRoom2.connectSession(playerSession);
    playerSession.addHandler(new SessionHandlerLatchCounter(playerSession,
        counter, latch));
    playerSession.onEvent(event);
    assertTrue(latch.await(500, TimeUnit.MILLISECONDS));
  }

  @Test
  public void multiSessionDisconnectValidation() throws InterruptedException {
View Full Code Here

    playerSession.onEvent(message);
    assertFalse(latch1.await(500, TimeUnit.MILLISECONDS));// Ensure that the message is not sent.
    Event event2 = Events.event(null, Events.DISCONNECT);
    Event event3 = Events.event(null, Events.DISCONNECT);
    playerSession2.onEvent(event2);
    playerSession3.onEvent(event3);

    assertTrue(latch2.await(500, TimeUnit.MILLISECONDS));
    // 1 ondisconnect(session1) + 0 onnetwork(session1) + 2 ondisconnect(session2 and 3)
    assertTrue(counter.get() == 3);
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.