clean
This commit is contained in:
parent
5007fc4383
commit
aa63bbca39
12
server.py
12
server.py
@ -1,10 +1,8 @@
|
|||||||
from dpnet.netserver import Netserver
|
from dpnet.netserver import Netserver
|
||||||
from giants.masterserver import MasterServer
|
from giants.masterserver import MasterServer
|
||||||
from utils.logger import setup_logger
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
logger = setup_logger(__name__)
|
num_players_alltime = 0
|
||||||
|
|
||||||
|
|
||||||
class Server:
|
class Server:
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
@ -14,10 +12,12 @@ class Server:
|
|||||||
|
|
||||||
async def on_connection_received(self, ip, port):
|
async def on_connection_received(self, ip, port):
|
||||||
version = 1.497
|
version = 1.497
|
||||||
server_name = "My server name"
|
server_name = "Hello %s" % ip
|
||||||
player_count = 2
|
global num_players_alltime
|
||||||
|
num_players_alltime = num_players_alltime + 1
|
||||||
|
player_count = num_players_alltime
|
||||||
max_player_count = 20
|
max_player_count = 20
|
||||||
map_name = "Map name"
|
map_name = "best map ever"
|
||||||
return version, server_name, player_count, max_player_count, map_name
|
return version, server_name, player_count, max_player_count, map_name
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user