From 276200bec9e867ea35102592942336f2fd3dd890 Mon Sep 17 00:00:00 2001 From: CesarCRP97 <32871629+CesarCRP97@users.noreply.github.com> Date: Sat, 2 Dec 2023 17:19:57 +0100 Subject: [PATCH] Changes of the default connection url ActivatedScripts.cs : annotations added --- Code&Go/Assets/Scripts/Network/ActivatedScript.cs | 11 ++++++++--- Code&Go/Assets/StreamingAssets/communityServer.conf | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Code&Go/Assets/Scripts/Network/ActivatedScript.cs b/Code&Go/Assets/Scripts/Network/ActivatedScript.cs index bc0a3d9e..03680758 100644 --- a/Code&Go/Assets/Scripts/Network/ActivatedScript.cs +++ b/Code&Go/Assets/Scripts/Network/ActivatedScript.cs @@ -11,19 +11,24 @@ public class ActivatedScript : MonoBehaviour { //TODO Esto no se muy bien si estaria mejor en campos que configurara el usuario en el momento de la exportación/Importación - [SerializeField] private string server; // = "http://13.48.149.249"; - [SerializeField] private string port; // = "8080"; + + //Standard local values + [SerializeField] private string server; // = "http://localhost"; + [SerializeField] private string port; // = "4200"; public GameObject InfoImportPanel; [SerializeField] private Text _title; private void Start() { + //Tries to find the file "communityServer". If found parses its information to connect to the url. var FileName = "communityServer.conf"; var filePath = System.IO.Path.Combine(Application.streamingAssetsPath + "/", FileName); string contents = ""; + + //If the path is found, it add everything to "contents" and then parses it and uses this values to define the url. if (System.IO.File.Exists(filePath)) { contents = System.IO.File.ReadAllText(filePath); @@ -34,7 +39,7 @@ private void Start() { server = serverConf["serverIP"]; port = serverConf["serverPort"]; } - + //Si no existe el path utiliza el serve y port por defecto Debug.Log("Server IP = " + server + " - Port = " + port); } diff --git a/Code&Go/Assets/StreamingAssets/communityServer.conf b/Code&Go/Assets/StreamingAssets/communityServer.conf index be51c334..bb6890f9 100644 --- a/Code&Go/Assets/StreamingAssets/communityServer.conf +++ b/Code&Go/Assets/StreamingAssets/communityServer.conf @@ -1,4 +1,4 @@ { - "serverIP": "http://13.48.149.249", - "serverPort": "8080" + "serverIP": "http://localhost", + "serverPort": "4200" }