e7299b17e9
Stack installed: - netfox v1.35.3 (core + extras + noray + internals) - godot-jolt v0.16.0-stable Architecture: - Server: ENet transport (works headless, no netfox deps) - Client/Editor: netfox rollback (RollbackSynchronizer, TickInterpolator) New/modified: - docs/migration-netfox-plan.md — migration architecture - scripts/network/network_manager.gd — netfox-aware ENet fallback - scripts/network/player.gd — clean base player - client/characters/player_netfox.gd — rollback player w/ WeaponManager - client/characters/input/player_net_input.gd — BaseNetInput subclass - client/characters/character/fps_character_controller.gd — netfox input feed - client/weapons/ — weapon data, registry, TacticalWeaponHitscan, WeaponManager - client/scripts/round_replicator.gd — client-side round state bridge - server/scripts/round_manager.gd — improved state machine - server/scripts/plugin_api/plugin_manager.gd — refined plugin system - config: enemy_tag, ally_tag for meatball targeting Removed: old C++ SimulationServer GDExtension (replaced by netfox rollback)
35 lines
848 B
GDScript
35 lines
848 B
GDScript
extends RefCounted
|
|
class_name NorayProtocolHandler
|
|
## This class parses incoming data from noray's protocol.
|
|
##
|
|
## Unless you're writing your own noray integration, [Noray] should cover most
|
|
## use cases.
|
|
|
|
## Emitted for every command parsed during a [method ingest] call.
|
|
signal on_command(command: String, data: String)
|
|
|
|
var _strbuf: String = ""
|
|
|
|
## Resets the parser.
|
|
func reset():
|
|
_strbuf = ""
|
|
|
|
## Parse an incoming piece of data.
|
|
func ingest(data: String):
|
|
_strbuf += data
|
|
if not _strbuf.contains("\n"):
|
|
return
|
|
|
|
var idx = _strbuf.rfind("\n")
|
|
var lines = _strbuf.substr(0, idx).split("\n", false)
|
|
_strbuf = _strbuf.erase(0, idx + 1)
|
|
|
|
for line in lines:
|
|
if not line.contains(" "):
|
|
on_command.emit(line, "")
|
|
else:
|
|
var parts = line.split(" ")
|
|
var command = parts[0]
|
|
var param = parts[1]
|
|
on_command.emit(command, param)
|