File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
TerrariaServerAPI/TerrariaApi.Server/Hooking Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -23,22 +23,24 @@ public static void AttachTo(HookManager hookManager)
2323 HookEvents . Terraria . Netplay . OnConnectionAccepted += OnConnectionAccepted ;
2424 HookEvents . Terraria . Chat . ChatHelper . BroadcastChatMessage += OnBroadcastChatMessage ;
2525 HookEvents . Terraria . Net . NetManager . SendData += OnSendNetData ;
26- On . Terraria . Netplay . UpdateConnectedClients += OnUpdateConnectedClients ;
26+ HookEvents . Terraria . Netplay . UpdateConnectedClients += OnUpdateConnectedClients ;
2727
2828 Hooks . NetMessage . SendData += OnSendData ;
2929 Hooks . NetMessage . SendBytes += OnSendBytes ;
3030 Hooks . MessageBuffer . GetData += OnReceiveData ;
3131 Hooks . MessageBuffer . NameCollision += OnNameCollision ;
3232 }
3333
34- static void OnUpdateConnectedClients ( On . Terraria . Netplay . orig_UpdateConnectedClients orig )
34+ static void OnUpdateConnectedClients ( object ? sender , HookEvents . Terraria . Netplay . UpdateConnectedClientsEventArgs args )
35+ {
36+ if ( ! args . ContinueExecution ) return ;
37+ args . ContinueExecution = false ;
38+ args . OriginalMethod ( ) ;
39+ if ( ServerApi . ForceUpdate )
3540 {
36- orig ( ) ;
37- if ( ServerApi . ForceUpdate )
38- {
39- Terraria . Netplay . HasClients = true ;
40- }
41+ Terraria . Netplay . HasClients = true ;
4142 }
43+ }
4244
4345 static void OnBroadcastChatMessage ( object ? sender , HookEvents . Terraria . Chat . ChatHelper . BroadcastChatMessageEventArgs args )
4446 {
You can’t perform that action at this time.
0 commit comments