allow anonymous player monitoring
This commit is contained in:
parent
aae40bf6e7
commit
b8146bd002
@ -2,6 +2,7 @@ extends Node
|
|||||||
|
|
||||||
|
|
||||||
export var monitor_enabled: bool = false
|
export var monitor_enabled: bool = false
|
||||||
|
export var anonymous: bool = true
|
||||||
export var debug: bool = false
|
export var debug: bool = false
|
||||||
export var development_url: String = "http://localhost:4050/api/v1"
|
export var development_url: String = "http://localhost:4050/api/v1"
|
||||||
var url_real: String = "https://alai.cromer.cl/api/v1"
|
var url_real: String = "https://alai.cromer.cl/api/v1"
|
||||||
@ -58,6 +59,7 @@ func _ready() -> void:
|
|||||||
|
|
||||||
game_version = get_parent().game_version
|
game_version = get_parent().game_version
|
||||||
|
|
||||||
|
if not anonymous:
|
||||||
player["rut"] = ""
|
player["rut"] = ""
|
||||||
player["name"] = ""
|
player["name"] = ""
|
||||||
player["email"] = ""
|
player["email"] = ""
|
||||||
@ -82,6 +84,7 @@ func _ready() -> void:
|
|||||||
else:
|
else:
|
||||||
os_id = 0
|
os_id = 0
|
||||||
|
|
||||||
|
if not anonymous:
|
||||||
game["player"] = player
|
game["player"] = player
|
||||||
game["level_id"] = 0
|
game["level_id"] = 0
|
||||||
game["os_id"] = os_id
|
game["os_id"] = os_id
|
||||||
@ -108,6 +111,12 @@ func _ready() -> void:
|
|||||||
|
|
||||||
func _physics_process(_delta: float) -> void:
|
func _physics_process(_delta: float) -> void:
|
||||||
if monitor_enabled:
|
if monitor_enabled:
|
||||||
|
if anonymous and has_node("MonitorGUI"):
|
||||||
|
$MonitorGUI.queue_free()
|
||||||
|
Event.emit_signal("monitor_loaded")
|
||||||
|
get_tree().paused = false
|
||||||
|
start_monitor()
|
||||||
|
else:
|
||||||
if has_node("MonitorGUI") and not $MonitorGUI.visible:
|
if has_node("MonitorGUI") and not $MonitorGUI.visible:
|
||||||
$MonitorGUI.visible = true
|
$MonitorGUI.visible = true
|
||||||
Event.emit_signal("monitor_loaded")
|
Event.emit_signal("monitor_loaded")
|
||||||
@ -137,6 +146,7 @@ func _physics_process(_delta: float) -> void:
|
|||||||
|
|
||||||
|
|
||||||
func _on_input_validated(validated_player: Dictionary) -> void:
|
func _on_input_validated(validated_player: Dictionary) -> void:
|
||||||
|
if not anonymous:
|
||||||
$MonitorGUI.queue_free()
|
$MonitorGUI.queue_free()
|
||||||
get_tree().paused = false
|
get_tree().paused = false
|
||||||
Event.emit_signal("game_started")
|
Event.emit_signal("game_started")
|
||||||
|
Loading…
Reference in New Issue
Block a user