increased max events for event api to 100
added GameInfo to EventInfo class make sure score gets updated properly after authentication
This commit is contained in:
parent
f40bcce44f
commit
4ec16d3aa2
@ -10,7 +10,7 @@ namespace IW4MAdmin.Application.API
|
|||||||
{
|
{
|
||||||
class EventApi : IEventApi
|
class EventApi : IEventApi
|
||||||
{
|
{
|
||||||
private const int MaxEvents = 32;
|
private const int MaxEvents = 100;
|
||||||
private Queue<EventInfo> RecentEvents = new Queue<EventInfo>();
|
private Queue<EventInfo> RecentEvents = new Queue<EventInfo>();
|
||||||
|
|
||||||
public IEnumerable<EventInfo> GetEvents(bool shouldConsume)
|
public IEnumerable<EventInfo> GetEvents(bool shouldConsume)
|
||||||
@ -35,6 +35,11 @@ namespace IW4MAdmin.Application.API
|
|||||||
var apiEvent = new EventInfo()
|
var apiEvent = new EventInfo()
|
||||||
{
|
{
|
||||||
ExtraInfo = E.Extra?.ToString() ?? E.Data,
|
ExtraInfo = E.Extra?.ToString() ?? E.Data,
|
||||||
|
GameInfo = new EntityInfo()
|
||||||
|
{
|
||||||
|
Name = E.Owner.GameName.ToString(),
|
||||||
|
Id = (int)E.Owner.GameName
|
||||||
|
},
|
||||||
OwnerEntity = new EntityInfo()
|
OwnerEntity = new EntityInfo()
|
||||||
{
|
{
|
||||||
Name = E.Owner.Hostname,
|
Name = E.Owner.Hostname,
|
||||||
|
@ -42,7 +42,9 @@ namespace IW4MAdmin.Application.Core
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// this update their ping
|
// this update their ping
|
||||||
|
// todo: this seems kinda hacky
|
||||||
value.Ping = client.Ping;
|
value.Ping = client.Ping;
|
||||||
|
value.Score = client.Score;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -462,17 +462,8 @@ namespace IW4MAdmin.Application
|
|||||||
queuedEvent.Target.DelayedEvents.Enqueue(queuedEvent);
|
queuedEvent.Target.DelayedEvents.Enqueue(queuedEvent);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
// for delayed events, they're added after the connect event so it should work out
|
||||||
if (queuedEvent.Type == GameEvent.EventType.Connect)
|
await processEvent(queuedEvent);
|
||||||
{
|
|
||||||
// we don't want to block here to due to needing event completion in the addplayer method
|
|
||||||
processEvent(queuedEvent);
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
{
|
|
||||||
await processEvent(queuedEvent);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// signal that all events have been processed
|
// signal that all events have been processed
|
||||||
|
@ -247,9 +247,7 @@ namespace IW4MAdmin
|
|||||||
|
|
||||||
Manager.GetEventHandler().AddEvent(e);
|
Manager.GetEventHandler().AddEvent(e);
|
||||||
|
|
||||||
// let all the plugins get the event
|
player.State = Player.ClientState.Connected;
|
||||||
// this is only beause the connect event executes
|
|
||||||
e.OnProcessed.Wait();
|
|
||||||
|
|
||||||
// add the delayed event to the queue
|
// add the delayed event to the queue
|
||||||
while (delayedEventQueue?.Count > 0)
|
while (delayedEventQueue?.Count > 0)
|
||||||
@ -583,8 +581,6 @@ namespace IW4MAdmin
|
|||||||
|
|
||||||
// all polled players should be authenticated
|
// all polled players should be authenticated
|
||||||
var addPlayerTasks = AuthQueue.GetAuthenticatedClients()
|
var addPlayerTasks = AuthQueue.GetAuthenticatedClients()
|
||||||
.Where(client => Players[client.ClientNumber] == null ||
|
|
||||||
Players[client.ClientNumber].State == Player.ClientState.Connecting)
|
|
||||||
.Select(client => AddPlayer(client));
|
.Select(client => AddPlayer(client));
|
||||||
|
|
||||||
await Task.WhenAll(addPlayerTasks);
|
await Task.WhenAll(addPlayerTasks);
|
||||||
|
@ -125,7 +125,7 @@
|
|||||||
<Architecture>X64</Architecture>
|
<Architecture>X64</Architecture>
|
||||||
</Interpreter>
|
</Interpreter>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.Web.targets" />
|
<!--<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.Web.targets" />-->
|
||||||
<!-- Specify pre- and post-build commands in the BeforeBuild and
|
<!-- Specify pre- and post-build commands in the BeforeBuild and
|
||||||
AfterBuild targets below. -->
|
AfterBuild targets below. -->
|
||||||
<Target Name="BeforeBuild">
|
<Target Name="BeforeBuild">
|
||||||
|
@ -8,6 +8,7 @@ namespace SharedLibraryCore.Dtos
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class EventInfo
|
public class EventInfo
|
||||||
{
|
{
|
||||||
|
public EntityInfo GameInfo { get; set; }
|
||||||
public EntityInfo OriginEntity { get; set; }
|
public EntityInfo OriginEntity { get; set; }
|
||||||
public EntityInfo TargetEntity { get; set; }
|
public EntityInfo TargetEntity { get; set; }
|
||||||
public EntityInfo EventType { get; set; }
|
public EntityInfo EventType { get; set; }
|
||||||
|
6408
WebfrontCore/wwwroot/css/bootstrap-custom.css
vendored
Normal file
6408
WebfrontCore/wwwroot/css/bootstrap-custom.css
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user