29 lines
No EOL
930 B
C#
29 lines
No EOL
930 B
C#
// WingsEmu
|
|
//
|
|
// Developed by NosWings Team
|
|
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using PhoenixLib.Events;
|
|
using PhoenixLib.ServiceBus;
|
|
using WingsAPI.Communication.InstantBattle;
|
|
using WingsEmu.Game.GameEvent;
|
|
using WingsEmu.Plugins.GameEvents.Event.Global;
|
|
|
|
namespace WingsEmu.Plugins.GameEvents.Consumers
|
|
{
|
|
public class InstantBattleStartMessageConsumer : IMessageConsumer<InstantBattleStartMessage>
|
|
{
|
|
private readonly IAsyncEventPipeline _eventPipeline;
|
|
|
|
public InstantBattleStartMessageConsumer(IAsyncEventPipeline eventPipeline) => _eventPipeline = eventPipeline;
|
|
|
|
public async Task HandleAsync(InstantBattleStartMessage notification, CancellationToken token)
|
|
{
|
|
await _eventPipeline.ProcessEventAsync(new GameEventPrepareEvent(GameEventType.InstantBattle)
|
|
{
|
|
NoDelay = notification.HasNoDelay
|
|
});
|
|
}
|
|
}
|
|
} |