24 lines
634 B
GDScript
24 lines
634 B
GDScript
extends MultiplayerSpawner
|
|
|
|
|
|
func _ready() -> void:
|
|
print(Multiplayer.get_local_ip())
|
|
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)
|