Package org.cspoker.client.common

Examples of org.cspoker.client.common.SmartLobbyContext


      final int buyin) throws LoginException, RemoteException,
      IllegalActionException {
    // Start Bot
    SmartClientContext clientContext = new SmartClientContext(server.login(
        "Bot " + botIndex++, "test"));
    final SmartLobbyContext lobbyContext = clientContext
    .getLobbyContext(new DefaultLobbyListener());
    final PlayerId botId = clientContext.getAccountContext().getPlayerID();
    final SingleThreadRequestExecutor executor = SingleThreadRequestExecutor
    .getInstance();
    bot = botFactory.createBot(botId, tableId, lobbyContext, buyin,
View Full Code Here


      throw new IllegalArgumentException("Please provide correct server context");
    try {
      RemoteLobbyContext remoteContext = serverContext.getLobbyContext(new AsynchronousLobbyListener(
          DisplayExecutor.getInstance(), this));

      this.context = new SmartLobbyContext(remoteContext, getClientCore().getUser().getPlayerId());
    } catch (RemoteException e) {
      throw new IllegalArgumentException(e);
    } catch (IllegalActionException exception) {
      // TODO handle
      exception.printStackTrace();
View Full Code Here

  }

  protected void start() throws RemoteException, LoginException, IllegalActionException {
    RemoteServerContext conn = server.login("foobar", "foobar");
    SmartClientContext clientContext = new SmartClientContext(conn);
    final SmartLobbyContext lobbyContext = clientContext.getLobbyContext(new DefaultLobbyListener());
    final PlayerId botId = clientContext.getAccountContext().getPlayerID();
    final SingleThreadRequestExecutor executor = SingleThreadRequestExecutor.getInstance();
    final TableId tableId = new TableId(0);
    bot = botFactory.createBot(botId, tableId, lobbyContext, 200000, executor, new DefaultBotListener() {
      @Override
      public void onSitOut(SitOutEvent sitOutEvent) {
        if(botId.equals(sitOutEvent.getPlayerId())){
          logger.info("Sitting in again after "+sitOutEvent);
          bot.reSitIn();
        }
      }
    }, new ProfitListener(1,new ProfitInfo(){

      @Override
      public RunningStats getProfit() {
        return bot.getProfit();
      }
     
      @Override
      public String getBotName() {
        return botFactory.toString();
      }
     
      @Override
      public TableConfiguration getTableConfiguration() {
        try {
          return lobbyContext.getHoldemTableInformation(tableId).getTableConfiguration();
        } catch (RemoteException e) {
          e.printStackTrace();
          logger.error(e);
          throw new RuntimeException(e);
        } catch (IllegalActionException e) {
View Full Code Here

TOP

Related Classes of org.cspoker.client.common.SmartLobbyContext

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.