diff --git a/fcwslib--/__pycache__/__init__.cpython-310.pyc b/fcwslib--/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index 95b93a6..0000000 Binary files a/fcwslib--/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/fcwslib--/__pycache__/__init__.cpython-38.pyc b/fcwslib--/__pycache__/__init__.cpython-38.pyc deleted file mode 100644 index b6354a3..0000000 Binary files a/fcwslib--/__pycache__/__init__.cpython-38.pyc and /dev/null differ diff --git a/fcwslib/__init__.py b/fcwslib/__init__.py new file mode 100644 index 0000000..4154402 --- /dev/null +++ b/fcwslib/__init__.py @@ -0,0 +1,26 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +__version__ = '0.0.1' +__all__ = [] +__author__ = 'Fuckcraft ' + +''' +Fuckcraft Websocket Library (FCWSLIB) +A library to develop minecraft websocket server easily. + + Copyright (C) 2021 Fuckcraft + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. +''' + +from main import * + diff --git a/fcwslib--/__init__.py b/fcwslib/main.py similarity index 79% rename from fcwslib--/__init__.py rename to fcwslib/main.py index b897032..02e37b7 100644 --- a/fcwslib--/__init__.py +++ b/fcwslib/main.py @@ -5,6 +5,23 @@ __version__ = '0.0.1' __all__ = ['run_server', 'subscribe', 'unsubscribe', 'send_command', 'tellraw'] __author__ = 'Fuckcraft ' +''' +Fuckcraft Websocket Library (FCWSLIB) +A library to develop minecraft websocket server easily. + + Copyright (C) 2021 Fuckcraft + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. +''' + import os import json import uuid @@ -19,11 +36,11 @@ import websockets # 此函数用于向 Minecraft 订阅请求 async def subscribe(websocket, event_name): ''' - 参数: + 输入: : websocket : websocket 对象 : : event_name : 需要订阅的请求 : - 返回: + 输出: None ''' @@ -48,17 +65,17 @@ async def subscribe(websocket, event_name): # 此函数用于向 Minecraft 消除订阅请求 async def unsubscribe(webscket): ''' - 参数: + 输入: : websocket : websocket 对象 : : event_name : 需要消除订阅的请求 : - 返回: + 输出: None ''' response = { "body": { - "eventName": str(event_name) # PlayerMessage + "eventName": str(event_name) # 示例:PlayerMessage }, "header": { "requestId": str(uuid.uuid4()), @@ -74,14 +91,16 @@ async def unsubscribe(webscket): await websocket.send(response) +# 我个人不负责这块的质量,因为他们逼迫我违心的写了这段代码 + # 此函数用于向 Minecraft 执行命令 async def send_command(websocket, command): ''' - 参数: + 输入: : websocket : websocket 对象 : : command : 执行的命令 : - 返回: + 输出: None ''' @@ -110,11 +129,11 @@ async def send_command(websocket, command): # 此函数用于向 Minecraft 发送消息 async def tellraw(websocket, message): ''' - 参数: + 输入: : websocket : websocket 对象 : : message : 发送的消息 : - 返回: + 输出: None ''' diff --git a/languages/__pycache__/__init__.cpython-39.pyc b/languages/__pycache__/__init__.cpython-39.pyc deleted file mode 100644 index f925bdd..0000000 Binary files a/languages/__pycache__/__init__.cpython-39.pyc and /dev/null differ diff --git a/languages/__pycache__/enGB.cpython-39.pyc b/languages/__pycache__/enGB.cpython-39.pyc deleted file mode 100644 index 81ade0e..0000000 Binary files a/languages/__pycache__/enGB.cpython-39.pyc and /dev/null differ diff --git a/languages/__pycache__/lang.cpython-39.pyc b/languages/__pycache__/lang.cpython-39.pyc deleted file mode 100644 index 8ae2ac3..0000000 Binary files a/languages/__pycache__/lang.cpython-39.pyc and /dev/null differ diff --git a/languages/__pycache__/zhCN.cpython-39.pyc b/languages/__pycache__/zhCN.cpython-39.pyc deleted file mode 100644 index 8ed1447..0000000 Binary files a/languages/__pycache__/zhCN.cpython-39.pyc and /dev/null differ diff --git a/msctspt/__init__.pyc b/msctspt/__init__.pyc deleted file mode 100644 index d6538b0..0000000 Binary files a/msctspt/__init__.pyc and /dev/null differ diff --git a/msctspt/__pycache__/__init__.cpython-39.pyc b/msctspt/__pycache__/__init__.cpython-39.pyc deleted file mode 100644 index 1618cc5..0000000 Binary files a/msctspt/__pycache__/__init__.cpython-39.pyc and /dev/null differ diff --git a/msctspt/__pycache__/bdxOpera_CP.cpython-39.pyc b/msctspt/__pycache__/bdxOpera_CP.cpython-39.pyc deleted file mode 100644 index a5eb9a5..0000000 Binary files a/msctspt/__pycache__/bdxOpera_CP.cpython-39.pyc and /dev/null differ diff --git a/msctspt/__pycache__/bugReporter.cpython-39.pyc b/msctspt/__pycache__/bugReporter.cpython-39.pyc deleted file mode 100644 index 81e0ce2..0000000 Binary files a/msctspt/__pycache__/bugReporter.cpython-39.pyc and /dev/null differ diff --git a/msctspt/__pycache__/funcOpera.cpython-39.pyc b/msctspt/__pycache__/funcOpera.cpython-39.pyc deleted file mode 100644 index 80172f1..0000000 Binary files a/msctspt/__pycache__/funcOpera.cpython-39.pyc and /dev/null differ diff --git a/msctspt/__pycache__/threadOpera.cpython-39.pyc b/msctspt/__pycache__/threadOpera.cpython-39.pyc deleted file mode 100644 index 47fc304..0000000 Binary files a/msctspt/__pycache__/threadOpera.cpython-39.pyc and /dev/null differ diff --git a/msctspt/__pycache__/transfer.cpython-38.pyc b/msctspt/__pycache__/transfer.cpython-38.pyc index b86a005..bba07b0 100644 Binary files a/msctspt/__pycache__/transfer.cpython-38.pyc and b/msctspt/__pycache__/transfer.cpython-38.pyc differ diff --git a/msctspt/__pycache__/transfer.cpython-39.pyc b/msctspt/__pycache__/transfer.cpython-39.pyc deleted file mode 100644 index 3fd8945..0000000 Binary files a/msctspt/__pycache__/transfer.cpython-39.pyc and /dev/null differ diff --git a/msctspt/__pycache__/values.cpython-39.pyc b/msctspt/__pycache__/values.cpython-39.pyc deleted file mode 100644 index b791c05..0000000 Binary files a/msctspt/__pycache__/values.cpython-39.pyc and /dev/null differ diff --git a/nmcsup/__pycache__/__init__.cpython-310.pyc b/nmcsup/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index 3b77c78..0000000 Binary files a/nmcsup/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/nmcsup/__pycache__/__init__.cpython-39.pyc b/nmcsup/__pycache__/__init__.cpython-39.pyc deleted file mode 100644 index 50caa78..0000000 Binary files a/nmcsup/__pycache__/__init__.cpython-39.pyc and /dev/null differ diff --git a/nmcsup/__pycache__/const.cpython-310.pyc b/nmcsup/__pycache__/const.cpython-310.pyc deleted file mode 100644 index 85f395c..0000000 Binary files a/nmcsup/__pycache__/const.cpython-310.pyc and /dev/null differ diff --git a/nmcsup/__pycache__/const.cpython-39.pyc b/nmcsup/__pycache__/const.cpython-39.pyc deleted file mode 100644 index 67d6277..0000000 Binary files a/nmcsup/__pycache__/const.cpython-39.pyc and /dev/null differ diff --git a/nmcsup/__pycache__/log.cpython-310.pyc b/nmcsup/__pycache__/log.cpython-310.pyc deleted file mode 100644 index b720ea3..0000000 Binary files a/nmcsup/__pycache__/log.cpython-310.pyc and /dev/null differ diff --git a/nmcsup/__pycache__/log.cpython-39.pyc b/nmcsup/__pycache__/log.cpython-39.pyc deleted file mode 100644 index 386b007..0000000 Binary files a/nmcsup/__pycache__/log.cpython-39.pyc and /dev/null differ diff --git a/nmcsup/__pycache__/nmcreader.cpython-39.pyc b/nmcsup/__pycache__/nmcreader.cpython-39.pyc deleted file mode 100644 index 3a59181..0000000 Binary files a/nmcsup/__pycache__/nmcreader.cpython-39.pyc and /dev/null differ diff --git a/nmcsup/__pycache__/trans.cpython-310.pyc b/nmcsup/__pycache__/trans.cpython-310.pyc deleted file mode 100644 index 2e9ef90..0000000 Binary files a/nmcsup/__pycache__/trans.cpython-310.pyc and /dev/null differ diff --git a/nmcsup/__pycache__/trans.cpython-39.pyc b/nmcsup/__pycache__/trans.cpython-39.pyc deleted file mode 100644 index 2be7a56..0000000 Binary files a/nmcsup/__pycache__/trans.cpython-39.pyc and /dev/null differ diff --git a/nmcsup/__pycache__/vers.cpython-310.pyc b/nmcsup/__pycache__/vers.cpython-310.pyc deleted file mode 100644 index 8b2d2e7..0000000 Binary files a/nmcsup/__pycache__/vers.cpython-310.pyc and /dev/null differ diff --git a/nmcsup/__pycache__/vers.cpython-39.pyc b/nmcsup/__pycache__/vers.cpython-39.pyc deleted file mode 100644 index 31b6a25..0000000 Binary files a/nmcsup/__pycache__/vers.cpython-39.pyc and /dev/null differ