IW4M-Admin/SharedLibraryCore/Event.cs
RaidMax 99390f1f35 fixed issue with status response erroring when incorrect length
view angle vector parse fail is now a handled exception
change local host check to byte array to make it faster than comparing string
kick command now requires moderator level or higher
tempban now requires administrator level or higher
hopefully fixed negative SPM bug
pipelined the events and consolidated them to run through GameEventHandler
uniform console colors
2018-04-26 01:13:04 -05:00

69 lines
1.5 KiB
C#

using System;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using SharedLibraryCore.Objects;
namespace SharedLibraryCore
{
public class GameEvent
{
public enum EventType
{
//FROM SERVER
Start,
Stop,
Connect,
Disconnect,
Say,
MapChange,
MapEnd,
//FROM ADMIN
Broadcast,
Tell,
Kick,
Ban,
Remote,
Unknown,
//FROM PLAYER
Report,
Flag,
Command,
// FROM GAME
Script,
Kill,
Damage,
Death,
}
public GameEvent(EventType t, string d, Player O, Player T, Server S)
{
Type = t;
Data = d?.Trim();
Origin = O;
Target = T;
Owner = S;
OnProcessed = new ManualResetEventSlim();
}
public GameEvent()
{
OnProcessed = new ManualResetEventSlim();
}
public EventType Type;
public string Data; // Data is usually the message sent by player
public string Message;
public Player Origin;
public Player Target;
public Server Owner;
public Boolean Remote = false;
public object Extra { get; set; }
public ManualResetEventSlim OnProcessed { get; private set; }
}
}