111
This commit is contained in:
16
Service/Application.Domain/BusEvents/BusEventsEnum.cs
Normal file
16
Service/Application.Domain/BusEvents/BusEventsEnum.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Application.Domain
|
||||
{
|
||||
public class BusEventsEnum
|
||||
{
|
||||
public enum BusEventsName
|
||||
{
|
||||
PutFightAward,//战斗奖励事件
|
||||
}
|
||||
}
|
||||
}
|
||||
17
Service/Application.Domain/BusEvents/BusEventsSubscriber.cs
Normal file
17
Service/Application.Domain/BusEvents/BusEventsSubscriber.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
namespace Application.Domain
|
||||
{
|
||||
public class BusEventsSubscriber : IEventSubscriber
|
||||
{
|
||||
/// <summary>
|
||||
/// 处理贡献提成
|
||||
/// </summary>
|
||||
/// <param name="context"></param>
|
||||
[EventSubscribe(BusEventsEnum.BusEventsName.PutFightAward, NumRetries = 0)]
|
||||
public async Task HandleQueueBonus(EventHandlerExecutingContext context)
|
||||
{
|
||||
var data = context.GetPayload<game_fight_data>();
|
||||
var fightService = App.GetService<IGameFightService>();
|
||||
await fightService.HandleFight(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user