Poker Dealer: A Poker Game With GPT

Poker Dealer: A Poker Game With GPT · GPT-Aktionen

Poker Game API

Manages poker games including creating games, joining players, dealing cards, and managing betting rounds.

  • POST /poker-createGamecreateGame

    Create a new poker game

  • POST /poker-joinGamejoinGame

    Join a player to an existing game and retrieve player ID. It must be called for each player seperatly. Also use virtual player avatar and expression in game given in response.

  • POST /poker-bettingRoundbettingRound

    Manage a betting round in the game. Actions: bet,raise,call,check,fold

  • POST /poker-dealCardsdealCards

    Deal cards to all players in the game.

  • GET /poker-showHandToRealPlayershowHandToRealPlayer

    After deal cards, show real player's hand to it using this path.It returns a cards image as base64 format.

  • POST /poker-flopCardsflopCards

    Deal flop cards in the game. Show cards img using openedCommunityCardsImageUrl.

  • POST /poker-turnCardturnCard

    Deal turn card in the game. Show cards img using openedCommunityCardsImageUrl.

  • POST /poker-riverCardriverCard

    Deal river card in the game. Show cards img using openedCommunityCardsImageUrl.

  • POST /poker-openAllHandsAndFinishopenAllHandsAndFinish

    Open hands, determine winner and finish game. Send active user ids in game.

Ursprüngliches API-Schema
{
  "openapi": "3.1.0",
  "info": {
    "title": "Poker Game API",
    "description": "Manages poker games including creating games, joining players, dealing cards, and managing betting rounds.",
    "version": "v1.0.0"
  },
  "servers": [
    {
      "url": "https://us-central1-gptbackend-cf06c.cloudfunctions.net"
    }
  ],
  "paths": {
    "/poker-createGame": {
      "post": {
        "description": "Create a new poker game",
        "operationId": "createGame",
        "responses": {}
      }
    },
    "/poker-joinGame": {
      "post": {
        "description": "Join a player to an existing game and retrieve player ID. It must be called for each player seperatly. Also use virtual player avatar and expression in game given in response.",
        "operationId": "joinGame",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "gameId": {
                    "type": "string"
                  },
                  "isReal": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "gameId",
                  "isReal"
                ]
              }
            }
          }
        },
        "responses": {}
      }
    },
    "/poker-bettingRound": {
      "post": {
        "description": "Manage a betting round in the game. Actions: bet,raise,call,check,fold",
        "operationId": "bettingRound",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "gameId": {
                    "type": "string"
                  },
                  "playerId": {
                    "type": "string"
                  },
                  "action": {
                    "type": "string"
                  },
                  "amount": {
                    "type": "number"
                  }
                },
                "required": [
                  "gameId",
                  "playerId",
                  "action"
                ]
              }
            }
          }
        },
        "responses": {}
      }
    },
    "/poker-dealCards": {
      "post": {
        "description": "Deal cards to all players in the game.",
        "operationId": "dealCards",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "gameId": {
                    "type": "string"
                  },
                  "realUserId": {
                    "type": "string"
                  }
                },
                "required": [
                  "gameId",
                  "realUserId"
                ]
              }
            }
          }
        },
        "responses": {}
      }
    },
    "/poker-showHandToRealPlayer": {
      "get": {
        "description": "After deal cards, show real player's hand to it using this path.It returns a cards image as base64 format.",
        "operationId": "showHandToRealPlayer",
        "parameters": [
          {
            "in": "query",
            "name": "gameId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "playerId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {}
      }
    },
    "/poker-flopCards": {
      "post": {
        "description": "Deal flop cards in the game. Show cards img using openedCommunityCardsImageUrl.",
        "operationId": "flopCards",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "gameId": {
                    "type": "string"
                  }
                },
                "required": [
                  "gameId"
                ]
              }
            }
          }
        },
        "responses": {}
      }
    },
    "/poker-turnCard": {
      "post": {
        "description": "Deal turn card in the game. Show cards img using openedCommunityCardsImageUrl.",
        "operationId": "turnCard",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "gameId": {
                    "type": "string"
                  }
                },
                "required": [
                  "gameId"
                ]
              }
            }
          }
        },
        "responses": {}
      }
    },
    "/poker-riverCard": {
      "post": {
        "description": "Deal river card in the game. Show cards img using openedCommunityCardsImageUrl.",
        "operationId": "riverCard",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "gameId": {
                    "type": "string"
                  }
                },
                "required": [
                  "gameId"
                ]
              }
            }
          }
        },
        "responses": {}
      }
    },
    "/poker-openAllHandsAndFinish": {
      "post": {
        "description": "Open hands, determine winner and finish game. Send active user ids in game.",
        "operationId": "openAllHandsAndFinish",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "gameId": {
                    "type": "string"
                  },
                  "activeUserIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "gameId",
                  "activeUserIds"
                ]
              }
            }
          }
        },
        "responses": {}
      }
    }
  },
  "components": {
    "schemas": {}
  }
}