File tree Expand file tree Collapse file tree
LabExtended/Patches/Functions/Mirror Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ using HarmonyLib ;
2+
3+ using Mirror ;
4+
5+ namespace LabExtended . Patches . Functions . Mirror
6+ {
7+ /// <summary>
8+ /// Removes pointless Mirror log spam.
9+ /// </summary>
10+ public static class MirrorLogPatches
11+ {
12+ [ HarmonyPatch ( typeof ( NetworkServer ) , nameof ( NetworkServer . BroadcastToConnection ) ) ]
13+ private static bool BroadcastToConnectionPrefix ( NetworkConnectionToClient connection )
14+ {
15+ foreach ( var networkIdentity in connection . observing )
16+ {
17+ if ( networkIdentity != null )
18+ {
19+ var networkWriter = NetworkServer . SerializeForConnection ( networkIdentity , connection ) ;
20+
21+ if ( networkWriter != null )
22+ {
23+ connection . Send ( new EntityStateMessage
24+ {
25+ netId = networkIdentity . netId ,
26+ payload = networkWriter . ToArraySegment ( )
27+ } ) ;
28+ }
29+ }
30+ }
31+
32+ return false ;
33+ }
34+ }
35+ }
You can’t perform that action at this time.
0 commit comments