24 lines
698 B
C#
24 lines
698 B
C#
using Photon.Core.Timer;
|
|
using Quartz;
|
|
namespace Application.Web;
|
|
|
|
public class AutoJob: ITimerAutoJob
|
|
{
|
|
public async Task Execute(IJobExecutionContext context)
|
|
{
|
|
string jobId = context.JobDetail.Key.Name;
|
|
if (!string.IsNullOrEmpty(jobId))
|
|
{
|
|
var jobService = App.GetService<IGameAutoJobService>();
|
|
var jobData = await jobService.GetJobInfo(jobId);
|
|
if (jobData != null)
|
|
{
|
|
await jobService.HandleJob(jobData);
|
|
if (jobData.opType == nameof(GameEnum.JobType.single))
|
|
{
|
|
await jobService.StopJob(jobId);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |