Fix some stuff!
This commit is contained in:
parent
57cd0544f4
commit
707c4b5296
|
@ -80,7 +80,8 @@ async def ws_room(ws: WebSocket, code: str, kind: str):
|
||||||
await ws.send_text("you fucked up dawg")
|
await ws.send_text("you fucked up dawg")
|
||||||
await ws.close()
|
await ws.close()
|
||||||
return
|
return
|
||||||
|
if len(name) > 25:
|
||||||
|
return ws.close(1009)
|
||||||
p = Player(name=name, uuid=uuid.uuid4())
|
p = Player(name=name, uuid=uuid.uuid4())
|
||||||
|
|
||||||
if not room.admin_uuid:
|
if not room.admin_uuid:
|
||||||
|
|
|
@ -21,6 +21,7 @@ class RoundStart(BaseModel):
|
||||||
czar: int
|
czar: int
|
||||||
card: Card
|
card: Card
|
||||||
|
|
||||||
|
|
||||||
class PubPlayer(BaseModel):
|
class PubPlayer(BaseModel):
|
||||||
name: str
|
name: str
|
||||||
points: int = 0
|
points: int = 0
|
||||||
|
@ -40,24 +41,30 @@ class PubRoom(BaseModel):
|
||||||
players: List[PubPlayer] = [] # List of player's uuids
|
players: List[PubPlayer] = [] # List of player's uuids
|
||||||
started: bool = False
|
started: bool = False
|
||||||
played_cards: List[int] = []
|
played_cards: List[int] = []
|
||||||
|
packs: List[str] = []
|
||||||
|
|
||||||
|
|
||||||
class Answer(BaseModel):
|
class Answer(BaseModel):
|
||||||
text: List[str]
|
text: List[str]
|
||||||
|
|
||||||
|
|
||||||
class AnswerReceived(Answer):
|
class AnswerReceived(Answer):
|
||||||
uuid: str
|
uuid: str
|
||||||
|
|
||||||
|
|
||||||
class AnswerSending(Answer):
|
class AnswerSending(Answer):
|
||||||
index: int
|
index: int
|
||||||
|
|
||||||
|
|
||||||
class AnswerSendingButItHasAUUIDBecauseItIsImportantToCheckIfItWasSentByTheCzar(AnswerSending):
|
class AnswerSendingButItHasAUUIDBecauseItIsImportantToCheckIfItWasSentByTheCzar(AnswerSending):
|
||||||
uuid: str
|
uuid: str
|
||||||
|
|
||||||
|
|
||||||
class Room(PubRoom):
|
class Room(PubRoom):
|
||||||
players: List[Player] = [] # List of player's uuids
|
players: List[Player] = [] # List of player's uuids
|
||||||
number: int
|
number: int
|
||||||
admin_uuid: UUID4 = None
|
admin_uuid: UUID4 = None
|
||||||
answers:List[AnswerSending] = []
|
answers: List[AnswerSending] = []
|
||||||
# def __init__(self, number):
|
# def __init__(self, number):
|
||||||
# super().__init__()
|
# super().__init__()
|
||||||
# self.number = number
|
# self.number = number
|
||||||
|
|
|
@ -18131,4 +18131,3 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue