Demo SDK
This commit is contained in:
@ -28,7 +28,7 @@ def get_player(uuid: str, engine: GameEngine = Depends(get_game_engine)) -> Play
|
||||
)
|
||||
if not player.active:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_404_NOT_FOUND,
|
||||
status_code=status.HTTP_403_FORBIDDEN,
|
||||
detail="Player kicked out due to inactivity",
|
||||
)
|
||||
return player
|
||||
@ -73,6 +73,16 @@ async def start_game(
|
||||
"/player/{uuid}",
|
||||
response_model=PlayerInfoResponseDto,
|
||||
status_code=status.HTTP_201_CREATED,
|
||||
responses={
|
||||
status.HTTP_403_FORBIDDEN: {
|
||||
"model": ErrorResponseDto,
|
||||
"description": " Player inactive",
|
||||
},
|
||||
status.HTTP_404_NOT_FOUND: {
|
||||
"model": ErrorResponseDto,
|
||||
"description": " Player with uuid not found, probably kicked out",
|
||||
},
|
||||
},
|
||||
)
|
||||
async def get_player_info(
|
||||
player: Player = Depends(get_player),
|
||||
@ -91,7 +101,11 @@ async def get_player_info(
|
||||
},
|
||||
status.HTTP_403_FORBIDDEN: {
|
||||
"model": ErrorResponseDto,
|
||||
"description": " Player uuid not valid, probably due to inactivity",
|
||||
"description": " Player inactive",
|
||||
},
|
||||
status.HTTP_404_NOT_FOUND: {
|
||||
"model": ErrorResponseDto,
|
||||
"description": " Player with uuid not found, probably kicked out",
|
||||
},
|
||||
status.HTTP_409_CONFLICT: {
|
||||
"model": ErrorResponseDto,
|
||||
|
||||
Reference in New Issue
Block a user