Skip to content

Commit

Permalink
Changes of the default connection url
Browse files Browse the repository at this point in the history
ActivatedScripts.cs : annotations added
  • Loading branch information
CesarCRP97 committed Dec 2, 2023
1 parent 5c1bc29 commit 276200b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions Code&Go/Assets/Scripts/Network/ActivatedScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions Code&Go/Assets/StreamingAssets/communityServer.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"serverIP": "http://13.48.149.249",
"serverPort": "8080"
"serverIP": "http://localhost",
"serverPort": "4200"
}

0 comments on commit 276200b

Please sign in to comment.