From 588483ca2d648fb8d280e550d3df8c0b3ecdbd33 Mon Sep 17 00:00:00 2001 From: steev Date: Mon, 15 Jan 2024 13:29:19 +0100 Subject: [PATCH] serverside gamemanager can start game but fails on nontype subscription error --- .vscode/launch.json | 2 +- Game Server/Classes/Game/Player.py | 1 + .../Game/__pycache__/Player.cpython-312.pyc | Bin 3276 -> 3302 bytes Game Server/Classes/System/GameManager.py | 20 ++--- .../Classes/System/Network/EventHandler.py | 14 +++ .../Classes/System/Network/NetworkManger.py | 1 + .../__pycache__/EventHandler.cpython-312.pyc | Bin 1503 -> 2239 bytes .../__pycache__/NetworkManger.cpython-312.pyc | Bin 10348 -> 10459 bytes .../__pycache__/GameManager.cpython-312.pyc | Bin 4910 -> 5048 bytes Game Server/log/fiarrhfr.log | 29 ------ Game Server/log/nlwaonqh.log | 83 ------------------ Game Server/log/sokyhrdv.log | 29 ------ Game Server/log/ylpfvlxp.log | 30 ------- Game Server/log/zscmixee.log | 30 ------- Game_Client/Classes/Game/World.py | 10 +-- .../Game/__pycache__/World.cpython-311.pyc | Bin 10501 -> 10535 bytes .../Classes/System/Components/Label.py | 1 + .../__pycache__/Label.cpython-311.pyc | Bin 3655 -> 3692 bytes 18 files changed, 31 insertions(+), 219 deletions(-) delete mode 100644 Game Server/log/fiarrhfr.log delete mode 100644 Game Server/log/nlwaonqh.log delete mode 100644 Game Server/log/sokyhrdv.log delete mode 100644 Game Server/log/ylpfvlxp.log delete mode 100644 Game Server/log/zscmixee.log diff --git a/.vscode/launch.json b/.vscode/launch.json index a8b7a75..720a496 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -8,7 +8,7 @@ "name": "Python:app", "type": "python", "request": "launch", - "program": "Game Client/main.py", + "program": "main.py", "console": "integratedTerminal", "justMyCode": true } diff --git a/Game Server/Classes/Game/Player.py b/Game Server/Classes/Game/Player.py index 81a6bb2..4578d56 100644 --- a/Game Server/Classes/Game/Player.py +++ b/Game Server/Classes/Game/Player.py @@ -14,6 +14,7 @@ class Player: self.__handCards = [] self.__deck = deck self.__id = random.randint(3, 99999) + self.__mana = mana def shuffleDeck(self): self.__deck = random.shuffle(self.__deck) diff --git a/Game Server/Classes/Game/__pycache__/Player.cpython-312.pyc b/Game Server/Classes/Game/__pycache__/Player.cpython-312.pyc index db7e217a25b1d1e45a231a7e98e943c9e36a7278..ff481bfc3886ce33fe5e31c52046bfaa6ccb1132 100644 GIT binary patch delta 201 zcmX>j`Am}cG%qg~0}wRGEloAv$oq_uv0?HT#$vV_mKuh5_Q~-~5{w*^E10yHir6R5 zXPU)mG1-dQh_i?DhL}_bOE352JmzhT!jn~5rZ9?4-o?_yC^^}dwTMw>@&?v9jPjFx z*_s)ZCSPPLV^p2&!QR5CG5IX}Tt@B5*&H_+^(XJ)lA0XP*~Dl(`4Q($MzhU(xY!sK s*;u7#IDcROQVUYR)QVy-wIlg6Nbr-uN@9>&1Dtux95=CM_djX^NJD&gm diff --git a/Game Server/Classes/System/GameManager.py b/Game Server/Classes/System/GameManager.py index 0ff21f7..162f08e 100644 --- a/Game Server/Classes/System/GameManager.py +++ b/Game Server/Classes/System/GameManager.py @@ -43,31 +43,29 @@ class GameManager: # this section mostly only used by the networking and event handling classes # other parts should never need to interface with this unless really required # ============================================================================= - def startGame(self, tcpSocket:socket): + def startGame(self, tcpSocket: socket): self.__state = "running" - players = list(self.__serverWorld.getPlayers) + players = list(self.__players.values()) print("game starts") self.logger.info("game manager is starting the game") - for userAddr in self.__users.keys(): + for userAddr, player_data in self.__players.items(): try: - user = self.__players[userAddr]["player"] + user = player_data["player"] user.addMana(1000) user.adjustHP(1000) user.shuffleDeck() cards = user.getDeck() user.setHand(cards[:5]) - enemy = players[0]["player"] + # iterates until the enemy player is not anymore equal to current player + enemy = next(player_data["player"] for player_data in players if player_data["player"] != user) - if enemy == user: - enemy = players[1]["player"] - payload = { - "event":"startgame", + "event": "startgame", "player": { - "mana":user.getMana(), + "mana": user.getMana(), "hp": user.getHP(), "hand": user.getHand() }, @@ -82,8 +80,6 @@ class GameManager: except Exception as e: self.logger.error(f"failed to start game due to error: {e}") break - # handles notifying all players that the game starts - pass def stopGame(self): # handles notifying all players that the game stops diff --git a/Game Server/Classes/System/Network/EventHandler.py b/Game Server/Classes/System/Network/EventHandler.py index a9cd090..0a32ef2 100644 --- a/Game Server/Classes/System/Network/EventHandler.py +++ b/Game Server/Classes/System/Network/EventHandler.py @@ -15,6 +15,20 @@ class TCPEventHandler: def handleTCPEvents(self, event, gameManager:GameManager, address): gameManager.getLogger().info(f"incommingevent {event}") if event["event"] == "PlaceCard": + gameManager.getLogger().info(f"player {event['user']} attempted to place card {event['card']}") + for playerKey in gameManager.getPlayers().keys(): + player = gameManager.getPlayers()[playerKey] + if int(event["user"]) != player["player"].getID(): + payload = { + "event":"cardPlaced", + "card": { + "card":event["card"], + "owner": event["user"], + "x": event["x"], + "y": event["y"] + } + } + player["socket"].send(payload) pass elif event["event"] == "MoveCard": pass diff --git a/Game Server/Classes/System/Network/NetworkManger.py b/Game Server/Classes/System/Network/NetworkManger.py index 0f4ffb3..930dc30 100644 --- a/Game Server/Classes/System/Network/NetworkManger.py +++ b/Game Server/Classes/System/Network/NetworkManger.py @@ -93,6 +93,7 @@ class NetworkManager: self.send({ "event": "loginresponse", "status": "success", + "username": user[client_address]["player"].getName(), "id": user[client_address]["player"].getID(), }, client_address) diff --git a/Game Server/Classes/System/Network/__pycache__/EventHandler.cpython-312.pyc b/Game Server/Classes/System/Network/__pycache__/EventHandler.cpython-312.pyc index fc97bd5e938289e59a673294dae3d6d2b004b7fe..3ad84862257672b69fc76e2a4fa40b15aa9001ec 100644 GIT binary patch delta 1008 zcmZ`&+iTNM7(XXXdRwx&wd?FkXUZ-%L#(dMUDzCB!wX&zLPz(U;+~8VBjIk>|&0 zMh`G!Ft49rqFFWrWzJ8+&w*?wwxeplV7DL%5`iGY#JQ^dH*Os|amxFTSh-O!bq|0Q z_Wul7+L>YL&=pQ|Sv=NK))E;`cG8-7ja6}^tzn5C093fzC%dd;SS&=lX*ba|RLlGZ zD+?RUiapcE$+Z8gU_%8x6a{Z03;>3- zLu%CbnYQe*BQ+mOBP^QiB6(BGelezLXd$H`S=1DfB&U%$9m6sypvtsY>rFTHZqT%B z!iOeIODy)16-`cgkVF_a5gQ*TAThX}+BAvjO`6VY$`Tr(WNtlVyPkEJt{J3VRc2-o zHrcu4eZ_Q>03j!fsV191Y1OpNB{h>H;me~YtD>YVIWWETDtR5{b;M*DBULqB)g7;( zG;XXUQnB>B5|dT>O^8*&Jk8Y2#*+GLTNm>P>R)YVvP~sEWbmOP-&*3s1|QD#Z(!ti)u;%*@}V@%8z#^(xB{5_x835H9-s1b}7gWaWIzY**&1_urRFGSZ|JN~wk zKVtYJMgQ5nWcUZx?4LcpwZ-+@Pgjbb_M9*8G^DnAs z)axGhBka__v%St1PRIv-f)>4#Q!Yfvp>Zt*di>wcfdxfgoJZ$zl(_WIQUe6aHVEM- XAnbyUUC{Lnbo{cnL*W1rs5Jip@}2k` delta 347 zcmdllc%Pf^G%qg~0}zlXtN? zFzsNN{D;+mQDE|Cwrh+slTWc*a0sySZjk=MATXJWBi~ICsIZ6+MDPHKUmP~M`6;D2 tsdh!GKrSN?7fS<)56p~=jJFwh?=q;}WiWcmp!S_joRRkv1CRh~1^{%DOt%04 diff --git a/Game Server/Classes/System/Network/__pycache__/NetworkManger.cpython-312.pyc b/Game Server/Classes/System/Network/__pycache__/NetworkManger.cpython-312.pyc index bdfd0fca332ae39b461fb1a40306309116b8c8f3..549b343a46fb6700fbe937976e295e2e22678138 100644 GIT binary patch delta 975 zcmYk1Z%h+s9LJyEU3=G7DP8|TTc`z^JIapMfo8}YQ&3S*tPJLyOz7x|7NPa-YQY`q zk}ZqIDDh`v4Diy##ATVeHzrHw7JUUq)@UZtSHAF-dr^$ZlD$~Ghw9?*#V6nUet*w% z-{C9UC0d99k-ut9xrU7qTg7LI_-l8+N7+Q@GAUerJ%ldtm@5zXG**#O~(V01t z_MWxOkp;^wz+uM*D>KVnoX5{R)3yJl$qavnFF=7zv4=?#`<=F;u;Yo)Qxtk0342%VRxw<1kVyRXI%{pBU8!<ofUED17itJJyXF5xw)pV95mgn;#X)U)UlFjU&&DLa#ak$nF+-~!oN*89rK^Vjz!W}SW+z-D5SJ|iGmlTKa zZp8P=AeA3e446&&j`%;ssF&g+lU$1km_HUt-!(9z=IEwj(<%+M(g_u=2O83U_K(vKBM&)rlAKeTWjJweS zaAVXtf?I_an82(Mg-du<*c%_F_6S9aV(p4is=lG1jg>}<2?`mVVs!l!SesS}Wl6&h xaf_>qX5$n!6gm7+ycCqFj8V|n{%hMhkxl1M$Q{ZQCK}_FI~nl4B9v=OZvZ(E`ndoA delta 874 zcmYL{TSyd97{|{yvpef;w{T!@b!AIaSXROw2#P&k5S6;sbdsR%xCnLs@EdQE;O%KG9aK_aP z`!T_N01DKQ+Y5~XdF84y)$-)EuO_`tAhUd89na2Y7S^S*(PU0@qN#e#iSjJff;Hr3 zqlH!Cp%iw`5zsiF!fV!iP9Wr97aaPKTb)f$gzOsa)XH8BD|%_Lw?DkX$!9wIB-zI* z^qQ4MT+0Z;kXoAg1FHWwD^0Z4OyQ*1rNO7$Oi-hYqCrDgry)xliicV?*q-f%bLv>O z1K={=$hn?;B<@oj$I{#gSDbhrVmZ*RVxMEnxeg0qI6Mo;HW1rWeD^I ztAsMvj}JT*W_mfwX$m(*FaGgNq;*h9-%k8k>j`^$`=r4hIj9WcU9W#fH3PQagfiar E55ch2d;kCd diff --git a/Game Server/Classes/System/__pycache__/GameManager.cpython-312.pyc b/Game Server/Classes/System/__pycache__/GameManager.cpython-312.pyc index e7c834ead91c75e7e707d28f991bac0ab627ec61..eda5f76007246fe45ad9999f5cf1e414fa0b2328 100644 GIT binary patch delta 1067 zcmYjQO>7%Q6rR~X@2=N&;-q$3Z{2NNC$Z$1q^W=q6R1d&v|!YfN)?c#U9ww4;@Huw z1Ee@@QHw~b92`9$94gWBqk<|BRaL1MBzhp1USbS1aw+1_14q*!H4O)taVRj-e*4Wg z@4cBf@6A^&*IT_eJsuU&p+`QmH|nll(OmADf2z zP!W$%r(q7ES$@L)$d+=RFG%AN zItjr$uB51*=PfrZyC$#)cFTLQ26?%i@{i^Hr^fz?Sc^;3MP2k;dxFCI_*sO}5-Ok( zKTQu8u!UG^^W4N^2swB`d#HSXmoP>PjRKm%U-EC@7)O}l^IxDCU*QrR757xeoUzGK z%gmb6Dq+kiP~r_8LGwn@UtnN>gYr%tpA4APowYk+}Cfd3=OZ0*rlQ4E92SnQ1-)@KX3YR`|gsSd*H~_@{A{h z7u681D7C<8a}xfN4crQbazG;zwWvt1o0(}Fib|s>zLvKq;Txq(Btg0aRpkg)VNl)P zNt&6dIA#*dA#uiCQ|3%2XId3(lL!?Y)=I|1@iZ)|@yJW`s_8*jgT|b&pxyNciut9J zizjad2DX8g>ZkHxZEc8x5KEmOCSc#`i$0zUw~^`CR$O` zcK%?klFo_1|I75BK63Rb&(9dAK=&PL>7W}B)=HaK%V+E?8KBdcK)g(42OueU&$k!9 za`h+QQS7gIusYBds+kPIKz%nR@OFK1M~ay&%oJ6p~_>7ZzK0@xa->y?_ayfv9Pc3I0XP|vl&50eWPxNB7=YB*hS3+!=T-pepcS^;iaWPhAL z?Vz)?)=5xdDK4>THg1D}*{fyaRsTns>{87mhDgpbUE&CJ!E?T$HLX!}C*pjXPqR}^ z41@JV(VtWlfrM&kp7!t_lR8Qur(@YPANQ3fiZ09>e&&=(}fxH~pk=yff`?mEQJTQ9N9qv^zEABV~c}HN| zapsWm3ig$OlEx$1cV*Yf#QJz%?%rI?%LDM)c&V-E@a9m~kPGD(TN@vx zJ%ol}%{<}{l2zP6fqt-pHlfboKEeVlrvDPt9(V{m6+LKjW1=F8tmOnX2Q>dIS0Qid zM0dex&3K2Xo#ycX1=*CK-Z3u>KzUqETEfmZI cj`UsAv&wuz?Z!9Yk> -10:40:46,774 root INFO new length of user dictionary: 1 -10:40:46,774 root INFO connected users 1 -10:40:46,775 root INFO confirming login for user -10:40:46,775 root INFO incommingevent {'event': 'login', 'username': 'player', 'deck': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]} -10:40:46,775 root INFO Received message from ('127.0.0.1', 51297): {"event": "login", "username": "player", "deck": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]} -10:41:00,103 root INFO Connected with ('127.0.0.1', 51299) -10:41:00,103 root INFO starting client handler thread for client at address ('127.0.0.1', 51299) -10:41:00,104 root INFO decoded message {'event': 'login', 'username': 'player', 'deck': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]} -10:41:00,104 root INFO user in message None -10:41:00,104 root INFO user logging in -10:41:00,104 root INFO task passed off to gameManager -10:41:00,104 root INFO creating user with id: > -10:41:00,104 root INFO new length of user dictionary: 2 -10:41:00,105 root INFO 2 players have join game starts -10:41:28,589 root INFO Connection with ('127.0.0.1', 51297) closed. diff --git a/Game Server/log/nlwaonqh.log b/Game Server/log/nlwaonqh.log deleted file mode 100644 index 262c4f9..0000000 --- a/Game Server/log/nlwaonqh.log +++ /dev/null @@ -1,83 +0,0 @@ -07:54:39,940 root INFO starting up server -07:54:39,941 root INFO starting up game manager -07:54:39,941 root INFO preparing to start server -07:54:39,941 root INFO starting up network manager -07:54:39,941 root INFO starting up network manager -07:54:39,941 root INFO starting up tcp server -07:54:39,943 root INFO starting up thread for client socket accepting -07:54:53,468 root INFO Connected with ('127.0.0.1', 50377) -07:54:53,469 root INFO starting client handler thread for client at address ('127.0.0.1', 50377) -07:54:53,470 root INFO decoded message {'event': 'login', 'username': 'player', 'deck': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]} -07:54:53,471 root INFO user in message None -07:54:53,471 root INFO user logging in -07:54:53,471 root INFO task passed off to gameManager -07:54:53,471 root INFO creating user with id: > -07:54:53,471 root INFO new length of user dictionary: 1 -07:54:53,471 root INFO connected users 1 -07:54:53,472 root INFO confirming login for user -07:54:53,472 root INFO incommingevent {'event': 'login', 'username': 'player', 'deck': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]} -07:54:53,472 root INFO Received message from ('127.0.0.1', 50377): {"event": "login", "username": "player", "deck": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]} -07:55:54,122 root ERROR Connection with ('127.0.0.1', 50377) forcibly closed by remote host. -07:55:54,122 root INFO removing player with address '('127.0.0.1', 50377)' from players database -07:55:54,122 root INFO new player length 0 -07:55:57,266 root INFO Connected with ('127.0.0.1', 50382) -07:55:57,266 root INFO starting client handler thread for client at address ('127.0.0.1', 50382) -07:55:57,267 root INFO decoded message {'event': 'login', 'username': 'player', 'deck': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]} -07:55:57,267 root INFO user in message None -07:55:57,267 root INFO user logging in -07:55:57,268 root INFO task passed off to gameManager -07:55:57,269 root INFO creating user with id: > -07:55:57,270 root INFO new length of user dictionary: 1 -07:55:57,270 root INFO connected users 1 -07:55:57,271 root INFO confirming login for user -07:55:57,271 root INFO incommingevent {'event': 'login', 'username': 'player', 'deck': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]} -07:55:57,272 root INFO Received message from ('127.0.0.1', 50382): {"event": "login", "username": "player", "deck": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]} -07:56:20,208 root ERROR Connection with ('127.0.0.1', 50382) forcibly closed by remote host. -07:56:20,208 root INFO removing player with address '('127.0.0.1', 50382)' from players database -07:56:20,208 root INFO new player length 0 -07:59:44,914 root INFO Connected with ('127.0.0.1', 50416) -07:59:44,915 root INFO starting client handler thread for client at address ('127.0.0.1', 50416) -07:59:44,921 root INFO decoded message {'event': 'login', 'username': 'player', 'deck': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]} -07:59:44,922 root INFO user in message None -07:59:44,922 root INFO user logging in -07:59:44,922 root INFO task passed off to gameManager -07:59:44,923 root INFO creating user with id: > -07:59:44,923 root INFO new length of user dictionary: 1 -07:59:44,923 root INFO connected users 1 -07:59:44,923 root INFO confirming login for user -07:59:44,924 root INFO incommingevent {'event': 'login', 'username': 'player', 'deck': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]} -07:59:44,925 root INFO Received message from ('127.0.0.1', 50416): {"event": "login", "username": "player", "deck": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]} -07:59:47,51 root INFO decoded message {'event': 'placecard', 'card': 1, 'type': 'MonsterCard', 'x': 422.0, 'y': 540.0} -07:59:47,52 root INFO user in message None -07:59:47,52 root INFO incommingevent {'event': 'placecard', 'card': 1, 'type': 'MonsterCard', 'x': 422.0, 'y': 540.0} -07:59:47,52 root INFO Received message from ('127.0.0.1', 50416): {"event": "placecard", "card": 1, "type": "MonsterCard", "x": 422.0, "y": 540.0} -07:59:48,65 root INFO decoded message {'event': 'placecard', 'card': 1, 'type': 'MonsterCard', 'x': 422.0, 'y': 540.0} -07:59:48,65 root INFO user in message None -07:59:48,66 root INFO incommingevent {'event': 'placecard', 'card': 1, 'type': 'MonsterCard', 'x': 422.0, 'y': 540.0} -07:59:48,66 root INFO Received message from ('127.0.0.1', 50416): {"event": "placecard", "card": 1, "type": "MonsterCard", "x": 422.0, "y": 540.0} -08:08:21,501 root ERROR Connection with ('127.0.0.1', 50416) forcibly closed by remote host. -08:08:21,501 root INFO removing player with address '('127.0.0.1', 50416)' from players database -08:08:21,502 root INFO new player length 0 -08:08:29,119 root INFO Connected with ('127.0.0.1', 50487) -08:08:29,120 root INFO starting client handler thread for client at address ('127.0.0.1', 50487) -08:08:29,129 root INFO decoded message {'event': 'login', 'username': 'player', 'deck': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]} -08:08:29,129 root INFO user in message None -08:08:29,129 root INFO user logging in -08:08:29,129 root INFO task passed off to gameManager -08:08:29,130 root INFO creating user with id: > -08:08:29,130 root INFO new length of user dictionary: 1 -08:08:29,130 root INFO connected users 1 -08:08:29,130 root INFO confirming login for user -08:08:29,130 root INFO incommingevent {'event': 'login', 'username': 'player', 'deck': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]} -08:08:29,131 root INFO Received message from ('127.0.0.1', 50487): {"event": "login", "username": "player", "deck": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]} -08:08:39,319 root INFO decoded message {'event': 'placecard', 'card': 1, 'type': 'MonsterCard', 'x': 411.0, 'y': 595.0} -08:08:39,320 root INFO user in message None -08:08:39,320 root INFO incommingevent {'event': 'placecard', 'card': 1, 'type': 'MonsterCard', 'x': 411.0, 'y': 595.0} -08:08:39,320 root INFO Received message from ('127.0.0.1', 50487): {"event": "placecard", "card": 1, "type": "MonsterCard", "x": 411.0, "y": 595.0} -08:08:39,697 root INFO decoded message {'event': 'placecard', 'card': 1, 'type': 'MonsterCard', 'x': 411.0, 'y': 595.0} -08:08:39,698 root INFO user in message None -08:08:39,698 root INFO incommingevent {'event': 'placecard', 'card': 1, 'type': 'MonsterCard', 'x': 411.0, 'y': 595.0} -08:08:39,698 root INFO Received message from ('127.0.0.1', 50487): {"event": "placecard", "card": 1, "type": "MonsterCard", "x": 411.0, "y": 595.0} -08:10:00,576 root ERROR Connection with ('127.0.0.1', 50487) forcibly closed by remote host. -08:10:00,576 root INFO removing player with address '('127.0.0.1', 50487)' from players database -08:10:00,576 root INFO new player length 0 diff --git a/Game Server/log/sokyhrdv.log b/Game Server/log/sokyhrdv.log deleted file mode 100644 index 5735db2..0000000 --- a/Game Server/log/sokyhrdv.log +++ /dev/null @@ -1,29 +0,0 @@ -19:08:13,964 root INFO starting up server -19:08:13,964 root INFO starting up game manager -19:08:13,965 root INFO preparing to start server -19:08:13,965 root INFO starting up network manager -19:08:13,965 root INFO starting up network manager -19:08:13,965 root INFO starting up tcp server -19:08:13,967 root INFO starting up thread for client socket accepting -19:08:18,567 root INFO Connected with ('127.0.0.1', 54324) -19:08:18,567 root INFO starting client handler thread for client at address ('127.0.0.1', 54324) -19:08:18,580 root INFO decoded message {'event': 'login', 'username': 'player', 'deck': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]} -19:08:18,588 root INFO user in message None -19:08:18,588 root INFO user logging in -19:08:18,589 root INFO task passed off to gameManager -19:08:18,589 root INFO creating user with id: > -19:08:18,589 root INFO new length of user dictionary: 1 -19:08:18,589 root INFO connected users 1 -19:08:18,589 root INFO confirming login for user -19:08:18,590 root INFO incommingevent {'event': 'login', 'username': 'player', 'deck': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]} -19:08:18,590 root INFO Received message from ('127.0.0.1', 54324): {"event": "login", "username": "player", "deck": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]} -19:10:33,867 root ERROR Connection with ('127.0.0.1', 54324) forcibly closed by remote host. -19:10:36,58 root INFO Connected with ('127.0.0.1', 54355) -19:10:36,58 root INFO starting client handler thread for client at address ('127.0.0.1', 54355) -19:10:36,60 root INFO decoded message {'event': 'login', 'username': 'player', 'deck': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]} -19:10:36,60 root INFO user in message None -19:10:36,60 root INFO user logging in -19:10:36,62 root INFO task passed off to gameManager -19:10:36,63 root INFO creating user with id: > -19:10:36,63 root INFO new length of user dictionary: 2 -19:10:36,63 root INFO 2 players have join game starts diff --git a/Game Server/log/ylpfvlxp.log b/Game Server/log/ylpfvlxp.log deleted file mode 100644 index 4b9dfa8..0000000 --- a/Game Server/log/ylpfvlxp.log +++ /dev/null @@ -1,30 +0,0 @@ -07:50:55,550 root INFO starting up server -07:50:55,550 root INFO starting up game manager -07:50:55,551 root INFO preparing to start server -07:50:55,551 root INFO starting up network manager -07:50:55,551 root INFO starting up network manager -07:50:55,551 root INFO starting up tcp server -07:50:55,553 root INFO starting up thread for client socket accepting -07:51:04,118 root INFO Connected with ('127.0.0.1', 50258) -07:51:04,119 root INFO starting client handler thread for client at address ('127.0.0.1', 50258) -07:51:04,120 root INFO decoded message {'event': 'login', 'username': 'player', 'deck': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]} -07:51:04,121 root INFO user in message None -07:51:04,121 root INFO user logging in -07:51:04,121 root INFO task passed off to gameManager -07:51:04,121 root INFO creating user with id: > -07:51:04,121 root INFO new length of user dictionary: 1 -07:51:04,121 root INFO connected users 1 -07:51:04,122 root INFO confirming login for user -07:51:04,122 root INFO incommingevent {'event': 'login', 'username': 'player', 'deck': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]} -07:51:04,122 root INFO Received message from ('127.0.0.1', 50258): {"event": "login", "username": "player", "deck": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]} -07:51:05,932 root ERROR Connection with ('127.0.0.1', 50258) forcibly closed by remote host. -07:51:05,933 root INFO new player length 1 -07:51:25,370 root INFO Connected with ('127.0.0.1', 50263) -07:51:25,371 root INFO starting client handler thread for client at address ('127.0.0.1', 50263) -07:51:25,372 root INFO decoded message {'event': 'login', 'username': 'player', 'deck': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]} -07:51:25,372 root INFO user in message None -07:51:25,372 root INFO user logging in -07:51:25,372 root INFO task passed off to gameManager -07:51:25,372 root INFO creating user with id: > -07:51:25,372 root INFO new length of user dictionary: 2 -07:51:25,372 root INFO 2 players have join game starts diff --git a/Game Server/log/zscmixee.log b/Game Server/log/zscmixee.log deleted file mode 100644 index bda7c19..0000000 --- a/Game Server/log/zscmixee.log +++ /dev/null @@ -1,30 +0,0 @@ -07:48:23,537 root INFO starting up server -07:48:23,538 root INFO starting up game manager -07:48:23,538 root INFO preparing to start server -07:48:23,538 root INFO starting up network manager -07:48:23,538 root INFO starting up network manager -07:48:23,539 root INFO starting up tcp server -07:48:23,541 root INFO starting up thread for client socket accepting -07:48:36,336 root INFO Connected with ('127.0.0.1', 50229) -07:48:36,337 root INFO starting client handler thread for client at address ('127.0.0.1', 50229) -07:48:36,369 root INFO decoded message {'event': 'login', 'username': 'player', 'deck': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]} -07:48:36,370 root INFO user in message None -07:48:36,371 root INFO user logging in -07:48:36,372 root INFO task passed off to gameManager -07:48:36,372 root INFO creating user with id: > -07:48:36,372 root INFO new length of user dictionary: 1 -07:48:36,372 root INFO connected users 1 -07:48:36,372 root INFO confirming login for user -07:48:36,374 root INFO incommingevent {'event': 'login', 'username': 'player', 'deck': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]} -07:48:36,374 root INFO Received message from ('127.0.0.1', 50229): {"event": "login", "username": "player", "deck": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]} -07:48:47,859 root ERROR Connection with ('127.0.0.1', 50229) forcibly closed by remote host. -07:48:47,859 root INFO new player length 1 -07:49:03,206 root INFO Connected with ('127.0.0.1', 50235) -07:49:03,207 root INFO starting client handler thread for client at address ('127.0.0.1', 50235) -07:49:03,207 root INFO decoded message {'event': 'login', 'username': 'player', 'deck': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]} -07:49:03,208 root INFO user in message None -07:49:03,208 root INFO user logging in -07:49:03,208 root INFO task passed off to gameManager -07:49:03,208 root INFO creating user with id: > -07:49:03,208 root INFO new length of user dictionary: 2 -07:49:03,208 root INFO 2 players have join game starts diff --git a/Game_Client/Classes/Game/World.py b/Game_Client/Classes/Game/World.py index 56212a8..13f2937 100644 --- a/Game_Client/Classes/Game/World.py +++ b/Game_Client/Classes/Game/World.py @@ -55,11 +55,11 @@ class World(): pManaPos = pygame.Vector2(20, pRow2Height + 255) # labeling - self.__labels.append(Label("PlayerHP", self.__screen, "1000 / 1000", pHPPos)) - self.__labels.append(Label("PlayerName", self.__screen, "Player", pNamePos)) - self.__labels.append(Label("PlayerName", self.__screen, "0", pManaPos)) - self.__labels.append(Label("EnemyHP", self.__screen, "1000 / 1000", eHPPos)) - self.__labels.append(Label("EnemyName", self.__screen, "Enemy", eNamePos)) + self.__labels.append(Label("PlayerHP", self.__screen, "0 / 0", pHPPos)) + self.__labels.append(Label("PlayerName", self.__screen, "Not Connected", pNamePos)) + self.__labels.append(Label("PlayerMana", self.__screen, "0", pManaPos)) + self.__labels.append(Label("EnemyHP", self.__screen, "0 / 0", eHPPos)) + self.__labels.append(Label("EnemyName", self.__screen, "Not Connected", eNamePos)) self.__boardFields.append(BoardField("EnemyDeck", "Enemy", "Deck", eDeckPos, "Assets/Cards/0/field.png", "e-deck")) self.__boardFields.append(BoardField("EnemyGraveyard", "Enemy", "Grave", eGravePos, "Assets/Cards/0/field.png", "e-grave")) diff --git a/Game_Client/Classes/Game/__pycache__/World.cpython-311.pyc b/Game_Client/Classes/Game/__pycache__/World.cpython-311.pyc index 17d6e55b2a9f9a835c10d5dccd9e42dc19a8d767..39f05627d1c442aec5d89fdda33591d3b500cfe3 100644 GIT binary patch delta 734 zcmY+?PiWIn9Ki8C)^;!LvL@Y1yEa+>xao%Lx|2HRF8%=#ns)QgT&G~^%ciYuN2u0l zbkjKz5s|&)5WL7v!X!H=i1Z?eAT$zm3=XYT7rpCRlv>8hsWO6ql9sZ^s!D&?}8ud3w#D3vSc zXhsZ*+_AD+(vPb7;-<6tN_Fv+Q{&h#GCzpF5qfUE>nx&?+4@yWR%}_ZaN5S{22O9_ z_J{muEPce%lhaQRt#z%-b#G&Q%969ToVD<@ji(!Unil;BM<(ktmYlNXl!X-=D-Epd zJUzPRSm$5PH!^1}dCHcjES$A*wt=(eS3hx}JUtxJnXf|&%(3ttW<6YE9+05Cl9G;D z_QlKL{Vp$iYI!;!Cs3JA%74)n^Gwf4B#p8@;LrpZ*MMt4bGL53jf^4T7KC|V0k}b3i{P$*&VHR`qIewAn zotxkj-G5&xF7w}Qi`_ zgGwfq8dPEnzM;WlefYop?~nH^Sy%X{l{z)VtSM#qpKK))O!im7xBfZs zWS|DV4^+St0+u&I(s~O19DC&7ZFj+-POzimPEux7@h3U2&j#~E7=j+Rs%|{Kh*Xf) z?OFX(_g><@jNuA$6`5nZ!XLdg7~>YT56e7qjrB)fk{a9G^CLTnK|!XF(?|)KLCzxQ vkV}Y$97B#E6v6jWy^h>KZtA1Grp12?=NJ+N)@iytBVQ;f`_#KE9sBYdPu str: return self.__text diff --git a/Game_Client/Classes/System/Components/__pycache__/Label.cpython-311.pyc b/Game_Client/Classes/System/Components/__pycache__/Label.cpython-311.pyc index f0331e9668411ab81dee80a15d59b2332cf028e6..8a6188b1a9a8076418b34a16b1813cbd6fec2bdd 100644 GIT binary patch delta 308 zcmX>u^G1euIWI340}xmXE=`@Vk++PAX#?ZrjT{D(|1*hhKE)Kx$X3Hx!w}CmS(ZhH zk$FJ?c^sIobm!<>;( zeezTMS0&SUiCWR?EF03>EOgQ*p4Yxuy79l>DgK-!T!FylgW0))n0$i$ zIHU6B2^{8(jB1llaIRt0nq10th*5X51$Q2!CkLza2L>Q9!x>DiU|YinX6y(CQwP$H r