♻️ added checks in client sdk
This commit is contained in:
@@ -26,8 +26,12 @@ public class RagonEventCache
|
||||
public ushort GetEventCode<TEvent>(TEvent _) where TEvent : IRagonEvent
|
||||
{
|
||||
var type = typeof(TEvent);
|
||||
var evntCode = _eventsRegistryByType[type];
|
||||
return evntCode;
|
||||
if (!_eventsRegistryByType.TryGetValue(type, out var eventCode))
|
||||
{
|
||||
RagonLog.Error($"Event with type {type} not registered");
|
||||
return 0;
|
||||
}
|
||||
return eventCode;
|
||||
}
|
||||
|
||||
public void Register<T>() where T : IRagonEvent, new()
|
||||
|
||||
Reference in New Issue
Block a user