Renamed a bunch of player stuff to pawn stuff and implemented extensive work on getting single-address 'netplay' code working. Not sure if I've created issues with single player but in theory it should all transfer across as if the player is simply always the host.

This commit is contained in:
2026-01-08 07:15:20 -05:00
parent 9fe376e27e
commit ec02685065
69 changed files with 1525 additions and 708 deletions

22
scripts/net_test.gd Normal file
View File

@@ -0,0 +1,22 @@
extends MultiplayerSpawner
func _ready() -> void:
if Game.net_test:
await get_tree().create_timer(0.25).timeout
Multiplayer.join_game("123")
else:
Multiplayer.handle = "456"
Multiplayer.become_host()
await get_tree().create_timer(2).timeout
var pids = Multiplayer.players.values()
if Multiplayer.is_host():
var ps : Dictionary[int, PawnBaseData] = {
pids[0] : load("res://data/pawns/van_reily.tres"),
pids[1] : load("res://data/pawns/lou_riche.tres")
}
Game.start_level(ps)
func _on_level_spawned(_node: Node) -> void:
Game.level_spawned.rpc_id(1, Multiplayer.id)