2020-12-05 21:24:54 +08:00
|
|
|
"""
|
|
|
|
writen by shenjackyuanjie
|
|
|
|
mail: 3695888@qq.com
|
|
|
|
"""
|
|
|
|
|
2021-01-25 12:22:55 +08:00
|
|
|
# share memory
|
2021-01-21 15:05:29 +08:00
|
|
|
from multiprocessing import Manager as share
|
2020-12-05 21:24:54 +08:00
|
|
|
|
2021-01-24 22:00:31 +08:00
|
|
|
import bin
|
2021-01-25 12:22:55 +08:00
|
|
|
import time
|
|
|
|
import logging
|
2021-01-24 22:00:31 +08:00
|
|
|
|
2021-01-25 12:22:55 +08:00
|
|
|
# 直接导入
|
2021-01-24 22:00:31 +08:00
|
|
|
import server
|
|
|
|
import client
|
2021-01-23 21:43:04 +08:00
|
|
|
|
2020-12-05 21:24:54 +08:00
|
|
|
|
2020-12-13 18:39:12 +08:00
|
|
|
class Game():
|
2020-12-21 18:46:20 +08:00
|
|
|
|
2020-12-05 21:24:54 +08:00
|
|
|
def __init__(self):
|
2021-01-25 17:01:54 +08:00
|
|
|
# basic config
|
|
|
|
self.start_time = time.strftime("%Y-%m-%d %H-%M-%S", time.gmtime(time.time()))
|
|
|
|
self.configs = ''
|
|
|
|
# share memory
|
2021-01-21 15:05:29 +08:00
|
|
|
self.dics = share().dict()
|
|
|
|
self.lists = share().list()
|
2021-01-25 17:01:54 +08:00
|
|
|
# logger
|
2021-01-25 12:22:55 +08:00
|
|
|
self.server_logger = logging.getLogger('server')
|
|
|
|
self.client_logger = logging.getLogger('client')
|
2021-01-25 17:01:54 +08:00
|
|
|
self.log_file_hander = logging.FileHandler('')
|
|
|
|
# client and server
|
2021-01-25 12:22:55 +08:00
|
|
|
self.client = client.RenderThread(self.lists, self.dics, self.client_logger, net_mode='local')
|
|
|
|
self.server = server.server(self.lists, self.dics, self.server_logger, net_mode='local')
|