release coming?

This commit is contained in:
沈瑗杰 2021-09-24 00:04:56 +08:00
parent 150a1c6179
commit 60f120862a
3 changed files with 12 additions and 16 deletions

View File

@ -19,9 +19,9 @@ import decimal
import logging import logging
import traceback import traceback
import configparser import configparser
from xml.dom.minidom import parse
import semver from typing import List
from xml.dom.minidom import parse
if __name__ == '__main__': # been start will not run this if __name__ == '__main__': # been start will not run this
sys.path.append('/bin/libs') sys.path.append('/bin/libs')
@ -221,7 +221,7 @@ Physics calculation
def is_decimal(A: any) -> bool: def is_decimal(A: any) -> bool:
if isinstance(A, decimal): if isinstance(A, decimal.Decimal):
return False return False
else: else:
return True return True
@ -334,7 +334,7 @@ def G_C(M, m, R, G): # stand for gravity calculation
return g return g
def distance(A: List[float, float], B: List[float, float]): def distance(A, B):
""" """
formats: formats:
A & B format: docs.basic_config:basic_poi A & B format: docs.basic_config:basic_poi
@ -353,4 +353,4 @@ def distance(A: List[float, float], B: List[float, float]):
poi_dis[2] **= 0.5 poi_dis[2] **= 0.5
return poi_dis[2] return poi_dis[2]
def # def

View File

@ -21,6 +21,7 @@ import threading
import configparser import configparser
import multiprocessing import multiprocessing
from decimal import Decimal
from multiprocessing import Pipe from multiprocessing import Pipe
from multiprocessing.connection import Connection from multiprocessing.connection import Connection
@ -85,9 +86,6 @@ class ClientWindow(pyglet.window.Window):
""" """
# logging # logging
self.logger = logging.getLogger('client') self.logger = logging.getLogger('client')
# share memory
# self.dev_list = dev_list
# self.dev_dic = dev_dic
# value # value
self.net_mode = net_mode self.net_mode = net_mode
self.run_input = False self.run_input = False
@ -95,15 +93,14 @@ class ClientWindow(pyglet.window.Window):
pyglet.resource.path = ['textures'] pyglet.resource.path = ['textures']
pyglet.resource.reindex() pyglet.resource.reindex()
self.config_file = tools.config('configs/main.config') self.config_file = tools.config('configs/main.config')
self.FPS = int(self.config_file['runtime']['fps']) self.FPS = Decimal(int(self.config_file['runtime']['fps']))
self.SPF = 1.0 / self.FPS self.SPF = Decimal('1') / self.FPS
# lang # lang
self.lang = tools.config('configs/lang/%s.json5' % self.config_file['runtime']['language'], 'client') self.lang = tools.config('configs/lang/%s.json5' % self.config_file['runtime']['language'], 'client')
# dic # dic
self.environment = {} self.environment = {}
self.textures = {} # all textures self.textures = {} # all textures
self.runtime = {} self.runtime = {}
# list
# FPS # FPS
self.max_fps = [self.FPS, time.time()] self.max_fps = [self.FPS, time.time()]
self.min_fps = [self.FPS, time.time()] self.min_fps = [self.FPS, time.time()]
@ -113,15 +110,13 @@ class ClientWindow(pyglet.window.Window):
self.label_batch = pyglet.graphics.Batch() self.label_batch = pyglet.graphics.Batch()
# frame # frame
self.frame = pyglet.gui.Frame(self) self.frame = pyglet.gui.Frame(self)
self.M_frame = pyglet.gui.MovableFrame(self)
# setup # setup
self.setup() self.setup()
self.info_label = pyglet.text.Label(x=10, y=self.height - 10, self.info_label = pyglet.text.Label(x=10, y=self.height - 10,
anchor_x='left', anchor_y='top', anchor_x='left', anchor_y='top',
batch=self.label_batch) batch=self.label_batch)
pyglet.clock.schedule_interval(self.update, self.SPF) pyglet.clock.schedule_interval(self.update, float(self.SPF))
self.times.append(time.time())
self.times.append(self.times[1] - self.times[0])
self.logger.debug(self.times[2])
self.logger.info(self.lang['setup.done']) self.logger.info(self.lang['setup.done'])
@new_thread('client_load_environment') @new_thread('client_load_environment')

View File

@ -16,6 +16,7 @@
}, },
'client': { 'client': {
'setup.done': '客户端载入完成', 'setup.done': '客户端载入完成',
'setup.use_time': '客户端载入消耗时间: {} 秒',
'os.pid_is': '客户端 PID: {} PPID: {}', 'os.pid_is': '客户端 PID: {} PPID: {}',
'button.been_press': '按钮被按下,目前状态为:', 'button.been_press': '按钮被按下,目前状态为:',
'mouse.press': '鼠标在 {} 被按下,按键为:{}', 'mouse.press': '鼠标在 {} 被按下,按键为:{}',
@ -23,7 +24,7 @@
'mouse.right': '右键', 'mouse.right': '右键',
'mouse.left': '左键', 'mouse.left': '左键',
'libs.local': '正在使用本地 pyglet 库 版本为: {}', 'libs.local': '正在使用本地 pyglet 库 版本为: {}',
'libs.outer': '正在使用全局 pyglet 库 版本为: {}\n(可能会造成bug因为本地库版本为2.0dev)' 'libs.outer': '正在使用全局 pyglet 库 版本为: {}\n(可能会造成bug因为本地库版本为2.0dev9)'
}, },
'server': { 'server': {
'setup.done': '服务端载入完成', 'setup.done': '服务端载入完成',