# Manage configuration to connect on khaganat # # Copyright (C) 2019 AleaJactaEst # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . class connexion: var _url_login = "" var _url_register = "" var _khaganat_host = "localhost" var _khaganat_port = "40916" var _language = "FR" var _valid_certificate = true func _init(): print("[config connexion] Load connexion config"); #var message = load("res://assets/Scripts/Models/nel_login_message.gd") var config_file = ConfigFile.new() # /home//.local/share/godot/app_userdata/Khanat/connexion.cfg var err = config_file.load("user://connexion.cfg") if err: print("Error code when loading player config file khanat.cfg: ", err) config_file.set_value("login", "url", "http://149.91.80.160/login/r2_login.php") config_file.set_value("register", "url", "http://149.91.80.160/ams/index.php?page=register") config_file.set_value("global", "valid_certificate", false) config_file.save("user://connexion.cfg") self._url_login = config_file.get_value("login", "url", "http://172.17.0.3/login/r2_login.php") self._url_register = config_file.get_value("register", "url", "http://172.17.0.3/login/r2_login.php") self._khaganat_host = config_file.get_value("server", "host", "172.17.0.3") self._khaganat_port = config_file.get_value("server", "port", "47851") self._language = config_file.get_value("global", "language", "fr") self._valid_certificate = config_file.get_value("global", "valid_certificate", false) config_file.save("user://connexion.cfg") func get_khaganat_host(): return self._khaganat_host func get_khaganat_port(): return int(self._khaganat_port) func get_url_login(): return self._url_login func get_url_register(): return self._url_register func get_valid_certificate(): return self._valid_certificate func get_language(): return self._language