diff --git a/app/main.py b/app/main.py index 71c1072..58a048b 100644 --- a/app/main.py +++ b/app/main.py @@ -80,7 +80,8 @@ async def ws_room(ws: WebSocket, code: str, kind: str): await ws.send_text("you fucked up dawg") await ws.close() return - + if len(name) > 25: + return ws.close(1009) p = Player(name=name, uuid=uuid.uuid4()) if not room.admin_uuid: diff --git a/app/models.py b/app/models.py index 871eb1f..4cd8b5b 100644 --- a/app/models.py +++ b/app/models.py @@ -21,6 +21,7 @@ class RoundStart(BaseModel): czar: int card: Card + class PubPlayer(BaseModel): name: str points: int = 0 @@ -40,24 +41,30 @@ class PubRoom(BaseModel): players: List[PubPlayer] = [] # List of player's uuids started: bool = False played_cards: List[int] = [] + packs: List[str] = [] + class Answer(BaseModel): text: List[str] + class AnswerReceived(Answer): uuid: str + class AnswerSending(Answer): index: int + class AnswerSendingButItHasAUUIDBecauseItIsImportantToCheckIfItWasSentByTheCzar(AnswerSending): uuid: str + class Room(PubRoom): players: List[Player] = [] # List of player's uuids number: int admin_uuid: UUID4 = None - answers:List[AnswerSending] = [] + answers: List[AnswerSending] = [] # def __init__(self, number): # super().__init__() # self.number = number diff --git a/cards.json b/cards.json index 8bdbf95..4390437 100644 --- a/cards.json +++ b/cards.json @@ -18131,4 +18131,3 @@ } } } -