Part 3 of SOK 2025
Work done so far
Implemented the PvP mode by leveraging XMPP for communication, enabling the played to exchange moves. The code for this are implementd in connection.h
, connection.cpp
and bohnenspieltui.cpp
.
Setting up the PvP mode
The player select the game mode they desires to play, for PvP the choice would be option P.
Connecting to XMPP server
To establish the chat room and enable the communication the player must provide their jabber id and password and the opponent’s JID (This should be done from both players side).
The program then establishes a connection to the XMPP server using the entered credentials. The game proceeds only when the credentials are verified.
Host and Turn Order
The program determines who will play first in a simple manner i.e., by comparing the lexicographical order of their jabber IDs.
Sending a move
When it’s player turn, they are prompted to enter their move. The move is validated and sent to opponent via the established chat room.
The board is updated locally and then the turn is passed to the opponent.
Receiving a move
When the move is received from the opponent, the program prompts the player to sync the board manually.
This is to ensure that both the players have their board in sync. Then the program prompts the user to enter their move and it game will be continued.
What’s next
- Automatic move sync
- The man page to explain the working to players.