GeekROS 8 months ago
parent
commit
e6fdde50e3
1 changed files with 8 additions and 2 deletions
  1. 8 2
      engine/scripts/framework/global.gd

+ 8 - 2
engine/scripts/framework/global.gd

@@ -10,7 +10,7 @@ var data = {
 	"varsion": "1.0.0",
 	"mode": "",
 	"server": {
-		"port": 7020,
+		"port": 9000,
 		"address": "game.makeryang.com"
 	},
 	"account": {
@@ -31,7 +31,9 @@ func _ready() -> void:
 		data["mode"] = "client"
 		Request.on_server_ping()
 		var error = Client.create_client()
-		if error != OK:
+		if error == OK:
+			print("[服务器连接成功]")
+		else:
 			printerr("[服务器连接失败]")
 
 # 是否为服务器模式
@@ -45,6 +47,10 @@ func is_server() -> bool:
 func get_server_port() -> int:
 	return data["server"]["port"]
 
+# 获取服务器IP
+func get_server_ip() -> String:
+	return data["server"]["ip"]
+
 # 获取服务器端口
 func get_server_address() -> String:
 	return data["server"]["address"]