server has its own world and has primitiv logic for starting a game

This commit is contained in:
steev 2024-01-07 20:45:25 +01:00
parent 3fa66bc2bf
commit d9b367dd42
3 changed files with 6 additions and 1 deletions

View File

@ -4,4 +4,5 @@ from Classes.Game.World import World
# send from the server to tell the player the game starts # send from the server to tell the player the game starts
# gives the client its and the opponents stats (not cards!!) # gives the client its and the opponents stats (not cards!!)
def GameStart(world: World): def GameStart(world: World):
print("game starts")
pass pass

View File

@ -9,6 +9,10 @@ class TCPEventHandler:
if message["event"] == "login": if message["event"] == "login":
# todo: handle login response here # todo: handle login response here
pass pass
elif message["event"] == "startgame":
# todo: handle starting the game here
print("game starts")
pass
class UDPEventHandler: class UDPEventHandler:
def __init__(self, socket:socket): def __init__(self, socket:socket):
@ -16,7 +20,7 @@ class UDPEventHandler:
def handleEvents(self, message): def handleEvents(self, message):
if message["event"] == "PlaceCard": if message["event"] == "PlaceCard":
pass pass
elif message["event"] == "MoveCard": elif message["event"] == "MoveCard":
pass pass
elif message["event"] == "RemoveCard": elif message["event"] == "RemoveCard":