diff --git a/Game Server/Classes/Game/__pycache__/Player.cpython-312.pyc b/Game Server/Classes/Game/__pycache__/Player.cpython-312.pyc index 2da2dba..db7e217 100644 Binary files a/Game Server/Classes/Game/__pycache__/Player.cpython-312.pyc and b/Game Server/Classes/Game/__pycache__/Player.cpython-312.pyc differ diff --git a/Game Server/Classes/System/GameManager.py b/Game Server/Classes/System/GameManager.py index c64961f..0ff21f7 100644 --- a/Game Server/Classes/System/GameManager.py +++ b/Game Server/Classes/System/GameManager.py @@ -52,7 +52,7 @@ class GameManager: self.logger.info("game manager is starting the game") for userAddr in self.__users.keys(): try: - user = self.__serverWorld.getPlayers[userAddr]["player"] + user = self.__players[userAddr]["player"] user.addMana(1000) user.adjustHP(1000) user.shuffleDeck() diff --git a/Game Server/Classes/System/Network/NetworkManger.py b/Game Server/Classes/System/Network/NetworkManger.py index f3c480c..0f4ffb3 100644 --- a/Game Server/Classes/System/Network/NetworkManger.py +++ b/Game Server/Classes/System/Network/NetworkManger.py @@ -91,7 +91,8 @@ class NetworkManager: self.__gameManager.getLogger().info(f"confirming login for user") self.send({ - "event":"loginresponse", + "event": "loginresponse", + "status": "success", "id": user[client_address]["player"].getID(), }, client_address) diff --git a/Game Server/Classes/System/__pycache__/GameManager.cpython-312.pyc b/Game Server/Classes/System/__pycache__/GameManager.cpython-312.pyc index cbcb0b9..e7c834e 100644 Binary files a/Game Server/Classes/System/__pycache__/GameManager.cpython-312.pyc and b/Game Server/Classes/System/__pycache__/GameManager.cpython-312.pyc differ diff --git a/Game Server/log/fiarrhfr.log b/Game Server/log/fiarrhfr.log new file mode 100644 index 0000000..341857e --- /dev/null +++ b/Game Server/log/fiarrhfr.log @@ -0,0 +1,29 @@ +10:37:09,378 root INFO starting up server +10:37:09,379 root INFO starting up game manager +10:37:09,379 root INFO preparing to start server +10:37:09,379 root INFO starting up network manager +10:37:09,379 root INFO starting up network manager +10:37:09,379 root INFO starting up tcp server +10:37:09,380 root INFO starting up thread for client socket accepting +10:40:46,771 root INFO Connected with ('127.0.0.1', 51297) +10:40:46,771 root INFO starting client handler thread for client at address ('127.0.0.1', 51297) +10:40:46,773 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:40:46,773 root INFO user in message None +10:40:46,774 root INFO user logging in +10:40:46,774 root INFO task passed off to gameManager +10:40:46,774 root INFO creating user with id: > +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_Client/Classes/Game/Events/Login.py b/Game_Client/Classes/Game/Events/Login.py index 365406f..0a5717a 100644 --- a/Game_Client/Classes/Game/Events/Login.py +++ b/Game_Client/Classes/Game/Events/Login.py @@ -1,12 +1,11 @@ import json import pygame -from Classes.System.Network.TCPClient import TCPClient from Classes.Game.World import World from Classes.Game.Player import Player # event the client sends to let the server know it logged in -def Login(tcpClient:TCPClient): +def Login(tcpClient): payload = { "event":"login", "username": "player", diff --git a/Game_Client/Classes/Game/Events/__pycache__/GameStart.cpython-311.pyc b/Game_Client/Classes/Game/Events/__pycache__/GameStart.cpython-311.pyc index 16e7390..cd25649 100644 Binary files a/Game_Client/Classes/Game/Events/__pycache__/GameStart.cpython-311.pyc and b/Game_Client/Classes/Game/Events/__pycache__/GameStart.cpython-311.pyc differ diff --git a/Game_Client/Classes/Game/Events/__pycache__/Login.cpython-311.pyc b/Game_Client/Classes/Game/Events/__pycache__/Login.cpython-311.pyc index a50672e..448498c 100644 Binary files a/Game_Client/Classes/Game/Events/__pycache__/Login.cpython-311.pyc and b/Game_Client/Classes/Game/Events/__pycache__/Login.cpython-311.pyc differ diff --git a/Game_Client/Classes/Game/Events/__pycache__/PlaceCard.cpython-311.pyc b/Game_Client/Classes/Game/Events/__pycache__/PlaceCard.cpython-311.pyc index f7eca6e..82f3101 100644 Binary files a/Game_Client/Classes/Game/Events/__pycache__/PlaceCard.cpython-311.pyc and b/Game_Client/Classes/Game/Events/__pycache__/PlaceCard.cpython-311.pyc differ diff --git a/Game_Client/Classes/Game/__pycache__/Player.cpython-311.pyc b/Game_Client/Classes/Game/__pycache__/Player.cpython-311.pyc index 81c3a64..3a363f1 100644 Binary files a/Game_Client/Classes/Game/__pycache__/Player.cpython-311.pyc and b/Game_Client/Classes/Game/__pycache__/Player.cpython-311.pyc differ 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 e60a3e6..9766f6d 100644 Binary files a/Game_Client/Classes/System/Network/__pycache__/EventHandler.cpython-311.pyc and b/Game_Client/Classes/System/Network/__pycache__/EventHandler.cpython-311.pyc differ diff --git a/Game_Client/Classes/System/__pycache__/App.cpython-311.pyc b/Game_Client/Classes/System/__pycache__/App.cpython-311.pyc index be962d3..290dcf6 100644 Binary files a/Game_Client/Classes/System/__pycache__/App.cpython-311.pyc and b/Game_Client/Classes/System/__pycache__/App.cpython-311.pyc differ