diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2025-04-07 11:45:05 +0200 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2025-04-07 11:45:05 +0200 |
commit | f3d360e022fce829370c7d916abe98083b14818c (patch) | |
tree | 4ac9f886b45a9482dcd42e991e85ab2e4bea3dbc /network/client_info.gd | |
parent | bd77c88efc9327805b6f6fd83fa0492ed59d0f9a (diff) |
Diffstat (limited to 'network/client_info.gd')
-rw-r--r-- | network/client_info.gd | 19 |
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 |