Skip to content
This repository was archived by the owner on Sep 15, 2024. It is now read-only.

Commit bfc49d6

Browse files
clean the Cleanup()
1 parent afbe879 commit bfc49d6

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Scripts/Scenes/Main/NetworkManager.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,17 @@ public override async void _Notification(int what)
101101
/// </summary>
102102
private static async Task ExitCleanup()
103103
{
104-
if (ENetClient.Running)
105-
{
106-
await GameClient.Stop();
107-
}
108-
109104
if (ENetServer.Running)
110105
{
111106
GameServer.ENetCmds.Enqueue(new ENetCmd(ENetOpcode.ClientWantsToExitApp));
112107
await GameServer.Stop();
113108
}
114109

110+
if (ENetClient.Running)
111+
{
112+
await GameClient.Stop();
113+
}
114+
115115
UtilOptions.SaveOptions();
116116
WebClient.Client.Dispose();
117117
ErrorNotifier.Dispose();
@@ -121,7 +121,7 @@ private static async Task ExitCleanup()
121121
ENetClient.CancelTokenSource?.Dispose();
122122
ENetServer.CancelTokenSource?.Dispose();
123123

124-
ClientPlayer.EmitPosition?.Dispose();
124+
//ClientPlayer.EmitPosition?.Dispose();
125125

126126
Instance.GetTree().Quit();
127127
}

0 commit comments

Comments
 (0)