コード例 #1
0
  public void handleEvent(GameEvent event, V086Controller.V086ClientHandler clientHandler) {
    handledCount++;

    GameTimeoutEvent timeoutEvent = (GameTimeoutEvent) event;
    KailleraUser player = timeoutEvent.getUser();
    KailleraUser user = clientHandler.getUser();

    if (player.equals(user)) {
      log.debug(
          user
              + " received timeout event "
              + timeoutEvent.getTimeoutNumber()
              + " for "
              + timeoutEvent.getGame()
              + ": resending messages...");
      clientHandler.resend(timeoutEvent.getTimeoutNumber());
    } else {
      log.debug(
          user
              + " received timeout event "
              + timeoutEvent.getTimeoutNumber()
              + " from "
              + player
              + " for "
              + timeoutEvent.getGame());
    }
  }
コード例 #2
0
  public void handleEvent(GameEvent event, V086Controller.V086ClientHandler clientHandler) {
    handledCount++;

    GameDesynchEvent desynchEvent = (GameDesynchEvent) event;

    try {
      clientHandler.send(
          new GameChat_Notification(
              clientHandler.getNextMessageNumber(),
              EmuLang.getString("GameDesynchAction.DesynchDetected"),
              desynchEvent.getMessage())); // $NON-NLS-1$
      // if (clientHandler.getUser().getStatus() == KailleraUser.STATUS_PLAYING)
      //	clientHandler.getUser().dropGame();
    } catch (MessageFormatException e) {
      log.error(
          "Failed to contruct GameChat_Notification message: " + e.getMessage(), e); // $NON-NLS-1$
    }
    // catch (DropGameException e)
    // {
    //	log.error("Failed to drop game during desynch: " + e.getMessage(), e);
    // }
  }