From aae40bf6e78255f5f28d809007109e5c9e103aa3 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Thu, 22 Sep 2022 16:01:09 -0300 Subject: [PATCH 1/2] update to version 1.1.0 --- godot/Main.tscn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/godot/Main.tscn b/godot/Main.tscn index 049625d..1324688 100644 --- a/godot/Main.tscn +++ b/godot/Main.tscn @@ -8,7 +8,7 @@ [node name="Main" type="Node"] pause_mode = 2 script = ExtResource( 1 ) -game_version = "1.0.0" +game_version = "1.1.0" level = ExtResource( 2 ) [node name="Level" type="Node" parent="."] -- 2.30.2 From b8146bd002a418499b9fd9ada392e61c1297591d Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Thu, 22 Sep 2022 16:42:24 -0300 Subject: [PATCH 2/2] allow anonymous player monitoring --- godot/monitor/Monitor.gd | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/godot/monitor/Monitor.gd b/godot/monitor/Monitor.gd index c1bf442..85238fd 100644 --- a/godot/monitor/Monitor.gd +++ b/godot/monitor/Monitor.gd @@ -2,6 +2,7 @@ extends Node export var monitor_enabled: bool = false +export var anonymous: bool = true export var debug: bool = false export var development_url: String = "http://localhost:4050/api/v1" var url_real: String = "https://alai.cromer.cl/api/v1" @@ -58,9 +59,10 @@ func _ready() -> void: game_version = get_parent().game_version - player["rut"] = "" - player["name"] = "" - player["email"] = "" + if not anonymous: + player["rut"] = "" + player["name"] = "" + player["email"] = "" var os_name = OS.get_name() if os_name == "Android": @@ -82,7 +84,8 @@ func _ready() -> void: else: os_id = 0 - game["player"] = player + if not anonymous: + game["player"] = player game["level_id"] = 0 game["os_id"] = os_id game["godot_version"] = godot_version @@ -108,9 +111,15 @@ func _ready() -> void: func _physics_process(_delta: float) -> void: if monitor_enabled: - if has_node("MonitorGUI") and not $MonitorGUI.visible: - $MonitorGUI.visible = true + 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: + $MonitorGUI.visible = true + Event.emit_signal("monitor_loaded") if started and not get_tree().paused: var frame = empty_frame.duplicate(true) @@ -137,12 +146,13 @@ func _physics_process(_delta: float) -> void: func _on_input_validated(validated_player: Dictionary) -> void: - $MonitorGUI.queue_free() - get_tree().paused = false - Event.emit_signal("game_started") - player = validated_player.duplicate(true) - game["player"] = player - start_monitor() + if not anonymous: + $MonitorGUI.queue_free() + get_tree().paused = false + Event.emit_signal("game_started") + player = validated_player.duplicate(true) + game["player"] = player + start_monitor() func _object_created(name: String, state: String, position: Vector2, velocity: Vector2) -> void: -- 2.30.2