Progress Update:
Last week, over Thanksgiving break I updated the server code so that it has all the functionality promised from back during the beginning of the semester. The main thread of the server acts as the lobby manager, and accepts incoming communication with clients. The clients also send over the lobby number that they want to join, and while the lobby manager server is waiting for replies from clients, it also sends the waiting clients updates to game sessions: whether there is a new game session created by another player or if another player joined a lobby. The games that is displayed to each player is dependent on the currently created games and also the player’s list of saved games. This information is fed back to all the waiting clients in real time. When a session is filled up, the lobby manager spawns a thread and then passes off all the information to the game session thread including whether or not this was a resumed game. If the game is a resumed game, the lobby manager has to load the pieces from that saved game by querying MongoDB. From then on the game session thread is responsible for replaying piece information between the players in its game session and the game manager thread can then keep accepting new connections so multiple ongoing games are possible.
Back to the game session thread, if the game session thread notices that this is a resumed game, then it will replay the pieces that were stored in the database related to the game back to the players, the client software now also has a replay state, where it reads pieces from the server and doesn’t accept any current player inputs until after the game session server sends a end of replay packet. From then on the client software can function as normally. The client software also got an upgrade to the GUI, there are now new display screens so that the software is more user friendly. For example the client can see which game sessions are available to join in real time. If the client has any games saved over, that is also displayed to the client. Note that players only see their own saved games, not the ones of other people. These saved games can only start when the people who were originally in the session all join back into the saved game. Other GUI updates include a win screen and a loading screen. The player can now also “give up” by pressing the “L” key and the player can also choose to save the game by clicking the “S” key. For a game to end all the players have to press the “L” key indicating that they ran out of moves to play. If any player hits the “S” key the game is automatically saved and ended, the game session manager takes all the pieces from the game and persists it to the database, and also updates the players info to include the game session number into the player’s saved game list.
This week I’m working on some more testing and slight modification since I’m developing on a Mac, but my teammates are on Windows and it seems like the sockets work differently than expected especially now when I’ve made the sockets nonblocking. This week I am working to make the server more robust as well as working on the final presentation and filming some gameplay.
Change of Plans:
No change of plans, things are on track.
Deliverables:
- Upgraded server software
- Upgrade GUI
- Replay Game Mechanic
- Server Deployed with MongoDB C++ driver
Plans for Next Week:
Wrapping up the server testing, and working on the final proposal and filming more videos.