How to set up Hearts and start a new game
- Start the server
- Get the jar files (so far just hearts.jar).
- Launch the server in a new window by entering this command line: [start "Hearts Server" java -classpath hearts.jar ampg.protocol.ConnectionAcceptor]
- The above command line assumes that hearts.jar is in the current directory. If it is not, put the correct path on the classpath. For example: [-classpath C:\ampg_workspace\hearts\_build_\dist\hearts.jar]
- The server will only handle one game at a time. Only one server at a time can be running on a machine (because we always use port 8189).
- Enter [start /?] for assistance with the start command.
- You should see a message confirming the server is up and running: [Listening on port: 8189]
- Clients connect to server
- On each client machine, telnet to the machine and port the server is running on. For example, [start "Hearts Client" telnet servername 8189] where servername is the name of the machine running the server.
- You should see the playing table, chat area (which will have the list of players connected and any chat messages they have sent), and a prompt waiting for you to enter your next command.
- Press return to get a refresh of the table and chat area.
- Chat with other players by typing a single quote (') and then your chat message.
- See HeartsCommandSet for more commands.
- If more than four players connect, the fifth and subsequent connections will be ignored by the server.
- Start the Game
- The game starts when one player enters the deal command and everyone continues to play. However, you should wait for all four players to connect to the server and be ready to play. You can use the chat feature to coordinate with the other players to find out when they are ready and who will be the first dealer.
- Quiting the Game
- Clients can quit by closing the telnet session.
- WARNING: once a player has quit playing, that player cannot resume playing. Hence, it pretty much ruins the game if someone quits early.
- The server can be killed by closing its window.