File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -345,18 +345,15 @@ public virtual void RegisterAssembly(Assembly assembly)
345
345
instance . SetServer ( this ) ;
346
346
347
347
// Get all packet handlers and add them to the handler map
348
- foreach ( var method in group . GetMethods ( ) . Where ( m => ! m . IsStatic && ! m . IsAbstract ) )
348
+ foreach ( var method in group . GetMethods ( ) . Where ( m => ! m . IsAbstract ) )
349
349
{
350
- var attr = method . GetCustomAttribute < PacketHandlerAttribute > ( ) ;
351
- if ( attr != null )
350
+ if ( method . GetCustomAttribute < PacketHandlerAttribute > ( ) is { } packetHandlerAttribute )
352
351
{
353
- RegisterPacketHandler ( method , attr , instance ) ;
352
+ RegisterPacketHandler ( method , packetHandlerAttribute , instance ) ;
354
353
}
355
- else
354
+ else if ( method . GetCustomAttribute < CommandHandlerAttribute > ( ) is { } commandHandlerAttribute )
356
355
{
357
- var cmdAttr = method . GetCustomAttribute < CommandHandlerAttribute > ( ) ;
358
- if ( cmdAttr == null ) continue ;
359
- RegisterCommandHandler ( method , cmdAttr , instance ) ;
356
+ RegisterCommandHandler ( method , commandHandlerAttribute , instance ) ;
360
357
}
361
358
}
362
359
}
You can’t perform that action at this time.
0 commit comments