merged rework -> master
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)
|
||||
self.__mana = mana
|
||||
|
||||
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.
155
OLD_Server/Classes/System/GameManager.py
Normal file
155
OLD_Server/Classes/System/GameManager.py
Normal file
@ -0,0 +1,155 @@
|
||||
import json
|
||||
import socket
|
||||
import time
|
||||
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.info("spawning card")
|
||||
|
||||
self.__cards.append(card)
|
||||
|
||||
payload = {
|
||||
"event":"PlacedCard",
|
||||
"owner": owner,
|
||||
"card": card,
|
||||
"x": x,
|
||||
"y": y,
|
||||
}
|
||||
|
||||
for userAddr in self.__players.keys():
|
||||
try:
|
||||
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())
|
||||
except:
|
||||
pass
|
||||
|
||||
# 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 = player_data["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(),
|
||||
},
|
||||
}
|
||||
|
||||
print(f"user {player_data["socket"]}")
|
||||
player_data["socket"].send(json.dumps(payload).encode())
|
||||
except Exception as e:
|
||||
self.logger.error(f"failed to start game due to error: {e}")
|
||||
break
|
||||
|
||||
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)}")
|
||||
|
||||
payload = {
|
||||
"event":"loginresponse",
|
||||
"status": "success",
|
||||
"id": player.getID(),
|
||||
"name": player.getName()
|
||||
}
|
||||
|
||||
socket.send(json.dumps(payload).encode())
|
||||
|
||||
|
||||
# counts participating players and starts the game if enough have joined
|
||||
if len(self.__players) >= 2:
|
||||
time.sleep(1)
|
||||
self.logger.info("2 players have join game starts")
|
||||
self.startGame()
|
||||
|
||||
return self.__players
|
||||
|
||||
def removePlayers(self, clientAddr):
|
||||
self.logger.info(f"removing player with address '{clientAddr}' from players database")
|
||||
del self.__players[clientAddr]
|
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)
|
45
OLD_Server/Classes/System/Network/EventHandler.py
Normal file
45
OLD_Server/Classes/System/Network/EventHandler.py
Normal file
@ -0,0 +1,45 @@
|
||||
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.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
|
||||
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
|
145
OLD_Server/Classes/System/Network/NetworkManger.py
Normal file
145
OLD_Server/Classes/System/Network/NetworkManger.py
Normal file
@ -0,0 +1,145 @@
|
||||
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",
|
||||
"username": user[client_address]["player"].getName(),
|
||||
"id": user[client_address]["player"].getID(),
|
||||
}, 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.")
|
||||
players = self.__gameManager.getPlayers()
|
||||
self.__gameManager.removePlayers(client_address)
|
||||
self.__gameManager.getLogger().info(f"new player length {len(players)}")
|
||||
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
|
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()
|
35
OLD_Server/log/ftosavkt.log
Normal file
35
OLD_Server/log/ftosavkt.log
Normal file
@ -0,0 +1,35 @@
|
||||
10:14:25,144 root INFO starting up server
|
||||
10:14:25,145 root INFO starting up game manager
|
||||
10:14:25,145 root INFO preparing to start server
|
||||
10:14:25,145 root INFO starting up network manager
|
||||
10:14:25,145 root INFO starting up network manager
|
||||
10:14:25,145 root INFO starting up tcp server
|
||||
10:14:25,147 root INFO starting up thread for client socket accepting
|
||||
10:14:28,852 root INFO Connected with ('127.0.0.1', 40793)
|
||||
10:14:28,853 root INFO starting client handler thread for client at address ('127.0.0.1', 40793)
|
||||
10:14:28,862 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:14:28,863 root INFO user in message None
|
||||
10:14:28,864 root INFO user logging in
|
||||
10:14:28,865 root INFO task passed off to gameManager
|
||||
10:14:28,866 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x000002AF62F902F0>>
|
||||
10:14:28,866 root INFO new length of user dictionary: 1
|
||||
10:14:28,866 root INFO connected users 1
|
||||
10:14:28,867 root INFO confirming login for user
|
||||
10:14:28,868 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:14:28,868 root INFO Received message from ('127.0.0.1', 40793): {"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:14:37,604 root INFO Connected with ('127.0.0.1', 40802)
|
||||
10:14:37,604 root INFO starting client handler thread for client at address ('127.0.0.1', 40802)
|
||||
10:14:37,617 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:14:37,618 root INFO user in message None
|
||||
10:14:37,618 root INFO user logging in
|
||||
10:14:37,618 root INFO task passed off to gameManager
|
||||
10:14:37,620 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x000002AF62F90590>>
|
||||
10:14:37,622 root INFO new length of user dictionary: 2
|
||||
10:14:38,623 root INFO 2 players have join game starts
|
||||
10:14:38,624 root INFO game manager is starting the game
|
||||
10:14:38,624 root INFO connected users 2
|
||||
10:14:38,625 root INFO confirming login for user
|
||||
10:14:38,626 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:14:38,626 root INFO Received message from ('127.0.0.1', 40802): {"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:14:45,312 root ERROR Connection with ('127.0.0.1', 40802) forcibly closed by remote host.
|
||||
10:14:48,810 root ERROR Connection with ('127.0.0.1', 40793) forcibly closed by remote host.
|
35
OLD_Server/log/kuketiqt.log
Normal file
35
OLD_Server/log/kuketiqt.log
Normal file
@ -0,0 +1,35 @@
|
||||
10:03:57,851 root INFO starting up server
|
||||
10:03:57,851 root INFO starting up game manager
|
||||
10:03:57,852 root INFO preparing to start server
|
||||
10:03:57,852 root INFO starting up network manager
|
||||
10:03:57,852 root INFO starting up network manager
|
||||
10:03:57,853 root INFO starting up tcp server
|
||||
10:03:57,854 root INFO starting up thread for client socket accepting
|
||||
10:04:05,109 root INFO Connected with ('127.0.0.1', 40671)
|
||||
10:04:05,110 root INFO starting client handler thread for client at address ('127.0.0.1', 40671)
|
||||
10:04:05,124 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:04:05,125 root INFO user in message None
|
||||
10:04:05,125 root INFO user logging in
|
||||
10:04:05,125 root INFO task passed off to gameManager
|
||||
10:04:05,126 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x0000028AEB2834A0>>
|
||||
10:04:05,126 root INFO new length of user dictionary: 1
|
||||
10:04:05,126 root INFO connected users 1
|
||||
10:04:05,126 root INFO confirming login for user
|
||||
10:04:05,126 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:04:05,127 root INFO Received message from ('127.0.0.1', 40671): {"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:04:11,420 root INFO Connected with ('127.0.0.1', 40672)
|
||||
10:04:11,420 root INFO starting client handler thread for client at address ('127.0.0.1', 40672)
|
||||
10:04:11,439 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:04:11,439 root INFO user in message None
|
||||
10:04:11,439 root INFO user logging in
|
||||
10:04:11,439 root INFO task passed off to gameManager
|
||||
10:04:11,440 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x0000028AEB2837A0>>
|
||||
10:04:11,440 root INFO new length of user dictionary: 2
|
||||
10:04:12,441 root INFO 2 players have join game starts
|
||||
10:04:12,442 root INFO game manager is starting the game
|
||||
10:04:12,442 root ERROR failed to start game due to error: list indices must be integers or slices, not str
|
||||
10:04:12,444 root ERROR failed to start game due to error: list indices must be integers or slices, not str
|
||||
10:04:12,445 root INFO connected users 2
|
||||
10:04:12,445 root INFO confirming login for user
|
||||
10:04:12,445 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:04:12,445 root INFO Received message from ('127.0.0.1', 40672): {"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]}
|
35
OLD_Server/log/mjlawgym.log
Normal file
35
OLD_Server/log/mjlawgym.log
Normal file
@ -0,0 +1,35 @@
|
||||
10:13:00,7 root INFO starting up server
|
||||
10:13:00,8 root INFO starting up game manager
|
||||
10:13:00,8 root INFO preparing to start server
|
||||
10:13:00,8 root INFO starting up network manager
|
||||
10:13:00,9 root INFO starting up network manager
|
||||
10:13:00,9 root INFO starting up tcp server
|
||||
10:13:00,11 root INFO starting up thread for client socket accepting
|
||||
10:13:16,730 root INFO Connected with ('127.0.0.1', 40780)
|
||||
10:13:16,731 root INFO starting client handler thread for client at address ('127.0.0.1', 40780)
|
||||
10:13:16,732 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:13:16,733 root INFO user in message None
|
||||
10:13:16,733 root INFO user logging in
|
||||
10:13:16,734 root INFO task passed off to gameManager
|
||||
10:13:16,734 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x0000029360D902F0>>
|
||||
10:13:16,735 root INFO new length of user dictionary: 1
|
||||
10:13:16,735 root INFO connected users 1
|
||||
10:13:16,737 root INFO confirming login for user
|
||||
10:13:16,738 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:13:16,738 root INFO Received message from ('127.0.0.1', 40780): {"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:13:25,741 root INFO Connected with ('127.0.0.1', 40781)
|
||||
10:13:25,741 root INFO starting client handler thread for client at address ('127.0.0.1', 40781)
|
||||
10:13:25,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:13:25,775 root INFO user in message None
|
||||
10:13:25,775 root INFO user logging in
|
||||
10:13:25,776 root INFO task passed off to gameManager
|
||||
10:13:25,779 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x0000029360D90590>>
|
||||
10:13:25,780 root INFO new length of user dictionary: 2
|
||||
10:13:26,781 root INFO 2 players have join game starts
|
||||
10:13:26,781 root INFO game manager is starting the game
|
||||
10:13:26,783 root INFO connected users 2
|
||||
10:13:26,784 root INFO confirming login for user
|
||||
10:13:26,784 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:13:26,784 root INFO Received message from ('127.0.0.1', 40781): {"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:13:50,23 root ERROR Connection with ('127.0.0.1', 40780) forcibly closed by remote host.
|
||||
10:14:14,978 root ERROR Connection with ('127.0.0.1', 40781) forcibly closed by remote host.
|
35
OLD_Server/log/ncyhufrr.log
Normal file
35
OLD_Server/log/ncyhufrr.log
Normal file
@ -0,0 +1,35 @@
|
||||
10:05:33,787 root INFO starting up server
|
||||
10:05:33,788 root INFO starting up game manager
|
||||
10:05:33,788 root INFO preparing to start server
|
||||
10:05:33,788 root INFO starting up network manager
|
||||
10:05:33,788 root INFO starting up network manager
|
||||
10:05:33,788 root INFO starting up tcp server
|
||||
10:05:33,790 root INFO starting up thread for client socket accepting
|
||||
10:05:41,185 root INFO Connected with ('127.0.0.1', 40678)
|
||||
10:05:41,185 root INFO starting client handler thread for client at address ('127.0.0.1', 40678)
|
||||
10:05:41,203 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:05:41,204 root INFO user in message None
|
||||
10:05:41,204 root INFO user logging in
|
||||
10:05:41,204 root INFO task passed off to gameManager
|
||||
10:05:41,204 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x00000162D5BA34D0>>
|
||||
10:05:41,204 root INFO new length of user dictionary: 1
|
||||
10:05:41,205 root INFO connected users 1
|
||||
10:05:41,205 root INFO confirming login for user
|
||||
10:05:41,206 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:05:41,206 root INFO Received message from ('127.0.0.1', 40678): {"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:05:47,221 root INFO Connected with ('127.0.0.1', 40680)
|
||||
10:05:47,221 root INFO starting client handler thread for client at address ('127.0.0.1', 40680)
|
||||
10:05:47,229 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:05:47,233 root INFO user in message None
|
||||
10:05:47,234 root INFO user logging in
|
||||
10:05:47,234 root INFO task passed off to gameManager
|
||||
10:05:47,234 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x00000162D5BA37D0>>
|
||||
10:05:47,234 root INFO new length of user dictionary: 2
|
||||
10:05:48,235 root INFO 2 players have join game starts
|
||||
10:05:48,236 root INFO game manager is starting the game
|
||||
10:05:48,236 root ERROR failed to start game due to error: list indices must be integers or slices, not str
|
||||
10:05:48,237 root ERROR failed to start game due to error: list indices must be integers or slices, not str
|
||||
10:05:48,237 root INFO connected users 2
|
||||
10:05:48,237 root INFO confirming login for user
|
||||
10:05:48,237 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:05:48,237 root INFO Received message from ('127.0.0.1', 40680): {"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]}
|
34
OLD_Server/log/oiaflmlv.log
Normal file
34
OLD_Server/log/oiaflmlv.log
Normal file
@ -0,0 +1,34 @@
|
||||
10:18:24,131 root INFO starting up server
|
||||
10:18:24,131 root INFO starting up game manager
|
||||
10:18:24,132 root INFO preparing to start server
|
||||
10:18:24,132 root INFO starting up network manager
|
||||
10:18:24,132 root INFO starting up network manager
|
||||
10:18:24,133 root INFO starting up tcp server
|
||||
10:18:24,135 root INFO starting up thread for client socket accepting
|
||||
10:18:29,738 root INFO Connected with ('127.0.0.1', 10248)
|
||||
10:18:29,738 root INFO starting client handler thread for client at address ('127.0.0.1', 10248)
|
||||
10:18:29,741 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:18:29,741 root INFO user in message None
|
||||
10:18:29,741 root INFO user logging in
|
||||
10:18:29,741 root INFO task passed off to gameManager
|
||||
10:18:29,742 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x000001A9B91A0320>>
|
||||
10:18:29,742 root INFO new length of user dictionary: 1
|
||||
10:18:29,742 root INFO connected users 1
|
||||
10:18:29,742 root INFO confirming login for user
|
||||
10:18:29,742 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:18:29,742 root INFO Received message from ('127.0.0.1', 10248): {"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:18:34,161 root INFO Connected with ('127.0.0.1', 10249)
|
||||
10:18:34,163 root INFO starting client handler thread for client at address ('127.0.0.1', 10249)
|
||||
10:18:34,182 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:18:34,182 root INFO user in message None
|
||||
10:18:34,183 root INFO user logging in
|
||||
10:18:34,183 root INFO task passed off to gameManager
|
||||
10:18:34,183 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x000001A9B91A05C0>>
|
||||
10:18:34,184 root INFO new length of user dictionary: 2
|
||||
10:18:35,184 root INFO 2 players have join game starts
|
||||
10:18:35,186 root INFO game manager is starting the game
|
||||
10:18:35,187 root INFO connected users 2
|
||||
10:18:35,187 root INFO confirming login for user
|
||||
10:18:35,187 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:18:35,188 root INFO Received message from ('127.0.0.1', 10249): {"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:18:48,867 root ERROR Connection with ('127.0.0.1', 10249) forcibly closed by remote host.
|
41
OLD_Server/log/ooqpxwpe.log
Normal file
41
OLD_Server/log/ooqpxwpe.log
Normal file
@ -0,0 +1,41 @@
|
||||
10:20:46,144 root INFO starting up server
|
||||
10:20:46,144 root INFO starting up game manager
|
||||
10:20:46,144 root INFO preparing to start server
|
||||
10:20:46,145 root INFO starting up network manager
|
||||
10:20:46,145 root INFO starting up network manager
|
||||
10:20:46,145 root INFO starting up tcp server
|
||||
10:20:46,146 root INFO starting up thread for client socket accepting
|
||||
10:20:51,500 root INFO Connected with ('127.0.0.1', 10276)
|
||||
10:20:51,501 root INFO starting client handler thread for client at address ('127.0.0.1', 10276)
|
||||
10:20:51,515 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:20:51,515 root INFO user in message None
|
||||
10:20:51,516 root INFO user logging in
|
||||
10:20:51,516 root INFO task passed off to gameManager
|
||||
10:20:51,517 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x000001DF06A50320>>
|
||||
10:20:51,517 root INFO new length of user dictionary: 1
|
||||
10:20:51,517 root INFO connected users 1
|
||||
10:20:51,518 root INFO confirming login for user
|
||||
10:20:51,518 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:20:51,518 root INFO Received message from ('127.0.0.1', 10276): {"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:21:07,724 root INFO Connected with ('127.0.0.1', 10277)
|
||||
10:21:07,725 root INFO starting client handler thread for client at address ('127.0.0.1', 10277)
|
||||
10:21:07,751 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:21:07,752 root INFO user in message None
|
||||
10:21:07,753 root INFO user logging in
|
||||
10:21:07,753 root INFO task passed off to gameManager
|
||||
10:21:07,753 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x000001DF06A505C0>>
|
||||
10:21:07,753 root INFO new length of user dictionary: 2
|
||||
10:21:08,754 root INFO 2 players have join game starts
|
||||
10:21:08,754 root INFO game manager is starting the game
|
||||
10:21:08,756 root INFO connected users 2
|
||||
10:21:08,756 root INFO confirming login for user
|
||||
10:21:08,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]}
|
||||
10:21:08,756 root INFO Received message from ('127.0.0.1', 10277): {"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:21:10,800 root INFO decoded message {'event': 'placecard', 'card': 1, 'type': 'Monster', 'user': 848, 'x': 1120.0, 'y': 600.0}
|
||||
10:21:10,801 root INFO user in message 848
|
||||
10:21:10,801 root INFO incommingevent {'event': 'placecard', 'card': 1, 'type': 'Monster', 'user': 848, 'x': 1120.0, 'y': 600.0}
|
||||
10:21:10,801 root INFO send to client True
|
||||
10:21:10,802 root INFO send to client False
|
||||
10:21:10,802 root INFO Received message from ('127.0.0.1', 10277): {"event": "placecard", "card": 1, "type": "Monster", "user": 848, "x": 1120.0, "y": 600.0}
|
||||
10:21:21,124 root ERROR Connection with ('127.0.0.1', 10277) forcibly closed by remote host.
|
||||
10:21:21,148 root ERROR Connection with ('127.0.0.1', 10276) forcibly closed by remote host.
|
35
OLD_Server/log/qrgtwasn.log
Normal file
35
OLD_Server/log/qrgtwasn.log
Normal file
@ -0,0 +1,35 @@
|
||||
10:08:28,843 root INFO starting up server
|
||||
10:08:28,843 root INFO starting up game manager
|
||||
10:08:28,844 root INFO preparing to start server
|
||||
10:08:28,844 root INFO starting up network manager
|
||||
10:08:28,844 root INFO starting up network manager
|
||||
10:08:28,844 root INFO starting up tcp server
|
||||
10:08:28,846 root INFO starting up thread for client socket accepting
|
||||
10:08:40,764 root INFO Connected with ('127.0.0.1', 40708)
|
||||
10:08:40,764 root INFO starting client handler thread for client at address ('127.0.0.1', 40708)
|
||||
10:08:40,785 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:08:40,787 root INFO user in message None
|
||||
10:08:40,787 root INFO user logging in
|
||||
10:08:40,788 root INFO task passed off to gameManager
|
||||
10:08:40,789 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x000001CCA0CD34A0>>
|
||||
10:08:40,789 root INFO new length of user dictionary: 1
|
||||
10:08:40,789 root INFO connected users 1
|
||||
10:08:40,790 root INFO confirming login for user
|
||||
10:08:40,790 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:08:40,790 root INFO Received message from ('127.0.0.1', 40708): {"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:08:50,849 root INFO Connected with ('127.0.0.1', 40709)
|
||||
10:08:50,850 root INFO starting client handler thread for client at address ('127.0.0.1', 40709)
|
||||
10:08:50,865 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:08:50,866 root INFO user in message None
|
||||
10:08:50,866 root INFO user logging in
|
||||
10:08:50,866 root INFO task passed off to gameManager
|
||||
10:08:50,867 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x000001CCA0CD37A0>>
|
||||
10:08:50,868 root INFO new length of user dictionary: 2
|
||||
10:08:51,868 root INFO 2 players have join game starts
|
||||
10:08:51,868 root INFO game manager is starting the game
|
||||
10:08:51,868 root ERROR failed to start game due to error: list indices must be integers or slices, not str
|
||||
10:08:51,869 root ERROR failed to start game due to error: list indices must be integers or slices, not str
|
||||
10:08:51,869 root INFO connected users 2
|
||||
10:08:51,869 root INFO confirming login for user
|
||||
10:08:51,869 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:08:51,869 root INFO Received message from ('127.0.0.1', 40709): {"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]}
|
40
OLD_Server/log/sxuostca.log
Normal file
40
OLD_Server/log/sxuostca.log
Normal file
@ -0,0 +1,40 @@
|
||||
10:11:31,951 root INFO starting up server
|
||||
10:11:31,951 root INFO starting up game manager
|
||||
10:11:31,951 root INFO preparing to start server
|
||||
10:11:31,952 root INFO starting up network manager
|
||||
10:11:31,952 root INFO starting up network manager
|
||||
10:11:31,952 root INFO starting up tcp server
|
||||
10:11:31,953 root INFO starting up thread for client socket accepting
|
||||
10:11:39,945 root INFO Connected with ('127.0.0.1', 40745)
|
||||
10:11:39,945 root INFO starting client handler thread for client at address ('127.0.0.1', 40745)
|
||||
10:11:39,959 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:11:39,960 root INFO user in message None
|
||||
10:11:39,960 root INFO user logging in
|
||||
10:11:39,960 root INFO task passed off to gameManager
|
||||
10:11:39,960 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x000002E7F1F034D0>>
|
||||
10:11:39,961 root INFO new length of user dictionary: 1
|
||||
10:11:39,962 root INFO connected users 1
|
||||
10:11:39,962 root INFO confirming login for user
|
||||
10:11:39,962 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:11:39,963 root INFO Received message from ('127.0.0.1', 40745): {"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:11:48,547 root INFO Connected with ('127.0.0.1', 40751)
|
||||
10:11:48,547 root INFO starting client handler thread for client at address ('127.0.0.1', 40751)
|
||||
10:11:48,578 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:11:48,578 root INFO user in message None
|
||||
10:11:48,578 root INFO user logging in
|
||||
10:11:48,579 root INFO task passed off to gameManager
|
||||
10:11:48,579 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x000002E7F1F037D0>>
|
||||
10:11:48,579 root INFO new length of user dictionary: 2
|
||||
10:11:49,581 root INFO 2 players have join game starts
|
||||
10:11:49,582 root INFO game manager is starting the game
|
||||
10:11:49,585 root INFO connected users 2
|
||||
10:11:49,585 root INFO confirming login for user
|
||||
10:11:49,586 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:11:49,586 root INFO Received message from ('127.0.0.1', 40751): {"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:12:17,219 root INFO decoded message {'event': 'placecard', 'card': 1, 'type': 'Monster', 'user': 56607, 'x': 386.0, 'y': 568.0}
|
||||
10:12:17,219 root INFO user in message 56607
|
||||
10:12:17,219 root INFO incommingevent {'event': 'placecard', 'card': 1, 'type': 'Monster', 'user': 56607, 'x': 386.0, 'y': 568.0}
|
||||
10:12:17,219 root INFO send to client False
|
||||
10:12:17,219 root INFO send to client True
|
||||
10:12:17,219 root INFO Received message from ('127.0.0.1', 40745): {"event": "placecard", "card": 1, "type": "Monster", "user": 56607, "x": 386.0, "y": 568.0}
|
||||
10:12:26,488 root ERROR Connection with ('127.0.0.1', 40751) forcibly closed by remote host.
|
35
OLD_Server/log/xtjfeaau.log
Normal file
35
OLD_Server/log/xtjfeaau.log
Normal file
@ -0,0 +1,35 @@
|
||||
10:09:58,809 root INFO starting up server
|
||||
10:09:58,809 root INFO starting up game manager
|
||||
10:09:58,809 root INFO preparing to start server
|
||||
10:09:58,809 root INFO starting up network manager
|
||||
10:09:58,810 root INFO starting up network manager
|
||||
10:09:58,810 root INFO starting up tcp server
|
||||
10:09:58,812 root INFO starting up thread for client socket accepting
|
||||
10:10:02,221 root INFO Connected with ('127.0.0.1', 40727)
|
||||
10:10:02,221 root INFO starting client handler thread for client at address ('127.0.0.1', 40727)
|
||||
10:10:02,225 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:10:02,225 root INFO user in message None
|
||||
10:10:02,225 root INFO user logging in
|
||||
10:10:02,226 root INFO task passed off to gameManager
|
||||
10:10:02,226 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x000001E9B7BE34D0>>
|
||||
10:10:02,226 root INFO new length of user dictionary: 1
|
||||
10:10:02,227 root INFO connected users 1
|
||||
10:10:02,227 root INFO confirming login for user
|
||||
10:10:02,227 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:10:02,228 root INFO Received message from ('127.0.0.1', 40727): {"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:10:22,682 root INFO Connected with ('127.0.0.1', 40736)
|
||||
10:10:22,682 root INFO starting client handler thread for client at address ('127.0.0.1', 40736)
|
||||
10:10:22,709 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:10:22,709 root INFO user in message None
|
||||
10:10:22,710 root INFO user logging in
|
||||
10:10:22,710 root INFO task passed off to gameManager
|
||||
10:10:22,710 root INFO creating user with id: <bound method Player.getID of <Classes.Game.Player.Player object at 0x000001E9B7BE37D0>>
|
||||
10:10:22,712 root INFO new length of user dictionary: 2
|
||||
10:10:23,713 root INFO 2 players have join game starts
|
||||
10:10:23,714 root INFO game manager is starting the game
|
||||
10:10:23,714 root ERROR failed to start game due to error: list indices must be integers or slices, not tuple
|
||||
10:10:23,715 root ERROR failed to start game due to error: list indices must be integers or slices, not tuple
|
||||
10:10:23,715 root INFO connected users 2
|
||||
10:10:23,715 root INFO confirming login for user
|
||||
10:10:23,715 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:10:23,715 root INFO Received message from ('127.0.0.1', 40736): {"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