4a5264c5b0
- Replaced TeamData.Team type hints with int in all scripts - Added explicit preloads for headless mode class resolution - Created stub LagCompensation and DamageProcessor scripts - Fixed PluginManager, SpawnManager, EconomyManager, BuyZone, RoundManager, BuyMenuHandler, BombObjective class_name references - Updated server config to match ServerConfig.gd format Gray screen root cause: server scripts failed to parse in headless mode due to Godot 4 class_name loading order (Resource after Node), leaving server_main.gd non-functional — accepted connections but never spawned players.
81 lines
2.9 KiB
GDScript
81 lines
2.9 KiB
GDScript
## Plugin Manifest — Custom Resource
|
|
##
|
|
## Each plugin directory must contain a plugin.tres file of this type.
|
|
## The PluginManager scans for these files when discovering plugins.
|
|
##
|
|
## Example plugin.tres:
|
|
## [gd_resource type="Resource" format=3]
|
|
## [ext_resource type="Script" id="1" path="res://server/scripts/plugin_api/plugin_manifest.gd"]
|
|
## [resource]
|
|
## script = ExtResource("1")
|
|
## name = "Hello World"
|
|
## version = "1.0.0"
|
|
## author = "Tactical Shooter Team"
|
|
## script_path = "hello_world.gd"
|
|
## enabled = true
|
|
|
|
extends Resource
|
|
# class_name PluginManifest — commented out for headless compat
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Exported fields
|
|
# ---------------------------------------------------------------------------
|
|
|
|
## Human-readable plugin name (e.g. "Hello World").
|
|
## This is used as the canonical identifier for load/unload/info commands.
|
|
@export var name: String = &""
|
|
|
|
## Plugin version string (e.g. "1.0.0").
|
|
## Follows semver convention for compatibility checking.
|
|
@export var version: String = &"1.0.0"
|
|
|
|
## Author name, handle, or team name.
|
|
@export var author: String = &""
|
|
|
|
## Path to the main GDScript file, relative to the plugin directory
|
|
## (e.g. "hello_world.gd" for a script in the same directory).
|
|
@export var script_path: String = &""
|
|
|
|
## Whether the plugin is enabled on initial load.
|
|
## Set to false to keep the plugin discovered but not auto-loaded.
|
|
@export var enabled: bool = true
|
|
|
|
## Minimum required PluginManager API version (semver string).
|
|
## Leave empty if no minimum is required.
|
|
@export var min_api_version: String = &""
|
|
|
|
## Maximum allowed PluginManager API version (semver string).
|
|
## Leave empty if any version is accepted.
|
|
@export var max_api_version: String = &""
|
|
|
|
## Arbitrary key-value metadata (e.g. description, homepage, dependencies).
|
|
## Useful for plugin browsers and info commands.
|
|
@export var metadata: Dictionary = {}
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Validation helpers
|
|
# ---------------------------------------------------------------------------
|
|
|
|
## Returns true if the manifest fields are minimally valid and usable.
|
|
##
|
|
## A valid manifest must have:
|
|
## - A non-empty name
|
|
## - A non-empty script_path referencing the plugin's main script
|
|
func is_valid() -> bool:
|
|
return not name.is_empty() and not script_path.is_empty()
|
|
|
|
## Returns true if this plugin is compatible with the given API version.
|
|
## Uses simple string comparison — extend with proper semver logic as needed.
|
|
func is_api_compatible(api_version: String) -> bool:
|
|
if not min_api_version.is_empty() and api_version < min_api_version:
|
|
return false
|
|
if not max_api_version.is_empty() and api_version > max_api_version:
|
|
return false
|
|
return true
|
|
|
|
## Returns a human-readable summary of the manifest.
|
|
func to_summary() -> String:
|
|
return "%s v%s by %s (script: %s, enabled: %s)" % [
|
|
name, version, author, script_path, str(enabled)
|
|
]
|