From 96e09e78958258e33ecc78f20664fd008c1fca9b Mon Sep 17 00:00:00 2001 From: RaidMax Date: Tue, 10 Apr 2018 19:36:28 -0500 Subject: [PATCH] migrated Profanty Determent plugin --- IW4MAdmin.sln | 40 ++++---- Plugins/ProfanityDeterment/Configuration.cs | 10 +- Plugins/ProfanityDeterment/Plugin.cs | 21 +++-- .../ProfanityDeterment.csproj | 91 ++++--------------- .../Properties/AssemblyInfo.cs | 36 -------- Plugins/ProfanityDeterment/Tracking.cs | 6 +- 6 files changed, 57 insertions(+), 147 deletions(-) delete mode 100644 Plugins/ProfanityDeterment/Properties/AssemblyInfo.cs diff --git a/IW4MAdmin.sln b/IW4MAdmin.sln index 46cfb152f..dbeba8e55 100644 --- a/IW4MAdmin.sln +++ b/IW4MAdmin.sln @@ -14,8 +14,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Plugins\Tests\Tests.csproj", "{B8C2A759-8663-4F6F-9BA4-19595F5E12C1}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProfanityDeterment", "Plugins\ProfanityDeterment\ProfanityDeterment.csproj", "{3EA31029-C76F-4C8E-AFD4-79F77DEA7033}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharedLibraryCore", "SharedLibraryCore\SharedLibraryCore.csproj", "{AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebfrontCore", "WebfrontCore\WebfrontCore.csproj", "{D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}" @@ -24,7 +22,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Application", "Application\ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stats", "Plugins\Stats\Stats.csproj", "{98BE4A81-8AFD-4957-83F7-009D353C6BCB}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Welcome", "Plugins\Welcome\Welcome.csproj", "{179140D3-97AA-4CB4-8BF6-A0C73CA75701}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Welcome", "Plugins\Welcome\Welcome.csproj", "{179140D3-97AA-4CB4-8BF6-A0C73CA75701}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProfanityDeterment", "Plugins\ProfanityDeterment\ProfanityDeterment.csproj", "{958FF7EC-0226-4E85-A85B-B84EC768197D}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -54,22 +54,6 @@ Global {B8C2A759-8663-4F6F-9BA4-19595F5E12C1}.Release|x64.Build.0 = Release-Stable|Any CPU {B8C2A759-8663-4F6F-9BA4-19595F5E12C1}.Release|x86.ActiveCfg = Release-Stable|x86 {B8C2A759-8663-4F6F-9BA4-19595F5E12C1}.Release|x86.Build.0 = Release-Stable|x86 - {3EA31029-C76F-4C8E-AFD4-79F77DEA7033}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3EA31029-C76F-4C8E-AFD4-79F77DEA7033}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3EA31029-C76F-4C8E-AFD4-79F77DEA7033}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {3EA31029-C76F-4C8E-AFD4-79F77DEA7033}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {3EA31029-C76F-4C8E-AFD4-79F77DEA7033}.Debug|x64.ActiveCfg = Debug|Any CPU - {3EA31029-C76F-4C8E-AFD4-79F77DEA7033}.Debug|x64.Build.0 = Debug|Any CPU - {3EA31029-C76F-4C8E-AFD4-79F77DEA7033}.Debug|x86.ActiveCfg = Debug|x86 - {3EA31029-C76F-4C8E-AFD4-79F77DEA7033}.Debug|x86.Build.0 = Debug|x86 - {3EA31029-C76F-4C8E-AFD4-79F77DEA7033}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3EA31029-C76F-4C8E-AFD4-79F77DEA7033}.Release|Any CPU.Build.0 = Release|Any CPU - {3EA31029-C76F-4C8E-AFD4-79F77DEA7033}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {3EA31029-C76F-4C8E-AFD4-79F77DEA7033}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {3EA31029-C76F-4C8E-AFD4-79F77DEA7033}.Release|x64.ActiveCfg = Release|Any CPU - {3EA31029-C76F-4C8E-AFD4-79F77DEA7033}.Release|x64.Build.0 = Release|Any CPU - {3EA31029-C76F-4C8E-AFD4-79F77DEA7033}.Release|x86.ActiveCfg = Release|x86 - {3EA31029-C76F-4C8E-AFD4-79F77DEA7033}.Release|x86.Build.0 = Release|x86 {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Debug|Any CPU.Build.0 = Debug|Any CPU {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU @@ -150,15 +134,31 @@ Global {179140D3-97AA-4CB4-8BF6-A0C73CA75701}.Release|x64.Build.0 = Release|Any CPU {179140D3-97AA-4CB4-8BF6-A0C73CA75701}.Release|x86.ActiveCfg = Release|Any CPU {179140D3-97AA-4CB4-8BF6-A0C73CA75701}.Release|x86.Build.0 = Release|Any CPU + {958FF7EC-0226-4E85-A85B-B84EC768197D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {958FF7EC-0226-4E85-A85B-B84EC768197D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {958FF7EC-0226-4E85-A85B-B84EC768197D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {958FF7EC-0226-4E85-A85B-B84EC768197D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {958FF7EC-0226-4E85-A85B-B84EC768197D}.Debug|x64.ActiveCfg = Debug|Any CPU + {958FF7EC-0226-4E85-A85B-B84EC768197D}.Debug|x64.Build.0 = Debug|Any CPU + {958FF7EC-0226-4E85-A85B-B84EC768197D}.Debug|x86.ActiveCfg = Debug|Any CPU + {958FF7EC-0226-4E85-A85B-B84EC768197D}.Debug|x86.Build.0 = Debug|Any CPU + {958FF7EC-0226-4E85-A85B-B84EC768197D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {958FF7EC-0226-4E85-A85B-B84EC768197D}.Release|Any CPU.Build.0 = Release|Any CPU + {958FF7EC-0226-4E85-A85B-B84EC768197D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {958FF7EC-0226-4E85-A85B-B84EC768197D}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {958FF7EC-0226-4E85-A85B-B84EC768197D}.Release|x64.ActiveCfg = Release|Any CPU + {958FF7EC-0226-4E85-A85B-B84EC768197D}.Release|x64.Build.0 = Release|Any CPU + {958FF7EC-0226-4E85-A85B-B84EC768197D}.Release|x86.ActiveCfg = Release|Any CPU + {958FF7EC-0226-4E85-A85B-B84EC768197D}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {B8C2A759-8663-4F6F-9BA4-19595F5E12C1} = {26E8B310-269E-46D4-A612-24601F16065F} - {3EA31029-C76F-4C8E-AFD4-79F77DEA7033} = {26E8B310-269E-46D4-A612-24601F16065F} {98BE4A81-8AFD-4957-83F7-009D353C6BCB} = {26E8B310-269E-46D4-A612-24601F16065F} {179140D3-97AA-4CB4-8BF6-A0C73CA75701} = {26E8B310-269E-46D4-A612-24601F16065F} + {958FF7EC-0226-4E85-A85B-B84EC768197D} = {26E8B310-269E-46D4-A612-24601F16065F} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {84F8F8E0-1F73-41E0-BD8D-BB6676E2EE87} diff --git a/Plugins/ProfanityDeterment/Configuration.cs b/Plugins/ProfanityDeterment/Configuration.cs index 2a807909a..8738fb8cc 100644 --- a/Plugins/ProfanityDeterment/Configuration.cs +++ b/Plugins/ProfanityDeterment/Configuration.cs @@ -1,10 +1,8 @@ -using SharedLibrary.Interfaces; -using System; -using System.Collections.Generic; -using System.Text; -using SharedLibrary; +using System.Collections.Generic; +using SharedLibraryCore; +using SharedLibraryCore.Interfaces; -namespace ProfanityDeterment +namespace IW4MAdmin.Plugins.ProfanityDeterment { class Configuration : IBaseConfiguration { diff --git a/Plugins/ProfanityDeterment/Plugin.cs b/Plugins/ProfanityDeterment/Plugin.cs index 92aeaa476..586fdeef2 100644 --- a/Plugins/ProfanityDeterment/Plugin.cs +++ b/Plugins/ProfanityDeterment/Plugin.cs @@ -1,18 +1,19 @@ -using System; -using System.Collections.Concurrent; +using System.Collections.Concurrent; using System.Linq; +using System.Reflection; using System.Threading.Tasks; -using SharedLibrary; -using SharedLibrary.Configuration; -using SharedLibrary.Interfaces; +using SharedLibraryCore; +using SharedLibraryCore.Configuration; +using SharedLibraryCore.Interfaces; +using SharedLibraryCore.Objects; -namespace ProfanityDeterment +namespace IW4MAdmin.Plugins.ProfanityDeterment { public class Plugin : IPlugin { - public string Name => "ProfanityFilter"; + public string Name => "ProfanityDeterment"; - public float Version => 0.1f; + public float Version => Assembly.GetExecutingAssembly().GetName().Version.Major + Assembly.GetExecutingAssembly().GetName().Version.Minor / 10.0f; public string Author => "RaidMax"; @@ -53,7 +54,7 @@ namespace ProfanityDeterment var clientProfanity = ProfanityCounts[E.Origin.ClientId]; if (clientProfanity.Infringements >= Settings.Configuration().KickAfterInfringementCount) { - await clientProfanity.Client.Kick(Settings.Configuration().ProfanityKickMessage, new SharedLibrary.Objects.Player() + await clientProfanity.Client.Kick(Settings.Configuration().ProfanityKickMessage, new Player() { ClientId = 1 }); @@ -63,7 +64,7 @@ namespace ProfanityDeterment { clientProfanity.Infringements++; - await clientProfanity.Client.Warn(Settings.Configuration().ProfanityWarningMessage, new SharedLibrary.Objects.Player() + await clientProfanity.Client.Warn(Settings.Configuration().ProfanityWarningMessage, new Player() { ClientId = 1 }); diff --git a/Plugins/ProfanityDeterment/ProfanityDeterment.csproj b/Plugins/ProfanityDeterment/ProfanityDeterment.csproj index 99cc8c839..faf94c811 100644 --- a/Plugins/ProfanityDeterment/ProfanityDeterment.csproj +++ b/Plugins/ProfanityDeterment/ProfanityDeterment.csproj @@ -1,77 +1,24 @@ - - - + + - Debug - AnyCPU - {3EA31029-C76F-4C8E-AFD4-79F77DEA7033} Library - Properties - ProfanityDeterment - ProfanityDeterment - v4.5.2 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - true - bin\x86\Debug\ - DEBUG;TRACE - full - x86 - prompt - MinimumRecommendedRules.ruleset - - - bin\x86\Release\ - TRACE - true - pdbonly - x86 - prompt - MinimumRecommendedRules.ruleset + netcoreapp2.0 + + + RaidMax.IW4MAdmin.Plugins.ProfanityDeterment + RaidMax + Forever None + Profanity Determent for IW4MAdmin + Warns and kicks players for using profanity + 2018 + - - - - - - - - + - - - - - - - - - {d51eeceb-438a-47da-870f-7d7b41bc24d6} - SharedLibrary - False - - - - - copy /Y "$(TargetDir)$(TargetName).dll" "$(SolutionDir)BUILD\plugins\" - - \ No newline at end of file + + + + + + diff --git a/Plugins/ProfanityDeterment/Properties/AssemblyInfo.cs b/Plugins/ProfanityDeterment/Properties/AssemblyInfo.cs deleted file mode 100644 index 8a75c3220..000000000 --- a/Plugins/ProfanityDeterment/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("ProfanityDeterment")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ProfanityDeterment")] -[assembly: AssemblyCopyright("Copyright © 2018")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("3ea31029-c76f-4c8e-afd4-79f77dea7033")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Plugins/ProfanityDeterment/Tracking.cs b/Plugins/ProfanityDeterment/Tracking.cs index becef1fe4..81df32c72 100644 --- a/Plugins/ProfanityDeterment/Tracking.cs +++ b/Plugins/ProfanityDeterment/Tracking.cs @@ -1,9 +1,9 @@ -using SharedLibrary.Objects; -using System; +using System; using System.Collections.Generic; using System.Text; +using SharedLibraryCore.Objects; -namespace ProfanityDeterment +namespace IW4MAdmin.Plugins.ProfanityDeterment { class Tracking {