File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
TerrariaServerAPI/TerrariaApi.Server/Hooking Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -23,13 +23,23 @@ 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 ;
2627
2728 Hooks . NetMessage . SendData += OnSendData ;
2829 Hooks . NetMessage . SendBytes += OnSendBytes ;
2930 Hooks . MessageBuffer . GetData += OnReceiveData ;
3031 Hooks . MessageBuffer . NameCollision += OnNameCollision ;
3132 }
3233
34+ static void OnUpdateConnectedClients ( On . Terraria . Netplay . orig_UpdateConnectedClients orig )
35+ {
36+ orig ( ) ;
37+ if ( ServerApi . ForceUpdate )
38+ {
39+ Terraria . Netplay . HasClients = true ;
40+ }
41+ }
42+
3343 static void OnBroadcastChatMessage ( object ? sender , HookEvents . Terraria . Chat . ChatHelper . BroadcastChatMessageEventArgs args )
3444 {
3545 if ( ! args . ContinueExecution ) return ;
You can’t perform that action at this time.
0 commit comments