And once again
This commit is contained in:
18
scenes_old_2/utils/server_data/server_data.gd
Normal file
18
scenes_old_2/utils/server_data/server_data.gd
Normal file
@ -0,0 +1,18 @@
|
||||
class_name ServerData extends Node
|
||||
|
||||
@export var players: Dictionary = {}
|
||||
@export var port: int = 27015
|
||||
@export var player_limit: int = 30
|
||||
@export var current_map: String = "lowpoly_tdm_2"
|
||||
|
||||
@rpc("any_peer", "reliable", "call_local")
|
||||
func set_player_side(side: String):
|
||||
if multiplayer.is_server():
|
||||
var id: int = multiplayer.get_remote_sender_id()
|
||||
if players.has(id):
|
||||
players[id]["side"] = side
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
17
scenes_old_2/utils/server_data/server_data.tscn
Normal file
17
scenes_old_2/utils/server_data/server_data.tscn
Normal file
@ -0,0 +1,17 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://cu6t3m38skton"]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/utils/server_data/server_data.gd" id="1_o07e3"]
|
||||
|
||||
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_t8y34"]
|
||||
properties/0/path = NodePath(".:players")
|
||||
properties/0/spawn = true
|
||||
properties/0/replication_mode = 1
|
||||
properties/1/path = NodePath(".:current_map")
|
||||
properties/1/spawn = true
|
||||
properties/1/replication_mode = 1
|
||||
|
||||
[node name="ServerData" type="Node"]
|
||||
script = ExtResource("1_o07e3")
|
||||
|
||||
[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."]
|
||||
replication_config = SubResource("SceneReplicationConfig_t8y34")
|
Reference in New Issue
Block a user