Event binding bug found

This commit is contained in:
2025-05-07 09:03:20 +03:00
parent 99015a3d5e
commit 2f65fb24c0
5 changed files with 13 additions and 12 deletions
@@ -32,9 +32,9 @@ namespace mROA.Implementation.Backend
public int ResisterObject<T>(object o, IEndPointContext context)
{
var last = _storage.Place(o);
EventBinders.OfType<IEventBinder<T>>().FirstOrDefault()
?.BindEvents((T)o, context, _representationModuleProducer!, last);
var binder = EventBinders.OfType<IEventBinder<T>>().FirstOrDefault();
binder?.BindEvents((T)o, context, _representationModuleProducer!, last);
return last;
}
@@ -40,7 +40,7 @@ namespace mROA.Implementation.Frontend
}
}
public void Connect()
public async Task Connect()
{
if (_interactionModule is null)
throw new Exception("Interaction module was not injected");
@@ -57,7 +57,7 @@ namespace mROA.Implementation.Frontend
.Wait();
_currentExtractor.SingleReceive();
var idMessage = _interactionModule.GetNextMessageReceiving(false).GetAwaiter().GetResult();
var idMessage = await _interactionModule.GetNextMessageReceiving(false);
if (idMessage.MessageType != EMessageType.IdAssigning)
{