mirror of
https://github.com/Relintai/pandemonium_demo_projects.git
synced 2024-12-21 13:56:50 +01:00
Fix the network synchronizer demo for pandemonium.
This commit is contained in:
parent
d34578c442
commit
255d45d9ca
@ -89,7 +89,7 @@ func _on_client_disconnected(peer_id):
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------------- Remote functions
|
||||
remote func _spawn_new_player(player_id, peer_id):
|
||||
func _spawn_new_player(player_id, peer_id):
|
||||
print("Spawn player id: ", player_id, ", Peer_id: ", peer_id)
|
||||
print("While my peer id is: ", get_tree().multiplayer.network_peer.get_unique_id())
|
||||
|
||||
@ -100,7 +100,13 @@ remote func _spawn_new_player(player_id, peer_id):
|
||||
character.set_color(COLORS_LIST[player_id])
|
||||
|
||||
|
||||
remote func _remove_player(player_id):
|
||||
func _remove_player(player_id):
|
||||
var player_node = get_tree().get_current_scene().get_node("player_" + str(player_id))
|
||||
if player_node != null:
|
||||
player_node.queue_free()
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
rpc_config(@"_spawn_new_player", MultiplayerAPI.RPC_MODE_REMOTE)
|
||||
rpc_config(@"_remove_player", MultiplayerAPI.RPC_MODE_REMOTE)
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
[sub_resource type="ProceduralSky" id=1]
|
||||
|
||||
[sub_resource type="Environment" id=2]
|
||||
[sub_resource type="Environment3D" id=2]
|
||||
background_mode = 2
|
||||
background_sky = SubResource( 1 )
|
||||
|
||||
@ -27,7 +27,7 @@ radius = 0.25
|
||||
[node name="Node" type="Node"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||
[node name="WorldEnvironment3D" type="WorldEnvironment3D" parent="."]
|
||||
environment = SubResource( 2 )
|
||||
|
||||
[node name="DirectionalLight" type="DirectionalLight" parent="."]
|
||||
|
@ -1,4 +1,4 @@
|
||||
[gd_resource type="Environment" load_steps=2 format=2]
|
||||
[gd_resource type="Environment3D" load_steps=2 format=2]
|
||||
|
||||
[sub_resource type="ProceduralSky" id=1]
|
||||
|
||||
|
@ -8,16 +8,6 @@
|
||||
|
||||
config_version=4
|
||||
|
||||
_global_script_classes=[ {
|
||||
"base": "SpringArm3D",
|
||||
"class": @"PlayerCamera",
|
||||
"language": @"GDScript",
|
||||
"path": "res://player_camera.gd"
|
||||
} ]
|
||||
_global_script_class_icons={
|
||||
@"PlayerCamera": ""
|
||||
}
|
||||
|
||||
[NetworkSynchronizer]
|
||||
|
||||
debug_doll_speedup=true
|
||||
@ -53,27 +43,27 @@ singletons=[ ]
|
||||
|
||||
forward={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":0,"physical_scancode":87,"unicode":0,"echo":false,"script":null)
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":0,"physical_scancode":87,"unicode":0,"echo":false,"action_match_force_exact":false,"script":null)
|
||||
]
|
||||
}
|
||||
backward={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":0,"physical_scancode":83,"unicode":0,"echo":false,"script":null)
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":0,"physical_scancode":83,"unicode":0,"echo":false,"action_match_force_exact":false,"script":null)
|
||||
]
|
||||
}
|
||||
left={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":0,"physical_scancode":65,"unicode":0,"echo":false,"script":null)
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":0,"physical_scancode":65,"unicode":0,"echo":false,"action_match_force_exact":false,"script":null)
|
||||
]
|
||||
}
|
||||
right={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":0,"physical_scancode":68,"unicode":0,"echo":false,"script":null)
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":0,"physical_scancode":68,"unicode":0,"echo":false,"action_match_force_exact":false,"script":null)
|
||||
]
|
||||
}
|
||||
jump={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":0,"physical_scancode":32,"unicode":0,"echo":false,"script":null)
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":0,"physical_scancode":32,"unicode":0,"echo":false,"action_match_force_exact":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
@ -86,7 +76,3 @@ jump={
|
||||
|
||||
common/physics_jitter_fix=0.0
|
||||
common/enable_pause_aware_picking=true
|
||||
|
||||
[rendering]
|
||||
|
||||
environment/default_environment="res://default_env.tres"
|
||||
|
Loading…
Reference in New Issue
Block a user