Skip to content

Commit 94fe22f

Browse files
bug fix
1 parent 08ec7b2 commit 94fe22f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lelonmo/socket_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def main(host="localhost"):
121121
wb.add("You are logged in as", persist_data.DATA["online"]["name"])
122122

123123
wb.add(f"Joining the game hosted at {host}")
124-
player_id = join_game(host, wb)
124+
player_id = join_game(wb, host)
125125
wb.add("Joined successfully")
126126
admin = False
127127
if player_id == 0: # Player id =

server/socket_server.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99

1010

1111
class Game():
12-
def __init__(self):
12+
def __init__(self, LANGUAGE):
1313
self.state = 0
1414
print("[I] Waiting for admin ...")
1515
self.game_data = dict(players=list())
16+
self.LANGUAGE = LANGUAGE
1617

1718
def _new_player(self, uuid, name, ip, status="Connected"):
1819
self.game_data["players"].append(
@@ -93,7 +94,7 @@ def handle_data(self, data: str, client_socket, client_thread):
9394
uuid)]["status"] = "Playing"
9495
elif not self._get_player_id(uuid) == -1:
9596
if self.game_data["players"][self._get_player_id(uuid)]["status"] != "Finished":
96-
if word_check.check_dict(msg, LANGUAGE) and word_check.check_list(msg, self.game_data["letters"]):
97+
if word_check.check_dict(msg, self.LANGUAGE) and word_check.check_list(msg, self.game_data["letters"]):
9798
self._answer("valid%", client_socket)
9899
self.game_data["players"][self._get_player_id(
99100
uuid)]["status"] = "Finished"
@@ -149,7 +150,7 @@ def run(self):
149150
self.tcpsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
150151
self.tcpsock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
151152
self.tcpsock.bind(("", self.port))
152-
game = Game()
153+
game = Game("fr")
153154
while True:
154155
self.tcpsock.listen(10)
155156
(self.clientsocket, (ip, port)) = self.tcpsock.accept()

0 commit comments

Comments
 (0)