Package org.cspoker.common.api.shared.exception

Examples of org.cspoker.common.api.shared.exception.IllegalActionException


    if(serverChatContext.compareAndSet(null, context)){
      serverListenerTree.setServerChatListener(chatListener);
      performer.perform(new ServerChatInterestAction(generator.getNextID()));
      return context;
    }else{
      throw new IllegalActionException("Already registered a server chat listener");
    }
  }
View Full Code Here


    if(tableChatContexts.putIfAbsent(tableID, context)==null){
      serverListenerTree.setTableChatListener(tableID, chatListener);
      performer.perform(new TableChatInterestAction(generator.getNextID(),tableID));
      return context;
    }else{
      throw new IllegalActionException("Already registered a chat listener for table #"+tableID+".");
    }
  }
View Full Code Here

    XmlRemoteLobbyContext context = new XmlRemoteLobbyContext(performer,generator, serverListenerTree);
    if(lobbyContext.compareAndSet(null, context)){
      serverListenerTree.getLobbyListenerTree().setLobbyListener(lobbyListener);
      return context;
    }else{
      throw new IllegalActionException("Already registered a lobby listener");
    }
  }
View Full Code Here

    if(playerContext.compareAndSet(null, new XmlRemoteHoldemPlayerContext(performer,generator,tableID, stalePlayerContextTrigger))){
      serverListenerTree.getLobbyListenerTree().getHoldemTableListenerTree(tableID).setHoldemPlayerListener(holdemPlayerListener);
      performer.perform(new SitInAction(generator.getNextID(),tableID,seatId,amount));
      return playerContext.get();
    }
    throw new IllegalActionException("Already seated at table #"+tableID+".");
   
  }
View Full Code Here

    if(playerContext.compareAndSet(null, new XmlRemoteHoldemPlayerContext(performer,generator,tableID, stalePlayerContextTrigger))){
      serverListenerTree.getLobbyListenerTree().getHoldemTableListenerTree(tableID).setHoldemPlayerListener(holdemPlayerListener);
      performer.perform(new SitInAnywhereAction(generator.getNextID(),tableID,amount));
      return playerContext.get();
    }
    throw new IllegalActionException("Already seated at table #"+tableID+".");
  }
View Full Code Here

    if(contexts.putIfAbsent(tableID, context)==null){
      serverListenerTree.getLobbyListenerTree().getHoldemTableListenerTree(tableID).setHoldemTableListener(holdemTableListener);
      performer.perform(new JoinHoldemTableAction(generator.getNextID(),tableID));
      return context;
    }else{
      throw new IllegalActionException("Already joined table #"+tableID+".");
    }
  }
View Full Code Here

  }

  @Override
  public void betOrRaise(int amount) throws IllegalActionException, RemoteException {
    if(!isSittingIn) {
      throw new IllegalActionException("Can't act when not sitting in.");
    }
    try {
      int callValue = gameStateContainer.getGameState().getCallValue(new PlayerId(serial));
      conn.sendRemote(new Raise(serial, game_id, callValue+amount));
    } catch (JSONException e) {
      throw new IllegalActionException(e);
    }
  }
View Full Code Here

  }

  @Override
  public void checkOrCall() throws IllegalActionException, RemoteException {
    if(!isSittingIn) {
      throw new IllegalActionException("Can't act when not sitting in.");
    }
    try {
      if(betLimitCall==0) conn.sendRemote(new Check(serial, game_id));
      else conn.sendRemote(new Call(serial, game_id));
    } catch (JSONException e) {
      throw new IllegalActionException(e);
    }
  }
View Full Code Here

  }

  @Override
  public void fold() throws IllegalActionException, RemoteException {
    if(!isSittingIn) {
      throw new IllegalActionException("Can't act when not sitting in.");
    }
    try {
      conn.sendRemote(new Fold(serial, game_id));
    } catch (JSONException e) {
      throw new IllegalActionException(e);
    }
  }
View Full Code Here

    }
  }

  private void throwIllegalActionExceptions(HTTPRequest request, String message){
    for(DispatchableAction<?> action:request.getActions()){
      eventListener.onActionPerformed(action.getIllegalActionEvent(new IllegalActionException(message)));
    }
  }
View Full Code Here

TOP

Related Classes of org.cspoker.common.api.shared.exception.IllegalActionException

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.