removed reload command
prevent control characters from being used in name added MOD_HEAD_SHOT to hit location increment css fix for alias dropdown testing view angle analysis
This commit is contained in:
parent
f7b41537d7
commit
88f31bc78c
@ -17,8 +17,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WelcomePlugin", "Plugins\We
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VotemapPlugin", "Plugins\VoteMap\VotemapPlugin.csproj", "{428D8EB9-ECA3-4A66-AA59-3A944378C33F}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VotemapPlugin", "Plugins\VoteMap\VotemapPlugin.csproj", "{428D8EB9-ECA3-4A66-AA59-3A944378C33F}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MessageboardPlugin", "Plugins\MessageBoard\MessageboardPlugin.csproj", "{E46C85BD-A99C-484E-BCCE-0F1831C5925E}"
|
|
||||||
EndProject
|
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugins", "Plugins", "{26E8B310-269E-46D4-A612-24601F16065F}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugins", "Plugins", "{26E8B310-269E-46D4-A612-24601F16065F}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FastRestartPlugin", "Plugins\FastRestart\FastRestartPlugin.csproj", "{1479DE87-ACB5-4046-81C8-A0BA5041227D}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FastRestartPlugin", "Plugins\FastRestart\FastRestartPlugin.csproj", "{1479DE87-ACB5-4046-81C8-A0BA5041227D}"
|
||||||
@ -180,30 +178,6 @@ Global
|
|||||||
{428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Stable|x64.Build.0 = Release-Stable|Any CPU
|
{428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Stable|x64.Build.0 = Release-Stable|Any CPU
|
||||||
{428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Stable|x86.ActiveCfg = Release-Stable|Any CPU
|
{428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Stable|x86.ActiveCfg = Release-Stable|Any CPU
|
||||||
{428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Stable|x86.Build.0 = Release-Stable|Any CPU
|
{428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Stable|x86.Build.0 = Release-Stable|Any CPU
|
||||||
{E46C85BD-A99C-484E-BCCE-0F1831C5925E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{E46C85BD-A99C-484E-BCCE-0F1831C5925E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{E46C85BD-A99C-484E-BCCE-0F1831C5925E}.Debug|Mixed Platforms.ActiveCfg = Release-Stable|Any CPU
|
|
||||||
{E46C85BD-A99C-484E-BCCE-0F1831C5925E}.Debug|x64.ActiveCfg = Release-Stable|Any CPU
|
|
||||||
{E46C85BD-A99C-484E-BCCE-0F1831C5925E}.Debug|x86.ActiveCfg = Debug|x86
|
|
||||||
{E46C85BD-A99C-484E-BCCE-0F1831C5925E}.Debug|x86.Build.0 = Debug|x86
|
|
||||||
{E46C85BD-A99C-484E-BCCE-0F1831C5925E}.Release|Any CPU.ActiveCfg = Release-Nightly|Any CPU
|
|
||||||
{E46C85BD-A99C-484E-BCCE-0F1831C5925E}.Release|Any CPU.Build.0 = Release-Nightly|Any CPU
|
|
||||||
{E46C85BD-A99C-484E-BCCE-0F1831C5925E}.Release|Mixed Platforms.ActiveCfg = Release-Stable|x86
|
|
||||||
{E46C85BD-A99C-484E-BCCE-0F1831C5925E}.Release|Mixed Platforms.Build.0 = Release-Stable|x86
|
|
||||||
{E46C85BD-A99C-484E-BCCE-0F1831C5925E}.Release|x64.ActiveCfg = Release-Nightly|Any CPU
|
|
||||||
{E46C85BD-A99C-484E-BCCE-0F1831C5925E}.Release|x64.Build.0 = Release-Nightly|Any CPU
|
|
||||||
{E46C85BD-A99C-484E-BCCE-0F1831C5925E}.Release|x86.ActiveCfg = Release-Stable|x86
|
|
||||||
{E46C85BD-A99C-484E-BCCE-0F1831C5925E}.Release|x86.Build.0 = Release-Stable|x86
|
|
||||||
{E46C85BD-A99C-484E-BCCE-0F1831C5925E}.Release-Nightly|Any CPU.ActiveCfg = Release-Nightly|Any CPU
|
|
||||||
{E46C85BD-A99C-484E-BCCE-0F1831C5925E}.Release-Nightly|Mixed Platforms.ActiveCfg = Release-Stable|Any CPU
|
|
||||||
{E46C85BD-A99C-484E-BCCE-0F1831C5925E}.Release-Nightly|x64.ActiveCfg = Release-Stable|Any CPU
|
|
||||||
{E46C85BD-A99C-484E-BCCE-0F1831C5925E}.Release-Nightly|x86.ActiveCfg = Release-Nightly|Any CPU
|
|
||||||
{E46C85BD-A99C-484E-BCCE-0F1831C5925E}.Release-Nightly|x86.Build.0 = Release-Nightly|Any CPU
|
|
||||||
{E46C85BD-A99C-484E-BCCE-0F1831C5925E}.Release-Stable|Any CPU.ActiveCfg = Release-Stable|Any CPU
|
|
||||||
{E46C85BD-A99C-484E-BCCE-0F1831C5925E}.Release-Stable|Mixed Platforms.ActiveCfg = Release-Stable|Any CPU
|
|
||||||
{E46C85BD-A99C-484E-BCCE-0F1831C5925E}.Release-Stable|x64.ActiveCfg = Release-Stable|Any CPU
|
|
||||||
{E46C85BD-A99C-484E-BCCE-0F1831C5925E}.Release-Stable|x86.ActiveCfg = Release-Stable|Any CPU
|
|
||||||
{E46C85BD-A99C-484E-BCCE-0F1831C5925E}.Release-Stable|x86.Build.0 = Release-Stable|Any CPU
|
|
||||||
{1479DE87-ACB5-4046-81C8-A0BA5041227D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{1479DE87-ACB5-4046-81C8-A0BA5041227D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{1479DE87-ACB5-4046-81C8-A0BA5041227D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{1479DE87-ACB5-4046-81C8-A0BA5041227D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{1479DE87-ACB5-4046-81C8-A0BA5041227D}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
{1479DE87-ACB5-4046-81C8-A0BA5041227D}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||||
@ -304,7 +278,6 @@ Global
|
|||||||
{4785AB75-66F3-4391-985D-63A5A049A0FA} = {26E8B310-269E-46D4-A612-24601F16065F}
|
{4785AB75-66F3-4391-985D-63A5A049A0FA} = {26E8B310-269E-46D4-A612-24601F16065F}
|
||||||
{AF097E6B-48D5-4452-9CCF-0A81A21F341D} = {26E8B310-269E-46D4-A612-24601F16065F}
|
{AF097E6B-48D5-4452-9CCF-0A81A21F341D} = {26E8B310-269E-46D4-A612-24601F16065F}
|
||||||
{428D8EB9-ECA3-4A66-AA59-3A944378C33F} = {26E8B310-269E-46D4-A612-24601F16065F}
|
{428D8EB9-ECA3-4A66-AA59-3A944378C33F} = {26E8B310-269E-46D4-A612-24601F16065F}
|
||||||
{E46C85BD-A99C-484E-BCCE-0F1831C5925E} = {26E8B310-269E-46D4-A612-24601F16065F}
|
|
||||||
{1479DE87-ACB5-4046-81C8-A0BA5041227D} = {26E8B310-269E-46D4-A612-24601F16065F}
|
{1479DE87-ACB5-4046-81C8-A0BA5041227D} = {26E8B310-269E-46D4-A612-24601F16065F}
|
||||||
{B8C2A759-8663-4F6F-9BA4-19595F5E12C1} = {26E8B310-269E-46D4-A612-24601F16065F}
|
{B8C2A759-8663-4F6F-9BA4-19595F5E12C1} = {26E8B310-269E-46D4-A612-24601F16065F}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
using SharedLibrary.Interfaces;
|
using SharedLibrary.Helpers;
|
||||||
|
using SharedLibrary.Interfaces;
|
||||||
using SharedLibrary.Objects;
|
using SharedLibrary.Objects;
|
||||||
|
using StatsPlugin.Helpers;
|
||||||
using StatsPlugin.Models;
|
using StatsPlugin.Models;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@ -34,7 +36,8 @@ namespace StatsPlugin.Cheat
|
|||||||
public DetectionPenaltyResult ProcessKill(EFClientKill kill)
|
public DetectionPenaltyResult ProcessKill(EFClientKill kill)
|
||||||
{
|
{
|
||||||
if ((kill.DeathType != IW4Info.MeansOfDeath.MOD_PISTOL_BULLET &&
|
if ((kill.DeathType != IW4Info.MeansOfDeath.MOD_PISTOL_BULLET &&
|
||||||
kill.DeathType != IW4Info.MeansOfDeath.MOD_RIFLE_BULLET) ||
|
kill.DeathType != IW4Info.MeansOfDeath.MOD_RIFLE_BULLET &&
|
||||||
|
kill.DeathType != IW4Info.MeansOfDeath.MOD_HEAD_SHOT) ||
|
||||||
kill.HitLoc == IW4Info.HitLocation.none)
|
kill.HitLoc == IW4Info.HitLocation.none)
|
||||||
return new DetectionPenaltyResult()
|
return new DetectionPenaltyResult()
|
||||||
{
|
{
|
||||||
@ -46,6 +49,18 @@ namespace StatsPlugin.Cheat
|
|||||||
Kills++;
|
Kills++;
|
||||||
AverageKillTime = (AverageKillTime + (DateTime.UtcNow - LastKill).TotalSeconds) / Kills;
|
AverageKillTime = (AverageKillTime + (DateTime.UtcNow - LastKill).TotalSeconds) / Kills;
|
||||||
|
|
||||||
|
#region VIEWANGLES
|
||||||
|
double distance = Vector3.Distance(kill.KillOrigin, kill.DeathOrigin);
|
||||||
|
double x = kill.KillOrigin.X + distance * Math.Cos(kill.ViewAngles.Y.ToRadians()) * Math.Cos(kill.ViewAngles.X.ToRadians());
|
||||||
|
double y = kill.KillOrigin.Y + (distance * Math.Sin((360.0f - kill.ViewAngles.Y).ToRadians()));
|
||||||
|
double z = kill.KillOrigin.Z + (distance * Math.Cos(kill.ViewAngles.Y.ToRadians()) * Math.Sin((360.0f - kill.ViewAngles.X).ToRadians()));
|
||||||
|
var trueVector = Vector3.Subtract(kill.KillOrigin, kill.DeathOrigin);
|
||||||
|
var calculatedVector = Vector3.Subtract(kill.KillOrigin, new Vector3((float)x, (float)y, (float)z));
|
||||||
|
double angle = trueVector.AngleBetween(calculatedVector);
|
||||||
|
Console.WriteLine(((float)angle).ToDegrees());
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region SESSION_RATIOS
|
#region SESSION_RATIOS
|
||||||
if (Kills >= Thresholds.LowSampleMinKills)
|
if (Kills >= Thresholds.LowSampleMinKills)
|
||||||
{
|
{
|
||||||
|
26
Plugins/SimpleStats/Helpers/Extensions.cs
Normal file
26
Plugins/SimpleStats/Helpers/Extensions.cs
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
using SharedLibrary.Helpers;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StatsPlugin.Helpers
|
||||||
|
{
|
||||||
|
static class Extensions
|
||||||
|
{
|
||||||
|
|
||||||
|
public static Vector3 FixIW4Angles(this Vector3 vector)
|
||||||
|
{
|
||||||
|
float X = vector.X > 0 ? 360.0f - vector.X : Math.Abs(vector.X);
|
||||||
|
float Y = vector.Y > 0 ? 360.0f - vector.Y : Math.Abs(vector.Y);
|
||||||
|
float Z = vector.Z > 0 ? 360.0f - vector.Z : Math.Abs(vector.Z);
|
||||||
|
|
||||||
|
return new Vector3(X, Y, Z);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static float ToRadians(this float value) => (float)Math.PI * value / 180.0f;
|
||||||
|
|
||||||
|
public static float ToDegrees(this float value) => value * 180.0f / (float)Math.PI;
|
||||||
|
}
|
||||||
|
}
|
@ -205,7 +205,7 @@ namespace StatsPlugin.Helpers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task AddScriptKill(Player attacker, Player victim, int serverId, string map, string hitLoc, string type,
|
public async Task AddScriptKill(Player attacker, Player victim, int serverId, string map, string hitLoc, string type,
|
||||||
string damage, string weapon, string killOrigin, string deathOrigin)
|
string damage, string weapon, string killOrigin, string deathOrigin, string viewAngles, string offset)
|
||||||
{
|
{
|
||||||
var statsSvc = ContextThreads[serverId];
|
var statsSvc = ContextThreads[serverId];
|
||||||
|
|
||||||
@ -221,7 +221,10 @@ namespace StatsPlugin.Helpers
|
|||||||
DeathType = ParseEnum<IW4Info.MeansOfDeath>.Get(type, typeof(IW4Info.MeansOfDeath)),
|
DeathType = ParseEnum<IW4Info.MeansOfDeath>.Get(type, typeof(IW4Info.MeansOfDeath)),
|
||||||
Damage = Int32.Parse(damage),
|
Damage = Int32.Parse(damage),
|
||||||
HitLoc = ParseEnum<IW4Info.HitLocation>.Get(hitLoc, typeof(IW4Info.HitLocation)),
|
HitLoc = ParseEnum<IW4Info.HitLocation>.Get(hitLoc, typeof(IW4Info.HitLocation)),
|
||||||
Weapon = ParseEnum<IW4Info.WeaponName>.Get(weapon, typeof(IW4Info.WeaponName))
|
Weapon = ParseEnum<IW4Info.WeaponName>.Get(weapon, typeof(IW4Info.WeaponName)),
|
||||||
|
ViewAngles = Vector3.Parse(viewAngles).FixIW4Angles(),
|
||||||
|
TimeOffset = Int64.Parse(offset),
|
||||||
|
When = DateTime.UtcNow
|
||||||
};
|
};
|
||||||
|
|
||||||
if (kill.DeathType == IW4Info.MeansOfDeath.MOD_SUICIDE &&
|
if (kill.DeathType == IW4Info.MeansOfDeath.MOD_SUICIDE &&
|
||||||
@ -238,14 +241,16 @@ namespace StatsPlugin.Helpers
|
|||||||
|
|
||||||
// increment their hit count
|
// increment their hit count
|
||||||
if (kill.DeathType == IW4Info.MeansOfDeath.MOD_PISTOL_BULLET ||
|
if (kill.DeathType == IW4Info.MeansOfDeath.MOD_PISTOL_BULLET ||
|
||||||
kill.DeathType == IW4Info.MeansOfDeath.MOD_RIFLE_BULLET)
|
kill.DeathType == IW4Info.MeansOfDeath.MOD_RIFLE_BULLET ||
|
||||||
|
kill.DeathType == IW4Info.MeansOfDeath.MOD_HEAD_SHOT)
|
||||||
{
|
{
|
||||||
playerStats.HitLocations.Single(hl => hl.Location == kill.HitLoc).HitCount += 1;
|
playerStats.HitLocations.Single(hl => hl.Location == kill.HitLoc).HitCount += 1;
|
||||||
await statsSvc.ClientStatSvc.SaveChangesAsync();
|
await statsSvc.ClientStatSvc.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
//statsSvc.KillStatsSvc.Insert(kill);
|
statsSvc.KillStatsSvc.Insert(kill);
|
||||||
//await statsSvc.KillStatsSvc.SaveChangesAsync();
|
await statsSvc.KillStatsSvc.SaveChangesAsync();
|
||||||
|
|
||||||
if (Plugin.Config.Configuration().EnableAntiCheat)
|
if (Plugin.Config.Configuration().EnableAntiCheat)
|
||||||
{
|
{
|
||||||
async Task executePenalty(Cheat.DetectionPenaltyResult penalty)
|
async Task executePenalty(Cheat.DetectionPenaltyResult penalty)
|
||||||
|
@ -22,7 +22,7 @@ namespace StatsPlugin.Helpers
|
|||||||
var deathstreakMessage = Plugin.Config.Configuration().DeathstreakMessages;
|
var deathstreakMessage = Plugin.Config.Configuration().DeathstreakMessages;
|
||||||
|
|
||||||
string message = killstreakMessage.FirstOrDefault(m => m.Count == killStreak)?.Message;
|
string message = killstreakMessage.FirstOrDefault(m => m.Count == killStreak)?.Message;
|
||||||
message = (message == null) ? deathstreakMessage.FirstOrDefault(m => m.Count == deathStreak)?.Message : message;
|
message = message ?? deathstreakMessage.FirstOrDefault(m => m.Count == deathStreak)?.Message;
|
||||||
return message ?? "";
|
return message ?? "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -56,6 +56,7 @@ namespace StatsPlugin
|
|||||||
left_leg_lower,
|
left_leg_lower,
|
||||||
right_foot,
|
right_foot,
|
||||||
left_foot,
|
left_foot,
|
||||||
|
gun,
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum WeaponName
|
public enum WeaponName
|
||||||
|
@ -36,5 +36,9 @@ namespace StatsPlugin.Models
|
|||||||
[NotMapped]
|
[NotMapped]
|
||||||
public double Distance => Vector3.Distance(KillOrigin, DeathOrigin) * 0.0254;
|
public double Distance => Vector3.Distance(KillOrigin, DeathOrigin) * 0.0254;
|
||||||
public IW4Info.MapName Map { get; set; }
|
public IW4Info.MapName Map { get; set; }
|
||||||
|
[NotMapped]
|
||||||
|
public long TimeOffset { get; set; }
|
||||||
|
public Vector3 ViewAngles { get; set; }
|
||||||
|
public DateTime When { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,8 @@ namespace StatsPlugin
|
|||||||
case Event.GType.Kill:
|
case Event.GType.Kill:
|
||||||
string[] killInfo = (E.Data != null) ? E.Data.Split(';') : new string[0];
|
string[] killInfo = (E.Data != null) ? E.Data.Split(';') : new string[0];
|
||||||
if (killInfo.Length >= 9 && killInfo[0].Contains("ScriptKill") && E.Owner.CustomCallback)
|
if (killInfo.Length >= 9 && killInfo[0].Contains("ScriptKill") && E.Owner.CustomCallback)
|
||||||
await Manager.AddScriptKill(E.Origin, E.Target, S.GetHashCode(), S.CurrentMap.Name, killInfo[7], killInfo[8], killInfo[5], killInfo[6], killInfo[3], killInfo[4]);
|
await Manager.AddScriptKill(E.Origin, E.Target, S.GetHashCode(), S.CurrentMap.Name, killInfo[7], killInfo[8],
|
||||||
|
killInfo[5], killInfo[6], killInfo[3], killInfo[4], killInfo[9], killInfo[10]);
|
||||||
else if (!E.Owner.CustomCallback)
|
else if (!E.Owner.CustomCallback)
|
||||||
await Manager.AddStandardKill(E.Origin, E.Target);
|
await Manager.AddStandardKill(E.Origin, E.Target);
|
||||||
break;
|
break;
|
||||||
@ -105,6 +106,7 @@ namespace StatsPlugin
|
|||||||
double skill = Math.Round(clientStats.Sum(c => c.Skill) / clientStats.Count, 2);
|
double skill = Math.Round(clientStats.Sum(c => c.Skill) / clientStats.Count, 2);
|
||||||
double spm = Math.Round(clientStats.Sum(c => c.SPM), 1);
|
double spm = Math.Round(clientStats.Sum(c => c.SPM), 1);
|
||||||
|
|
||||||
|
double headRatio = 0;
|
||||||
double chestRatio = 0;
|
double chestRatio = 0;
|
||||||
double abdomenRatio = 0;
|
double abdomenRatio = 0;
|
||||||
double chestAbdomenRatio = 0;
|
double chestAbdomenRatio = 0;
|
||||||
@ -122,6 +124,10 @@ namespace StatsPlugin
|
|||||||
|
|
||||||
chestAbdomenRatio = Math.Round(clientStats.Where(c => c.HitLocations.Count > 0).Sum(cs => cs.HitLocations.First(hl => hl.Location == IW4Info.HitLocation.torso_upper).HitCount) /
|
chestAbdomenRatio = Math.Round(clientStats.Where(c => c.HitLocations.Count > 0).Sum(cs => cs.HitLocations.First(hl => hl.Location == IW4Info.HitLocation.torso_upper).HitCount) /
|
||||||
(double)clientStats.Where(c => c.HitLocations.Count > 0).Sum(cs => cs.HitLocations.First(hl => hl.Location == IW4Info.HitLocation.torso_lower).HitCount), 2);
|
(double)clientStats.Where(c => c.HitLocations.Count > 0).Sum(cs => cs.HitLocations.First(hl => hl.Location == IW4Info.HitLocation.torso_lower).HitCount), 2);
|
||||||
|
|
||||||
|
headRatio = Math.Round(clientStats.Where(c => c.HitLocations.Count > 0).Sum(cs => cs.HitLocations.First(hl => hl.Location == IW4Info.HitLocation.head).HitCount) /
|
||||||
|
(double)clientStats.Where(c => c.HitLocations.Count > 0)
|
||||||
|
.Sum(c => c.HitLocations.Where(hl => hl.Location != IW4Info.HitLocation.none).Sum(f => f.HitCount)), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new List<ProfileMeta>()
|
return new List<ProfileMeta>()
|
||||||
@ -168,6 +174,12 @@ namespace StatsPlugin
|
|||||||
Key = "Chest To Abdomen Ratio",
|
Key = "Chest To Abdomen Ratio",
|
||||||
Value = chestAbdomenRatio,
|
Value = chestAbdomenRatio,
|
||||||
Sensitive = true
|
Sensitive = true
|
||||||
|
},
|
||||||
|
new ProfileMeta()
|
||||||
|
{
|
||||||
|
Key = "Headshot Ratio",
|
||||||
|
Value = headRatio,
|
||||||
|
Sensitive = true
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -191,7 +203,10 @@ namespace StatsPlugin
|
|||||||
return messageMeta;
|
return messageMeta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Config.Configuration().EnableAntiCheat)
|
||||||
|
{
|
||||||
MetaService.AddMeta(getStats);
|
MetaService.AddMeta(getStats);
|
||||||
|
}
|
||||||
MetaService.AddMeta(getMessages);
|
MetaService.AddMeta(getMessages);
|
||||||
|
|
||||||
// todo: is this fast? make async?
|
// todo: is this fast? make async?
|
||||||
|
@ -126,6 +126,7 @@
|
|||||||
<Compile Include="Commands\ViewStats.cs" />
|
<Compile Include="Commands\ViewStats.cs" />
|
||||||
<Compile Include="Config\StreakMessageConfiguration.cs" />
|
<Compile Include="Config\StreakMessageConfiguration.cs" />
|
||||||
<Compile Include="Config\StatsConfiguration.cs" />
|
<Compile Include="Config\StatsConfiguration.cs" />
|
||||||
|
<Compile Include="Helpers\Extensions.cs" />
|
||||||
<Compile Include="Helpers\ServerStats.cs" />
|
<Compile Include="Helpers\ServerStats.cs" />
|
||||||
<Compile Include="Helpers\StatManager.cs" />
|
<Compile Include="Helpers\StatManager.cs" />
|
||||||
<Compile Include="Helpers\StreakMessage.cs" />
|
<Compile Include="Helpers\StreakMessage.cs" />
|
||||||
|
@ -637,21 +637,6 @@ namespace SharedLibrary.Commands
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CReload : Command
|
|
||||||
{
|
|
||||||
public CReload() :
|
|
||||||
base("reload", "reload configuration files", "rl", Player.Permission.Owner, false)
|
|
||||||
{ }
|
|
||||||
|
|
||||||
public override async Task ExecuteAsync(Event E)
|
|
||||||
{
|
|
||||||
if (E.Owner.Reload())
|
|
||||||
await E.Origin.Tell("Sucessfully reloaded configuration files");
|
|
||||||
else
|
|
||||||
await E.Origin.Tell("Unable to reload configuration files");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class CFlag : Command
|
public class CFlag : Command
|
||||||
{
|
{
|
||||||
public CFlag() :
|
public CFlag() :
|
||||||
|
@ -9,9 +9,9 @@ namespace SharedLibrary.Helpers
|
|||||||
{
|
{
|
||||||
public class Vector3
|
public class Vector3
|
||||||
{
|
{
|
||||||
public float X { get; private set; }
|
public float X { get; protected set; }
|
||||||
public float Y { get; private set; }
|
public float Y { get; protected set; }
|
||||||
public float Z { get; private set; }
|
public float Z { get; protected set; }
|
||||||
|
|
||||||
public Vector3(float x, float y, float z)
|
public Vector3(float x, float y, float z)
|
||||||
{
|
{
|
||||||
@ -41,6 +41,8 @@ namespace SharedLibrary.Helpers
|
|||||||
return Math.Round(Math.Sqrt(Math.Pow(b.X - a.X, 2) + Math.Pow(b.Y - a.Y, 2) + Math.Pow(b.Z - a.Z, 2)), 2);
|
return Math.Round(Math.Sqrt(Math.Pow(b.X - a.X, 2) + Math.Pow(b.Y - a.Y, 2) + Math.Pow(b.Z - a.Z, 2)), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Vector3 Subtract(Vector3 a, Vector3 b) => new Vector3(b.X - a.X, b.Y - a.Y, b.Z - a.Z);
|
||||||
|
|
||||||
public double DotProduct(Vector3 a) => (a.X * this.X) + (a.Y * this.Y) + (a.Z * this.Z);
|
public double DotProduct(Vector3 a) => (a.X * this.X) + (a.Y * this.Y) + (a.Z * this.Z);
|
||||||
|
|
||||||
public double Magnitude() => Math.Sqrt((X * X) + (Y * Y) + (Z * Z));
|
public double Magnitude() => Math.Sqrt((X * X) + (Y * Y) + (Z * Z));
|
||||||
|
@ -1,29 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
namespace SharedLibrary.Migrations
|
|
||||||
{
|
|
||||||
using System.CodeDom.Compiler;
|
|
||||||
using System.Data.Entity.Migrations;
|
|
||||||
using System.Data.Entity.Migrations.Infrastructure;
|
|
||||||
using System.Resources;
|
|
||||||
|
|
||||||
[GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
|
|
||||||
public sealed partial class Intial : IMigrationMetadata
|
|
||||||
{
|
|
||||||
private readonly ResourceManager Resources = new ResourceManager(typeof(Intial));
|
|
||||||
|
|
||||||
string IMigrationMetadata.Id
|
|
||||||
{
|
|
||||||
get { return "201803030146021_Intial"; }
|
|
||||||
}
|
|
||||||
|
|
||||||
string IMigrationMetadata.Source
|
|
||||||
{
|
|
||||||
get { return null; }
|
|
||||||
}
|
|
||||||
|
|
||||||
string IMigrationMetadata.Target
|
|
||||||
{
|
|
||||||
get { return Resources.GetString("Target"); }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
namespace SharedLibrary.Migrations
|
|
||||||
{
|
|
||||||
using System;
|
|
||||||
using System.Data.Entity.Migrations;
|
|
||||||
|
|
||||||
public partial class Intial : DbMigration
|
|
||||||
{
|
|
||||||
public override void Up()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Down()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
File diff suppressed because one or more lines are too long
@ -126,12 +126,6 @@ namespace SharedLibrary
|
|||||||
abstract protected Task ProcessEvent(Event E);
|
abstract protected Task ProcessEvent(Event E);
|
||||||
abstract public Task ExecuteEvent(Event E);
|
abstract public Task ExecuteEvent(Event E);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Reloads all the server configurations
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>True on sucess</returns>
|
|
||||||
abstract public bool Reload();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Send a message to all players
|
/// Send a message to all players
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -182,10 +182,6 @@
|
|||||||
<Compile Include="Interfaces\IManager.cs" />
|
<Compile Include="Interfaces\IManager.cs" />
|
||||||
<Compile Include="Interfaces\ISerializable.cs" />
|
<Compile Include="Interfaces\ISerializable.cs" />
|
||||||
<Compile Include="Helpers\MessageToken.cs" />
|
<Compile Include="Helpers\MessageToken.cs" />
|
||||||
<Compile Include="Migrations\201803030146021_Intial.cs" />
|
|
||||||
<Compile Include="Migrations\201803030146021_Intial.Designer.cs">
|
|
||||||
<DependentUpon>201803030146021_Intial.cs</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Migrations\Configuration.cs" />
|
<Compile Include="Migrations\Configuration.cs" />
|
||||||
<Compile Include="Objects\Alias.cs" />
|
<Compile Include="Objects\Alias.cs" />
|
||||||
<Compile Include="Objects\Penalty.cs" />
|
<Compile Include="Objects\Penalty.cs" />
|
||||||
@ -258,11 +254,6 @@
|
|||||||
<Install>false</Install>
|
<Install>false</Install>
|
||||||
</BootstrapperPackage>
|
</BootstrapperPackage>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<EmbeddedResource Include="Migrations\201803030146021_Intial.resx">
|
|
||||||
<DependentUpon>201803030146021_Intial.cs</DependentUpon>
|
|
||||||
</EmbeddedResource>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PostBuildEvent>copy /Y "$(TargetDir)$(TargetName).dll" "$(SolutionDir)BUILD\lib"
|
<PostBuildEvent>copy /Y "$(TargetDir)$(TargetName).dll" "$(SolutionDir)BUILD\lib"
|
||||||
|
@ -187,7 +187,6 @@ namespace IW4MAdmin
|
|||||||
Commands.Add(new CFindPlayer());
|
Commands.Add(new CFindPlayer());
|
||||||
Commands.Add(new CListRules());
|
Commands.Add(new CListRules());
|
||||||
Commands.Add(new CPrivateMessage());
|
Commands.Add(new CPrivateMessage());
|
||||||
Commands.Add(new CReload());
|
|
||||||
Commands.Add(new CFlag());
|
Commands.Add(new CFlag());
|
||||||
Commands.Add(new CReport());
|
Commands.Add(new CReport());
|
||||||
Commands.Add(new CListReports());
|
Commands.Add(new CListReports());
|
||||||
|
@ -31,7 +31,7 @@ namespace IW4MAdmin
|
|||||||
|
|
||||||
override public async Task<bool> AddPlayer(Player polledPlayer)
|
override public async Task<bool> AddPlayer(Player polledPlayer)
|
||||||
{
|
{
|
||||||
if (polledPlayer.Ping == 999 || polledPlayer.Ping < 1 || polledPlayer.ClientNumber > (MaxClients) || polledPlayer.ClientNumber < 0)
|
if (/*polledPlayer.Ping == 999 ||*/ polledPlayer.Ping < 1 || polledPlayer.ClientNumber > (MaxClients) || polledPlayer.ClientNumber < 0)
|
||||||
{
|
{
|
||||||
//Logger.WriteDebug($"Skipping client not in connected state {P}");
|
//Logger.WriteDebug($"Skipping client not in connected state {P}");
|
||||||
return true;
|
return true;
|
||||||
@ -69,6 +69,13 @@ namespace IW4MAdmin
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (polledPlayer.Name.Where(c => Char.IsControl(c)).Count() > 0)
|
||||||
|
{
|
||||||
|
Logger.WriteDebug($"Kicking {polledPlayer} because their contains control characters");
|
||||||
|
await this.ExecuteCommandAsync($"clientkick {polledPlayer.ClientNumber} \"Your name cannot contain control characters.\"");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
Logger.WriteDebug($"Client slot #{polledPlayer.ClientNumber} now reserved");
|
Logger.WriteDebug($"Client slot #{polledPlayer.ClientNumber} now reserved");
|
||||||
|
|
||||||
try
|
try
|
||||||
@ -618,7 +625,7 @@ namespace IW4MAdmin
|
|||||||
#if DEBUG
|
#if DEBUG
|
||||||
{
|
{
|
||||||
basepath.Value = (GameName == Game.IW4) ?
|
basepath.Value = (GameName == Game.IW4) ?
|
||||||
@"Z:\" :
|
@"D:\" :
|
||||||
@"\\tsclient\G\Program Files (x86)\Steam\SteamApps\common\Call of Duty 4";
|
@"\\tsclient\G\Program Files (x86)\Steam\SteamApps\common\Call of Duty 4";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -956,23 +963,6 @@ namespace IW4MAdmin
|
|||||||
await Manager.GetPenaltyService().RemoveActivePenalties(Target.AliasLink.AliasLinkId);
|
await Manager.GetPenaltyService().RemoveActivePenalties(Target.AliasLink.AliasLinkId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool Reload()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
InitializeMaps();
|
|
||||||
InitializeAutoMessages();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
catch (Exception E)
|
|
||||||
{
|
|
||||||
Logger.WriteError("Unable to reload configs! - " + E.Message);
|
|
||||||
BroadcastMessages = new List<String>();
|
|
||||||
Maps = new List<Map>();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override public void InitializeTokens()
|
override public void InitializeTokens()
|
||||||
{
|
{
|
||||||
Manager.GetMessageTokens().Add(new SharedLibrary.Helpers.MessageToken("TOTALPLAYERS", Manager.GetClientService().GetTotalClientsAsync().Result.ToString));
|
Manager.GetMessageTokens().Add(new SharedLibrary.Helpers.MessageToken("TOTALPLAYERS", Manager.GetClientService().GetTotalClientsAsync().Result.ToString));
|
||||||
|
@ -23,7 +23,7 @@ namespace WebfrontCore.Controllers
|
|||||||
ViewBag.Authorized = Authorized;
|
ViewBag.Authorized = Authorized;
|
||||||
ViewBag.Url = Startup.Configuration["Web:Address"];
|
ViewBag.Url = Startup.Configuration["Web:Address"];
|
||||||
string inviteLink = Manager.GetApplicationSettings().Configuration().DiscordInviteCode;
|
string inviteLink = Manager.GetApplicationSettings().Configuration().DiscordInviteCode;
|
||||||
ViewBag.DiscordLink = inviteLink.Contains("http") ? inviteLink : $"https://discordapp.com/invite/{inviteLink}";
|
ViewBag.DiscordLink = inviteLink != null && inviteLink.Contains("http") ? inviteLink : $"https://discordapp.com/invite/{inviteLink}";
|
||||||
base.OnActionExecuting(context);
|
base.OnActionExecuting(context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,6 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
<tr class="d-none d-md-table-row">
|
<tr class="d-none d-md-table-row">
|
||||||
<td>
|
<td>
|
||||||
@Html.ActionLink(Model.OffenderName, "ProfileAsync", "Client", new { id = Model.OffenderId }, new { @class = "link-inverse" })
|
@Html.ActionLink(Model.OffenderName, "ProfileAsync", "Client", new { id = Model.OffenderId }, new { @class = "link-inverse" })
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<title>@ViewBag.Title | IW4MAdmin</title>
|
<title>@ViewBag.Title | IW4MAdmin</title>
|
||||||
<meta property="og:title" content="@ViewBag.Title | IW4MAdmin">
|
<meta property="og:title" content="@ViewBag.Title | IW4MAdmin">
|
||||||
<meta property="og:type" content="website">
|
<meta property="og:type" content="website">
|
||||||
<meta property="og:image" content="/favicon.ico">
|
<meta property="og:image" content="/images/icon.png">
|
||||||
<meta property="og:description" content="@ViewBag.Description">
|
<meta property="og:description" content="@ViewBag.Description">
|
||||||
<meta property="og:url" content="@ViewBag.Url">
|
<meta property="og:url" content="@ViewBag.Url">
|
||||||
<meta name="description" content="@ViewBag.Description">
|
<meta name="description" content="@ViewBag.Description">
|
||||||
|
@ -100,7 +100,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#profile_aliases_btn {
|
#profile_aliases_btn {
|
||||||
position: absolute;
|
position: relative;
|
||||||
top: auto;
|
top: auto;
|
||||||
margin-top: 0.7em;
|
margin-top: 0.7em;
|
||||||
font-size: 0.5em;
|
font-size: 0.5em;
|
||||||
|
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 9.5 KiB |
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 8.2 KiB |
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 11 KiB |
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 12 KiB |
BIN
WebfrontCore/wwwroot/images/icon.png
Normal file
BIN
WebfrontCore/wwwroot/images/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
@ -9,6 +9,56 @@ init()
|
|||||||
level.callbackPlayerKilled = ::Callback_PlayerKilled;
|
level.callbackPlayerKilled = ::Callback_PlayerKilled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hitLocationToBone(hitloc)
|
||||||
|
{
|
||||||
|
switch(hitloc)
|
||||||
|
{
|
||||||
|
case "helmet":
|
||||||
|
return "j_helmet";
|
||||||
|
case "head":
|
||||||
|
return "j_head";
|
||||||
|
case "neck":
|
||||||
|
return "j_neck";
|
||||||
|
case "torso_upper":
|
||||||
|
return "j_spineupper";
|
||||||
|
case "torso_lower":
|
||||||
|
return "j_spinelower";
|
||||||
|
case "right_arm_upper":
|
||||||
|
return "j_shoulder_ri";
|
||||||
|
case "left_arm_upper":
|
||||||
|
return "j_shoulder_le";
|
||||||
|
case "right_arm_lower":
|
||||||
|
return "j_elbow_ri";
|
||||||
|
case "left_arm_lower":
|
||||||
|
return "j_elbow_le";
|
||||||
|
case "right_hand":
|
||||||
|
return "j_wrist_ri";
|
||||||
|
case "left_hand":
|
||||||
|
return "j_wrist_le";
|
||||||
|
case "right_leg_upper":
|
||||||
|
return "j_hip_ri";
|
||||||
|
case "left_leg_upper":
|
||||||
|
return "j_hip_le";
|
||||||
|
case "right_leg_lower":
|
||||||
|
return "j_knee_ri";
|
||||||
|
case "left_leg_lower":
|
||||||
|
return "j_knee_le";
|
||||||
|
case "right_foot":
|
||||||
|
return "j_ankle_ri";
|
||||||
|
case "left_foot":
|
||||||
|
return "j_ankle_le";
|
||||||
|
default:
|
||||||
|
return "tag_origin";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
VectorScale(vector)
|
||||||
|
{
|
||||||
|
vector[0] = vector[0]*100000;
|
||||||
|
vector[1] = vector[1]*100000;
|
||||||
|
vector[2] = vector[2]*100000;
|
||||||
|
return vector;
|
||||||
|
}
|
||||||
|
|
||||||
Callback_PlayerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, psOffsetTime, deathAnimDuration )
|
Callback_PlayerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, psOffsetTime, deathAnimDuration )
|
||||||
{
|
{
|
||||||
@ -19,6 +69,11 @@ Callback_PlayerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vD
|
|||||||
else if(!isPlayer(attacker) && sMeansOfDeath == "MOD_FALLING")
|
else if(!isPlayer(attacker) && sMeansOfDeath == "MOD_FALLING")
|
||||||
_attacker = victim;
|
_attacker = victim;
|
||||||
|
|
||||||
logPrint("ScriptKill;" + _attacker.guid + ";" + victim.guid + ";" + _attacker.origin + ";" + victim.origin + ";" + iDamage + ";" + sWeapon + ";" + sHitLoc + ";" + sMeansOfDeath + ";" + _attacker getPlayerAngles() + ";" + vDir + ";" + gettime() + "\n");
|
location = victim GetTagOrigin(hitLocationToBone(sHitLoc));
|
||||||
|
//attacker iPrintLnBold(location);
|
||||||
|
//attacker iPrintLnBold(attacker.origin[0]);
|
||||||
|
|
||||||
|
/*BulletTrace(_attacker GetTagOrigin("tag_eye"), VectorScale(anglesToForward(attacker getPlayerAngles())), true, attacker)["entity"]*/
|
||||||
|
logPrint("ScriptKill;" + _attacker.guid + ";" + victim.guid + ";" + _attacker GetTagOrigin("tag_eye") + ";" + location + ";" + iDamage + ";" + sWeapon + ";" + sHitLoc + ";" + sMeansOfDeath + ";" + _attacker getPlayerAngles() + ";" + gettime() + "\n");
|
||||||
self maps\mp\gametypes\_damage::Callback_PlayerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, psOffsetTime, deathAnimDuration );
|
self maps\mp\gametypes\_damage::Callback_PlayerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, psOffsetTime, deathAnimDuration );
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user