Server Performance boost

The Servers Performance was up to 100% percent. Tried to close threads not needed directly. now it is under 1%
(Threads stacking, when errors)
This commit is contained in:
brausjonas
2023-03-31 14:32:27 +02:00
parent 725a68b90c
commit 38b4f06bb1
16 changed files with 288 additions and 151 deletions
+5
View File
@@ -318,4 +318,9 @@ public class Client : MonoBehaviour
{
stream.Write(new byte[]{10, index, 0, 0, 0, 0, 0, 0, 0, 0});
}
private void OnApplicationQuit()
{
stream.Write(new byte[]{126, 0, 0, 0, 0, 0, 0, 0, 0, 0});
}
}
@@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
@@ -66,6 +67,8 @@ public class StartHandler : MonoBehaviour
PlayerPrefs.Save();
layout2.GetComponentInChildren<TMP_Text>().text = "Your room code is: \n" + code;
stream.Close();
}
public void ButtonJoin()
@@ -152,4 +155,10 @@ public class StartHandler : MonoBehaviour
layout0.SetActive(true);
layout1.SetActive(false);
}
private void OnApplicationQuit()
{
Stream stream = client.GetStream();
stream.Write(new byte[]{126, 0, 0, 0, 0, 0, 0, 0, 0});
}
}