commit 20c2ec8c0332ba1b19e061246a8091c7e874f50e Author: jie65535 Date: Mon Mar 4 23:28:20 2024 +0800 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2bf1ef8 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +debug.log \ No newline at end of file diff --git a/Debugger.py b/Debugger.py new file mode 100644 index 0000000..af0725b --- /dev/null +++ b/Debugger.py @@ -0,0 +1,50 @@ +import socket +import signal +import sys + +# 监听的地址和端口 +HOST = '127.0.0.1' +PORT = 12345 + +# 定义信号处理函数 +def signal_handler(sig, frame): + print('\nExiting...') + sys.exit(0) + +# 设置信号处理程序 +signal.signal(signal.SIGINT, signal_handler) +signal.signal(signal.SIGTERM, signal_handler) + +# 创建TCP socket +with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as server_socket: + # 设置socket选项,允许地址重用 + server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + # 绑定地址和端口 + server_socket.bind((HOST, PORT)) + # 开始监听 + server_socket.listen(1) + print(f"Listening on {HOST}:{PORT}...") + + try: + while True: + # 接受连接 + conn, addr = server_socket.accept() + with conn: + print(f"Connected by {addr}") + + # 打开/创建debug.log文件 + with open("debug.log", "a") as log_file: + while True: + data = conn.recv(1024) + if not data: + print(f"Connection closed by {addr}") + break + # 将收到的消息写入到控制台和日志文件中 + msg = data.decode('utf-8') + print(msg) + log_file.write(msg) + log_file.flush() + + except KeyboardInterrupt: + print('\nKeyboardInterrupt: Exiting...') + sys.exit(0) \ No newline at end of file diff --git a/JCursor/Cursor.png b/JCursor/Cursor.png new file mode 100644 index 0000000..a2428d7 Binary files /dev/null and b/JCursor/Cursor.png differ diff --git a/JCursor/JCursor.lua b/JCursor/JCursor.lua new file mode 100644 index 0000000..19eadd5 --- /dev/null +++ b/JCursor/JCursor.lua @@ -0,0 +1,67 @@ +--- STEAMODDED HEADER +--- MOD_NAME: J Cursor +--- MOD_ID: JCursor +--- MOD_AUTHOR: [Jie65535] +--- MOD_DESCRIPTION: Custom Cursor (./Mods/JCursor/Cursor.png) + +---------------------------------------------- +------------MOD CODE ------------------------- + +SMODS.registerUIElement("JCursor", { + { + n = G.UIT.R, + config = { + padding = 0.2, + align = "cm" + }, + nodes = { + UIBox_button({ + minw = 3.85, + button = "openModDirectory", + label = { + "Open directory" + } + }), + UIBox_button({ + minw = 3.85, + button = "refreshCursor", + label = { + "Refresh cursor" + } + }), + } + } +}) + +local function getModDirectory() + return "/Mods/JCursor" +end + +local function getCursorFile() + return getModDirectory() .. "/Cursor.png" +end + +local function setCursor(filename) + cursor = love.mouse.newCursor(filename, 0, 0) + love.mouse.setCursor(cursor) +end + +function G.FUNCS.openModDirectory(arg_736_0) + sendDebugMessage("openModDirectory") + love.system.openURL("file://" .. love.filesystem.getSaveDirectory() .. getModDirectory()) +end + +function G.FUNCS.refreshCursor(arg_736_0) + sendDebugMessage("refreshCursor") + setCursor(getCursorFile()) +end + +local defaultCursor = getCursorFile() +if love.filesystem.exists(defaultCursor) then + setCursor(defaultCursor) +end + +sendDebugMessage("JCursor loaded!") + +---------------------------------------------- +------------MOD CODE END---------------------- \ No newline at end of file diff --git a/JDumper.lua b/JDumper.lua new file mode 100644 index 0000000..4430e99 --- /dev/null +++ b/JDumper.lua @@ -0,0 +1,14 @@ +--- STEAMODDED HEADER +--- MOD_NAME: J Dumper +--- MOD_ID: JDumper +--- MOD_AUTHOR: [Jie65535] +--- MOD_DESCRIPTION: Dump all game information! + +---------------------------------------------- +------------MOD CODE ------------------------- + + +sendDebugMessage("J Dumper Activated!") + +---------------------------------------------- +------------MOD CODE END---------------------- \ No newline at end of file