some big change

This commit is contained in:
沈瑗杰 2021-02-16 12:51:07 +08:00
parent c942132df5
commit 2d2a8284de
4 changed files with 14 additions and 12 deletions

View File

@ -23,13 +23,13 @@ except (ModuleNotFoundError, ImportError, ImportWarning):
class client(mp.Process, pyglet.window.Window): class client(mp.Process, pyglet.window.Window):
def __init__(self, logger, dev_dic=None, dev_list=None, path=None, net_mode='local'): def __init__(self, logger, dev_dic=None, dev_list=None, path=None, net_mode='local'):
''' """
:param path: 运行路径 :param path: 运行路径
:param dev_list: 共享内存 :param dev_list: 共享内存
:param dev_dic: 共享内存 :param dev_dic: 共享内存
:param logger: logger :param logger: logger
:param net_mode: 网络模式 # local / ip :param net_mode: 网络模式 # local / ip
''' """
# do father class __init__() # do father class __init__()
mp.Process.__init__(self) mp.Process.__init__(self)
# logging # logging
@ -71,9 +71,6 @@ class client(mp.Process, pyglet.window.Window):
# net_mode # net_mode
if self.net_mode == 'local': if self.net_mode == 'local':
pass pass
# net_mode != 'local' and ,can is a ipv4 ip
# elif re.match(self.ipv4_re, self.net_mode):
# pass
# textures # textures
self.textures = {} self.textures = {}
# parts # parts

View File

@ -56,14 +56,21 @@ class Game:
self.main_logger = logging.getLogger().getChild('main') self.main_logger = logging.getLogger().getChild('main')
self.server_logger = logging.getLogger().getChild('server') self.server_logger = logging.getLogger().getChild('server')
self.client_logger = logging.getLogger().getChild('client') self.client_logger = logging.getLogger().getChild('client')
self.main_logger.info('client logger and server logger done') self.main_logger.info('loggers created')
self.main_logger.info('main logger setup done')
self.log_log_config()
# version check # version check
self.python_version_check() self.python_version_check()
# client and server # client and server
self.client = client.client(self.client_logger, self.dicts, self.lists, net_mode='local') self.client = client.client(self.client_logger, self.dicts, self.lists, net_mode='local')
self.server = server.server(self.lists, self.dicts, self.server_logger, net_mode='local') self.server = server.server(self.lists, self.dicts, self.server_logger, net_mode='local')
# //todo log configs
def log_log_config(self):
self.main_logger.info('game start setup at %s' % self.start_time)
self.main_logger.debug('log file name: %s' % self.log_filename)
self.main_logger.debug('log file level: %s' % self.log_config['level'])
self.main_logger.debug('log file format: %s' % self.log_config['fmt'])
self.main_logger.debug('log file date format: %s' % self.log_config['date_fmt'])
def python_version_check(self) -> None: def python_version_check(self) -> None:
self.main_logger.info('Difficult Rocket is running on Python Vision %s' % self.on_python_v) self.main_logger.info('Difficult Rocket is running on Python Vision %s' % self.on_python_v)

View File

@ -26,8 +26,6 @@
] ]
] ]
}, },
'defaut ship': 'default ship': [
[
] ]
} }

View File

@ -14,7 +14,7 @@
'bool', 'bool',
// hidden in part list // hidden in part list
'bool', 'bool',
// hidden in misson (even thought that is not done yet) // hidden in mission (even thought that is not done yet)
'float' 'float'
// buoyancy(浮力) in the water // buoyancy(浮力) in the water
], ],