c4beeae38f
Top-down twin-stick bullet-hell, Godot 4.7, server-authoritative dedicated server with client-side prediction. Clients send input only; the server resolves every hit for both players and enemies (no PvP). - SimWorld: whole simulation as plain RefCounted objects (no nodes, no physics server), ~0.24ms/tick at peak load -- runs headless for free and drives 78 tests in under a second - BulletPool: struct-of-arrays bullet storage, replicated as spawn/despawn events rather than per-tick state - Emitter framework (Ring/AimedSpread/WallGap/ArcSweep) shared by trash enemies and bosses -- a new boss is data in src/content/content.gd, no simulation changes - The Warden of the Fold: stationary 4-phase boss built entirely on that format - Lobby hub with a portal into on-demand dungeon instances; one process hosts the hub plus every concurrent dungeon - Emergency escape: 3s server-owned channel, cancelled by damage - tools/check.sh, test.sh (GUT), smoke.sh (real server + bot clients over ENet), bench.gd; git hooks wired to the same scripts - docs/ARCHITECTURE.md, NETCODE.md, WORKFLOW.md, ROADMAP.md
58 lines
2.1 KiB
GDScript
58 lines
2.1 KiB
GDScript
class_name GutHookScript
|
|
## This script is the base for custom scripts to be used in pre and post
|
|
## run hooks.
|
|
##
|
|
## GUT Wiki: [url=https://gut.readthedocs.io]https://gut.readthedocs.io[/url]
|
|
## [br][br]
|
|
## Creating a hook script requires that you:[br]
|
|
## - Inherit [code skip-lint]GutHookScript[/code][br]
|
|
## - Implement a [code skip-lint]run()[/code] method[br]
|
|
## - Configure the path in GUT (gutconfig and/or editor) as the approparite hook (pre or post).[br]
|
|
##
|
|
## See [wiki]Hooks[/wiki]
|
|
|
|
|
|
## Class responsible for generating xml. You could use this to generate XML
|
|
## yourself instead of using the built in GUT xml generation options. See
|
|
## [addons/gut/junit_xml_export.gd]
|
|
var JunitXmlExport = load('res://addons/gut/junit_xml_export.gd')
|
|
|
|
## This is the instance of [GutMain] that is running the tests. You can get
|
|
## information about the run from this object. This is set by GUT when the
|
|
## script is instantiated.
|
|
var gut = null
|
|
|
|
# the exit code to be used by gut_cmdln. See set method.
|
|
var _exit_code = null
|
|
|
|
var _should_abort = false
|
|
|
|
## Virtual method that will be called by GUT after instantiating this script.
|
|
## This is where you put all of your logic.
|
|
func run():
|
|
gut.logger.error("Run method not overloaded. Create a 'run()' method in your hook script to run your code.")
|
|
|
|
## Register inner classes from one or more scripts for doubling.
|
|
## Only worth calling from pre-run hook, not post-run.
|
|
func register_inner_classes(script: Script):
|
|
gut.get_doubler().inner_class_registry.register(script)
|
|
|
|
## Set the exit code when running from the command line. If not set then the
|
|
## default exit code will be returned (0 when no tests fail, 1 when any tests
|
|
## fail).
|
|
func set_exit_code(code : int):
|
|
_exit_code = code
|
|
|
|
## Returns the exit code set with [code skip-lint]set_exit_code[/code]
|
|
func get_exit_code():
|
|
return _exit_code
|
|
|
|
## Usable by pre-run script to cause the run to end AFTER the run() method
|
|
## finishes. GUT will quit and post-run script will not be ran.
|
|
func abort():
|
|
_should_abort = true
|
|
|
|
## Returns if [code skip-lint]abort[/code] was called.
|
|
func should_abort():
|
|
return _should_abort
|