added old code, fixed it (mostly), merged some new code to the old code, made it mostly runnable
This commit is contained in:
4
OLD_Server/.env
Normal file
4
OLD_Server/.env
Normal file
@ -0,0 +1,4 @@
|
||||
HOST="127.0.0.1"
|
||||
TCPPORT=54322
|
||||
UDPPORT=54323
|
||||
ENV="DEV"
|
14
OLD_Server/.vscode/settings.json
vendored
Normal file
14
OLD_Server/.vscode/settings.json
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"cSpell.words": [
|
||||
"DGRAM"
|
||||
],
|
||||
"cSpell.ignoreWords": [
|
||||
"activateeffectcard",
|
||||
"activatemonstereffect",
|
||||
"attackcard",
|
||||
"attackplayer",
|
||||
"movecard",
|
||||
"placecard",
|
||||
"removecard"
|
||||
]
|
||||
}
|
BIN
OLD_Server/Assets/Arenas/default.png
Normal file
BIN
OLD_Server/Assets/Arenas/default.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
BIN
OLD_Server/Assets/Cards/Arena/field.png
Normal file
BIN
OLD_Server/Assets/Cards/Arena/field.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 612 B |
@ -0,0 +1,22 @@
|
||||
{
|
||||
"id": 1,
|
||||
"name": "Test Monster",
|
||||
"image": "Assets/Cards/testmonstercard/cards.png",
|
||||
"description": "can attack other monsters",
|
||||
"costs": 30,
|
||||
"defense": 40,
|
||||
"attacks":[
|
||||
{
|
||||
"id": 1,
|
||||
"name":"test attack",
|
||||
"description": "can attack another Monster",
|
||||
"damage": 80
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"name":"test attack",
|
||||
"description": "can attack another Monster",
|
||||
"damage": 80
|
||||
}
|
||||
]
|
||||
}
|
BIN
OLD_Server/Assets/Cards/MonsterCards/testmonstercard/card.png
Normal file
BIN
OLD_Server/Assets/Cards/MonsterCards/testmonstercard/card.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.3 KiB |
BIN
OLD_Server/Assets/Cards/SpeelCards/testspellcard/artworkjson.png
Normal file
BIN
OLD_Server/Assets/Cards/SpeelCards/testspellcard/artworkjson.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "testspell",
|
||||
"image":"Assets/Cards/testspelltcard/artwork.png",
|
||||
"costs": 30,
|
||||
"description":"this is a test spell card"
|
||||
}
|
BIN
OLD_Server/Assets/Cards/TrapCards/testtrapcard/artworkjson.png
Normal file
BIN
OLD_Server/Assets/Cards/TrapCards/testtrapcard/artworkjson.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "testtrap",
|
||||
"image":"Assets/Cards/testtrapcard/artwork.png",
|
||||
"costs": 30,
|
||||
"description":"this is a test tryp card"
|
||||
}
|
57
OLD_Server/Classes/Game/Player.py
Normal file
57
OLD_Server/Classes/Game/Player.py
Normal file
@ -0,0 +1,57 @@
|
||||
import random
|
||||
|
||||
|
||||
class Player:
|
||||
__id:int
|
||||
__hp:int
|
||||
__mana:int
|
||||
__name:str
|
||||
__handCards:list
|
||||
__deck:list
|
||||
|
||||
def __init__(self, name:str, deck:list, hp:int=1000, mana:int=0):
|
||||
self.__hp = hp
|
||||
self.__mana = mana
|
||||
self.__name = name
|
||||
self.__handCards = []
|
||||
self.__deck = deck
|
||||
self.__id = random.randint(3, 99999)
|
||||
|
||||
def shuffleDeck(self):
|
||||
self.__deck = random.shuffle(self.__deck)
|
||||
|
||||
def getDeck(self) -> list:
|
||||
return self.__deck
|
||||
|
||||
def getName(self) -> str:
|
||||
return self.__name
|
||||
|
||||
def getHP(self) -> int:
|
||||
return self.__hp
|
||||
|
||||
def adjustHP(self, hp:int) -> int:
|
||||
self.__hp = self.__hp + hp
|
||||
|
||||
def getID(self) -> int:
|
||||
return self.__id
|
||||
|
||||
def getHand(self) -> list:
|
||||
return self.__handCards
|
||||
|
||||
def getMana(self) -> int:
|
||||
return self.__mana
|
||||
|
||||
def addMana(self, amount) -> int:
|
||||
self.__mana + amount
|
||||
return self.__mana
|
||||
|
||||
def AddToHand(self, card) -> list:
|
||||
self.__handCards.append(card)
|
||||
return self.__handCards
|
||||
|
||||
def setHand(self, hand:list):
|
||||
self.__handCards = hand
|
||||
|
||||
def removeFromHand(self, pos:int) -> list:
|
||||
self.__handCards.remove(pos)
|
||||
return self.__handCards
|
BIN
OLD_Server/Classes/Game/__pycache__/Player.cpython-311.pyc
Normal file
BIN
OLD_Server/Classes/Game/__pycache__/Player.cpython-311.pyc
Normal file
Binary file not shown.
BIN
OLD_Server/Classes/Game/__pycache__/Player.cpython-312.pyc
Normal file
BIN
OLD_Server/Classes/Game/__pycache__/Player.cpython-312.pyc
Normal file
Binary file not shown.
137
OLD_Server/Classes/System/GameManager.py
Normal file
137
OLD_Server/Classes/System/GameManager.py
Normal file
@ -0,0 +1,137 @@
|
||||
import json
|
||||
import socket
|
||||
from Classes.Game.Player import Player
|
||||
|
||||
|
||||
class GameManager:
|
||||
__players:dict
|
||||
__playingPlayer:Player
|
||||
__state:str
|
||||
__round:str
|
||||
__cards:list
|
||||
|
||||
def __init__(self, logger):
|
||||
self.__players = {}
|
||||
self.__playingPlayer = None
|
||||
self.__state = "waiting"
|
||||
self.__round = "none"
|
||||
self.logger = logger
|
||||
self.__cards = []
|
||||
pass
|
||||
|
||||
def getLogger(self):
|
||||
return self.logger
|
||||
|
||||
# card management
|
||||
def spawnCard(self, card, owner, x, y):
|
||||
self.logger("spawning card")
|
||||
|
||||
self.__cards.append(card)
|
||||
|
||||
payload = {
|
||||
"event":"PlacedCard",
|
||||
"owner": owner,
|
||||
"card": card,
|
||||
"x": x,
|
||||
"y": y,
|
||||
}
|
||||
|
||||
for userAddr in self.__players.keys():
|
||||
self.logger.info(f"send to client {self.__players[userAddr]['player'].getID() != owner}")
|
||||
if self.__players[userAddr]["player"].getID() != owner:
|
||||
self.__players[userAddr]["socket"].send(json.dumps(payload).encode())
|
||||
|
||||
# game round management
|
||||
# this section manages the flow of rounds this should inherit itself
|
||||
# =============================================================================
|
||||
|
||||
# this function iterates all
|
||||
def progressRound(self):
|
||||
# phases
|
||||
# - playerPrep => playing player switches, gets a mana point and gets verified
|
||||
if self.__playingPlayer != None:
|
||||
for player in self.__players:
|
||||
if self.__playingPlayer != player:
|
||||
self.__playingPlayer = player
|
||||
else:
|
||||
self.__playingPlayer = next(iter(self.__players))
|
||||
# - playerDraw => player draws a card
|
||||
# - playerPlay => player can place cards and active effects
|
||||
# - playerEnd => player ends his turn and the code reiterates with the remaining player
|
||||
pass
|
||||
|
||||
# game state management
|
||||
# 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):
|
||||
self.__state = "running"
|
||||
|
||||
players = list(self.__players.values())
|
||||
|
||||
print("game starts")
|
||||
self.logger.info("game manager is starting the game")
|
||||
for userAddr, player_data in self.__players.items():
|
||||
try:
|
||||
user = self.__players[userAddr]["player"]
|
||||
user.addMana(1000)
|
||||
user.adjustHP(1000)
|
||||
user.shuffleDeck()
|
||||
cards = self.__players[userAddr]["deck"]
|
||||
user.setHand(cards[:5])
|
||||
|
||||
# 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)
|
||||
|
||||
payload = {
|
||||
"event": "startgame",
|
||||
"player": {
|
||||
"mana": user.getMana(),
|
||||
"hp": user.getHP(),
|
||||
"hand": user.getHand()
|
||||
},
|
||||
"enemy": {
|
||||
"id": enemy.getID(),
|
||||
"name": enemy.getName(),
|
||||
"hp": enemy.getHP(),
|
||||
},
|
||||
}
|
||||
|
||||
tcpSocket.send(json.dumps(payload).encode())
|
||||
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
|
||||
# handles stoping the game itself and notifies server to stop itself
|
||||
pass
|
||||
|
||||
# player management
|
||||
# the network manager will create a player instance
|
||||
# =============================================================
|
||||
|
||||
# gets all player known to the game manager and returns them
|
||||
def getPlayers(self) -> dict:
|
||||
return self.__players
|
||||
|
||||
# creates a player and handles counting all players and if conditions met starting the game
|
||||
# returns the new dict in which the new player now is added
|
||||
def addPlayers(self, player:Player, socket:socket, clientAddr, deck) -> dict:
|
||||
|
||||
self.logger.info(f"creating user with id: {player.getID}")
|
||||
self.__players[clientAddr] = {
|
||||
"player": player,
|
||||
"deck": deck,
|
||||
"socket":socket
|
||||
}
|
||||
self.logger.info(f"new length of user dictionary: {len(self.__players)}")
|
||||
|
||||
# counts participating players and starts the game if enough have joined
|
||||
if len(self.__players) == 2:
|
||||
self.logger.info("2 players have join game starts")
|
||||
self.startGame(socket)
|
||||
|
||||
return self.__players
|
18
OLD_Server/Classes/System/Logger.py
Normal file
18
OLD_Server/Classes/System/Logger.py
Normal file
@ -0,0 +1,18 @@
|
||||
import logging
|
||||
|
||||
|
||||
class Logger:
|
||||
def __init__(self, filename):
|
||||
logging.basicConfig(filename=filename,
|
||||
filemode='a',
|
||||
format='%(asctime)s,%(msecs)d %(name)s %(levelname)s %(message)s',
|
||||
datefmt='%H:%M:%S',
|
||||
level=logging.DEBUG)
|
||||
|
||||
def info(self, message):
|
||||
print(message)
|
||||
logging.info(message)
|
||||
|
||||
def error(self, message):
|
||||
print(message)
|
||||
logging.error(message)
|
32
OLD_Server/Classes/System/Network/EventHandler.py
Normal file
32
OLD_Server/Classes/System/Network/EventHandler.py
Normal file
@ -0,0 +1,32 @@
|
||||
import socket
|
||||
from Classes.Game.Player import Player
|
||||
from Classes.System.GameManager import GameManager
|
||||
|
||||
from Classes.System.World import World
|
||||
|
||||
|
||||
class TCPEventHandler:
|
||||
__tcpSocket:socket
|
||||
|
||||
def __init__(self, socket:socket):
|
||||
self.__tcpSocket = socket
|
||||
|
||||
# handles passing of event data to the right functions
|
||||
def handleTCPEvents(self, event, gameManager:GameManager, address):
|
||||
gameManager.getLogger().info(f"incommingevent {event}")
|
||||
if event["event"] == "placecard":
|
||||
gameManager.spawnCard(event["card"], event["user"], event["x"], event["y"])
|
||||
pass
|
||||
elif event["event"] == "MoveCard":
|
||||
pass
|
||||
elif event["event"] == "RemoveCard":
|
||||
pass
|
||||
elif event["event"] == "AttackCard":
|
||||
pass
|
||||
elif event["event"] == "AttackPlayer":
|
||||
pass
|
||||
elif event["event"] == "ActivateEffectCard":
|
||||
pass
|
||||
elif event["event"] == "ActivateMonsterCard":
|
||||
pass
|
||||
pass
|
142
OLD_Server/Classes/System/Network/NetworkManger.py
Normal file
142
OLD_Server/Classes/System/Network/NetworkManger.py
Normal file
@ -0,0 +1,142 @@
|
||||
import json
|
||||
import signal
|
||||
import socket
|
||||
import sys
|
||||
import threading
|
||||
from Classes.Game.Player import Player
|
||||
from Classes.System.GameManager import GameManager
|
||||
|
||||
from Classes.System.Network.EventHandler import TCPEventHandler
|
||||
from Classes.System.World import World
|
||||
|
||||
class NetworkManager:
|
||||
class TCP:
|
||||
__Addr:str
|
||||
__Port:str
|
||||
__BufferSize:int = 1024
|
||||
__tcpSocket:socket
|
||||
__eventHandler: dict
|
||||
__users: dict
|
||||
__TCPClientThread:threading.Thread
|
||||
__gameManager:GameManager
|
||||
|
||||
def __init__(self, Addr:str, Port:str, gameManager:GameManager):
|
||||
gameManager.getLogger().info("starting up network manager")
|
||||
|
||||
self.running = True
|
||||
self.__Addr = Addr
|
||||
self.__Port = int(Port)
|
||||
self.__gameManager = gameManager
|
||||
self.__eventHandler = {}
|
||||
|
||||
gameManager.getLogger().info("starting up tcp server")
|
||||
self.__tcpSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
self.__tcpSocket.bind((self.__Addr, self.__Port))
|
||||
self.__tcpSocket.listen()
|
||||
|
||||
gameManager.getLogger().info("starting up thread for client socket accepting")
|
||||
self.__TCPClientThread = threading.Thread(target=self.accept_connections)
|
||||
self.__TCPClientThread.daemon = True
|
||||
self.__TCPClientThread.start()
|
||||
|
||||
def accept_connections(self):
|
||||
while self.running:
|
||||
try:
|
||||
client_tcp_socket, client_address = self.__tcpSocket.accept()
|
||||
self.__gameManager.getLogger().info(f"Connected with {client_address}")
|
||||
self.__gameManager.getPlayers()[client_address] = client_tcp_socket
|
||||
self.__eventHandler[client_address] = TCPEventHandler(client_tcp_socket)
|
||||
|
||||
client_handler_thread = threading.Thread(
|
||||
target=self.receive,
|
||||
args=(client_tcp_socket, client_address)
|
||||
)
|
||||
|
||||
self.__gameManager.getLogger().info(f"starting client handler thread for client at address {client_address}")
|
||||
client_handler_thread.daemon = True
|
||||
client_handler_thread.start()
|
||||
|
||||
except Exception as e:
|
||||
self.__gameManager.getLogger().error(f"tcp socket failed to accept connection due to error: {e}")
|
||||
pass
|
||||
client_handler_thread.join()
|
||||
|
||||
def receive(self, client_socket, client_address):
|
||||
while self.running:
|
||||
try:
|
||||
data = client_socket.recv(self.__BufferSize)
|
||||
if not data:
|
||||
self.__gameManager.getLogger().info(f"Connection with {client_address} closed.")
|
||||
break
|
||||
|
||||
try:
|
||||
|
||||
message = data.decode()
|
||||
messageJson = json.loads(message)
|
||||
self.__gameManager.getLogger().info(f"decoded message {messageJson}")
|
||||
user = messageJson.get("user")
|
||||
self.__gameManager.getLogger().info(f"user in message {user}")
|
||||
|
||||
except Exception as ex:
|
||||
self.__gameManager.getLogger().info(f"decoding incoming packet failed due to exception: {ex}")
|
||||
|
||||
# creates a user and counts how many currently are connected to the server
|
||||
# if enough users for a round are connected the server has to start the game
|
||||
if user not in self.__gameManager.getPlayers():
|
||||
if messageJson["event"] == "login":
|
||||
self.__gameManager.getLogger().info("user logging in")
|
||||
self.__gameManager.getLogger().info("task passed off to gameManager")
|
||||
user = self.__gameManager.addPlayers(Player(messageJson["username"], messageJson["deck"]), client_socket, client_address, messageJson["deck"])
|
||||
self.__gameManager.getLogger().info(f"connected users {len(self.__gameManager.getPlayers())}")
|
||||
|
||||
self.__gameManager.getLogger().info(f"confirming login for user")
|
||||
self.send({
|
||||
"event":"loginresponse",
|
||||
"status": "success",
|
||||
"id": user[client_address]["player"].getID(),
|
||||
"name": user[client_address]["player"].getName()
|
||||
}, client_address)
|
||||
|
||||
self.__eventHandler[client_address].handleTCPEvents(messageJson, self.__gameManager, client_address)
|
||||
self.__gameManager.getLogger().info(f"Received message from {client_address}: {message}")
|
||||
|
||||
except socket.error as e:
|
||||
|
||||
if e.errno == 10054:
|
||||
self.__gameManager.getLogger().error(f"Connection with {client_address} forcibly closed by remote host.")
|
||||
break
|
||||
|
||||
self.__gameManager.getLogger().error(f"Socket error receiving data from {client_address}: {e}")
|
||||
|
||||
except json.JSONDecodeError as e:
|
||||
self.__gameManager.getLogger().error(f"JSON decoding error receiving data from {client_address}: {e}")
|
||||
|
||||
# except Exception as e:
|
||||
# self.__gameManager.getLogger().error(f"UknownError receiving data from {client_address} due to error: {e}")
|
||||
|
||||
def broadcast(self, payload:dict):
|
||||
for user in self.__gameManager.getPlayers().values():
|
||||
user["socket"].send(json.dumps(payload).encode())
|
||||
|
||||
def send(self, payload: dict, user: str):
|
||||
players = self.__gameManager.getPlayers()
|
||||
|
||||
if user in players and "socket" in players[user]:
|
||||
players[user]["socket"].send(json.dumps(payload).encode())
|
||||
else:
|
||||
self.__gameManager.getLogger().error(f"user '{user}' or socket was not found 'socket' failed to send data.")
|
||||
|
||||
def stop(self):
|
||||
self.__TCPClientThread.join() # Wait for the thread to finish before exiting
|
||||
|
||||
tcp: TCP
|
||||
# udp: UDP
|
||||
|
||||
def __init__(self, Addr:str, TCPPort:str, UDPPort:str, gameManager:GameManager):
|
||||
self.tcp = self.TCP(Addr, TCPPort, gameManager)
|
||||
signal.signal(signal.SIGINT, self.handle_interrupt) # Register the signal handler
|
||||
|
||||
def handle_interrupt(self, signum, frame):
|
||||
self.__gameManager.getLogger().info("Received keyboard interrupt. Stopping the server.")
|
||||
self.tcp().stop()
|
||||
sys.exit(0)
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
23
OLD_Server/Classes/System/PlayerManager.py
Normal file
23
OLD_Server/Classes/System/PlayerManager.py
Normal file
@ -0,0 +1,23 @@
|
||||
import json
|
||||
class Player:
|
||||
|
||||
def createUser(self, user:json):
|
||||
self.__users.append(user)
|
||||
|
||||
def createUser(self, user:json):
|
||||
if self.getUser(user["username"]) == None:
|
||||
self.__users.append(Player(user["username"]))
|
||||
|
||||
def removeUser(self, user:int):
|
||||
self.__users.remove(user)
|
||||
|
||||
def removeUser(self, user:str):
|
||||
self.__users.remove(user)
|
||||
|
||||
def getUsers(self) -> list:
|
||||
return self.__users
|
||||
|
||||
def getUser(self, user:int):
|
||||
for user in self.__users:
|
||||
if int(user["id"]) == user:
|
||||
return user
|
34
OLD_Server/Classes/System/QueueManager.py
Normal file
34
OLD_Server/Classes/System/QueueManager.py
Normal file
@ -0,0 +1,34 @@
|
||||
|
||||
|
||||
from Classes.Game.Player import Player
|
||||
|
||||
|
||||
class QueueManager:
|
||||
__queue:list
|
||||
|
||||
def __init__(self):
|
||||
self.__queue = []
|
||||
|
||||
def getQueue(self) -> list:
|
||||
return self.__queue
|
||||
|
||||
def addToQueue(self, user) -> list:
|
||||
if self.isInQueue(user["id"]):
|
||||
self.__queue.append(user)
|
||||
return self.__queue
|
||||
|
||||
def removeFromQueue(self, player:Player) -> list:
|
||||
self.__queue.remove(player)
|
||||
return self.__queue
|
||||
|
||||
def isInQueue(self, user:int) -> bool:
|
||||
for user in self.__queue:
|
||||
if int(user["id"]) == user:
|
||||
return True
|
||||
return False
|
||||
|
||||
def isInQueue(self, user:str) -> bool:
|
||||
for user in self.__queue:
|
||||
if user["username"] == user:
|
||||
return True
|
||||
return False
|
40
OLD_Server/Classes/System/Server.py
Normal file
40
OLD_Server/Classes/System/Server.py
Normal file
@ -0,0 +1,40 @@
|
||||
import json
|
||||
import socket
|
||||
import threading
|
||||
from Classes.System.GameManager import GameManager
|
||||
|
||||
from Classes.System.Network.NetworkManger import NetworkManager
|
||||
from Classes.System.PlayerManager import Player
|
||||
from Classes.System.World import World
|
||||
from Classes.System.Logger import Logger
|
||||
|
||||
class Server:
|
||||
|
||||
__address:str
|
||||
__tcpPort:str
|
||||
__udpPort:str
|
||||
__world:World
|
||||
__gameManager:GameManager
|
||||
|
||||
networkManager:NetworkManager
|
||||
|
||||
def __init__(self, address:str, tcpPort:str, udpPort:str, logger:Logger):
|
||||
self.__address = address
|
||||
self.__tcpPort = tcpPort
|
||||
self.__udpPort = udpPort
|
||||
self.__world = World()
|
||||
self.logger = logger
|
||||
|
||||
self.logger.info("starting up game manager")
|
||||
self.__gameManager = GameManager(logger)
|
||||
|
||||
self.logger.info("preparing to start server")
|
||||
self.startServer(self.__gameManager)
|
||||
|
||||
# handles starting the server and assigning socket values to the local reference
|
||||
def startServer(self, gameManager:GameManager):
|
||||
self.logger.info("starting up network manager")
|
||||
self.__networkManager = NetworkManager(self.__address, self.__tcpPort, self.__udpPort, gameManager)
|
||||
|
||||
def getNetworkManager(self) -> NetworkManager:
|
||||
return self.__networkManager
|
6
OLD_Server/Classes/System/Utils/Path.py
Normal file
6
OLD_Server/Classes/System/Utils/Path.py
Normal file
@ -0,0 +1,6 @@
|
||||
import os
|
||||
|
||||
|
||||
class PathUtil:
|
||||
def getAbsolutePathTo(notAbsolutPath:str) -> str:
|
||||
return os.path.abspath("OLD_Server/" + notAbsolutPath)
|
11
OLD_Server/Classes/System/Utils/StringUtils.py
Normal file
11
OLD_Server/Classes/System/Utils/StringUtils.py
Normal file
@ -0,0 +1,11 @@
|
||||
import random
|
||||
import string
|
||||
|
||||
|
||||
class StringUtils:
|
||||
def get_random_string(length) -> str:
|
||||
# choose from all lowercase letter
|
||||
letters = string.ascii_lowercase
|
||||
result_str = ''.join(random.choice(letters) for i in range(length))
|
||||
print("Random string of length", length, "is:", result_str)
|
||||
return result_str
|
BIN
OLD_Server/Classes/System/Utils/__pycache__/Path.cpython-311.pyc
Normal file
BIN
OLD_Server/Classes/System/Utils/__pycache__/Path.cpython-311.pyc
Normal file
Binary file not shown.
Binary file not shown.
20
OLD_Server/Classes/System/World.py
Normal file
20
OLD_Server/Classes/System/World.py
Normal file
@ -0,0 +1,20 @@
|
||||
import socket
|
||||
from Classes.Game.Player import Player
|
||||
|
||||
|
||||
class World:
|
||||
__players:dict
|
||||
|
||||
def __init__(self):
|
||||
self.__players = {}
|
||||
|
||||
def getPlayers(self) -> list:
|
||||
return self.__players
|
||||
|
||||
def addPlayers(self, player:Player, socket:socket, clientAddr) -> list:
|
||||
self.__players[clientAddr] = {
|
||||
player: player,
|
||||
socket:socket
|
||||
}
|
||||
|
||||
return self.__players
|
Binary file not shown.
Binary file not shown.
BIN
OLD_Server/Classes/System/__pycache__/Logger.cpython-311.pyc
Normal file
BIN
OLD_Server/Classes/System/__pycache__/Logger.cpython-311.pyc
Normal file
Binary file not shown.
BIN
OLD_Server/Classes/System/__pycache__/Logger.cpython-312.pyc
Normal file
BIN
OLD_Server/Classes/System/__pycache__/Logger.cpython-312.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
OLD_Server/Classes/System/__pycache__/Server.cpython-311.pyc
Normal file
BIN
OLD_Server/Classes/System/__pycache__/Server.cpython-311.pyc
Normal file
Binary file not shown.
BIN
OLD_Server/Classes/System/__pycache__/Server.cpython-312.pyc
Normal file
BIN
OLD_Server/Classes/System/__pycache__/Server.cpython-312.pyc
Normal file
Binary file not shown.
BIN
OLD_Server/Classes/System/__pycache__/World.cpython-311.pyc
Normal file
BIN
OLD_Server/Classes/System/__pycache__/World.cpython-311.pyc
Normal file
Binary file not shown.
BIN
OLD_Server/Classes/System/__pycache__/World.cpython-312.pyc
Normal file
BIN
OLD_Server/Classes/System/__pycache__/World.cpython-312.pyc
Normal file
Binary file not shown.
31
OLD_Server/index.py
Normal file
31
OLD_Server/index.py
Normal file
@ -0,0 +1,31 @@
|
||||
import logging
|
||||
import os
|
||||
import random
|
||||
import string
|
||||
import sys
|
||||
|
||||
from Classes.System.Server import Server
|
||||
from Classes.System.Logger import Logger
|
||||
from Classes.System.Utils.Path import PathUtil
|
||||
|
||||
def get_random_string(length) -> str:
|
||||
# choose from all lowercase letter
|
||||
letters = string.ascii_lowercase
|
||||
result_str = ''.join(random.choice(letters) for i in range(length))
|
||||
print("Random string of length", length, "is:", result_str)
|
||||
return result_str
|
||||
|
||||
def main():
|
||||
# retrieves host data from environment
|
||||
HOST = "127.0.0.1"
|
||||
TCPPORT = "54322"
|
||||
UDPPORT = "54323"
|
||||
|
||||
logger = Logger(PathUtil.getAbsolutePathTo("log/"+get_random_string(8)+".log"))
|
||||
logger.info("starting up server")
|
||||
server = Server(HOST, TCPPORT, UDPPORT, logging)
|
||||
server.getNetworkManager().tcp.stop()
|
||||
sys.exit(0)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
28
OLD_Server/log/jopxlbza.log
Normal file
28
OLD_Server/log/jopxlbza.log
Normal file
@ -0,0 +1,28 @@
|
||||
21:35:45,88 root INFO starting up server
|
||||
21:35:45,89 root INFO starting up game manager
|
||||
21:35:45,89 root INFO preparing to start server
|
||||
21:35:45,89 root INFO starting up network manager
|
||||
21:35:45,89 root INFO starting up network manager
|
||||
21:35:45,89 root INFO starting up tcp server
|
||||
21:35:45,89 root INFO starting up thread for client socket accepting
|
||||
21:35:51,856 root INFO Connected with ('127.0.0.1', 49747)
|
||||
21:35:51,856 root INFO starting client handler thread for client at address ('127.0.0.1', 49747)
|
||||
21:35:51,859 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]}
|
||||
21:35:51,860 root INFO user in message None
|
||||
21:35:51,861 root INFO user logging in
|
||||
21:35:51,861 root INFO task passed off to gameManager
|
||||
21:35:51,861 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x000001BA28D8A990>>
|
||||
21:35:56,111 root INFO new length of user dictionary: 1
|
||||
21:36:08,506 root INFO connected users 1
|
||||
21:36:08,506 root INFO confirming login for user
|
||||
21:36:08,507 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]}
|
||||
21:36:08,507 root INFO Received message from ('127.0.0.1', 49747): {"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]}
|
||||
21:37:40,56 root INFO Connected with ('127.0.0.1', 49795)
|
||||
21:37:40,56 root INFO starting client handler thread for client at address ('127.0.0.1', 49795)
|
||||
21:37:40,57 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]}
|
||||
21:37:40,58 root INFO user in message None
|
||||
21:37:40,58 root INFO user logging in
|
||||
21:37:40,58 root INFO task passed off to gameManager
|
||||
21:37:40,58 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x000001BA295F67D0>>
|
||||
21:37:43,614 root INFO new length of user dictionary: 2
|
||||
21:37:50,2 root INFO 2 players have join game starts
|
28
OLD_Server/log/jsrrepta.log
Normal file
28
OLD_Server/log/jsrrepta.log
Normal file
@ -0,0 +1,28 @@
|
||||
21:02:55,541 root INFO starting up server
|
||||
21:02:55,542 root INFO starting up game manager
|
||||
21:02:55,542 root INFO preparing to start server
|
||||
21:02:55,542 root INFO starting up network manager
|
||||
21:02:55,543 root INFO starting up network manager
|
||||
21:02:55,543 root INFO starting up tcp server
|
||||
21:02:55,543 root INFO starting up thread for client socket accepting
|
||||
21:03:03,608 root INFO Connected with ('127.0.0.1', 65384)
|
||||
21:03:03,609 root INFO starting client handler thread for client at address ('127.0.0.1', 65384)
|
||||
21:03:03,610 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]}
|
||||
21:03:03,613 root INFO user in message None
|
||||
21:03:03,613 root INFO user logging in
|
||||
21:03:03,613 root INFO task passed off to gameManager
|
||||
21:03:03,613 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x000001C89C1A1750>>
|
||||
21:03:03,613 root INFO new length of user dictionary: 1
|
||||
21:03:03,613 root INFO connected users 1
|
||||
21:03:03,613 root INFO confirming login for user
|
||||
21:03:03,614 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]}
|
||||
21:03:03,614 root INFO Received message from ('127.0.0.1', 65384): {"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]}
|
||||
21:03:21,850 root INFO Connected with ('127.0.0.1', 65399)
|
||||
21:03:21,850 root INFO starting client handler thread for client at address ('127.0.0.1', 65399)
|
||||
21:03:21,852 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]}
|
||||
21:03:21,852 root INFO user in message None
|
||||
21:03:21,852 root INFO user logging in
|
||||
21:03:21,852 root INFO task passed off to gameManager
|
||||
21:03:21,852 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x000001C89C1A26D0>>
|
||||
21:03:21,852 root INFO new length of user dictionary: 2
|
||||
21:03:21,852 root INFO 2 players have join game starts
|
32
OLD_Server/log/kawhnrji.log
Normal file
32
OLD_Server/log/kawhnrji.log
Normal file
@ -0,0 +1,32 @@
|
||||
22:18:28,492 root INFO starting up server
|
||||
22:18:28,493 root INFO starting up game manager
|
||||
22:18:28,493 root INFO preparing to start server
|
||||
22:18:28,493 root INFO starting up network manager
|
||||
22:18:28,493 root INFO starting up network manager
|
||||
22:18:28,493 root INFO starting up tcp server
|
||||
22:18:28,493 root INFO starting up thread for client socket accepting
|
||||
22:18:33,537 root INFO Connected with ('127.0.0.1', 50893)
|
||||
22:18:33,537 root INFO starting client handler thread for client at address ('127.0.0.1', 50893)
|
||||
22:18:33,539 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]}
|
||||
22:18:33,540 root INFO user in message None
|
||||
22:18:36,99 root INFO user logging in
|
||||
22:18:36,131 root INFO task passed off to gameManager
|
||||
22:18:36,195 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x0000025B8F8AAC10>>
|
||||
22:18:36,427 root INFO new length of user dictionary: 1
|
||||
22:18:36,454 root INFO connected users 1
|
||||
22:18:36,467 root INFO confirming login for user
|
||||
22:18:37,23 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]}
|
||||
22:18:37,87 root INFO Received message from ('127.0.0.1', 50893): {"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]}
|
||||
22:18:42,538 root INFO Connected with ('127.0.0.1', 50897)
|
||||
22:18:42,538 root INFO starting client handler thread for client at address ('127.0.0.1', 50897)
|
||||
22:18:42,540 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]}
|
||||
22:18:42,540 root INFO user in message None
|
||||
22:18:44,273 root INFO user logging in
|
||||
22:18:44,305 root INFO task passed off to gameManager
|
||||
22:18:44,369 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x0000025B90C1A2D0>>
|
||||
22:18:44,475 root INFO new length of user dictionary: 2
|
||||
22:18:45,389 root INFO 2 players have join game starts
|
||||
22:18:47,378 root INFO connected users 2
|
||||
22:18:47,410 root INFO confirming login for user
|
||||
22:18:47,948 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]}
|
||||
22:18:48,11 root INFO Received message from ('127.0.0.1', 50897): {"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]}
|
33
OLD_Server/log/olchcxfi.log
Normal file
33
OLD_Server/log/olchcxfi.log
Normal file
@ -0,0 +1,33 @@
|
||||
22:30:19,522 root INFO starting up server
|
||||
22:30:19,523 root INFO starting up game manager
|
||||
22:30:19,523 root INFO preparing to start server
|
||||
22:30:19,523 root INFO starting up network manager
|
||||
22:30:19,523 root INFO starting up network manager
|
||||
22:30:19,523 root INFO starting up tcp server
|
||||
22:30:19,523 root INFO starting up thread for client socket accepting
|
||||
22:30:25,764 root INFO Connected with ('127.0.0.1', 51190)
|
||||
22:30:25,765 root INFO starting client handler thread for client at address ('127.0.0.1', 51190)
|
||||
22:30:25,767 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]}
|
||||
22:30:25,769 root INFO user in message None
|
||||
22:30:28,438 root INFO user logging in
|
||||
22:30:28,469 root INFO task passed off to gameManager
|
||||
22:30:28,531 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x000001B8A2D5EB90>>
|
||||
22:30:28,679 root INFO new length of user dictionary: 1
|
||||
22:30:28,898 root INFO connected users 1
|
||||
22:30:28,910 root INFO confirming login for user
|
||||
22:30:29,365 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]}
|
||||
22:30:29,397 root INFO Received message from ('127.0.0.1', 51190): {"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]}
|
||||
22:30:35,73 root INFO Connected with ('127.0.0.1', 51194)
|
||||
22:30:35,73 root INFO starting client handler thread for client at address ('127.0.0.1', 51194)
|
||||
22:30:35,75 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]}
|
||||
22:30:35,75 root INFO user in message None
|
||||
22:30:35,940 root INFO user logging in
|
||||
22:30:35,982 root INFO task passed off to gameManager
|
||||
22:30:36,3 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x000001B8A4DDA310>>
|
||||
22:30:36,98 root INFO new length of user dictionary: 2
|
||||
22:30:36,277 root INFO 2 players have join game starts
|
||||
22:30:36,468 root INFO game manager is starting the game
|
||||
22:30:36,805 root INFO connected users 2
|
||||
22:30:36,817 root INFO confirming login for user
|
||||
22:30:42,749 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]}
|
||||
22:30:42,781 root INFO Received message from ('127.0.0.1', 51194): {"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]}
|
59
OLD_Server/log/ploaokwx.log
Normal file
59
OLD_Server/log/ploaokwx.log
Normal file
@ -0,0 +1,59 @@
|
||||
22:53:50,717 root INFO starting up server
|
||||
22:53:50,718 root INFO starting up game manager
|
||||
22:53:50,718 root INFO preparing to start server
|
||||
22:53:50,718 root INFO starting up network manager
|
||||
22:53:50,718 root INFO starting up network manager
|
||||
22:53:50,718 root INFO starting up tcp server
|
||||
22:53:50,719 root INFO starting up thread for client socket accepting
|
||||
22:53:57,759 root INFO Connected with ('127.0.0.1', 51806)
|
||||
22:53:57,759 root INFO starting client handler thread for client at address ('127.0.0.1', 51806)
|
||||
22:53:57,761 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]}
|
||||
22:53:57,764 root INFO user in message None
|
||||
22:53:58,552 root INFO user logging in
|
||||
22:53:58,584 root INFO task passed off to gameManager
|
||||
22:53:58,657 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x0000025100466710>>
|
||||
22:53:58,751 root INFO new length of user dictionary: 1
|
||||
22:53:58,980 root INFO connected users 1
|
||||
22:53:59,2 root INFO confirming login for user
|
||||
22:53:59,505 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]}
|
||||
22:53:59,516 root INFO Received message from ('127.0.0.1', 51806): {"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]}
|
||||
22:54:02,832 root INFO Connected with ('127.0.0.1', 51810)
|
||||
22:54:02,832 root INFO starting client handler thread for client at address ('127.0.0.1', 51810)
|
||||
22:54:02,832 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]}
|
||||
22:54:02,834 root INFO user in message None
|
||||
22:54:03,426 root INFO user logging in
|
||||
22:54:03,448 root INFO task passed off to gameManager
|
||||
22:54:03,480 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x00000251009BEC90>>
|
||||
22:54:03,586 root INFO new length of user dictionary: 2
|
||||
22:54:03,818 root INFO 2 players have join game starts
|
||||
22:54:03,923 root INFO game manager is starting the game
|
||||
22:54:04,230 root INFO connected users 2
|
||||
22:54:04,262 root INFO confirming login for user
|
||||
22:54:04,741 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]}
|
||||
22:54:04,774 root INFO Received message from ('127.0.0.1', 51810): {"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]}
|
||||
23:01:35,624 root INFO Connected with ('127.0.0.1', 51984)
|
||||
23:01:35,624 root INFO starting client handler thread for client at address ('127.0.0.1', 51984)
|
||||
23:01:35,625 root ERROR Connection with ('127.0.0.1', 51806) forcibly closed by remote host.
|
||||
23:01:35,625 root ERROR Connection with ('127.0.0.1', 51810) forcibly closed by remote host.
|
||||
23:01:36,21 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]}
|
||||
23:01:36,22 root INFO user in message None
|
||||
23:01:36,637 root INFO user logging in
|
||||
23:01:36,700 root INFO task passed off to gameManager
|
||||
23:01:36,762 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x000002517FEFAC10>>
|
||||
23:01:36,975 root INFO new length of user dictionary: 3
|
||||
23:01:37,228 root INFO connected users 3
|
||||
23:01:37,312 root INFO confirming login for user
|
||||
23:01:37,756 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]}
|
||||
23:01:37,852 root INFO Received message from ('127.0.0.1', 51984): {"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]}
|
||||
23:01:41,725 root INFO Connected with ('127.0.0.1', 51989)
|
||||
23:01:41,725 root INFO starting client handler thread for client at address ('127.0.0.1', 51989)
|
||||
23:01:41,727 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]}
|
||||
23:01:41,727 root INFO user in message None
|
||||
23:01:42,769 root INFO user logging in
|
||||
23:01:42,801 root INFO task passed off to gameManager
|
||||
23:01:42,853 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x00000251008D6B50>>
|
||||
23:01:43,191 root INFO new length of user dictionary: 4
|
||||
23:01:43,244 root INFO connected users 4
|
||||
23:01:43,349 root INFO confirming login for user
|
||||
23:01:43,822 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]}
|
||||
23:01:43,843 root INFO Received message from ('127.0.0.1', 51989): {"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]}
|
23
OLD_Server/log/tmqifhet.log
Normal file
23
OLD_Server/log/tmqifhet.log
Normal file
@ -0,0 +1,23 @@
|
||||
22:17:17,848 root INFO starting up server
|
||||
22:17:17,849 root INFO starting up game manager
|
||||
22:17:17,849 root INFO preparing to start server
|
||||
22:17:17,849 root INFO starting up network manager
|
||||
22:17:17,849 root INFO starting up network manager
|
||||
22:17:17,849 root INFO starting up tcp server
|
||||
22:17:17,849 root INFO starting up thread for client socket accepting
|
||||
22:17:23,920 root INFO Connected with ('127.0.0.1', 50854)
|
||||
22:17:23,921 root INFO starting client handler thread for client at address ('127.0.0.1', 50854)
|
||||
22:17:23,923 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]}
|
||||
22:17:23,923 root INFO user in message None
|
||||
22:17:26,307 root INFO user logging in
|
||||
22:17:26,339 root INFO task passed off to gameManager
|
||||
22:17:26,370 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x000001190D632110>>
|
||||
22:17:26,466 root INFO new length of user dictionary: 1
|
||||
22:17:26,654 root INFO connected users 1
|
||||
22:17:26,665 root INFO confirming login for user
|
||||
22:17:27,185 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]}
|
||||
22:17:27,239 root INFO Received message from ('127.0.0.1', 50854): {"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]}
|
||||
22:17:35,108 root INFO Connected with ('127.0.0.1', 50858)
|
||||
22:17:35,109 root INFO starting client handler thread for client at address ('127.0.0.1', 50858)
|
||||
22:17:35,110 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]}
|
||||
22:17:35,110 root INFO user in message None
|
7
OLD_Server/log/usujxxks.log
Normal file
7
OLD_Server/log/usujxxks.log
Normal file
@ -0,0 +1,7 @@
|
||||
22:18:11,454 root INFO starting up server
|
||||
22:18:11,455 root INFO starting up game manager
|
||||
22:18:11,455 root INFO preparing to start server
|
||||
22:18:11,455 root INFO starting up network manager
|
||||
22:18:11,456 root INFO starting up network manager
|
||||
22:18:11,456 root INFO starting up tcp server
|
||||
22:18:11,457 root INFO starting up thread for client socket accepting
|
35
OLD_Server/log/votjjlwn.log
Normal file
35
OLD_Server/log/votjjlwn.log
Normal file
@ -0,0 +1,35 @@
|
||||
21:49:14,507 root INFO starting up server
|
||||
21:49:14,507 root INFO starting up game manager
|
||||
21:49:14,507 root INFO preparing to start server
|
||||
21:49:14,507 root INFO starting up network manager
|
||||
21:49:14,507 root INFO starting up network manager
|
||||
21:49:14,507 root INFO starting up tcp server
|
||||
21:49:14,509 root INFO starting up thread for client socket accepting
|
||||
21:49:17,561 root INFO Connected with ('127.0.0.1', 50136)
|
||||
21:49:17,561 root INFO starting client handler thread for client at address ('127.0.0.1', 50136)
|
||||
21:49:17,562 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]}
|
||||
21:49:17,562 root INFO user in message None
|
||||
21:49:20,150 root INFO user logging in
|
||||
21:49:20,182 root INFO task passed off to gameManager
|
||||
21:49:20,214 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x0000021CA6E8F890>>
|
||||
21:49:20,319 root INFO new length of user dictionary: 1
|
||||
21:49:20,508 root INFO connected users 1
|
||||
21:49:20,539 root INFO confirming login for user
|
||||
21:49:21,932 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]}
|
||||
21:49:21,995 root INFO Received message from ('127.0.0.1', 50136): {"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]}
|
||||
21:49:28,5 root INFO Connected with ('127.0.0.1', 50140)
|
||||
21:49:28,5 root INFO starting client handler thread for client at address ('127.0.0.1', 50140)
|
||||
21:49:28,6 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]}
|
||||
21:49:28,7 root INFO user in message None
|
||||
21:49:28,943 root INFO user logging in
|
||||
21:49:28,975 root INFO task passed off to gameManager
|
||||
21:49:29,39 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x0000021CA9BDB090>>
|
||||
21:49:29,153 root INFO new length of user dictionary: 2
|
||||
21:49:29,375 root INFO 2 players have join game starts
|
||||
21:50:40,445 root INFO connected users 2
|
||||
21:51:12,743 root INFO confirming login for user
|
||||
21:51:14,842 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]}
|
||||
21:51:15,515 root INFO Received message from ('127.0.0.1', 50140): {"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]}
|
||||
21:51:22,712 root INFO decoded message {'event': 'placecard', 'card': 1, 'type': 'Monster', 'user': 35452, 'x': 1114.0, 'y': 599.0}
|
||||
21:51:22,712 root INFO user in message 35452
|
||||
21:51:28,960 root INFO incommingevent {'event': 'placecard', 'card': 1, 'type': 'Monster', 'user': 35452, 'x': 1114.0, 'y': 599.0}
|
47
OLD_Server/log/wdqxolbm.log
Normal file
47
OLD_Server/log/wdqxolbm.log
Normal file
@ -0,0 +1,47 @@
|
||||
22:46:35,887 root INFO starting up server
|
||||
22:46:35,888 root INFO starting up game manager
|
||||
22:46:35,888 root INFO preparing to start server
|
||||
22:46:35,888 root INFO starting up network manager
|
||||
22:46:35,889 root INFO starting up network manager
|
||||
22:46:35,889 root INFO starting up tcp server
|
||||
22:46:35,890 root INFO starting up thread for client socket accepting
|
||||
22:46:43,643 root INFO Connected with ('127.0.0.1', 51606)
|
||||
22:46:43,643 root INFO starting client handler thread for client at address ('127.0.0.1', 51606)
|
||||
22:46:43,645 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]}
|
||||
22:46:43,649 root INFO user in message None
|
||||
22:46:45,928 root INFO user logging in
|
||||
22:46:45,961 root INFO task passed off to gameManager
|
||||
22:46:45,994 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x000002808CF01450>>
|
||||
22:46:46,152 root INFO new length of user dictionary: 1
|
||||
22:46:46,427 root INFO connected users 1
|
||||
22:46:46,461 root INFO confirming login for user
|
||||
22:46:47,23 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]}
|
||||
22:46:47,87 root INFO Received message from ('127.0.0.1', 51606): {"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]}
|
||||
22:46:54,634 root INFO Connected with ('127.0.0.1', 51611)
|
||||
22:46:54,634 root INFO starting client handler thread for client at address ('127.0.0.1', 51611)
|
||||
22:46:54,636 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]}
|
||||
22:46:54,636 root INFO user in message None
|
||||
22:46:55,649 root INFO user logging in
|
||||
22:46:55,670 root INFO task passed off to gameManager
|
||||
22:46:55,753 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x000002808CEBD150>>
|
||||
22:46:55,912 root INFO new length of user dictionary: 2
|
||||
22:46:56,217 root INFO 2 players have join game starts
|
||||
22:46:56,281 root INFO game manager is starting the game
|
||||
22:46:56,639 root INFO connected users 2
|
||||
22:46:56,744 root INFO confirming login for user
|
||||
22:46:57,245 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]}
|
||||
22:46:57,267 root INFO Received message from ('127.0.0.1', 51611): {"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]}
|
||||
22:51:59,765 root ERROR Connection with ('127.0.0.1', 51611) forcibly closed by remote host.
|
||||
22:52:04,500 root ERROR Connection with ('127.0.0.1', 51606) forcibly closed by remote host.
|
||||
22:52:08,317 root INFO Connected with ('127.0.0.1', 51743)
|
||||
22:52:08,317 root INFO starting client handler thread for client at address ('127.0.0.1', 51743)
|
||||
22:52:08,318 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]}
|
||||
22:52:08,319 root INFO user in message None
|
||||
22:52:10,75 root INFO user logging in
|
||||
22:52:10,140 root INFO task passed off to gameManager
|
||||
22:52:10,203 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x000002808A67CFD0>>
|
||||
22:52:11,567 root INFO new length of user dictionary: 3
|
||||
22:52:11,673 root INFO connected users 3
|
||||
22:52:11,684 root INFO confirming login for user
|
||||
22:52:12,84 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]}
|
||||
22:52:12,95 root INFO Received message from ('127.0.0.1', 51743): {"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]}
|
33
OLD_Server/log/yxojocbd.log
Normal file
33
OLD_Server/log/yxojocbd.log
Normal file
@ -0,0 +1,33 @@
|
||||
22:52:35,47 root INFO starting up server
|
||||
22:52:35,47 root INFO starting up game manager
|
||||
22:52:35,47 root INFO preparing to start server
|
||||
22:52:35,48 root INFO starting up network manager
|
||||
22:52:35,48 root INFO starting up network manager
|
||||
22:52:35,48 root INFO starting up tcp server
|
||||
22:52:35,48 root INFO starting up thread for client socket accepting
|
||||
22:52:39,563 root INFO Connected with ('127.0.0.1', 51765)
|
||||
22:52:39,563 root INFO starting client handler thread for client at address ('127.0.0.1', 51765)
|
||||
22:52:39,564 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]}
|
||||
22:52:39,566 root INFO user in message None
|
||||
22:52:40,945 root INFO user logging in
|
||||
22:52:40,976 root INFO task passed off to gameManager
|
||||
22:52:41,8 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x000001B9ECF725D0>>
|
||||
22:52:41,125 root INFO new length of user dictionary: 1
|
||||
22:52:41,303 root INFO connected users 1
|
||||
22:52:41,324 root INFO confirming login for user
|
||||
22:52:41,819 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]}
|
||||
22:52:41,851 root INFO Received message from ('127.0.0.1', 51765): {"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]}
|
||||
22:52:45,441 root INFO Connected with ('127.0.0.1', 51768)
|
||||
22:52:45,441 root INFO starting client handler thread for client at address ('127.0.0.1', 51768)
|
||||
22:52:45,442 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]}
|
||||
22:52:45,443 root INFO user in message None
|
||||
22:52:46,369 root INFO user logging in
|
||||
22:52:46,401 root INFO task passed off to gameManager
|
||||
22:52:46,453 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x000001B9EDCDBF10>>
|
||||
22:52:46,549 root INFO new length of user dictionary: 2
|
||||
22:52:46,783 root INFO 2 players have join game starts
|
||||
22:52:46,867 root INFO game manager is starting the game
|
||||
22:52:47,205 root INFO connected users 2
|
||||
22:52:47,216 root INFO confirming login for user
|
||||
22:52:47,857 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]}
|
||||
22:52:47,868 root INFO Received message from ('127.0.0.1', 51768): {"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]}
|
42
OLD_Server/server logic notes.md
Normal file
42
OLD_Server/server logic notes.md
Normal file
@ -0,0 +1,42 @@
|
||||
# validation for placing cards:
|
||||
- is the game still running
|
||||
- is it the players turn
|
||||
- does the card exist
|
||||
- does the player have that card in his deck
|
||||
- does the player have this card in his hand
|
||||
- is the type of card allowed in that type of field
|
||||
- is the field already blocked by another card
|
||||
|
||||
# validation for attacking another player
|
||||
- is the game still running
|
||||
- is it the players turn
|
||||
- does the card exist
|
||||
- does the player have that card in his deck
|
||||
- is that card played
|
||||
- does the enemy have remaining monster cards on his side
|
||||
- if yes a direct attack would only be possible if a effect allows it
|
||||
- can this card attack
|
||||
- is the card of correct type
|
||||
- is it blocked by effects (will be implemented after card effects are implemented)
|
||||
|
||||
# player death management (win condition)
|
||||
- does a players hp go to 0?
|
||||
- make the other player the winner
|
||||
- if an effect affects the playing player card priority comes first
|
||||
|
||||
# handle a player leaving
|
||||
- check if game still runs
|
||||
- make remaining player win if yes
|
||||
|
||||
# turn management
|
||||
- server keeps track of each turn
|
||||
- whos turn is it
|
||||
- what turn state is currently active
|
||||
- draw state
|
||||
- place state
|
||||
- is the player trying to do actions not allowed in the given state
|
||||
|
||||
# drawing cards:
|
||||
- ensure the player only can have 7 cards
|
||||
- if limit exceeds the player payes lifepoints and drops a card
|
||||
- ensure the drawn card for sure still can be in the players deck
|
Reference in New Issue
Block a user