Team 5: Virtual Casino
Baseline Use Case
- Functionality:
- Baseline
- System Elements:
-
- Game Server: The middleware server responsible for serving
blackjack to clients. The game server registers one
interface with the orb naming service, the Floor interface
which contains methods allow entrance to and exit from the
gaming system. It also exports two other interfaces on request;
the Bank interface and the Tables interface. These handle the
monitary transactions and the actual game mechanics
respectively.
- Database Server: The MS-SQL system that stores all the state
for one middleware server right now and multiple ones in the
future.
- Client: The application that the player uses to play the
game. It has one interface, the Player interface, that it exports to
the game server to allow the game server to control the flow
of game play.
- Player: The human controlling the client application
- Use Case:
-
- A player or players can now do the following:
- Login to a game server by entering his/her name.
- Buy "chips" using the bank interface.
- Use the Tables interface to join a table.
- Play a mostly regulation blackjack game against
the dealer while other players play concurantly.
- Buy more "chips" during the game
- Leave the table, sell your "chips" back to the bank, and
unregister from the game.
- Client does the following:
- Looks up the Floor interface from the ORB naming
server and then loads that interface.
- Let the player register with a game server
- Loads the Bank and Tables interfaces from the game
server
- When the player requests to join a table, the
Client creates a player object and sends the Player
interface to the Game Server letting the server drive
the flow of the game.
- At the end of play the client lets the player
leave the table, sell his/her "chips" and unregister.
- Server does the following:
- Register its "Floor" inteface with the naming service.
- Take registration requests from a player, putting the
player's name in the database and returning a player ID.
- Create "Bank" and "Tables" objects and send references to
them to the client on request.
- Sell chips to a client.
- Assign clients to tables, with a maximum of five
per table.
- Take the Player interface from the client and run
the game using that interface.
- Allow the client to leave the game.
- Allow the client to sell "chips" back to the
bank.
- Test distribution:
- /afs/ece/class/ece841/public_html/team5/team5-baseline.tar.bz2
- Test Sequence
-
- Running the Database Server
- Login to msepc12.sp.cs.cmu.edu and start SQL server.
Directions for access to this host available on request.
- Running the Game Server
- Log in to any host in the ECE linux cluster.
- Change directory to where you wish to unpack the tarball.
- Type tar xjvf
/afs/ece/class/ece841/public_html/team5/team5-baseline.tar.bz2.
- Change to the newly created project directory: cd
team5-baseline
- If you are using CSH or TCSH for your shell type: source
./env.csh.
- If you are using Bourne/BASH/KSH for your shell type: .
./env.bsh.
- Make sure that no other orbs are running on this system
by typing killall orbd and then start an orb
daemon with ./startOrbd.sh&. Make sure to wait a
minute until the orb starts completely. It gives no output to
tell you when it is ready but waiting a minute is usually enough.
- Clear out the database of old data in case there is some
corrupt data that will effect our test by running ./runDBClear.sh which
will not give any output if it runs correctly.
- Start the Casino Server with ./BlackJackServer& and
wait to see the message, "---Server ready and running .....". If
the orb is running on a different system use the "-h" option as such:
./BlackJackServer -h <otherhost>.
- The server is now up and ready to server games to clients.
- Running a Client
- Change to the project directory: cd
team5-baseline, the same directory from which the server
was started.
- Start client on this host with ./BlackJackClient. If
the orb is on a different host, use the "-h" option as such:
./BlackJackClient -h <otherhost>.
- When prompted by the client
application enter your name and hit return.
- When prompted to buy chips, enter a number and hit return.
- The next prompt will ask you to place a bet on the
upcoming hand. Type a number between 10 and the number of chips that
you have bought in increments of ten. If you bet zero you quit the
game.
- You will be dealt two cards. If at anytime you get a
total of 21 points, you win. Otherwise you will have to get more points
than the dealer without going over 21 to win. If you go over 21 or have
fewer points than the dealer, you lose and lose your bet. If you win
you get the amount of your bet added to your chip total, if you lose
that much is subtracted.
- If you don't win automatically with your first two cards
you will be prompted to choose between hitting or staying with the cards
you have. Hit "h" if you want to be dealt another card or "s" if you
want to stay with the ones you have.
- The hand continues until either you stay or go over 21
- At the end of the hand your chips are added to or
subracted from depending on whether you win or loose
- Once the hand is over you will be prompted to bet again
with your remaining chips. If you are out of chips your only valid
choice is to quit the game by entering zero (0) chips as your bet.
- The game continues until you run out of chips or decide
to quit with your winnings.
- Configuration/deployment issues:
-
- The project is not packaged into separate Server and
Player jar files yet, all the classes are grouped together
into one jar file. This jar file is packaged into a tar file
with start scripts and the Microsoft SQS server java driver
jar files.
- Known problems:
- If the server is started while the orb is still starting up,
an exeption may be uncaught. This has only happened once.
- If you input a non-numerical character at the prompt asking
you for the number of chips to buy or amount to bet you will get an
error saying, "GetInteger: Number format error." This is correct
behaviour but not very well worded. It looks more like a debugging
message than a prompt for the player to input the correct type of value.
If you enter a number after getting this error, the game will continue.
- If try to buy too many chips, you get an input warning but no
prompt telling you what the limit is.
- Once you run out of chips, you cannot buy more without
exiting the application
- A table is not destroyed when the last player leaves it.
- Only one player plays at a table at one time.
- The player is not told what table he/she is at.
- The point totals for each hand are not displayed.
- If you kill the server, the player freezes.
- If you kill the client and restart it using the same
user name, without restarting the server, a fatal uncaught
exception is generated at the client and a non-fatal exception
is thrown at the server. That username can not be used again
until the database has been cleared.
- We do not deal with money or credit, you can buy as many
chips as you want as long as it go over the input limit.
- The system can only run with one database as the host is hard
coded into the java source code.