summaryrefslogtreecommitdiff
path: root/network/client_info.gd
diff options
context:
space:
mode:
Diffstat (limited to 'network/client_info.gd')
-rw-r--r--network/client_info.gd19
1 files changed, 19 insertions, 0 deletions
diff --git a/network/client_info.gd b/network/client_info.gd
new file mode 100644
index 0000000..45327e8
--- /dev/null
+++ b/network/client_info.gd
@@ -0,0 +1,19 @@
+class_name ClientInfo
+
+
+var file: String
+
+
+func _init(file_path: String) -> void:
+ file = FileAccess.get_file_as_string(file_path)
+
+
+
+func get_address() -> String:
+ var regex := RegEx.create_from_string("<address>(.*)<\\/address>")
+ return regex.search(file).get_string(1)
+
+
+func get_port() -> int:
+ var regex := RegEx.create_from_string("<port>(.*)<\\/port>")
+ return regex.search(file).get_string(1) as int