se-dev-game-code

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

SE Dev Game Code Skill

SE 开发游戏代码 Skill

Allows reading the decompiled C# code of Space Engineers version 1.
⚠️ CRITICAL: Commands run in a UNIX shell (busybox), NOT Windows CMD. Use bash syntax!
Examples:
  • test -f file.txt && echo exists
  • ls -la | head -10
  • if exist file.txt (echo exists)
    - This will NOT work
Actions:
  • prepare: Run the one-time preparation (Prepare.bat)
  • bash: Run UNIX shell commands via busybox
  • search: Run code searches using
    search_code.py
  • test: Test this skill by running
    test_search.bat
允许查看《太空工程师》版本1的反编译C#代码。
⚠️ 重要提示:命令在UNIX shell(busybox)中运行,而非Windows CMD。请使用bash语法!
Examples:
  • test -f file.txt && echo exists
  • ls -la | head -10
  • if exist file.txt (echo exists)
    - 此命令无法运行
操作:
  • prepare: 执行一次性准备操作(Prepare.bat)
  • bash: 通过busybox执行UNIX shell命令
  • search: 使用
    search_code.py
    执行代码搜索
  • test: 通过运行
    test_search.bat
    测试该Skill

Routing Decision

路由规则

Check these patterns in order - first match wins:
PriorityPatternExampleRoute
1Empty or bare invocation
se-dev-game-code
Show this help
2Prepare keywords
se-dev-game-code prepare
,
se-dev-game-code setup
,
se-dev-game-code init
prepare
3Bash/shell keywords
se-dev-game-code bash
,
se-dev-game-code grep
,
se-dev-game-code cat
bash
4Search keywords
se-dev-game-code search
,
se-dev-game-code find class
,
se-dev-game-code lookup
search
5Test keywords
se-dev-game-code test
,
se-dev-game-code verify
,
se-dev-game-code check
test
按顺序检查以下匹配规则 - 匹配到第一条即生效:
优先级匹配模式示例路由目标
1空调用或仅调用命令名
se-dev-game-code
显示本帮助文档
2包含Prepare相关关键词
se-dev-game-code prepare
,
se-dev-game-code setup
,
se-dev-game-code init
prepare
3包含Bash/Shell相关关键词
se-dev-game-code bash
,
se-dev-game-code grep
,
se-dev-game-code cat
bash
4包含Search相关关键词
se-dev-game-code search
,
se-dev-game-code find class
,
se-dev-game-code lookup
search
5包含Test相关关键词
se-dev-game-code test
,
se-dev-game-code verify
,
se-dev-game-code check
test

Getting Started

快速开始

⚠️ CRITICAL: Before running ANY commands, read CommandExecution.md to avoid common mistakes that cause command failures.
If the
Prepare.DONE
file is missing in this folder, you MUST run the one-time preparation steps first. See the prepare action.
⚠️ 重要提示:在执行任何命令前,请阅读CommandExecution.md,以避免导致命令执行失败的常见错误。
如果本文件夹中缺少
Prepare.DONE
文件,你必须先执行一次性准备步骤。请查看prepare操作

Essential Documentation

核心文档

  • CommandExecution.md - ⚠️ READ THIS FIRST - How to run commands correctly on Windows
  • CommandExecution.md - ⚠️ 请首先阅读 - 如何在Windows上正确执行命令

Code Search Documentation

代码搜索文档

  • QuickStart.md - More examples and quick reference
  • CodeSearch.md - Complete guide to searching classes, methods, fields, etc.
  • HierarchySearch.md - Finding class/interface inheritance and implementations
  • Advanced.md - Power user techniques for complex searches
  • Troubleshooting.md - What to do when searches return NO-MATCHES or too many results
  • Implementation.md - Technical details for skill contributors (optional)
  • QuickStart.md - 更多示例与快速参考
  • CodeSearch.md - 搜索类、方法、字段等的完整指南
  • HierarchySearch.md - 查找类/接口的继承与实现关系
  • Advanced.md - 高级用户的复杂搜索技巧
  • Troubleshooting.md - 当搜索无结果或结果过多时的解决方法
  • Implementation.md - 供Skill贡献者参考的技术细节(可选)

Quick Search Examples

快速搜索示例

bash
undefined
bash
undefined

Find class declarations

Find class declarations

uv run search_code.py class declaration MyCubeBlock
uv run search_code.py class declaration MyCubeBlock

Find method signatures

Find method signatures

uv run search_code.py method signature UpdateBeforeSimulation
uv run search_code.py method signature UpdateBeforeSimulation

Find class hierarchy

Find class hierarchy

uv run search_code.py class children MyTerminalBlock
uv run search_code.py class children MyTerminalBlock

Count results before viewing (useful for large result sets)

Count results before viewing (useful for large result sets)

uv run search_code.py class usage MyEntity --count
uv run search_code.py class usage MyEntity --count

Limit number of results

Limit number of results

uv run search_code.py class usage MyEntity --limit 50
uv run search_code.py class usage MyEntity --limit 50

Paginate through results

Paginate through results

uv run search_code.py class usage MyEntity --limit 100 --offset 0 uv run search_code.py class usage MyEntity --limit 100 --offset 100

Always check the game code when:
- You're unsure about the game's internal APIs and how to interface with them.
- The inner workings of Space Engineers is unclear.
uv run search_code.py class usage MyEntity --limit 100 --offset 0 uv run search_code.py class usage MyEntity --limit 100 --offset 100

建议在以下情况时查看游戏代码:
- 你对游戏的内部API及其调用方式不确定时
- 不清楚《太空工程师》的内部运行机制时

Custom Scripting

自定义脚本

For building your own utility scripts to work with the indexes and decompiled code:
  • ScriptingGuide.md - How to write Python scripts, use BusyBox, handle Windows paths
若要构建用于处理索引与反编译代码的自定义工具脚本:
  • ScriptingGuide.md - 如何编写Python脚本、使用BusyBox、处理Windows路径

Game Content Data

游戏内容数据

The textual part of the game's
Content
is copied into the
Content
folder for free text search:
  • Language translations, including the string IDs
  • Block and other entity definitions
  • Default blueprints and scenarios
  • See ContentTypes.md for the full list of content types
游戏
Content
中的文本部分已复制到
Content
文件夹中,支持全文搜索:
  • 语言翻译内容,包括字符串ID
  • 方块及其他实体定义
  • 默认蓝图与场景
  • 完整的内容类型列表请查看ContentTypes.md

General Rules

通用规则

  • In the
    Decompiled
    folder search only inside the C# source files (.cs) in general. If you work on transpiler or preloader patches, then also search in the IL code (.il) files.
  • In the
    Content
    folder search the files appropriate for the task. See ContentTypes.md for the list of types.
  • Do not search for decompiled game code outside the
    Decompiled
    folder which is at the same level as this skill file. The decompiled game source tree must be there if the preparation succeeded.
  • Do not search for game content data outside the
    Content
    folder which is at the same level as this skill file. The copied game content must be there if the preparation succeeded.
  • 通常情况下,仅在
    Decompiled
    文件夹内的C#源文件(.cs)中搜索。如果你处理转译器或预加载器补丁,也可在IL代码文件(.il)中搜索。
  • Content
    文件夹中搜索与任务对应的文件。内容类型列表请查看ContentTypes.md
  • 请勿在本Skill文件同级目录的
    Decompiled
    文件夹之外搜索反编译游戏代码。若准备操作成功,反编译的游戏源码树必须位于该文件夹中。
  • 请勿在本Skill文件同级目录的
    Content
    文件夹之外搜索游戏内容数据。若准备操作成功,复制的游戏内容必须位于该文件夹中。

Action References

操作参考

Follow the detailed instructions in:
  • prepare action - One-time preparation
  • bash action - Running UNIX shell commands via busybox
  • search action - Running code searches
  • test action - Testing this skill
请参考以下详细说明:
  • prepare 操作 - 一次性准备操作
  • bash 操作 - 通过busybox执行UNIX shell命令
  • search 操作 - 执行代码搜索
  • test 操作 - 测试本Skill