From d9b367dd42a3bf2173ab528dba926be59f9db510 Mon Sep 17 00:00:00 2001 From: steev Date: Sun, 7 Jan 2024 20:45:25 +0100 Subject: [PATCH] server has its own world and has primitiv logic for starting a game --- Game_Client/Classes/Game/Events/GameStart.py | 1 + .../Classes/System/Network/EventHandler.py | 6 +++++- .../__pycache__/EventHandler.cpython-311.pyc | Bin 1861 -> 1984 bytes 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Game_Client/Classes/Game/Events/GameStart.py b/Game_Client/Classes/Game/Events/GameStart.py index 08b908f..5faf41d 100644 --- a/Game_Client/Classes/Game/Events/GameStart.py +++ b/Game_Client/Classes/Game/Events/GameStart.py @@ -4,4 +4,5 @@ from Classes.Game.World import World # send from the server to tell the player the game starts # gives the client its and the opponents stats (not cards!!) def GameStart(world: World): + print("game starts") pass \ No newline at end of file diff --git a/Game_Client/Classes/System/Network/EventHandler.py b/Game_Client/Classes/System/Network/EventHandler.py index ba262f2..b1ecd8a 100644 --- a/Game_Client/Classes/System/Network/EventHandler.py +++ b/Game_Client/Classes/System/Network/EventHandler.py @@ -9,6 +9,10 @@ class TCPEventHandler: if message["event"] == "login": # todo: handle login response here pass + elif message["event"] == "startgame": + # todo: handle starting the game here + print("game starts") + pass class UDPEventHandler: def __init__(self, socket:socket): @@ -16,7 +20,7 @@ class UDPEventHandler: def handleEvents(self, message): if message["event"] == "PlaceCard": - pass + pass elif message["event"] == "MoveCard": pass elif message["event"] == "RemoveCard": diff --git a/Game_Client/Classes/System/Network/__pycache__/EventHandler.cpython-311.pyc b/Game_Client/Classes/System/Network/__pycache__/EventHandler.cpython-311.pyc index 0e8c79b0c155fb6913f508d8196c64c5d7f0df72..525d7ce86b9a588df9e7ed20f55ada06578dec7b 100644 GIT binary patch delta 427 zcmX@gcYvR7IWI340}yQZGb@#YWh37PMlNO`7lc2@OlD-Uh!iYg1Sx=k6qaQ`-fFlA zBSQ*9Fc@pH`rTqpElbTSxy723pPrd_i?g^Sv8W_HF*mh}8$>FA`Nf)yw^$2`GV@9% zG5LCV0F7;6xWO$n!Tbuh^o;UL+-e^f*f<3r@CbCc+~5_N5PpSMc7gOIUY!pN%$$Nx zc?2iuUgS}@!lQ73N8tuY(Fb;*I8btO5tAjW7|^(tlQ%QDin6l;1<{Ggyv*krg*M-1 zj$@RQ1}ZHQ0TRVbKte&Gh#MpTGN4K()Mc_BlN6)qa^fIyuxdUK3#?2Q!~zk5 zlLOd%3_vVR<|0;*C<{yqP0ue5o80`A(wtPgB8|ys*km-g8G$auBtC+~z91x|CJV5e F0s!^PVBP=# delta 325 zcmX@Wf0U1JIWI340}vbto}QY=ypeAMBNr2p%M8Syl_uA)D2k^r1T$zd``uzqElbTS zxy723pPrewl3{Wrldq~WP+0@R4Q`IgB+uvP{a)q5S@IM zRgqC}@_W{Oa$+C>urfXn3oI`UVu1+W$*0+T#6c`g<|0;*C<{!gNNBPiyM(J6kk1Ij m#Th{212ZEd;|&Jh1~B}<#?A