File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ using NLog ;
2+ using Torch . Managers . PatchManager ;
3+ using VRage ;
4+ using VRage . Network ;
5+
6+ namespace Torch . Patches
7+ {
8+ [ PatchShim ]
9+ public static class MyReplicationServerPatch
10+ {
11+ public static Logger Log = LogManager . GetCurrentClassLogger ( ) ;
12+
13+ public static void Patch ( PatchContext ctx )
14+ {
15+ ctx . GetPattern ( typeof ( MyReplicationServer ) . GetMethod ( "OnClientConnected" , System . Reflection . BindingFlags . Public | System . Reflection . BindingFlags . Instance ) )
16+ . Suffixes . Add ( typeof ( MyReplicationServerPatch ) . GetMethod ( nameof ( OnClientConnectedSuffix ) , System . Reflection . BindingFlags . NonPublic | System . Reflection . BindingFlags . Static ) ) ;
17+ }
18+
19+ public static void OnClientConnectedSuffix ( ref ConnectedClientDataMsg __result , MyPacket packet )
20+ {
21+ int nameLimit = 32 ;
22+
23+ if ( __result . Name . Length > nameLimit )
24+ {
25+ __result . Name = __result . Name . Substring ( 0 , nameLimit ) ;
26+ }
27+ }
28+ }
29+ }
Original file line number Diff line number Diff line change 247247 <Compile Include =" Patches\KeenLogPatch.cs" />
248248 <Compile Include =" Patches\MessageSizeLimitPatch.cs" />
249249 <Compile Include =" Patches\ModsDownloadingPatch.cs" />
250+ <Compile Include =" Patches\MyReplicationServerPatch.cs" />
250251 <Compile Include =" Patches\PhysicsMemoryPatch.cs" />
251252 <Compile Include =" Patches\SessionDownloadPatch.cs" />
252253 <Compile Include =" Patches\TorchAsyncSaving.cs" />
You can’t perform that action at this time.
0 commit comments