Packet recycling

This commit is contained in:
Sardelka
2022-08-11 18:25:01 +08:00
parent a26a799a9f
commit 1d3e53f734
8 changed files with 61 additions and 6 deletions

View File

@ -26,7 +26,7 @@ namespace RageCoop.Client
public static void ToggleConnection(string address, string username = null, string password = null)
{
Peer?.Dispose();
Peer?.Shutdown("Bye");
if (IsOnServer)
{
}
@ -37,6 +37,8 @@ namespace RageCoop.Client
}
else
{
Peer?.Dispose();
IsConnecting = true;
password = password ?? Main.Settings.Password;
username=username ?? Main.Settings.Username;