2017-09-27 16:07:43 -04:00
|
|
|
|
#if DEBUG
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
2017-11-29 19:35:50 -05:00
|
|
|
|
using System.IO;
|
2017-11-25 20:29:58 -05:00
|
|
|
|
|
2017-09-27 16:07:43 -04:00
|
|
|
|
using SharedLibrary;
|
|
|
|
|
using SharedLibrary.Interfaces;
|
|
|
|
|
using SharedLibrary.Helpers;
|
2017-11-25 20:29:58 -05:00
|
|
|
|
using SharedLibrary.Objects;
|
2017-11-29 19:35:50 -05:00
|
|
|
|
using System.Text.RegularExpressions;
|
2018-02-10 23:33:42 -05:00
|
|
|
|
using StatsPlugin.Models;
|
2017-09-27 16:07:43 -04:00
|
|
|
|
|
|
|
|
|
namespace IW4MAdmin.Plugins
|
|
|
|
|
{
|
|
|
|
|
public class Tests : IPlugin
|
|
|
|
|
{
|
|
|
|
|
public string Name => "Dev Tests";
|
|
|
|
|
|
|
|
|
|
public float Version => 0.1f;
|
|
|
|
|
|
|
|
|
|
public string Author => "RaidMax";
|
|
|
|
|
|
2017-09-29 22:42:24 -04:00
|
|
|
|
private DateTime Interval;
|
2017-09-27 16:07:43 -04:00
|
|
|
|
|
|
|
|
|
public async Task OnEventAsync(Event E, Server S)
|
|
|
|
|
{
|
|
|
|
|
if (E.Type == Event.GType.Start)
|
|
|
|
|
{
|
|
|
|
|
#region PLAYER_HISTORY
|
|
|
|
|
var rand = new Random(GetHashCode());
|
|
|
|
|
var time = DateTime.UtcNow;
|
|
|
|
|
|
|
|
|
|
await Task.Run(() =>
|
|
|
|
|
{
|
|
|
|
|
if (S.PlayerHistory.Count > 0)
|
|
|
|
|
return;
|
|
|
|
|
|
2017-11-02 12:49:45 -04:00
|
|
|
|
while (S.PlayerHistory.Count < 144)
|
2017-09-27 16:07:43 -04:00
|
|
|
|
{
|
|
|
|
|
S.PlayerHistory.Enqueue(new PlayerHistory(time, rand.Next(7, 18)));
|
2017-11-02 12:49:45 -04:00
|
|
|
|
time = time.AddMinutes(PlayerHistory.UpdateInterval);
|
2017-09-27 16:07:43 -04:00
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
#endregion
|
2017-11-13 18:17:10 -05:00
|
|
|
|
|
|
|
|
|
#region PLUGIN_INFO
|
2017-11-16 18:09:19 -05:00
|
|
|
|
Console.WriteLine("|Name |Alias|Description |Requires Target|Syntax |Required Level|");
|
|
|
|
|
Console.WriteLine("|--------------| -----| --------------------------------------------------------| -----------------| -------------| ----------------|");
|
2017-11-13 18:17:10 -05:00
|
|
|
|
foreach (var command in S.Manager.GetCommands().OrderByDescending(c => c.Permission).ThenBy(c => c.Name))
|
|
|
|
|
{
|
2017-11-16 18:09:19 -05:00
|
|
|
|
Console.WriteLine($"|{command.Name}|{command.Alias}|{command.Description}|{command.RequiresTarget}|{command.Syntax.Substring(8).EscapeMarkdown()}|{command.Permission}|");
|
2017-11-13 18:17:10 -05:00
|
|
|
|
}
|
|
|
|
|
#endregion
|
2017-09-27 16:07:43 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-10-16 23:47:41 -04:00
|
|
|
|
public async Task OnLoadAsync(IManager manager)
|
2017-09-27 16:07:43 -04:00
|
|
|
|
{
|
|
|
|
|
Interval = DateTime.Now;
|
2018-02-10 23:33:42 -05:00
|
|
|
|
var clients = new List<Player>();
|
|
|
|
|
var oldClients = new Dictionary<int, Player>();
|
2017-11-29 19:35:50 -05:00
|
|
|
|
#region CLIENTS
|
|
|
|
|
if (File.Exists("import_clients.csv"))
|
|
|
|
|
{
|
2018-02-07 00:19:06 -05:00
|
|
|
|
manager.GetLogger().WriteVerbose("Beginning import of existing clients");
|
2017-11-29 19:35:50 -05:00
|
|
|
|
|
|
|
|
|
var lines = File.ReadAllLines("import_clients.csv").Skip(1);
|
|
|
|
|
foreach (string line in lines)
|
|
|
|
|
{
|
|
|
|
|
string[] fields = Regex.Replace(line, "\".*\"", "").Split(',');
|
|
|
|
|
fields.All(f =>
|
|
|
|
|
{
|
|
|
|
|
f = f.StripColors().Trim();
|
|
|
|
|
return true;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (fields.Length != 11)
|
|
|
|
|
{
|
|
|
|
|
manager.GetLogger().WriteError("Invalid client import file... aborting import");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2018-02-10 23:33:42 -05:00
|
|
|
|
if (fields[1].Substring(0, 5) == "01100" || fields[0] == string.Empty || fields[1] == string.Empty || fields[6] == string.Empty)
|
2017-11-29 19:35:50 -05:00
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
if (!Regex.Match(fields[6], @"^\d+\.\d+\.\d+.\d+$").Success)
|
2018-02-10 23:33:42 -05:00
|
|
|
|
fields[6] = "0";
|
2017-11-29 19:35:50 -05:00
|
|
|
|
|
|
|
|
|
var client = new Player()
|
|
|
|
|
{
|
2018-02-10 23:33:42 -05:00
|
|
|
|
// for link
|
|
|
|
|
ClientId = Convert.ToInt32(fields[2]),
|
2017-11-29 19:35:50 -05:00
|
|
|
|
Name = fields[0],
|
2018-02-10 23:33:42 -05:00
|
|
|
|
NetworkId = fields[1].Trim().ConvertLong(),
|
|
|
|
|
IPAddress = fields[6].ConvertToIP(),
|
2017-11-29 19:35:50 -05:00
|
|
|
|
Level = (Player.Permission)Convert.ToInt32(fields[3]),
|
|
|
|
|
Connections = Convert.ToInt32(fields[5]),
|
|
|
|
|
LastConnection = DateTime.Parse(fields[7]),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
clients.Add(client);
|
2018-02-10 23:33:42 -05:00
|
|
|
|
oldClients.Add(client.ClientId, client);
|
2017-11-29 19:35:50 -05:00
|
|
|
|
}
|
2018-02-10 23:33:42 -05:00
|
|
|
|
//#if DO_IMPORT
|
|
|
|
|
clients = clients.Distinct().ToList();
|
2017-11-29 19:35:50 -05:00
|
|
|
|
|
|
|
|
|
clients = clients
|
|
|
|
|
.GroupBy(c => new { c.Name, c.IPAddress })
|
|
|
|
|
.Select(c => c.FirstOrDefault())
|
|
|
|
|
.ToList();
|
|
|
|
|
|
2018-02-10 23:33:42 -05:00
|
|
|
|
//newClients = clients.ToList();
|
|
|
|
|
//newClients.ForEach(c => c.ClientId = 0);
|
|
|
|
|
|
2018-02-07 00:19:06 -05:00
|
|
|
|
manager.GetLogger().WriteVerbose($"Read {clients.Count} clients for import");
|
2017-11-29 19:35:50 -05:00
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
SharedLibrary.Database.Importer.ImportClients(clients);
|
|
|
|
|
}
|
|
|
|
|
|
2018-02-10 23:33:42 -05:00
|
|
|
|
catch (Exception e)
|
2017-11-29 19:35:50 -05:00
|
|
|
|
{
|
|
|
|
|
manager.GetLogger().WriteError("Saving imported clients failed");
|
|
|
|
|
}
|
2018-02-10 23:33:42 -05:00
|
|
|
|
//#endif
|
2017-11-29 19:35:50 -05:00
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
#region PENALTIES
|
|
|
|
|
if (File.Exists("import_penalties.csv"))
|
|
|
|
|
{
|
|
|
|
|
var penalties = new List<Penalty>();
|
2018-02-07 00:19:06 -05:00
|
|
|
|
manager.GetLogger().WriteVerbose("Beginning import of existing penalties");
|
2017-11-29 19:35:50 -05:00
|
|
|
|
foreach (string line in File.ReadAllLines("import_penalties.csv").Skip(1))
|
|
|
|
|
{
|
|
|
|
|
string comma = Regex.Match(line, "\".*,.*\"").Value.Replace(",", "");
|
|
|
|
|
string[] fields = Regex.Replace(line, "\".*,.*\"", comma).Split(',');
|
|
|
|
|
|
|
|
|
|
fields.All(f =>
|
|
|
|
|
{
|
|
|
|
|
f = f.StripColors().Trim();
|
|
|
|
|
return true;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (fields.Length != 7)
|
|
|
|
|
{
|
|
|
|
|
manager.GetLogger().WriteError("Invalid penalty import file... aborting import");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2018-02-10 23:33:42 -05:00
|
|
|
|
if (fields[2].Contains("0110") || fields[2].Contains("0000000"))
|
2017-11-29 19:35:50 -05:00
|
|
|
|
continue;
|
|
|
|
|
try
|
|
|
|
|
{
|
2018-02-10 23:33:42 -05:00
|
|
|
|
|
2017-11-29 19:35:50 -05:00
|
|
|
|
var expires = DateTime.Parse(fields[6]);
|
|
|
|
|
var when = DateTime.Parse(fields[5]);
|
|
|
|
|
|
|
|
|
|
var penalty = new Penalty()
|
|
|
|
|
{
|
|
|
|
|
Type = (Penalty.PenaltyType)Int32.Parse(fields[0]),
|
2018-02-10 23:33:42 -05:00
|
|
|
|
Expires = expires == DateTime.MinValue ? when : expires,
|
|
|
|
|
Punisher = new SharedLibrary.Database.Models.EFClient() { NetworkId = fields[3].ConvertLong() },
|
|
|
|
|
Offender = new SharedLibrary.Database.Models.EFClient() { NetworkId = fields[2].ConvertLong() },
|
2017-11-29 19:35:50 -05:00
|
|
|
|
Offense = fields[1],
|
|
|
|
|
Active = true,
|
|
|
|
|
When = when,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
penalties.Add(penalty);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
2018-02-07 00:19:06 -05:00
|
|
|
|
manager.GetLogger().WriteVerbose($"Could not import penalty with line {line}");
|
2017-11-29 19:35:50 -05:00
|
|
|
|
}
|
|
|
|
|
}
|
2018-02-10 23:33:42 -05:00
|
|
|
|
//#if DO_IMPORT
|
2017-11-29 19:35:50 -05:00
|
|
|
|
SharedLibrary.Database.Importer.ImportPenalties(penalties);
|
2018-02-07 00:19:06 -05:00
|
|
|
|
manager.GetLogger().WriteVerbose($"Imported {penalties.Count} penalties");
|
2018-02-10 23:33:42 -05:00
|
|
|
|
//#endif
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
#region CHATHISTORY
|
|
|
|
|
// load the entire database lol
|
|
|
|
|
var cls = manager.GetClientService().Find(c => c.Active).Result;
|
|
|
|
|
|
|
|
|
|
if (File.Exists("import_chathistory.csv"))
|
|
|
|
|
{
|
|
|
|
|
var chatHistory = new List<EFClientMessage>();
|
|
|
|
|
manager.GetLogger().WriteVerbose("Beginning import of existing messages");
|
|
|
|
|
foreach (string line in File.ReadAllLines("import_chathistory.csv").Skip(1))
|
|
|
|
|
{
|
|
|
|
|
string comma = Regex.Match(line, "\".*,.*\"").Value.Replace(",", "");
|
|
|
|
|
string[] fields = Regex.Replace(line, "\".*,.*\"", comma).Split(',');
|
|
|
|
|
|
|
|
|
|
fields.All(f =>
|
|
|
|
|
{
|
|
|
|
|
f = f.StripColors().Trim();
|
|
|
|
|
return true;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (fields.Length != 4)
|
|
|
|
|
{
|
|
|
|
|
manager.GetLogger().WriteError("Invalid chat history import file... aborting import");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
int cId = Convert.ToInt32(fields[0]);
|
|
|
|
|
var linkedClient = oldClients[cId];
|
|
|
|
|
|
|
|
|
|
var newcl = cls.FirstOrDefault(c => c.NetworkId == linkedClient.NetworkId);
|
|
|
|
|
if (newcl == null)
|
|
|
|
|
newcl = cls.FirstOrDefault(c => c.Name == linkedClient.Name && c.IPAddress == linkedClient.IPAddress);
|
|
|
|
|
int newCId = newcl.ClientId;
|
|
|
|
|
|
|
|
|
|
var chatMessage = new EFClientMessage()
|
|
|
|
|
{
|
|
|
|
|
Active = true,
|
|
|
|
|
ClientId = newCId,
|
|
|
|
|
Message = fields[1],
|
|
|
|
|
TimeSent = DateTime.Parse(fields[3]),
|
|
|
|
|
ServerId = Math.Abs($"127.0.0.1:{Convert.ToInt32(fields[2]).ToString()}".GetHashCode())
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
chatHistory.Add(chatMessage);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|
manager.GetLogger().WriteVerbose($"Could not import chatmessage with line {line}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
manager.GetLogger().WriteVerbose($"Read {chatHistory.Count} messages for import");
|
|
|
|
|
SharedLibrary.Database.Importer.ImportSQLite(chatHistory);
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
#region STATS
|
|
|
|
|
if (File.Exists("import_stats.csv"))
|
|
|
|
|
{
|
|
|
|
|
var stats = new List<EFClientStatistics>();
|
|
|
|
|
manager.GetLogger().WriteVerbose("Beginning import of existing client stats");
|
|
|
|
|
|
|
|
|
|
var lines = File.ReadAllLines("import_stats.csv").Skip(1);
|
|
|
|
|
foreach (string line in lines)
|
|
|
|
|
{
|
|
|
|
|
string[] fields = line.Split(',');
|
|
|
|
|
|
|
|
|
|
if (fields.Length != 9)
|
|
|
|
|
{
|
|
|
|
|
manager.GetLogger().WriteError("Invalid client import file... aborting import");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
if (fields[0].Substring(0, 5) == "01100")
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
long id = fields[0].ConvertLong();
|
|
|
|
|
var client = cls.First(c => c.NetworkId == id);
|
|
|
|
|
|
|
|
|
|
var time = Convert.ToInt32(fields[8]);
|
|
|
|
|
double spm = time < 60 ? 0 : Math.Round(Convert.ToInt32(fields[1]) * 100.0 / time, 3);
|
|
|
|
|
if (spm > 1000)
|
|
|
|
|
spm = 0;
|
|
|
|
|
|
|
|
|
|
var st = new EFClientStatistics()
|
|
|
|
|
{
|
|
|
|
|
Active = true,
|
|
|
|
|
ClientId = client.ClientId,
|
|
|
|
|
ServerId = Math.Abs("127.0.0.1:28965".GetHashCode()),
|
|
|
|
|
Kills = Convert.ToInt32(fields[1]),
|
|
|
|
|
Deaths = Convert.ToInt32(fields[2]),
|
|
|
|
|
SPM = spm,
|
|
|
|
|
Skill = 0
|
|
|
|
|
};
|
|
|
|
|
stats.Add(st);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
manager.GetLogger().WriteVerbose($"Read {stats.Count} clients stats for import");
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
SharedLibrary.Database.Importer.ImportSQLite<EFClientStatistics>(stats);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|
manager.GetLogger().WriteError("Saving imported stats failed");
|
|
|
|
|
}
|
2017-11-29 19:35:50 -05:00
|
|
|
|
}
|
|
|
|
|
#endregion
|
2017-09-27 16:07:43 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async Task OnTickAsync(Server S)
|
|
|
|
|
{
|
2018-02-10 23:33:42 -05:00
|
|
|
|
return;
|
2018-02-07 00:19:06 -05:00
|
|
|
|
if ((DateTime.Now - Interval).TotalSeconds > 1)
|
2017-09-27 16:07:43 -04:00
|
|
|
|
{
|
|
|
|
|
var rand = new Random();
|
|
|
|
|
int index = rand.Next(0, 17);
|
2017-11-25 20:29:58 -05:00
|
|
|
|
var p = new Player()
|
2017-09-27 16:07:43 -04:00
|
|
|
|
{
|
2017-11-29 19:35:50 -05:00
|
|
|
|
Name = $"Test_{index}",
|
2018-02-10 23:33:42 -05:00
|
|
|
|
NetworkId = (long)$"_test_{index}".GetHashCode(),
|
2017-11-25 20:29:58 -05:00
|
|
|
|
ClientNumber = index,
|
|
|
|
|
Ping = 1,
|
2018-02-10 23:33:42 -05:00
|
|
|
|
IPAddress = $"127.0.0.{index}".ConvertToIP()
|
2017-09-27 16:07:43 -04:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (S.Players.ElementAt(index) != null)
|
|
|
|
|
await S.RemovePlayer(index);
|
2018-02-10 23:33:42 -05:00
|
|
|
|
// await S.AddPlayer(p);
|
|
|
|
|
|
2017-11-02 18:20:10 -04:00
|
|
|
|
|
2017-09-27 16:07:43 -04:00
|
|
|
|
Interval = DateTime.Now;
|
2017-09-29 22:42:24 -04:00
|
|
|
|
if (S.ClientNum > 0)
|
|
|
|
|
{
|
|
|
|
|
var victimPlayer = S.Players.Where(pl => pl != null).ToList()[rand.Next(0, S.ClientNum - 1)];
|
|
|
|
|
var attackerPlayer = S.Players.Where(pl => pl != null).ToList()[rand.Next(0, S.ClientNum - 1)];
|
|
|
|
|
|
2017-11-25 20:29:58 -05:00
|
|
|
|
await S.ExecuteEvent(new Event(Event.GType.Say, $"test_{attackerPlayer.ClientNumber}", victimPlayer, attackerPlayer, S));
|
2017-11-02 18:20:10 -04:00
|
|
|
|
|
2017-09-29 22:42:24 -04:00
|
|
|
|
string[] eventLine = null;
|
|
|
|
|
|
2017-10-04 19:01:04 -04:00
|
|
|
|
for (int i = 0; i < 1; i++)
|
2017-09-29 22:42:24 -04:00
|
|
|
|
{
|
2017-10-04 19:01:04 -04:00
|
|
|
|
if (S.GameName == Server.Game.IW4)
|
2017-09-29 22:42:24 -04:00
|
|
|
|
{
|
2017-10-04 19:01:04 -04:00
|
|
|
|
|
|
|
|
|
// attackerID ; victimID ; attackerOrigin ; victimOrigin ; Damage ; Weapon ; hitLocation ; meansOfDeath
|
|
|
|
|
var minimapInfo = StatsPlugin.MinimapConfig.IW4Minimaps().MapInfo.FirstOrDefault(m => m.MapName == S.CurrentMap.Name);
|
|
|
|
|
if (minimapInfo == null)
|
|
|
|
|
return;
|
|
|
|
|
eventLine = new string[]
|
|
|
|
|
{
|
2017-09-29 22:42:24 -04:00
|
|
|
|
"ScriptKill",
|
2018-02-10 23:33:42 -05:00
|
|
|
|
attackerPlayer.NetworkId.ToString(),
|
|
|
|
|
victimPlayer.NetworkId.ToString(),
|
2017-10-03 19:17:35 -04:00
|
|
|
|
new Vector3(rand.Next(minimapInfo.MaxRight, minimapInfo.MaxLeft), rand.Next(minimapInfo.MaxBottom, minimapInfo.MaxTop), rand.Next(0, 100)).ToString(),
|
|
|
|
|
new Vector3(rand.Next(minimapInfo.MaxRight, minimapInfo.MaxLeft), rand.Next(minimapInfo.MaxBottom, minimapInfo.MaxTop), rand.Next(0, 100)).ToString(),
|
2017-09-29 22:42:24 -04:00
|
|
|
|
rand.Next(50, 105).ToString(),
|
|
|
|
|
((StatsPlugin.IW4Info.WeaponName)rand.Next(0, Enum.GetValues(typeof(StatsPlugin.IW4Info.WeaponName)).Length - 1)).ToString(),
|
|
|
|
|
((StatsPlugin.IW4Info.HitLocation)rand.Next(0, Enum.GetValues(typeof(StatsPlugin.IW4Info.HitLocation)).Length - 1)).ToString(),
|
|
|
|
|
((StatsPlugin.IW4Info.MeansOfDeath)rand.Next(0, Enum.GetValues(typeof(StatsPlugin.IW4Info.MeansOfDeath)).Length - 1)).ToString()
|
2017-10-04 19:01:04 -04:00
|
|
|
|
};
|
2017-09-29 22:42:24 -04:00
|
|
|
|
|
2017-10-04 19:01:04 -04:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
eventLine = new string[]
|
|
|
|
|
{
|
2017-09-29 22:42:24 -04:00
|
|
|
|
"K",
|
2018-02-10 23:33:42 -05:00
|
|
|
|
victimPlayer.NetworkId.ToString(),
|
2017-11-25 20:29:58 -05:00
|
|
|
|
victimPlayer.ClientNumber.ToString(),
|
2017-09-29 22:42:24 -04:00
|
|
|
|
rand.Next(0, 1) == 0 ? "allies" : "axis",
|
|
|
|
|
victimPlayer.Name,
|
2018-02-10 23:33:42 -05:00
|
|
|
|
attackerPlayer.NetworkId.ToString(),
|
2017-11-25 20:29:58 -05:00
|
|
|
|
attackerPlayer.ClientNumber.ToString(),
|
2017-09-29 22:42:24 -04:00
|
|
|
|
rand.Next(0, 1) == 0 ? "allies" : "axis",
|
|
|
|
|
attackerPlayer.Name.ToString(),
|
|
|
|
|
((StatsPlugin.IW4Info.WeaponName)rand.Next(0, Enum.GetValues(typeof(StatsPlugin.IW4Info.WeaponName)).Length - 1)).ToString(), // Weapon
|
2017-10-03 19:17:35 -04:00
|
|
|
|
rand.Next(50, 105).ToString(), // Damage
|
2017-09-29 22:42:24 -04:00
|
|
|
|
((StatsPlugin.IW4Info.MeansOfDeath)rand.Next(0, Enum.GetValues(typeof(StatsPlugin.IW4Info.MeansOfDeath)).Length - 1)).ToString(), // Means of Death
|
|
|
|
|
((StatsPlugin.IW4Info.HitLocation)rand.Next(0, Enum.GetValues(typeof(StatsPlugin.IW4Info.HitLocation)).Length - 1)).ToString(), // Hit Location
|
2017-10-04 19:01:04 -04:00
|
|
|
|
};
|
|
|
|
|
}
|
2017-09-29 22:42:24 -04:00
|
|
|
|
|
2017-10-04 19:01:04 -04:00
|
|
|
|
var _event = Event.ParseEventString(eventLine, S);
|
|
|
|
|
await S.ExecuteEvent(_event);
|
|
|
|
|
}
|
2018-02-07 00:19:06 -05:00
|
|
|
|
}
|
2017-09-27 16:07:43 -04:00
|
|
|
|
}
|
2017-09-29 22:42:24 -04:00
|
|
|
|
|
2017-09-27 16:07:43 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async Task OnUnloadAsync()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|