@@ -24,14 +24,14 @@ public partial class EventService : IEventService
2424 public TypeStringKey ( Type type )
2525 {
2626 Type = type ?? throw new ArgumentNullException ( nameof ( type ) ) ;
27- TypeName = type . Name ;
27+ TypeName = type . Name . ToLowerInvariant ( ) ;
2828 HashCode = TypeName . GetHashCode ( ) ;
2929 }
3030
3131 public TypeStringKey ( string typeName )
3232 {
3333 Type = null ;
34- TypeName = typeName ?? throw new ArgumentNullException ( nameof ( typeName ) ) ;
34+ TypeName = typeName ? . ToLowerInvariant ( ) ?? throw new ArgumentNullException ( nameof ( typeName ) ) ;
3535 HashCode = TypeName . GetHashCode ( ) ;
3636 }
3737
@@ -56,7 +56,7 @@ public int GetHashCode(TypeStringKey obj)
5656 private readonly AsyncReaderWriterLock _operationsLock = new ( ) ;
5757 private readonly ConcurrentDictionary < TypeStringKey , ConcurrentDictionary < OneOf < IEvent , string > , IEvent > > _subscribers = new ( ) ;
5858 private readonly ConcurrentDictionary < TypeStringKey , ( TypeStringKey Event , Func < LuaCsFunc , IEvent > RunnerFactory ) > _luaAliasEventFactory = new ( ) ;
59- private readonly ConcurrentDictionary < string , ConcurrentDictionary < string , LuaCsFunc > > _luaLegacyEventsSubscribers = new ( ) ;
59+ private readonly ConcurrentDictionary < TypeStringKey , ConcurrentDictionary < TypeStringKey , LuaCsFunc > > _luaLegacyEventsSubscribers = new ( ) ;
6060 private readonly ConcurrentDictionary < IEventService , IEventService > _subscribedEventDispatchers = new ( ) ;
6161
6262 #region LifeCycle
@@ -118,7 +118,7 @@ public void Add(string eventName, string identifier, LuaCsFunc callback, object
118118 }
119119 else
120120 {
121- var eventSubs = _luaLegacyEventsSubscribers . GetOrAdd ( eventName , key => new ConcurrentDictionary < string , LuaCsFunc > ( ) ) ;
121+ var eventSubs = _luaLegacyEventsSubscribers . GetOrAdd ( eventName , key => new ConcurrentDictionary < TypeStringKey , LuaCsFunc > ( ) ) ;
122122 eventSubs [ identifier ] = callback ;
123123 }
124124 }
0 commit comments