Code Monkey home page Code Monkey logo

monitorr's Issues

当玩家退出时,监控依旧在查询此玩家的信息

服务器MCDR后台日志:
[MCDR] [2021-08-07 09:46:58] [MonitorR/WARNING]: [Minecraft Data API] Query for player zi_xian at path Pos timeout
[MCDR] [2021-08-07 09:47:03] [MonitorR/WARNING]: [Minecraft Data API] Query for player greenskype at path Pos timeout
[MCDR] [2021-08-07 09:47:08] [MonitorR/WARNING]: [Minecraft Data API] Query for player YiFeng1999 at path Pos timeout

两个bug

一个是再windows下面:不能作为文件名存在,
time = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
把:去掉就可以了;
还有一个没检查records文件夹是否存在,默认之前插件留存这个文件夹就不报错,但是全新创建服务器一直报错
config_folder = f"./config/{PLUGIN_METADATA['id']}"
log_folder = f'{config_folder}/logs'
log_file = f'{log_folder}/log.json'
site_file = f'{config_folder}/site.json'
config_file = f'{config_folder}/config.json'

def split_log() -> None:
global record_fp
if os.path.exists(log_file):
time = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
os.rename(log_file, f'./records/{time}.json')
if not os.path.exists(config_folder):
os.makedirs(config_folder)
if not os.path.exists(log_folder):
os.makedirs(log_folder)
record_fp = open(log_file, 'w+', encoding='utf-8')

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.