1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-15 01:28:34 -05:00

Event based plugin support now added

This commit is contained in:
RaidMax
2015-08-20 14:23:13 -05:00
parent 73aa001d79
commit ec7bed8e11
10 changed files with 236 additions and 74 deletions

View File

@ -82,14 +82,17 @@ namespace SharedLibrary
String eventType = line[0].Substring(line[0].Length - 1);
eventType = eventType.Trim();
if (eventType == "J")
return new Event(GType.Connect, null, SV.clientFromEventLine(line, 2), null, SV);
if (eventType == "Q")
return new Event(GType.Disconnect, null, SV.clientFromEventLine(line, 2), null, SV);
if (eventType == "K")
return new Event(GType.Kill, line[9], SV.clientFromEventLine(line, 6), SV.clientFromEventLine(line, 2), SV);
{
StringBuilder Data = new StringBuilder();
if (line.Length > 9)
{
for (int i = 9; i < line.Length; i++)
Data.Append(line[i] + ";");
}
return new Event(GType.Kill, Data.ToString(), SV.clientFromEventLine(line, 6), SV.clientFromEventLine(line, 2), SV);
}
if (line[0].Substring(line[0].Length - 3).Trim() == "say")
{
@ -99,10 +102,10 @@ namespace SharedLibrary
}
if (eventType == ":")
return new Event(GType.MapEnd, line[0], new Player("WORLD", "WORLD", 0, 0), null, null);
return new Event(GType.MapEnd, line[0], new Player("WORLD", "WORLD", 0, 0), null, SV);
if (line[0].Split('\\').Length > 5) // blaze it
return new Event(GType.MapChange, line[0], new Player("WORLD", "WORLD", 0, 0), null, null);
return new Event(GType.MapChange, line[0], new Player("WORLD", "WORLD", 0, 0), null, SV);
return null;
@ -123,4 +126,9 @@ namespace SharedLibrary
public Player Target;
public Server Owner;
}
public abstract class EventNotify
{
public abstract void onEvent(Event E);
}
}