EventManager rewritten to support a push arch instead of an internal poll. Crash finally fixed!!! The dangers of threading.
This commit is contained in:
@ -2,12 +2,9 @@ using System;
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using Aurora.Proto.Party;
|
||||
using Aurora.Proto.General;
|
||||
using Aurora.Proto.Events;
|
||||
using Aurora.Models;
|
||||
using Aurora.Services;
|
||||
using Aurora.Services.EventManager;
|
||||
|
||||
namespace Aurora.RemoteImpl
|
||||
{
|
||||
@ -39,6 +36,8 @@ namespace Aurora.RemoteImpl
|
||||
IpAddress = context.Host,
|
||||
};
|
||||
|
||||
Console.WriteLine("SERVER - Client joined party: " + partyMember.Id);
|
||||
|
||||
_partyMembers.Add(partyMember);
|
||||
|
||||
BaseEvent e = new BaseEvent
|
||||
@ -50,7 +49,7 @@ namespace Aurora.RemoteImpl
|
||||
}
|
||||
};
|
||||
|
||||
EventManager.Instance.PushEvent(e);
|
||||
EventManager.Instance.FireEvent(e);
|
||||
|
||||
JoinPartyResponse response = new JoinPartyResponse() { Status = PartyJoinedStatusEnum.Connected, ClientId = partyMember.Id };
|
||||
return Task.FromResult(response);
|
||||
@ -71,7 +70,7 @@ namespace Aurora.RemoteImpl
|
||||
}
|
||||
};
|
||||
|
||||
EventManager.Instance.PushEvent(bv);
|
||||
EventManager.Instance.FireEvent(bv);
|
||||
|
||||
LeavePartyResponse response = new LeavePartyResponse() { Status = PartyJoinedStatusEnum.Disconnected };
|
||||
return Task.FromResult(response);
|
||||
|
Reference in New Issue
Block a user