Package de.pokerth.protocol.ProtoBuf

Examples of de.pokerth.protocol.ProtoBuf.NetGameInfo


    Collection<Integer> l = new ArrayList<Integer>();
    l.add(250);
    l.add(600);
    l.add(1000);
    NetGameInfo gameInfo = createGameInfo(NetGameInfo.NetGameType.normalGame, 20, 7, 8, EndRaiseMode.raiseByEndValue, 1000, 100, GuestUser + " create test game", l, 10, 0, 7, 2000);
    sendMessage(createGameRequestMsg(
        gameInfo,
        GamePassword,
        false));

    PokerTHMessage msg;
    msg = receiveMessage();
    if (!msg.hasPlayerListMessage() || msg.getMessageType() != PokerTHMessageType.Type_PlayerListMessage) {
      failOnErrorMessage(msg);
      fail("Invalid message.");
    }

    msg = receiveMessage();
    if (!msg.hasGameListNewMessage() || msg.getMessageType() != PokerTHMessageType.Type_GameListNewMessage) {
      failOnErrorMessage(msg);
      fail("Invalid message.");
    }

    msg = receiveMessage();
    if (msg.hasJoinGameAckMessage() && msg.getMessageType() == PokerTHMessageType.Type_JoinGameAckMessage)
    {
      assertTrue(msg.getJoinGameAckMessage().getGameId() != 0);
      NetGameInfo receivedGameInfo = msg.getJoinGameAckMessage().getGameInfo();
      assertEquals(receivedGameInfo.getDelayBetweenHands(), gameInfo.getDelayBetweenHands());
      assertEquals(receivedGameInfo.getEndRaiseMode(), gameInfo.getEndRaiseMode());
      assertEquals(receivedGameInfo.getEndRaiseSmallBlindValue(), gameInfo.getEndRaiseSmallBlindValue());
      assertEquals(receivedGameInfo.getFirstSmallBlind(), gameInfo.getFirstSmallBlind());
      assertEquals(receivedGameInfo.getGameName(), gameInfo.getGameName());
      assertEquals(receivedGameInfo.getManualBlindsCount(), gameInfo.getManualBlindsCount());
      for (Iterator<Integer> rec_it = receivedGameInfo.getManualBlindsList().iterator(),
          game_it = gameInfo.getManualBlindsList().iterator();
          rec_it.hasNext() && game_it.hasNext();)
      {
        assertEquals(rec_it.next(), game_it.next());
      }
      assertEquals(receivedGameInfo.getMaxNumPlayers(), gameInfo.getMaxNumPlayers());
      assertEquals(receivedGameInfo.getNetGameType(), gameInfo.getNetGameType());
      assertEquals(receivedGameInfo.getPlayerActionTimeout(), gameInfo.getPlayerActionTimeout());
      assertEquals(receivedGameInfo.getProposedGuiSpeed(), gameInfo.getProposedGuiSpeed());
      assertEquals(receivedGameInfo.getRaiseIntervalMode(), gameInfo.getRaiseIntervalMode());
      assertEquals(receivedGameInfo.getRaiseEveryHands(), gameInfo.getRaiseEveryHands());
      assertEquals(receivedGameInfo.getRaiseEveryMinutes(), gameInfo.getRaiseEveryMinutes());
      assertEquals(receivedGameInfo.getStartMoney(), gameInfo.getStartMoney());
    }
    else {
      failOnErrorMessage(msg);
      fail("Invalid message.");
    }
View Full Code Here


  @Test
  public void testRunNormalGameAsGuest() throws Exception {
    guestInit();

    Collection<Integer> l = new ArrayList<Integer>();
    NetGameInfo gameInfo = createGameInfo(NetGameType.normalGame, 10, 5, 5, EndRaiseMode.doubleBlinds, 0, 100, GuestUser + " run normal game", l, 10, 0, 2, 2000);
    sendMessage(createGameRequestMsg(
        gameInfo,
        "",
        false));
View Full Code Here

      fail("Invalid message.");
    }

    Collection<Integer> l = new ArrayList<Integer>();
    String gameName = AuthUser + " rejoin game";
    NetGameInfo gameInfo = createGameInfo(NetGameType.normalGame, 5, 7, 5, EndRaiseMode.doubleBlinds, 0, 50, gameName, l, 10, 0, 11, 10000);
    sendMessage(createGameRequestMsg(
        gameInfo,
        "",
        false));
View Full Code Here

      fail("Invalid message.");
    }

    Collection<Integer> l = new ArrayList<Integer>();
    String gameName = AuthUser + " rejoin game";
    NetGameInfo gameInfo = createGameInfo(NetGameType.rankingGame, 5, 7, 5, EndRaiseMode.doubleBlinds, 0, 50, gameName, l, 10, 0, 11, 10000);
    sendMessage(createGameRequestMsg(
        gameInfo,
        "",
        false));
View Full Code Here

    assertEquals(ChatType.chatTypePrivate, msg.getChatMessage().getChatType());
    assertEquals(playerId[0], msg.getChatMessage().getPlayerId());

    // Game messages can be sent by registered users within a game.
    Collection<Integer> l = new ArrayList<Integer>();
    NetGameInfo gameInfo = createGameInfo(NetGameType.normalGame, 10, 5, 5, EndRaiseMode.doubleBlinds, 0, 100, GuestUser + " game list normal game", l, 10, 0, 2, 2000);
    sendMessage(createGameRequestMsg(
        gameInfo,
        "",
        false));
    do {
View Full Code Here

        .build();
    sendMessage(msg);

    // Create a new game.
    Collection<Integer> l = new ArrayList<Integer>();
    NetGameInfo gameInfo = createGameInfo(NetGameType.normalGame, 10, 5, 5, EndRaiseMode.doubleBlinds, 0, 100, GuestUser + " game list normal game", l, 10, 0, 2, 2000);
    sendMessage(createGameRequestMsg(
        gameInfo,
        "",
        false));
View Full Code Here

      fail("Invalid message: " + msg.getMessageType());
    }

    Collection<Integer> l = new ArrayList<Integer>();
    String gameName = AuthUser + " rejoin game";
    NetGameInfo gameInfo = createGameInfo(NetGameType.normalGame, 5, 7, 5, EndRaiseMode.doubleBlinds, 0, 50, gameName, l, 10, 0, 11, 10000);
    sendMessage(createGameRequestMsg(
        gameInfo,
        "",
        false));
View Full Code Here

      fail("Invalid message.");
    }

    Collection<Integer> l = new ArrayList<Integer>();
    String gameName = AuthUser + " run ranking game";
    NetGameInfo gameInfo = createGameInfo(NetGameType.rankingGame, 5, 7, 5, EndRaiseMode.doubleBlinds, 0, 50, gameName, l, 10, 0, 11, 10000);
    sendMessage(createGameRequestMsg(
        gameInfo,
        "",
        false));
View Full Code Here

  protected void checkGameListNewMsg(int myId, GameListNewMessage gameListNew, NetGameMode mode, NetGameInfo gameInfo) {
    assertEquals(NetGameMode.netGameCreated, gameListNew.getGameMode());
    assertTrue(!gameListNew.getIsPrivate());
    assertEquals(myId, gameListNew.getAdminPlayerId());
    NetGameInfo receivedGameInfo = gameListNew.getGameInfo();
    assertEquals(gameInfo.getDelayBetweenHands(), receivedGameInfo.getDelayBetweenHands());
    assertEquals(gameInfo.getEndRaiseMode(), receivedGameInfo.getEndRaiseMode());
    assertEquals(gameInfo.getEndRaiseSmallBlindValue(), receivedGameInfo.getEndRaiseSmallBlindValue());
    assertEquals(gameInfo.getFirstSmallBlind(), receivedGameInfo.getFirstSmallBlind());
    assertEquals(gameInfo.getGameName(), receivedGameInfo.getGameName());
    assertTrue(receivedGameInfo.getManualBlindsCount() == 0);
    assertEquals(gameInfo.getMaxNumPlayers(), receivedGameInfo.getMaxNumPlayers());
    assertEquals(gameInfo.getNetGameType(), receivedGameInfo.getNetGameType());
    assertEquals(gameInfo.getPlayerActionTimeout(), receivedGameInfo.getPlayerActionTimeout());
    assertEquals(gameInfo.getProposedGuiSpeed(), receivedGameInfo.getProposedGuiSpeed());
    assertEquals(RaiseIntervalMode.raiseOnHandNum, gameInfo.getRaiseIntervalMode());
    assertEquals(gameInfo.getStartMoney(), receivedGameInfo.getStartMoney());
  }
View Full Code Here

    msg = receiveMessage();
    assertTrue(msg.hasPlayerListMessage());

    // Create a new game.
    Collection<Integer> l = new ArrayList<Integer>();
    NetGameInfo gameInfo = createGameInfo(NetGameType.normalGame, 10, 5, 5, EndRaiseMode.doubleBlinds, 0, 100, GuestUser + " game list normal game", l, 10, 0, 2, 2000);
    sendMessage(createGameRequestMsg(
        gameInfo,
        "",
        false));
View Full Code Here

TOP

Related Classes of de.pokerth.protocol.ProtoBuf.NetGameInfo

Copyright © 2018 www.massapicom. 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.