Add command GET_GAMESTATE #99

Closed
opened 2026-04-11 21:49:44 +02:00 by jona.walpert · 3 comments
jona.walpert commented 2026-04-11 21:49:44 +02:00 (Migrated from git.scicore.unibas.ch)

Task

Summary

Add GET_GAME_STATE to provide game state information to the client (players, cards, pot, phase)

Context

Request, parser, handler, Response

Current Progress

  • Request
  • Parser
  • Handler
  • Response
  • JavaDoc
  • Documentation

Request

GET_GAME_STATE

Response

  +OK
    GAME_ID=1
    PHASE=POST_FLOP
    POT=350
    PLAYERS
      PLAYER
        USERNAME=player1
        ID=e47a671e-2b2a-42df-bb82-953fe2ebd307
        CHIPS=19500
        SEAT=1
        STATE=ACTIVE
      END
      PLAYER
        USERNAME=player2
        ID=b7bbd9b3-0d49-4c92-8306-b1c8506d2ff0
        CHIPS=0
        SEAT=2
        STATE=FOLDED
      END
    END
    COMMUNITY_CARDS
      CARD=AH
      CARD=7D
      CARD=2S
    END
  END

Error Response

  -ERR
    CODE=NOT_IN_LOBBY
    MESSAGE=User not in a lobby
  END

Checklist

  • I outlined checkpoints describing phases of my work related to this task
  • I added relevant labels
  • I linked to other issues or branches that must be completed first
## Task <!--The reccommended type is: Task--> ### Summary Add `GET_GAME_STATE` to provide game state information to the client (players, cards, pot, phase) ### Context Request, parser, handler, Response <!--Examples: Networking, Game-Engine, User interface, ...--> ### Current Progress - [ ] Request - [ ] Parser - [ ] Handler - [ ] Response - [ ] JavaDoc - [ ] Documentation #### Request ``` GET_GAME_STATE ``` #### Response ``` +OK GAME_ID=1 PHASE=POST_FLOP POT=350 PLAYERS PLAYER USERNAME=player1 ID=e47a671e-2b2a-42df-bb82-953fe2ebd307 CHIPS=19500 SEAT=1 STATE=ACTIVE END PLAYER USERNAME=player2 ID=b7bbd9b3-0d49-4c92-8306-b1c8506d2ff0 CHIPS=0 SEAT=2 STATE=FOLDED END END COMMUNITY_CARDS CARD=AH CARD=7D CARD=2S END END ``` #### Error Response ``` -ERR CODE=NOT_IN_LOBBY MESSAGE=User not in a lobby END ``` ### Checklist - [x] I outlined checkpoints describing phases of my work related to this task - [x] I added relevant labels - [x] I linked to other issues or branches that must be completed first
jona.walpert commented 2026-04-11 21:49:44 +02:00 (Migrated from git.scicore.unibas.ch)

assigned to @jona.walpert

assigned to @jona.walpert
jona.walpert commented 2026-04-11 22:05:42 +02:00 (Migrated from git.scicore.unibas.ch)

mentioned in merge request !107

mentioned in merge request !107
jona.walpert commented 2026-04-11 22:08:20 +02:00 (Migrated from git.scicore.unibas.ch)

mentioned in commit 3b8f7d42dd

mentioned in commit 3b8f7d42dd48990fed131403063670e3e48f92c7
jona.walpert (Migrated from git.scicore.unibas.ch) closed this issue 2026-04-11 22:08:21 +02:00
This repo is archived. You cannot comment on issues.
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: University-of-Basel-Studentprojects/Programmierprojekt#99