Skip to content

feat: print with [Sandbox.candidate_name.script.load] banner #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,4 @@ All other information should be explored by reading the source code!
- [2023/3/29 15:26] feat: print with `[Sandbox.candidate_name.script]` banner when script got an error.([#35](https://github.com/Escapingbug/dotaxctf/pull/35))
- [2023/3/29 21:44] fix: remove all nonempty entities after round ends.([#36](https://github.com/Escapingbug/dotaxctf/pull/36))
- [2023/3/29 22:49] feat: update panel state when round ends.([#37](https://github.com/Escapingbug/dotaxctf/pull/37))
- [2023/3/30 02:43] feat: print with `[Sandbox.candidate_name.script.load]` banner for loading error log.([#38](https://github.com/Escapingbug/dotaxctf/pull/38))
4 changes: 2 additions & 2 deletions sandbox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function Sandbox:LoadScript(user_script, quota, env, candidate_name)
}
local results = {pcall(lua_sandbox.protect, user_script, options)}
if not results[1] then
print("load script error: " .. results[2])
print("[Sandbox.".. candidate_name ..".script.load]", results[2])
return nil
end
return results[2]
Expand All @@ -49,7 +49,7 @@ function Sandbox:RunFunctionWrap(func, candidate_name, ...)
end
local results = {pcall(func, ...)}
if not results[1] then
print("[Sandbox.".. candidate_name ..".script]", results[2])
print("[Sandbox.".. candidate_name ..".script.run]", results[2])
return nil
end
return results[2]
Expand Down