1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-14 00:58:18 -05:00

migrating to .NET Core 2.0

This commit is contained in:
RaidMax
2018-04-08 01:44:42 -05:00
parent 9eaed1d07d
commit e8b6525fea
121 changed files with 534 additions and 1157 deletions

View File

@ -1,4 +1,6 @@
using SharedLibrary;
using SharedLibraryCore;
using SharedLibraryCore.Dtos;
using SharedLibraryCore.Objects;
using System;
using System.Collections.Generic;
@ -6,7 +8,7 @@ namespace WebfrontCore.Application.API
{
class EventAPI
{
public static Queue<SharedLibrary.Dtos.EventInfo> Events = new Queue<SharedLibrary.Dtos.EventInfo>();
public static Queue<EventInfo> Events = new Queue<EventInfo>();
static DateTime LastFlagEvent;
static string[] FlaggedMessageContains =
{
@ -24,7 +26,7 @@ namespace WebfrontCore.Application.API
public static void OnServerEventOccurred(object sender, Event E)
{
if (E.Type == Event.GType.Say && E.Origin.Level < SharedLibrary.Objects.Player.Permission.Trusted)
if (E.Type == Event.GType.Say && E.Origin.Level < Player.Permission.Trusted)
{
bool flaggedMessage = false;
foreach (string msg in FlaggedMessageContains)
@ -41,9 +43,9 @@ namespace WebfrontCore.Application.API
FlaggedMessageCount = 0;
E.Owner.Broadcast("If you suspect someone of ^5CHEATING ^7use the ^5!report ^7command").Wait();
Events.Enqueue(new SharedLibrary.Dtos.EventInfo(
SharedLibrary.Dtos.EventInfo.EventType.ALERT,
SharedLibrary.Dtos.EventInfo.EventVersion.IW4MAdmin,
Events.Enqueue(new EventInfo(
EventInfo.EventType.ALERT,
EventInfo.EventVersion.IW4MAdmin,
"Chat indicates there may be a cheater",
"Alert",
E.Owner.Hostname, ""));
@ -58,9 +60,9 @@ namespace WebfrontCore.Application.API
if (E.Type == Event.GType.Report)
{
Events.Enqueue(new SharedLibrary.Dtos.EventInfo(
SharedLibrary.Dtos.EventInfo.EventType.ALERT,
SharedLibrary.Dtos.EventInfo.EventVersion.IW4MAdmin,
Events.Enqueue(new EventInfo(
EventInfo.EventType.ALERT,
EventInfo.EventVersion.IW4MAdmin,
$"**{E.Origin.Name}** has reported **{E.Target.Name}** for: {E.Data.Trim()}",
E.Target.Name, E.Origin.Name, ""));
}