Skip to content
Snippets Groups Projects
Commit 4804cc14 authored by Stefan Richter's avatar Stefan Richter
Browse files

added network error-messages for things that never should happen

parent de37f0a1
No related branches found
No related tags found
No related merge requests found
...@@ -38,9 +38,9 @@ public static class CommunicationEvents ...@@ -38,9 +38,9 @@ public static class CommunicationEvents
//CHANGE HERE PORT OF SERVER //CHANGE HERE PORT OF SERVER
public static string ServerPortDefault = "8085"; //used for Local public static string ServerPortDefault = "8085"; //used for Local
public static string ServerAddressLocalhost = "http://localhost"; //Without Port public static string ServerAddressLocalhost = "http://localhost"; //Without Port //Kann das weg?
public static string ServerAddressLocal = "http://localhost:8085"; // "http://localhost:8085" public static string ServerAddressLocal = "http://localhost:8085"; // "http://localhost:8085" //Kann das weg?
public static string ServerAdress = "http://localhost:8085"; //need "http://" //used by dispalyScrolls.cs //http://10.231.4.95:8085"; public static string ServerAdress = "http://localhost:8085"; //need "http://" //used by dispalyScrolls.cs //http://10.231.4.95:8085"; //IMPORTANT for MAINMENUE
public static Process process_mmt_frameIT_server; public static Process process_mmt_frameIT_server;
...@@ -53,10 +53,11 @@ public static class CommunicationEvents ...@@ -53,10 +53,11 @@ public static class CommunicationEvents
*/ */
public static string lastIP = ""; public static string lastIP = "";
public static string newIP = ""; public static string newIP = "";
public static string IPslot1 = ""; public static string IPslot1 = "- if you can read this";
public static string IPslot2 = "http://10.231.4.95:8085"; public static string IPslot2 = "- NetworkConfig";
public static string IPslot3 = "10.231.4.95:8085"; public static string IPslot3 = "- not loaded";
public static string selecIP = ""; public static string selecIP = "GO TO -> 'Options'\n-> 'Reset Options'\nPRESS: \n'Reset Configurations'";
//------ //------
public static int[] ServerRunningA = new int[7] { 0, 0, 0, 0, 0, 0, 0 }; //other, lastIP, newIP, IP1, IP2, IP3, selecIP} //0: offline, 1: Checking, 2: online, 3: NoNetworkAddress; public static int[] ServerRunningA = new int[7] { 0, 0, 0, 0, 0, 0, 0 }; //other, lastIP, newIP, IP1, IP2, IP3, selecIP} //0: offline, 1: Checking, 2: online, 3: NoNetworkAddress;
......
...@@ -24,8 +24,8 @@ public static class StreamingAssetLoader ...@@ -24,8 +24,8 @@ public static class StreamingAssetLoader
//Config //Config
public static string file_8_path = "Config"; public static string ConfigDir = "Config";
public static string file_8 = "Network.JSON"; public static string ConfigFile_Network = "Network.JSON";
//public static ID_toPath toPath = ID_toPath.DataPath; //public static ID_toPath toPath = ID_toPath.DataPath;
public enum ID_toPath public enum ID_toPath
...@@ -65,6 +65,8 @@ public static bool checkFileExistence(string sourcepath, string filename) ...@@ -65,6 +65,8 @@ public static bool checkFileExistence(string sourcepath, string filename)
public static void NetworkJSON_Save() public static void NetworkJSON_Save()
{ {
NetworkJSON myObject = new NetworkJSON(); NetworkJSON myObject = new NetworkJSON();
//MyClass myObject = new MyClass(); //MyClass myObject = new MyClass();
myObject.newIP = CommunicationEvents.newIP; myObject.newIP = CommunicationEvents.newIP;
myObject.lastIP = CommunicationEvents.lastIP; myObject.lastIP = CommunicationEvents.lastIP;
...@@ -88,10 +90,10 @@ public static void NetworkJSON_Save() ...@@ -88,10 +90,10 @@ public static void NetworkJSON_Save()
//Data storage //Data storage
SafeCreateDirectory(Application.persistentDataPath + "/Config"); SafeCreateDirectory(Path.Combine(Application.persistentDataPath ,ConfigDir));
//string json = JsonUtility.ToJson(date); //string json = JsonUtility.ToJson(date);
string json = JsonUtility.ToJson(myObject); string json = JsonUtility.ToJson(myObject);
StreamWriter Writer = new StreamWriter(Application.persistentDataPath + "/Config/Network.json"); StreamWriter Writer = new StreamWriter(Path.Combine(Application.persistentDataPath, ConfigDir, ConfigFile_Network));
Writer.Write(json); Writer.Write(json);
Writer.Flush(); Writer.Flush();
Writer.Close(); Writer.Close();
...@@ -118,16 +120,6 @@ public static void ResetPlayerSaveGame() ...@@ -118,16 +120,6 @@ public static void ResetPlayerSaveGame()
public static void ResetPlayerConfig()
{
string sourcePath = Path.Combine(Application.streamingAssetsPath, StreamToPersistentDataPath_Folder);
string targetFolder = Application.persistentDataPath;
RereadFileWithUnityWebRequest(sourcePath, StreamingAssetLoader.file_8_path, StreamingAssetLoader.file_8, targetFolder);
NetworkJSON_Load();
}
public static void ResetPersistentDataPath() public static void ResetPersistentDataPath()
{ {
RereadFiles_PersistentDataPath(); RereadFiles_PersistentDataPath();
...@@ -163,11 +155,19 @@ public static void deleteADirectoryAndSubDir(string path) ...@@ -163,11 +155,19 @@ public static void deleteADirectoryAndSubDir(string path)
} }
} }
} }
public static void ResetPlayerConfig()
{
string sourcePath = Path.Combine(Application.streamingAssetsPath, StreamToPersistentDataPath_Folder, ConfigDir);
string targetFolder = Application.persistentDataPath;
RereadFileWithUnityWebRequest(sourcePath, ConfigDir, ConfigFile_Network, targetFolder);
NetworkJSON_Load();
}
public static void RereadFiles_PersistentDataPath() public static void RereadFiles_PersistentDataPath()
{ {
Debug.Log("Reread_PersistentDataPath");
//RereadFileUWR(StreamingAssetLoader.file_1_path, StreamingAssetLoader.file_1, ID_toPath.PersistentDataPath); //RereadFileUWR(StreamingAssetLoader.file_1_path, StreamingAssetLoader.file_1, ID_toPath.PersistentDataPath);
//---- //----
string rootPath = Path.Combine(Application.streamingAssetsPath, StreamToPersistentDataPath_Folder); string rootPath = Path.Combine(Application.streamingAssetsPath, StreamToPersistentDataPath_Folder);
...@@ -179,6 +179,7 @@ public static void RereadFiles_PersistentDataPath() ...@@ -179,6 +179,7 @@ public static void RereadFiles_PersistentDataPath()
} }
public static void RereadFiles_DataPath() public static void RereadFiles_DataPath()
{ {
Debug.Log("Reread_DataPath");
string rootPath = Path.Combine(Application.streamingAssetsPath, StreamToDataPath_Folder); string rootPath = Path.Combine(Application.streamingAssetsPath, StreamToDataPath_Folder);
string targetFolder = Application.dataPath; string targetFolder = Application.dataPath;
ReReadFiles(rootPath, targetFolder); ReReadFiles(rootPath, targetFolder);
...@@ -235,7 +236,7 @@ public static void ReReadFiles(string rootPath, string targetFolder)//ID_toPath ...@@ -235,7 +236,7 @@ public static void ReReadFiles(string rootPath, string targetFolder)//ID_toPath
public static void NetworkJSON_Load() public static void NetworkJSON_Load()
{ {
var reader = new StreamReader(Application.persistentDataPath + "/Config/Network.JSON"); var reader = new StreamReader(Path.Combine(Application.persistentDataPath, ConfigDir, ConfigFile_Network));
string json = reader.ReadToEnd(); string json = reader.ReadToEnd();
reader.Close(); reader.Close();
...@@ -370,6 +371,7 @@ public static void RereadFileWithUnityWebRequest(string sourcePath1, string path ...@@ -370,6 +371,7 @@ public static void RereadFileWithUnityWebRequest(string sourcePath1, string path
string sourcePath = Path.Combine(sourcePath1, fileName); string sourcePath = Path.Combine(sourcePath1, fileName);
//Debug.Log(sourcePath);
using var loadingRequest = UnityWebRequest.Get(sourcePath); using var loadingRequest = UnityWebRequest.Get(sourcePath);
loadingRequest.SendWebRequest(); loadingRequest.SendWebRequest();
while (!loadingRequest.isDone) while (!loadingRequest.isDone)
...@@ -583,7 +585,7 @@ public static void Score_Save(string Directory_path, string date) ...@@ -583,7 +585,7 @@ public static void Score_Save(string Directory_path, string date)
public static string Score_Load(string Directory_path) public static string Score_Load(string Directory_path)
{ {
//Data acquisition //Data acquisition
var reader = new StreamReader(Application.persistentDataPath + "/Config/Network.JSON"); var reader = new StreamReader(Path.Combine(Application.persistentDataPath, ConfigDir, ConfigFile_Network));
string json = reader.ReadToEnd(); string json = reader.ReadToEnd();
reader.Close(); reader.Close();
......
...@@ -56,16 +56,16 @@ void Start() ...@@ -56,16 +56,16 @@ void Start()
void start2_CheckOS_CheckConfig() void start2_CheckOS_CheckConfig()
{ {
//Debug.Log("start2: " + CommunicationEvents.Opsys);
switch (CommunicationEvents.Opsys) switch (CommunicationEvents.Opsys)
{ {
case OperationSystem.Windows:
case OperationSystem.Windows:
//Debug.Log(checkPersistentDataPath());
if (!checkPersistentDataPath()) if (!checkPersistentDataPath())
{ {
//Debug.Log("initialReset_PDP");
ResetPersistentDataPath(); ResetPersistentDataPath();
switch (Opsys) switch (Opsys)
{ {
...@@ -93,7 +93,7 @@ void start2_CheckOS_CheckConfig() ...@@ -93,7 +93,7 @@ void start2_CheckOS_CheckConfig()
if (!checkPersistentDataPath()) if (!checkPersistentDataPath())
{ {
//Debug.Log("initialReset_PDP");
ResetPersistentDataPath(); ResetPersistentDataPath();
switch (Opsys) switch (Opsys)
{ {
...@@ -122,7 +122,7 @@ void start2_CheckOS_CheckConfig() ...@@ -122,7 +122,7 @@ void start2_CheckOS_CheckConfig()
if (!checkPersistentDataPath()) if (!checkPersistentDataPath())
{ {
//Debug.Log("initialReset_PDP");
ResetPersistentDataPath(); ResetPersistentDataPath();
switch (Opsys) switch (Opsys)
{ {
......
...@@ -3,18 +3,17 @@ ...@@ -3,18 +3,17 @@
"newIP": "", "newIP": "",
"IPslot1": "uframeit.informatik.uni-erlangen.de:8085", "IPslot1": "uframeit.informatik.uni-erlangen.de:8085",
"IPslot2": "uframeit.informatik.uni-erlangen.de:8086", "IPslot2": "uframeit.informatik.uni-erlangen.de:8086",
"IPslot3":"10.231.4.95:8085", "IPslot3": "",
"selecIP": "", "selecIP": "",
"ControlMode":"1", "ControlMode": "Keyboard",
"TouchMode":"1", "TouchMode": 1,
"TAvisibility":"1", "TAvisibility": 1.0,
"autoOSrecognition":"true", "autoOSrecognition": true,
"Opsys": "Windows", "Opsys": "Windows",
"FrameITUIversion":"2", "FrameITUIversion": 2,
"InputManagerVersion":"1", "InputManagerVersion": 1,
"colliderScale_all":"1.2", "colliderScale_all": 1.200000047683716,
"cursorSize":"0.03125", "cursorSize": 0.03125,
"camRotatingSensitivity":"2f", "camRotatingSensitivity": 2.0,
"MouseKeepingInWindow":"true" "MouseKeepingInWindow": true
} }
\ No newline at end of file
...@@ -42,6 +42,11 @@ ...@@ -42,6 +42,11 @@
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"key": "experimental.enabled", "key": "experimental.enabled",
"value": "{\"m_Value\":false}" "value": "{\"m_Value\":false}"
},
{
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"key": "editor.stripProBuilderScriptsOnBuild",
"value": "{\"m_Value\":true}"
} }
] ]
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment