migrated Profanty Determent plugin

This commit is contained in:
RaidMax 2018-04-10 19:36:28 -05:00
parent 1a50391bfe
commit 96e09e7895
6 changed files with 57 additions and 147 deletions

View File

@ -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}

View File

@ -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
{

View File

@ -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
});

View File

@ -1,77 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{3EA31029-C76F-4C8E-AFD4-79F77DEA7033}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ProfanityDeterment</RootNamespace>
<AssemblyName>ProfanityDeterment</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<TargetFramework>netcoreapp2.0</TargetFramework>
<ApplicationIcon />
<StartupObject />
<PackageId>RaidMax.IW4MAdmin.Plugins.ProfanityDeterment</PackageId>
<Authors>RaidMax</Authors>
<Company>Forever None</Company>
<Product>Profanity Determent for IW4MAdmin</Product>
<Description>Warns and kicks players for using profanity</Description>
<Copyright>2018</Copyright>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<ProjectReference Include="..\..\SharedLibraryCore\SharedLibraryCore.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Include="Configuration.cs" />
<Compile Include="Plugin.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Tracking.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\SharedLibrary\SharedLibrary.csproj">
<Project>{d51eeceb-438a-47da-870f-7d7b41bc24d6}</Project>
<Name>SharedLibrary</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent Condition=" '$(OS)' != 'Unix' ">copy /Y "$(TargetDir)$(TargetName).dll" "$(SolutionDir)BUILD\plugins\"</PostBuildEvent>
</PropertyGroup>
</Project>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)BUILD\Plugins&quot;" />
</Target>
</Project>

View File

@ -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")]

View File

@ -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
{