// // AHF 10/31/2002 // // Poker server communication // // Tells client that it is time for the user to bet // import java.util.*; import java.lang.*; import java.rmi.*; import java.net.*; class BetReturnMessage extends ReturnMessage { int min_bet; int max_bet; public BetReturnMessage(int bet, int mx_bet) { min_bet = bet; // Amount that must be bet to stay in the game max_bet = mx_bet; // Current holdings }; void service(PokerClient pk){ if(pk.quit_request) { // The player has asked to quit the game, so we will fold // now automatically and tell the system that we are quitting try{ pk.gs.fold(pk.id, true); }catch(RemoteException e){ System.exit(1); }; }else if(max_bet < min_bet) { // The player has been forced out of the game: fold System.out.println("The minimum bet exceeds your holdings. You are folding..."); try{ pk.gs.fold(pk.id, false); }catch(RemoteException e) { System.exit(1); }; }else{ // Indicates that the user may now make a bet pk.bet_now = true; // Remember what the minimum bet is pk.min_bet = min_bet; pk.max_bet = max_bet; //System.out.println("Max bet: " + max_bet); // Ask the user to bet System.out.println("Please bet now. The minimum bet is " + min_bet); }; }; };