added old code, fixed it (mostly), merged some new code to the old code, made it mostly runnable
This commit is contained in:
22
New_Client/Classes/Game/NetworkEvents/Login.py
Normal file
22
New_Client/Classes/Game/NetworkEvents/Login.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import json
|
||||
import pygame
|
||||
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):
|
||||
payload = {
|
||||
"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]
|
||||
}
|
||||
|
||||
tcpClient.send(payload)
|
||||
|
||||
# server response for login event
|
||||
def LoginResponse(message:dict):
|
||||
# checks if the response on the login request is successfull
|
||||
if message["status"] != "success":
|
||||
print("login failed")
|
||||
pass
|
||||
Reference in New Issue
Block a user