moved event API stuff around
finally fixed threading issue (which actually had to do with IW4x log outputs being out of sync (not an issue with my code). What a lot of headache over something that wasn't my fault.
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SharedLibraryCore;
|
||||
using SharedLibraryCore.Events;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@ -14,7 +15,7 @@ namespace WebfrontCore.Controllers.API
|
||||
[HttpGet]
|
||||
public IActionResult Event(bool shouldConsume = true)
|
||||
{
|
||||
var events = Manager.GetEventApi().GetEvents(shouldConsume);
|
||||
var events = EventApi.GetEvents(shouldConsume);
|
||||
return Json(events);
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ namespace WebfrontCore.Controllers
|
||||
|
||||
Manager.GetEventHandler().AddEvent(remoteEvent);
|
||||
// wait for the event to process
|
||||
await Task.Run(() => remoteEvent.OnProcessed.Wait(5000));
|
||||
await remoteEvent.OnProcessed.WaitAsync(60*1000);
|
||||
var response = server.CommandResult.Where(c => c.ClientId == client.ClientId).ToList();
|
||||
|
||||
// remove the added command response
|
||||
|
Reference in New Issue
Block a user