Skip to content
Snippets Groups Projects
Commit a0e83acf authored by baletiballo's avatar baletiballo
Browse files

auto-reload default server addresses from streaming assets if smth broke them

Instead of telling the player to do so
parent eb1e55f4
No related branches found
No related tags found
No related merge requests found
......@@ -94,6 +94,12 @@ public class ServerSlotData
/// </summary>
public IEnumerator UpdateServerStatus(bool skipIfAlreadyChecked = false)
{
// This is the "default" value of slot1. If it has not been overwritten, the config should be reset from Streaming Assets (as it says)
// This should hopefully deal with this situation before a player has to
if (domain.Equals("if you can read this, go to 'Options'\n -> 'Reset Options'\n -> PRESS: 'Reset Configurations'"))
{
StreamingAssetLoader.ResetPlayerConfig();
}
if (skipIfAlreadyChecked && hasBeenChecked)
{
yield break; // Skip, if not neccessary
......@@ -105,7 +111,7 @@ public IEnumerator UpdateServerStatus(bool skipIfAlreadyChecked = false)
if (string.IsNullOrEmpty(domain))
{
currentStatus = ServerStatus.NoNetworkAddress;
UnityEngine.Debug.LogWarning("Server " + myKey.ToString() + " has no network adress.");
UnityEngine.Debug.LogWarning($"Server {myKey} has no network adress.");
}
else
{
......@@ -118,7 +124,7 @@ public IEnumerator UpdateServerStatus(bool skipIfAlreadyChecked = false)
}
else
{
UnityEngine.Debug.Log("Couldn't connect to Server " + myKey.ToString() + " under " + domain + " : " + request.error + "\n");
UnityEngine.Debug.Log($"Couldn't connect to Server {myKey} under {domain} : {request.error}");
currentStatus = ServerStatus.offline;
//try again
......@@ -149,11 +155,11 @@ public IEnumerator UpdateServerStatus(bool skipIfAlreadyChecked = false)
{
{ ServerSlot.last, new ServerSlotData("") },
{ ServerSlot.newIP, new ServerSlotData("") },
{ ServerSlot.slot1, new ServerSlotData("- if you can read this") },
{ ServerSlot.slot2, new ServerSlotData("- NetworkConfig") },
{ ServerSlot.slot3, new ServerSlotData("- GO TO -> 'Options'") },
{ ServerSlot.slot4, new ServerSlotData("- -> 'Reset Options'") },
{ ServerSlot.slot5, new ServerSlotData("- -> PRESS: 'Reset Configurations'") },
{ ServerSlot.slot1, new ServerSlotData("if you can read this, go to 'Options'\n -> 'Reset Options'\n -> PRESS: 'Reset Configurations'") },
{ ServerSlot.slot2, new ServerSlotData("") },
{ ServerSlot.slot3, new ServerSlotData("") },
{ ServerSlot.slot4, new ServerSlotData("") },
{ ServerSlot.slot5, new ServerSlotData("") },
{ ServerSlot.selecIP, new ServerSlotData("") },
{ ServerSlot.localServer, new ServerSlotData(ServerAddressLocal) }
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment