Polish C# scripting: ReadFile, cs_exec, frame budget#222
Draft
timfox wants to merge 1 commit into
Draft
Conversation
- Add IdTech3.Engine.ReadFile internal call with safe relative VFS paths - Add cs_exec one-shot compile/run (Game.Script.Init wrapper, no assembly swap) - Enforce cs_frameCallbackBudgetMs for Frame + frame event dispatch - Register cs_exec in cmd.c; sync demo IdTech3.Engine.cs - Document scripting overview in ARCHITECTURE.md and update CSHARP.md/tests Co-authored-by: Tim Fox <timfox@outlook.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Completes the C# scripting polish pass on top of the initial Mono integration (
USE_CSHARP, default OFF).Changes
IdTech3.Engine.ReadFile: VFS read via internal call; blocks absolute paths,.., and backslashes (same policy as JavaScriptreadFile).cs_exec: One-shot compile/run of console statements wrapped inGame.Script.Initwithout replacing the assembly loaded bycs_reload.cs_frameCallbackBudgetMs: Soft per-frame cap forGame.Script.Frameplus the syntheticframeevent (skips event dispatch when budget exceeded;0= unlimited).docs/CSHARP.md, scripting overview indocs/ARCHITECTURE.md, demoIdTech3.Engine.cssync,tests/scripts/test_csharp_scripting.shguards.Validation
./tests/scripts/test_csharp_scripting.sh— PASS./scripts/compile_engine.sh vulkan— PASS./scripts/compile_engine.sh vulkan csharp— PASS (when Mono dev packages installed)Usage
cs_autoInitremains 0 by default; CI unchanged.