Moved application into webfront core project
This commit is contained in:
parent
52cc5a30e6
commit
7c0fbb1896
@ -1,29 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace IW4MAdmin
|
|
||||||
{
|
|
||||||
class Admin
|
|
||||||
{
|
|
||||||
public Admin()
|
|
||||||
{
|
|
||||||
Time = DateTime.Now;
|
|
||||||
Server = new Server("127.0.0.1", 28960, "NO");
|
|
||||||
}
|
|
||||||
|
|
||||||
public Server Server;
|
|
||||||
|
|
||||||
public static String getTime()
|
|
||||||
{
|
|
||||||
return DateTime.Now.ToString("H:mm:ss");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Monitor()
|
|
||||||
{
|
|
||||||
Server.Monitor();
|
|
||||||
}
|
|
||||||
|
|
||||||
private DateTime Time;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,430 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<ProjectGuid>{DD5DCDA2-51DB-4B1A-922F-5705546E6115}</ProjectGuid>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<RootNamespace>IW4MAdmin</RootNamespace>
|
|
||||||
<AssemblyName>IW4MAdmin</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
<TargetFrameworkProfile>
|
|
||||||
</TargetFrameworkProfile>
|
|
||||||
<IsWebBootstrapper>true</IsWebBootstrapper>
|
|
||||||
<PublishUrl>ftp://raidmax.org/</PublishUrl>
|
|
||||||
<Install>true</Install>
|
|
||||||
<InstallFrom>Web</InstallFrom>
|
|
||||||
<UpdateEnabled>true</UpdateEnabled>
|
|
||||||
<UpdateMode>Foreground</UpdateMode>
|
|
||||||
<UpdateInterval>7</UpdateInterval>
|
|
||||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
|
||||||
<UpdatePeriodically>false</UpdatePeriodically>
|
|
||||||
<UpdateRequired>false</UpdateRequired>
|
|
||||||
<MapFileExtensions>false</MapFileExtensions>
|
|
||||||
<InstallUrl>http://raidmax.org/IW4M/Admin/</InstallUrl>
|
|
||||||
<SupportUrl>http://raidmax.org/IW4MAdmin</SupportUrl>
|
|
||||||
<TargetCulture>en</TargetCulture>
|
|
||||||
<ProductName>IW4M Administration</ProductName>
|
|
||||||
<PublisherName>ForeverNone LLC</PublisherName>
|
|
||||||
<WebPage>publish.htm</WebPage>
|
|
||||||
<OpenBrowserOnPublish>false</OpenBrowserOnPublish>
|
|
||||||
<ApplicationRevision>6</ApplicationRevision>
|
|
||||||
<ApplicationVersion>1.3.1.%2a</ApplicationVersion>
|
|
||||||
<UseApplicationTrust>false</UseApplicationTrust>
|
|
||||||
<PublishWizardCompleted>true</PublishWizardCompleted>
|
|
||||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
<Prefer32Bit>false</Prefer32Bit>
|
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
<CodeAnalysisIgnoreGeneratedCode>false</CodeAnalysisIgnoreGeneratedCode>
|
|
||||||
<RunCodeAnalysis>true</RunCodeAnalysis>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-Nightly|AnyCPU' ">
|
|
||||||
<PlatformTarget>x86</PlatformTarget>
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>3</WarningLevel>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
<GenerateSerializationAssemblies>On</GenerateSerializationAssemblies>
|
|
||||||
<Prefer32Bit>false</Prefer32Bit>
|
|
||||||
<RunCodeAnalysis>false</RunCodeAnalysis>
|
|
||||||
<CodeAnalysisIgnoreGeneratedCode>false</CodeAnalysisIgnoreGeneratedCode>
|
|
||||||
<DocumentationFile>
|
|
||||||
</DocumentationFile>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetZone>LocalIntranet</TargetZone>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup />
|
|
||||||
<PropertyGroup>
|
|
||||||
<SignManifests>false</SignManifests>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<ApplicationIcon>IW4AdminIcon.ico</ApplicationIcon>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<StartupObject>
|
|
||||||
</StartupObject>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup />
|
|
||||||
<PropertyGroup>
|
|
||||||
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<GenerateManifests>false</GenerateManifests>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup />
|
|
||||||
<PropertyGroup />
|
|
||||||
<PropertyGroup />
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-Stable|AnyCPU'">
|
|
||||||
<OutputPath>bin\Release-Stable\</OutputPath>
|
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<WarningLevel>3</WarningLevel>
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<PlatformTarget>x86</PlatformTarget>
|
|
||||||
<GenerateSerializationAssemblies>On</GenerateSerializationAssemblies>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<CodeAnalysisIgnoreGeneratedCode>false</CodeAnalysisIgnoreGeneratedCode>
|
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
|
||||||
<PlatformTarget>x86</PlatformTarget>
|
|
||||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
|
||||||
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-Nightly|x86' ">
|
|
||||||
<PlatformTarget>x86</PlatformTarget>
|
|
||||||
<OutputPath>bin\x86\Release\</OutputPath>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-Stable|x86'">
|
|
||||||
<PlatformTarget>x86</PlatformTarget>
|
|
||||||
<OutputPath>bin\x86\Release-Stable\</OutputPath>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
|
||||||
<DefineConstants>CODE_ANALYSIS;DEBUG;TRACE</DefineConstants>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
|
||||||
<RunCodeAnalysis>true</RunCodeAnalysis>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<CodeAnalysisIgnoreGeneratedCode>false</CodeAnalysisIgnoreGeneratedCode>
|
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-Nightly|x64'">
|
|
||||||
<OutputPath>bin\x64\Release-Nightly\</OutputPath>
|
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<WarningLevel>3</WarningLevel>
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
|
||||||
<GenerateSerializationAssemblies>On</GenerateSerializationAssemblies>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<CodeAnalysisIgnoreGeneratedCode>false</CodeAnalysisIgnoreGeneratedCode>
|
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-Stable|x64'">
|
|
||||||
<OutputPath>bin\x64\Release-Stable\</OutputPath>
|
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<WarningLevel>3</WarningLevel>
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
|
||||||
<GenerateSerializationAssemblies>On</GenerateSerializationAssemblies>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<CodeAnalysisIgnoreGeneratedCode>false</CodeAnalysisIgnoreGeneratedCode>
|
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
<Prefer32Bit>true</Prefer32Bit>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
|
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<WarningLevel>3</WarningLevel>
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<PlatformTarget>x86</PlatformTarget>
|
|
||||||
<GenerateSerializationAssemblies>On</GenerateSerializationAssemblies>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<CodeAnalysisIgnoreGeneratedCode>false</CodeAnalysisIgnoreGeneratedCode>
|
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
|
||||||
<OutputPath>bin\x86\Release\</OutputPath>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<PlatformTarget>x86</PlatformTarget>
|
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
|
||||||
<OutputPath>bin\x64\Release\</OutputPath>
|
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<WarningLevel>3</WarningLevel>
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
|
||||||
<GenerateSerializationAssemblies>On</GenerateSerializationAssemblies>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<CodeAnalysisIgnoreGeneratedCode>false</CodeAnalysisIgnoreGeneratedCode>
|
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
<Prefer32Bit>true</Prefer32Bit>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Microsoft.CSharp" />
|
|
||||||
<Reference Include="System" />
|
|
||||||
<Reference Include="System.ComponentModel.Composition" />
|
|
||||||
<Reference Include="System.Data" />
|
|
||||||
<Reference Include="System.Management" />
|
|
||||||
<Reference Include="System.Web" />
|
|
||||||
<Reference Include="System.Xml" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="Kayak.cs" />
|
|
||||||
<Compile Include="Logger.cs" />
|
|
||||||
<Compile Include="Main.cs" />
|
|
||||||
<Compile Include="Manager.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
<Compile Include="Properties\Settings.Designer.cs">
|
|
||||||
<AutoGen>True</AutoGen>
|
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
|
||||||
<DependentUpon>Settings.settings</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Server.cs" />
|
|
||||||
<Compile Include="ServerConfigurationGenerator.cs" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Content Include="Webfront\chat.html">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="Webfront\images\minimap_mp_rust.png">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="Webfront\images\minimap_mp_terminal.png">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="Webfront\profile.html">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="Webfront\scripts\wordcloud2.js">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="Webfront\stats.html">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<None Include="app.manifest" />
|
|
||||||
<Content Include="IW4AdminIcon.ico" />
|
|
||||||
<Content Include="Webfront\admins.html">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="Webfront\bans.html">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="Webfront\console.html">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="Webfront\error.html">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="Webfront\footer.html">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="Webfront\_header.html">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="Webfront\login.html">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="Webfront\main.css">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="Webfront\main.html">
|
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="Webfront\mobile.css">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="Webfront\notfound.html">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="Webfront\penalties.html">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="Webfront\players.html">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="Config\maps.cfg">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="Config\messages.cfg">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="Config\rules.cfg">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="Config\web.cfg">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<None Include="packages.config" />
|
|
||||||
<None Include="Properties\app.manifest" />
|
|
||||||
<None Include="Properties\Settings.settings">
|
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
|
||||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
|
||||||
</None>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<BootstrapperPackage Include=".NETFramework,Version=v4.0">
|
|
||||||
<Visible>False</Visible>
|
|
||||||
<ProductName>Microsoft .NET Framework 4 %28x86 and x64%29</ProductName>
|
|
||||||
<Install>true</Install>
|
|
||||||
</BootstrapperPackage>
|
|
||||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
|
||||||
<Visible>False</Visible>
|
|
||||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
|
||||||
<Install>false</Install>
|
|
||||||
</BootstrapperPackage>
|
|
||||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
|
||||||
<Visible>False</Visible>
|
|
||||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
|
||||||
<Install>false</Install>
|
|
||||||
</BootstrapperPackage>
|
|
||||||
<BootstrapperPackage Include="Microsoft.Visual.C++.12.0.x86">
|
|
||||||
<Visible>False</Visible>
|
|
||||||
<ProductName>Visual C++ 2013 Runtime Libraries %28x86%29</ProductName>
|
|
||||||
<Install>true</Install>
|
|
||||||
</BootstrapperPackage>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<PublishFile Include="Config\maps.cfg">
|
|
||||||
<Visible>False</Visible>
|
|
||||||
<Group>
|
|
||||||
</Group>
|
|
||||||
<TargetPath>
|
|
||||||
</TargetPath>
|
|
||||||
<PublishState>DataFile</PublishState>
|
|
||||||
<IncludeHash>True</IncludeHash>
|
|
||||||
<FileType>File</FileType>
|
|
||||||
</PublishFile>
|
|
||||||
<PublishFile Include="Config\messages.cfg">
|
|
||||||
<Visible>False</Visible>
|
|
||||||
<Group>
|
|
||||||
</Group>
|
|
||||||
<TargetPath>
|
|
||||||
</TargetPath>
|
|
||||||
<PublishState>DataFile</PublishState>
|
|
||||||
<IncludeHash>True</IncludeHash>
|
|
||||||
<FileType>File</FileType>
|
|
||||||
</PublishFile>
|
|
||||||
<PublishFile Include="Config\rules.cfg">
|
|
||||||
<Visible>False</Visible>
|
|
||||||
<Group>
|
|
||||||
</Group>
|
|
||||||
<TargetPath>
|
|
||||||
</TargetPath>
|
|
||||||
<PublishState>DataFile</PublishState>
|
|
||||||
<IncludeHash>True</IncludeHash>
|
|
||||||
<FileType>File</FileType>
|
|
||||||
</PublishFile>
|
|
||||||
<PublishFile Include="IW4MAdmin.XmlSerializers">
|
|
||||||
<Visible>False</Visible>
|
|
||||||
<Group>
|
|
||||||
</Group>
|
|
||||||
<TargetPath>
|
|
||||||
</TargetPath>
|
|
||||||
<PublishState>Exclude</PublishState>
|
|
||||||
<IncludeHash>True</IncludeHash>
|
|
||||||
<FileType>Assembly</FileType>
|
|
||||||
</PublishFile>
|
|
||||||
<PublishFile Include="Kayak">
|
|
||||||
<Visible>False</Visible>
|
|
||||||
<Group>
|
|
||||||
</Group>
|
|
||||||
<TargetPath>
|
|
||||||
</TargetPath>
|
|
||||||
<PublishState>Exclude</PublishState>
|
|
||||||
<IncludeHash>True</IncludeHash>
|
|
||||||
<FileType>Assembly</FileType>
|
|
||||||
</PublishFile>
|
|
||||||
<PublishFile Include="Moserware.Skills">
|
|
||||||
<Visible>False</Visible>
|
|
||||||
<Group>
|
|
||||||
</Group>
|
|
||||||
<TargetPath>
|
|
||||||
</TargetPath>
|
|
||||||
<PublishState>Exclude</PublishState>
|
|
||||||
<IncludeHash>True</IncludeHash>
|
|
||||||
<FileType>Assembly</FileType>
|
|
||||||
</PublishFile>
|
|
||||||
<PublishFile Include="System.Data.SQLite">
|
|
||||||
<Visible>False</Visible>
|
|
||||||
<Group>
|
|
||||||
</Group>
|
|
||||||
<TargetPath>
|
|
||||||
</TargetPath>
|
|
||||||
<PublishState>Exclude</PublishState>
|
|
||||||
<IncludeHash>True</IncludeHash>
|
|
||||||
<FileType>Assembly</FileType>
|
|
||||||
</PublishFile>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\SharedLibrary\SharedLibrary.csproj">
|
|
||||||
<Project>{d51eeceb-438a-47da-870f-7d7b41bc24d6}</Project>
|
|
||||||
<Name>SharedLibrary</Name>
|
|
||||||
<Private>False</Private>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Webfront\views\" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<PostBuildEvent>xcopy /E "$(SolutionDir)lib" "$(TargetDir)lib"
|
|
||||||
copy /Y "$(SolutionDir)_customcallbacks.gsc" "$(SolutionDir)BUILD\userraw\scripts\_customcallbacks.gsc"
|
|
||||||
|
|
||||||
copy /Y "$(TargetDir)$(TargetName).exe" "$(SolutionDir)BUILD"
|
|
||||||
copy /Y "$(TargetDir)IW4MAdmin.exe.config" "$(SolutionDir)BUILD"
|
|
||||||
xcopy /Y /I /E "$(SolutionDir)SharedLibrary\$(OutDir)*" "$(SolutionDir)Admin\Lib"
|
|
||||||
|
|
||||||
xcopy /Y /I /E "$(ProjectDir)webfront\*" "$(SolutionDir)BUILD\Webfront"
|
|
||||||
xcopy /Y /I /E "$(SolutionDir)Admin\Config\*" "$(SolutionDir)BUILD\Config"
|
|
||||||
|
|
||||||
if $(ConfigurationName) == Release-Nightly powershell.exe -file "$(SolutionDir)DEPLOY\publish_nightly.ps1" 1.6
|
|
||||||
if $(ConfigurationName) == Release-Stable powershell.exe -file "$(SolutionDir)DEPLOY\publish_stable.ps1" 1.6
|
|
||||||
|
|
||||||
|
|
||||||
</PostBuildEvent>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<PreBuildEvent>
|
|
||||||
</PreBuildEvent>
|
|
||||||
</PropertyGroup>
|
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
|
||||||
<Target Name="BeforeBuild">
|
|
||||||
</Target>
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
</Target>
|
|
||||||
-->
|
|
||||||
</Project>
|
|
@ -1,621 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using System.Data.SQLite;
|
|
||||||
using System.Data;
|
|
||||||
using System.Linq;
|
|
||||||
using System.IO;
|
|
||||||
using System.Collections;
|
|
||||||
using SharedLibrary;
|
|
||||||
|
|
||||||
namespace IW4MAdmin
|
|
||||||
{
|
|
||||||
abstract class DatabaseA : SharedLibrary.Database
|
|
||||||
{
|
|
||||||
public Database(String FN)
|
|
||||||
{
|
|
||||||
FileName = FN;
|
|
||||||
DBCon = String.Format("Data Source={0}", FN);
|
|
||||||
Con = new SQLiteConnection(DBCon);
|
|
||||||
Open = false;
|
|
||||||
Init();
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract public void Init();
|
|
||||||
|
|
||||||
//HELPERS
|
|
||||||
protected bool Insert(String tableName, Dictionary<String, object> data)
|
|
||||||
{
|
|
||||||
String columns = "";
|
|
||||||
String values = "";
|
|
||||||
Boolean returnCode = true;
|
|
||||||
foreach (KeyValuePair<String, object> val in data)
|
|
||||||
{
|
|
||||||
columns += String.Format(" {0},", val.Key);
|
|
||||||
values += String.Format(" '{0}',", val.Value);
|
|
||||||
}
|
|
||||||
columns = columns.Substring(0, columns.Length - 1);
|
|
||||||
values = values.Substring(0, values.Length - 1);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
this.ExecuteNonQuery(String.Format("insert into {0}({1}) values({2});", tableName, columns, values));
|
|
||||||
}
|
|
||||||
catch (Exception fail)
|
|
||||||
{
|
|
||||||
Console.WriteLine(fail.Message);
|
|
||||||
returnCode = false;
|
|
||||||
}
|
|
||||||
return returnCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected bool Update(String tableName, Dictionary<String, object> data, String where)
|
|
||||||
{
|
|
||||||
String vals = "";
|
|
||||||
Boolean returnCode = true;
|
|
||||||
if (data.Count >= 1)
|
|
||||||
{
|
|
||||||
foreach (KeyValuePair<String, object> val in data)
|
|
||||||
{
|
|
||||||
vals += String.Format(" {0} = '{1}',", val.Key, val.Value);
|
|
||||||
}
|
|
||||||
vals = vals.Substring(0, vals.Length - 1);
|
|
||||||
}
|
|
||||||
try
|
|
||||||
{
|
|
||||||
ExecuteNonQuery(String.Format("update {0} set {1} where {2};", tableName, vals, where));
|
|
||||||
}
|
|
||||||
catch (Exception fail)
|
|
||||||
{
|
|
||||||
Console.WriteLine(fail.Message);
|
|
||||||
returnCode = false;
|
|
||||||
}
|
|
||||||
return returnCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected DataRow getDataRow(String Q)
|
|
||||||
{
|
|
||||||
DataRow Result = GetDataTable(Q).Rows[0];
|
|
||||||
return Result;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected int ExecuteNonQuery(String Request)
|
|
||||||
{
|
|
||||||
waitForClose();
|
|
||||||
int rowsUpdated = 0;
|
|
||||||
|
|
||||||
lock (Con)
|
|
||||||
{
|
|
||||||
Con.Open();
|
|
||||||
SQLiteCommand CMD = new SQLiteCommand(Con);
|
|
||||||
CMD.CommandText = Request;
|
|
||||||
rowsUpdated = CMD.ExecuteNonQuery();
|
|
||||||
Con.Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
return rowsUpdated;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected DataTable GetDataTable(String sql)
|
|
||||||
{
|
|
||||||
DataTable dt = new DataTable();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
waitForClose();
|
|
||||||
lock (Con)
|
|
||||||
{
|
|
||||||
Con.Open();
|
|
||||||
SQLiteCommand mycommand = new SQLiteCommand(Con);
|
|
||||||
mycommand.CommandText = sql;
|
|
||||||
SQLiteDataReader reader = mycommand.ExecuteReader();
|
|
||||||
dt.Load(reader);
|
|
||||||
reader.Close();
|
|
||||||
Con.Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Console.WriteLine(e.Message);
|
|
||||||
throw new Exception(e.Message);
|
|
||||||
}
|
|
||||||
return dt;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void waitForClose()
|
|
||||||
{
|
|
||||||
while (Con.State == ConnectionState.Open)
|
|
||||||
{
|
|
||||||
Utilities.Wait(0.01);
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected String FileName;
|
|
||||||
protected String DBCon;
|
|
||||||
protected SQLiteConnection Con;
|
|
||||||
protected bool Open;
|
|
||||||
}
|
|
||||||
|
|
||||||
class ClientsDB : Database
|
|
||||||
{
|
|
||||||
public ClientsDB(String FN) : base(FN) { }
|
|
||||||
|
|
||||||
public override void Init()
|
|
||||||
{
|
|
||||||
if(!File.Exists(FileName))
|
|
||||||
{
|
|
||||||
String Create = "CREATE TABLE [CLIENTS] ( [Name] TEXT NULL, [npID] TEXT NULL, [Number] INTEGER PRIMARY KEY AUTOINCREMENT, [Level] INT DEFAULT 0 NULL, [LastOffense] TEXT NULL, [Connections] INT DEFAULT 1 NULL, [IP] TEXT NULL, [LastConnection] TEXT NULL);";
|
|
||||||
ExecuteNonQuery(Create);
|
|
||||||
Create = "CREATE TABLE [BANS] ( [Reason] TEXT NULL, [npID] TEXT NULL, [bannedByID] TEXT NULL, [IP] TEXT NULL, [TIME] TEXT NULL);";
|
|
||||||
ExecuteNonQuery(Create);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Returns a single player object with matching GUID, false if no matches
|
|
||||||
public Player getPlayer(String ID, int cNum)
|
|
||||||
{
|
|
||||||
String Query = String.Format("SELECT * FROM CLIENTS WHERE npID = '{0}' LIMIT 1", ID);
|
|
||||||
DataTable Result = GetDataTable(Query);
|
|
||||||
|
|
||||||
if (Result != null && Result.Rows.Count > 0)
|
|
||||||
{
|
|
||||||
DataRow ResponseRow = Result.Rows[0];
|
|
||||||
DateTime LC;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
LC = DateTime.Parse(ResponseRow["LastConnection"].ToString());
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
LC = DateTime.Now;
|
|
||||||
}
|
|
||||||
|
|
||||||
return new Player(ResponseRow["Name"].ToString(), ResponseRow["npID"].ToString(), cNum, (Player.Permission)(ResponseRow["Level"]), Convert.ToInt32(ResponseRow["Number"]), ResponseRow["LastOffense"].ToString(), (int)ResponseRow["Connections"], ResponseRow["IP"].ToString(), LC);
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Overloaded method for getPlayer, returns Client with matching DBIndex, null if none found
|
|
||||||
public Player getPlayer(int dbIndex)
|
|
||||||
{
|
|
||||||
String Query = String.Format("SELECT * FROM CLIENTS WHERE Number = '{0}' LIMIT 1", dbIndex);
|
|
||||||
DataTable Result = GetDataTable(Query);
|
|
||||||
|
|
||||||
if (Result != null && Result.Rows.Count > 0)
|
|
||||||
{
|
|
||||||
DataRow p = Result.Rows[0];
|
|
||||||
DateTime LC;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
LC = DateTime.Parse(p["LastConnection"].ToString());
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
LC = DateTime.Now;
|
|
||||||
}
|
|
||||||
|
|
||||||
return new Player(p["Name"].ToString(), p["npID"].ToString(), -1, (Player.Permission)(p["Level"]), Convert.ToInt32(p["Number"]), p["LastOffense"].ToString(), Convert.ToInt32(p["Connections"]), p["IP"].ToString(), LC);
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
//get player by ip, (used for webfront)
|
|
||||||
public Player getPlayer(String IP)
|
|
||||||
{
|
|
||||||
String Query = String.Format("SELECT * FROM CLIENTS WHERE IP='{0}'", IP);
|
|
||||||
DataTable Result = GetDataTable(Query);
|
|
||||||
|
|
||||||
if (Result != null && Result.Rows.Count > 0)
|
|
||||||
{
|
|
||||||
List<Player> lastKnown = new List<Player>();
|
|
||||||
foreach (DataRow p in Result.Rows)
|
|
||||||
{
|
|
||||||
DateTime LC;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
LC = DateTime.Parse(p["LastConnection"].ToString());
|
|
||||||
lastKnown.Add(new Player(p["Name"].ToString(), p["npID"].ToString(), -1, (Player.Permission)(p["Level"]), Convert.ToInt32(p["Number"]), p["LastOffense"].ToString(), Convert.ToInt32((DateTime.Now - LC).TotalSeconds), p["IP"].ToString(), LC));
|
|
||||||
}
|
|
||||||
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (lastKnown.Count > 0)
|
|
||||||
{
|
|
||||||
List<Player> Returning = lastKnown.OrderBy(t => t.Connections).ToList();
|
|
||||||
return Returning[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Returns a list of players matching name parameter, null if no players found matching
|
|
||||||
public List<Player> findPlayers(String name)
|
|
||||||
{
|
|
||||||
String Query = String.Format("SELECT * FROM CLIENTS WHERE Name LIKE '%{0}%' LIMIT 8", name);
|
|
||||||
DataTable Result = GetDataTable(Query);
|
|
||||||
|
|
||||||
List<Player> Players = new List<Player>();
|
|
||||||
|
|
||||||
if (Result != null && Result.Rows.Count > 0)
|
|
||||||
{
|
|
||||||
foreach (DataRow p in Result.Rows)
|
|
||||||
{
|
|
||||||
DateTime LC;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
LC = DateTime.Parse(p["LastConnection"].ToString());
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
LC = DateTime.Now;
|
|
||||||
}
|
|
||||||
|
|
||||||
Players.Add(new Player(p["Name"].ToString(), p["npID"].ToString(), -1, (Player.Permission)(p["Level"]), Convert.ToInt32(p["Number"]), p["LastOffense"].ToString(), Convert.ToInt32(p["Connections"]), p["IP"].ToString(), LC));
|
|
||||||
}
|
|
||||||
return Players;
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Returns any player with level 4 permissions, null if no owner found
|
|
||||||
public Player getOwner()
|
|
||||||
{
|
|
||||||
String Query = String.Format("SELECT * FROM CLIENTS WHERE Level > '{0}'", 4);
|
|
||||||
DataTable Result = GetDataTable(Query);
|
|
||||||
|
|
||||||
if (Result != null && Result.Rows.Count > 0)
|
|
||||||
{
|
|
||||||
DataRow ResponseRow = Result.Rows[0];
|
|
||||||
if (ResponseRow["IP"].ToString().Length < 6)
|
|
||||||
ResponseRow["IP"] = "0";
|
|
||||||
return new Player(ResponseRow["Name"].ToString(), ResponseRow["npID"].ToString(), -1, (Player.Permission)(ResponseRow["Level"]), Convert.ToInt32(ResponseRow["Number"]), null, 0, ResponseRow["IP"].ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Returns list of bans in database
|
|
||||||
public List<Ban> getBans()
|
|
||||||
{
|
|
||||||
List<Ban> Bans = new List<Ban>();
|
|
||||||
DataTable Result = GetDataTable("SELECT * FROM BANS ORDER BY TIME DESC");
|
|
||||||
|
|
||||||
foreach (DataRow Row in Result.Rows)
|
|
||||||
{
|
|
||||||
if (Row["TIME"].ToString().Length < 2) //compatibility with my old database
|
|
||||||
Row["TIME"] = DateTime.Now.ToString();
|
|
||||||
|
|
||||||
Bans.Add(new Ban(Row["Reason"].ToString(), Row["npID"].ToString(), Row["bannedByID"].ToString(), DateTime.Parse(Row["TIME"].ToString()), Row["IP"].ToString()));
|
|
||||||
}
|
|
||||||
|
|
||||||
return Bans;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Returns all players with level > Flagged
|
|
||||||
public List<Player> getAdmins()
|
|
||||||
{
|
|
||||||
List<Player> Admins = new List<Player>();
|
|
||||||
String Query = String.Format("SELECT * FROM CLIENTS WHERE LEVEL > '{0}'", 1);
|
|
||||||
DataTable Result = GetDataTable(Query);
|
|
||||||
|
|
||||||
foreach (DataRow P in Result.Rows)
|
|
||||||
Admins.Add(new Player(P["Name"].ToString(), P["npID"].ToString(), (Player.Permission)P["Level"], P["IP"].ToString()));
|
|
||||||
|
|
||||||
return Admins;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Returns total number of player entries in database
|
|
||||||
public int totalPlayers()
|
|
||||||
{
|
|
||||||
DataTable Result = GetDataTable("SELECT * from CLIENTS ORDER BY Number DESC LIMIT 1");
|
|
||||||
if (Result.Rows.Count > 0)
|
|
||||||
return Convert.ToInt32(Result.Rows[0]["Number"]);
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Add specified player to database
|
|
||||||
public void addPlayer(Player P)
|
|
||||||
{
|
|
||||||
Dictionary<String, object> newPlayer = new Dictionary<String, object>();
|
|
||||||
|
|
||||||
newPlayer.Add("Name", Utilities.removeNastyChars(P.Name));
|
|
||||||
newPlayer.Add("npID", P.npID);
|
|
||||||
newPlayer.Add("Level", (int)P.Level);
|
|
||||||
newPlayer.Add("LastOffense", "");
|
|
||||||
newPlayer.Add("Connections", 1);
|
|
||||||
newPlayer.Add("IP", P.IP);
|
|
||||||
newPlayer.Add("LastConnection", Utilities.DateTimeSQLite(DateTime.Now));
|
|
||||||
|
|
||||||
Insert("CLIENTS", newPlayer);
|
|
||||||
}
|
|
||||||
|
|
||||||
///Update information of specified player
|
|
||||||
public void updatePlayer(Player P)
|
|
||||||
{
|
|
||||||
Dictionary<String, Object> updatedPlayer = new Dictionary<String, Object>();
|
|
||||||
|
|
||||||
updatedPlayer.Add("Name", P.Name);
|
|
||||||
updatedPlayer.Add("npID", P.npID);
|
|
||||||
updatedPlayer.Add("Level", (int)P.Level);
|
|
||||||
updatedPlayer.Add("LastOffense", P.LastOffense);
|
|
||||||
updatedPlayer.Add("Connections", P.Connections);
|
|
||||||
updatedPlayer.Add("IP", P.IP);
|
|
||||||
updatedPlayer.Add("LastConnection", Utilities.DateTimeSQLite(DateTime.Now));
|
|
||||||
|
|
||||||
Update("CLIENTS", updatedPlayer, String.Format("npID = '{0}'", P.npID));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//Add specified ban to database
|
|
||||||
public void addBan(Ban B)
|
|
||||||
{
|
|
||||||
Dictionary<String, object> newBan = new Dictionary<String, object>();
|
|
||||||
|
|
||||||
newBan.Add("Reason", B.getReason());
|
|
||||||
newBan.Add("npID", B.getID());
|
|
||||||
newBan.Add("bannedByID", B.getBanner());
|
|
||||||
newBan.Add("IP", B.getIP());
|
|
||||||
newBan.Add("TIME", Utilities.DateTimeSQLite(DateTime.Now));
|
|
||||||
|
|
||||||
Insert("BANS", newBan);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//Deletes ban with matching GUID
|
|
||||||
public void removeBan(String GUID)
|
|
||||||
{
|
|
||||||
String Query = String.Format("DELETE FROM BANS WHERE npID = '{0}'", GUID);
|
|
||||||
ExecuteNonQuery(Query);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void removeBan(String GUID, String IP)
|
|
||||||
{
|
|
||||||
String Query = String.Format("DELETE FROM BANS WHERE npID = '{0}' or IP= '%{1}%'", GUID, IP);
|
|
||||||
ExecuteNonQuery(Query);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class StatsDB : Database
|
|
||||||
{
|
|
||||||
public StatsDB(String FN) : base(FN) { }
|
|
||||||
|
|
||||||
public override void Init()
|
|
||||||
{
|
|
||||||
if (!File.Exists(FileName))
|
|
||||||
{
|
|
||||||
String Create = "CREATE TABLE [STATS] ( [Number] INTEGER, [KILLS] INTEGER DEFAULT 0, [DEATHS] INTEGER DEFAULT 0, [KDR] REAL DEFAULT 0, [SKILL] REAL DEFAULT 0, [MEAN] REAL DEFAULT 0, [DEV] REAL DEFAULT 0 );";
|
|
||||||
ExecuteNonQuery(Create);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Return stats for player specified by Database ID, null if no matches
|
|
||||||
public Stats getStats(int DBID)
|
|
||||||
{
|
|
||||||
String Query = String.Format("SELECT * FROM STATS WHERE Number = '{0}'", DBID);
|
|
||||||
DataTable Result = GetDataTable(Query);
|
|
||||||
|
|
||||||
if (Result != null && Result.Rows.Count > 0)
|
|
||||||
{
|
|
||||||
DataRow ResponseRow = Result.Rows[0];
|
|
||||||
if (ResponseRow["MEAN"] == DBNull.Value)
|
|
||||||
ResponseRow["MEAN"] = Moserware.Skills.GameInfo.DefaultGameInfo.DefaultRating.Mean;
|
|
||||||
if (ResponseRow["DEV"] == DBNull.Value)
|
|
||||||
ResponseRow["DEV"] = Moserware.Skills.GameInfo.DefaultGameInfo.DefaultRating.StandardDeviation;
|
|
||||||
if (ResponseRow["SKILL"] == DBNull.Value)
|
|
||||||
ResponseRow["SKILL"] = 0;
|
|
||||||
|
|
||||||
return new Stats(Convert.ToInt32(ResponseRow["Number"]), Convert.ToInt32(ResponseRow["KILLS"]), Convert.ToInt32(ResponseRow["DEATHS"]), Convert.ToDouble(ResponseRow["KDR"]), Convert.ToDouble(ResponseRow["SKILL"]), Convert.ToDouble(ResponseRow["MEAN"]), Convert.ToDouble(ResponseRow["DEV"]));
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addPlayer(Player P)
|
|
||||||
{
|
|
||||||
Dictionary<String, object> newPlayer = new Dictionary<String, object>();
|
|
||||||
|
|
||||||
newPlayer.Add("Number", P.databaseID);
|
|
||||||
newPlayer.Add("KILLS", 0);
|
|
||||||
newPlayer.Add("DEATHS", 0);
|
|
||||||
newPlayer.Add("KDR", 0);
|
|
||||||
newPlayer.Add("SKILL", Moserware.Skills.GameInfo.DefaultGameInfo.DefaultRating.ConservativeRating);
|
|
||||||
newPlayer.Add("MEAN", Moserware.Skills.GameInfo.DefaultGameInfo.DefaultRating.Mean);
|
|
||||||
newPlayer.Add("DEV", Moserware.Skills.GameInfo.DefaultGameInfo.DefaultRating.StandardDeviation);
|
|
||||||
|
|
||||||
Insert("STATS", newPlayer);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Update stat information of specified player
|
|
||||||
public void updatePlayer(Player P)
|
|
||||||
{
|
|
||||||
if (P.stats == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
Dictionary<String, object> updatedPlayer = new Dictionary<String, object>();
|
|
||||||
|
|
||||||
updatedPlayer.Add("KILLS", P.stats.Kills);
|
|
||||||
updatedPlayer.Add("DEATHS", P.stats.Deaths);
|
|
||||||
updatedPlayer.Add("KDR", Math.Round(P.stats.KDR, 2));
|
|
||||||
updatedPlayer.Add("SKILL", P.stats.Skill);
|
|
||||||
//updatedPlayer.Add("MEAN", P.stats.Rating.Mean);
|
|
||||||
//updatedPlayer.Add("DEV", P.stats.Rating.StandardDeviation);
|
|
||||||
|
|
||||||
Update("STATS", updatedPlayer, String.Format("Number = '{0}'", P.databaseID));
|
|
||||||
}
|
|
||||||
|
|
||||||
//Returns top 5 players (we filter through them later)
|
|
||||||
public List<Stats> topStats()
|
|
||||||
{
|
|
||||||
String Query = String.Format("SELECT * FROM STATS WHERE KILLS > '{0}' AND KDR < '{1}' AND SKILL > '{2}' ORDER BY SKILL DESC LIMIT 5", 250, 7, 245);
|
|
||||||
DataTable Result = GetDataTable(Query);
|
|
||||||
|
|
||||||
List<Stats> Top = new List<Stats>();
|
|
||||||
|
|
||||||
if (Result != null && Result.Rows.Count > 0)
|
|
||||||
{
|
|
||||||
foreach (DataRow D in Result.Rows)
|
|
||||||
{
|
|
||||||
if (D["MEAN"] == DBNull.Value || D["DEV"] == DBNull.Value || D["SKILL"] == DBNull.Value)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
Stats S = new Stats(Convert.ToInt32(D["Number"]), Convert.ToInt32(D["KILLS"]), Convert.ToInt32(D["DEATHS"]), Convert.ToDouble(D["KDR"]), Convert.ToDouble(D["SKILL"]), Convert.ToDouble(D["MEAN"]), Convert.ToDouble(D["DEV"]));
|
|
||||||
Top.Add(S);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return Top;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Stats> getMultipleStats(int start, int length)
|
|
||||||
{
|
|
||||||
String Query = String.Format("SELECT * FROM STATS ORDER BY SKILL DESC LIMIT '{0}' OFFSET '{1}'", length, start);
|
|
||||||
DataTable Result = GetDataTable(Query);
|
|
||||||
|
|
||||||
List<Stats> Stats = new List<Stats>();
|
|
||||||
|
|
||||||
if (Result != null && Result.Rows.Count > 0)
|
|
||||||
{
|
|
||||||
foreach (DataRow D in Result.Rows)
|
|
||||||
{
|
|
||||||
if (D["MEAN"] == DBNull.Value)
|
|
||||||
continue;
|
|
||||||
if (D["DEV"] == DBNull.Value)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (D["SKILL"] == DBNull.Value)
|
|
||||||
D["SKILL"] = 0;
|
|
||||||
|
|
||||||
Stats S = new Stats(Convert.ToInt32(D["Number"]), Convert.ToInt32(D["KILLS"]), Convert.ToInt32(D["DEATHS"]), Convert.ToDouble(D["KDR"]), Convert.ToDouble(D["SKILL"]), Convert.ToDouble(D["MEAN"]), Convert.ToDouble(D["DEV"]));
|
|
||||||
Stats.Add(S);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return Stats;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int totalStats()
|
|
||||||
{
|
|
||||||
DataTable Result = GetDataTable("SELECT * FROM STATS");
|
|
||||||
return Result.Rows.Count;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void clearSkill()
|
|
||||||
{
|
|
||||||
String Query = "SELECT * FROM STATS";
|
|
||||||
DataTable Result = GetDataTable(Query);
|
|
||||||
|
|
||||||
if (Result != null && Result.Rows.Count > 0)
|
|
||||||
{
|
|
||||||
foreach (DataRow D in Result.Rows)
|
|
||||||
Update("STATS", new Dictionary<String, Object> () { {"SKILL", 1} }, String.Format("Number = '{0}'", D["Number"]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class AliasesDB : Database
|
|
||||||
{
|
|
||||||
public AliasesDB(String FN) : base(FN) { }
|
|
||||||
|
|
||||||
public override void Init()
|
|
||||||
{
|
|
||||||
if (!File.Exists(FileName))
|
|
||||||
{
|
|
||||||
String Create = "CREATE TABLE [ALIASES] ( [Number] INTEGER, [NAMES] TEXT NULL, [IPS] TEXTNULL );";
|
|
||||||
ExecuteNonQuery(Create);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Aliases getPlayer(int dbIndex)
|
|
||||||
{
|
|
||||||
String Query = String.Format("SELECT * FROM ALIASES WHERE Number = '{0}' LIMIT 1", dbIndex);
|
|
||||||
DataTable Result = GetDataTable(Query);
|
|
||||||
|
|
||||||
if (Result != null && Result.Rows.Count > 0)
|
|
||||||
{
|
|
||||||
DataRow p = Result.Rows[0];
|
|
||||||
return new Aliases(Convert.ToInt32(p["Number"]), p["NAMES"].ToString(), p["IPS"].ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Aliases> getPlayer(String IP)
|
|
||||||
{
|
|
||||||
String Query = String.Format("SELECT * FROM ALIASES WHERE IPS LIKE '%{0}%'", IP);
|
|
||||||
DataTable Result = GetDataTable(Query);
|
|
||||||
List<Aliases> players = new List<Aliases>();
|
|
||||||
|
|
||||||
if (Result != null && Result.Rows.Count > 0)
|
|
||||||
{
|
|
||||||
foreach (DataRow p in Result.Rows)
|
|
||||||
players.Add(new Aliases(Convert.ToInt32(p["Number"]), p["NAMES"].ToString(), p["IPS"].ToString()));
|
|
||||||
}
|
|
||||||
|
|
||||||
return players;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Aliases> findPlayers(String name)
|
|
||||||
{
|
|
||||||
String[] EyePee = name.Split('.');
|
|
||||||
String Penor = "THISISNOTANIP";
|
|
||||||
if (EyePee.Length > 1)
|
|
||||||
Penor = (EyePee[0] + '.' + EyePee[1] + '.');
|
|
||||||
|
|
||||||
String Query = String.Format("SELECT * FROM ALIASES WHERE NAMES LIKE '%{0}%' OR IPS LIKE '%{1}%' LIMIT 15", name, Penor);
|
|
||||||
DataTable Result = GetDataTable(Query);
|
|
||||||
|
|
||||||
List<Aliases> players = new List<Aliases>();
|
|
||||||
|
|
||||||
if (Result != null && Result.Rows.Count > 0)
|
|
||||||
{
|
|
||||||
foreach (DataRow p in Result.Rows)
|
|
||||||
players.Add(new Aliases(Convert.ToInt32(p["Number"]), p["NAMES"].ToString(), p["IPS"].ToString()));
|
|
||||||
}
|
|
||||||
|
|
||||||
return players;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addPlayer(Aliases Alias)
|
|
||||||
{
|
|
||||||
Dictionary<String, object> newPlayer = new Dictionary<String, object>();
|
|
||||||
|
|
||||||
newPlayer.Add("Number", Alias.getNumber());
|
|
||||||
newPlayer.Add("NAMES", Alias.getNamesDB());
|
|
||||||
newPlayer.Add("IPS", Alias.getIPSDB());
|
|
||||||
|
|
||||||
Insert("ALIASES", newPlayer);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updatePlayer(Aliases Alias)
|
|
||||||
{
|
|
||||||
Dictionary<String, object> updatedPlayer = new Dictionary<String, object>();
|
|
||||||
|
|
||||||
updatedPlayer.Add("Number", Alias.getNumber());
|
|
||||||
updatedPlayer.Add("NAMES", Alias.getNamesDB());
|
|
||||||
updatedPlayer.Add("IPS", Alias.getIPSDB());
|
|
||||||
|
|
||||||
Update("ALIASES", updatedPlayer, String.Format("Number = '{0}'", Alias.getNumber()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
134
Admin/File.cs
134
Admin/File.cs
@ -1,134 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using System.IO;
|
|
||||||
|
|
||||||
namespace IW4MAdmin
|
|
||||||
{
|
|
||||||
class IFile
|
|
||||||
{
|
|
||||||
public IFile(String fileName)
|
|
||||||
{
|
|
||||||
//Not safe for directories with more than one folder but meh
|
|
||||||
_Directory = fileName.Split('\\')[0];
|
|
||||||
Name = (fileName.Split('\\'))[fileName.Split('\\').Length-1];
|
|
||||||
|
|
||||||
if (!Directory.Exists(_Directory))
|
|
||||||
Directory.CreateDirectory(_Directory);
|
|
||||||
|
|
||||||
if (!File.Exists(fileName))
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
FileStream penis = File.Create(fileName);
|
|
||||||
penis.Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
Console.WriteLine("Unable to open log file for writing!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Handle = new StreamReader(new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite));
|
|
||||||
sze = Handle.BaseStream.Length;
|
|
||||||
}
|
|
||||||
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
//Console.WriteLine("Unable to open log file for writing!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public IFile(String file, bool write)
|
|
||||||
{
|
|
||||||
Name = file;
|
|
||||||
writeHandle = new StreamWriter(new FileStream(Name, FileMode.Create, FileAccess.Write, FileShare.ReadWrite));
|
|
||||||
sze = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getSize()
|
|
||||||
{
|
|
||||||
sze = Handle.BaseStream.Length;
|
|
||||||
return sze;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Write(String line)
|
|
||||||
{
|
|
||||||
if (writeHandle != null)
|
|
||||||
{
|
|
||||||
writeHandle.WriteLine(line);
|
|
||||||
writeHandle.Flush();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public String[] getParameters(int num)
|
|
||||||
{
|
|
||||||
if (sze > 0)
|
|
||||||
{
|
|
||||||
String firstLine = Handle.ReadLine();
|
|
||||||
String[] Parms = firstLine.Split(':');
|
|
||||||
if (Parms.Length < num)
|
|
||||||
return null;
|
|
||||||
else
|
|
||||||
return Parms;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Close()
|
|
||||||
{
|
|
||||||
if(Handle != null)
|
|
||||||
Handle.Close();
|
|
||||||
if (writeHandle != null)
|
|
||||||
writeHandle.Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String[] readAll()
|
|
||||||
{
|
|
||||||
return Handle.ReadToEnd().Split(new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLines()
|
|
||||||
{
|
|
||||||
return Handle.ReadToEnd();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String[] Tail(int lineCount)
|
|
||||||
{
|
|
||||||
var buffer = new List<string>(lineCount);
|
|
||||||
string line;
|
|
||||||
for (int i = 0; i < lineCount; i++)
|
|
||||||
{
|
|
||||||
line = Handle.ReadLine();
|
|
||||||
if (line == null) return buffer.ToArray();
|
|
||||||
buffer.Add(line);
|
|
||||||
}
|
|
||||||
|
|
||||||
int lastLine = lineCount - 1; //The index of the last line read from the buffer. Everything > this index was read earlier than everything <= this indes
|
|
||||||
|
|
||||||
while (null != (line = Handle.ReadLine()))
|
|
||||||
{
|
|
||||||
lastLine++;
|
|
||||||
if (lastLine == lineCount) lastLine = 0;
|
|
||||||
buffer[lastLine] = line;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (lastLine == lineCount - 1) return buffer.ToArray();
|
|
||||||
var retVal = new string[lineCount];
|
|
||||||
buffer.CopyTo(lastLine + 1, retVal, 0, lineCount - lastLine - 1);
|
|
||||||
buffer.CopyTo(0, retVal, lineCount - lastLine - 1, lastLine + 1);
|
|
||||||
return retVal;
|
|
||||||
}
|
|
||||||
//END
|
|
||||||
|
|
||||||
private long sze;
|
|
||||||
private String Name;
|
|
||||||
private String _Directory;
|
|
||||||
StreamReader Handle;
|
|
||||||
StreamWriter writeHandle;
|
|
||||||
}
|
|
||||||
}
|
|
Binary file not shown.
Before Width: | Height: | Size: 31 KiB |
Binary file not shown.
@ -1,37 +0,0 @@
|
|||||||
using System.Reflection;
|
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Resources;
|
|
||||||
|
|
||||||
// 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("IW4MAdmin Application")]
|
|
||||||
[assembly: AssemblyDescription("Server administration for IW4X Servers")]
|
|
||||||
[assembly: AssemblyConfiguration("")]
|
|
||||||
[assembly: AssemblyCompany("ForeverNone LLC")]
|
|
||||||
[assembly: AssemblyProduct("IW4MAdmin")]
|
|
||||||
[assembly: AssemblyCopyright("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(true)]
|
|
||||||
|
|
||||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
|
||||||
[assembly: Guid("62f47df4-c8eb-4b5d-bdd8-9de0ca6b570f")]
|
|
||||||
|
|
||||||
// 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.6.*")]
|
|
||||||
[assembly: NeutralResourcesLanguageAttribute("en")]
|
|
26
Admin/Properties/Settings.Designer.cs
generated
26
Admin/Properties/Settings.Designer.cs
generated
@ -1,26 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <auto-generated>
|
|
||||||
// This code was generated by a tool.
|
|
||||||
// Runtime Version:4.0.30319.42000
|
|
||||||
//
|
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
|
||||||
// the code is regenerated.
|
|
||||||
// </auto-generated>
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
namespace IW4MAdmin.Properties {
|
|
||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.5.0.0")]
|
|
||||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
|
||||||
|
|
||||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
|
||||||
|
|
||||||
public static Settings Default {
|
|
||||||
get {
|
|
||||||
return defaultInstance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
|
||||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
|
||||||
<Profiles>
|
|
||||||
<Profile Name="(Default)" />
|
|
||||||
</Profiles>
|
|
||||||
</SettingsFile>
|
|
@ -1,105 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<title>IW4MAdmin by RaidMax</title>
|
|
||||||
<meta name="description" content="Administration tool for IW4M servers. IW4MAdmin Created by RaidMax">
|
|
||||||
<link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
|
|
||||||
|
|
||||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/canvasjs/1.7.0/canvasjs.min.js"></script>
|
|
||||||
|
|
||||||
<link rel="stylesheet" type="text/css" href="/webfront/main.css"/>
|
|
||||||
<link rel="stylesheet" type="text/css" href="/webfront/mobile.css"/>
|
|
||||||
</head>
|
|
||||||
<script>
|
|
||||||
var user;
|
|
||||||
|
|
||||||
$.getJSON("_userinfo", function(response) {
|
|
||||||
user = response;
|
|
||||||
$(document).trigger("actionEventLoad");
|
|
||||||
});
|
|
||||||
|
|
||||||
function parseGet(val) {
|
|
||||||
var result = "undefined",
|
|
||||||
tmp = [];
|
|
||||||
location.search
|
|
||||||
.substr(1)
|
|
||||||
.split("&")
|
|
||||||
.forEach(function (item) {
|
|
||||||
tmp = item.split("=");
|
|
||||||
if (tmp[0] === val) result = decodeURIComponent(tmp[1]);
|
|
||||||
});
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getColorForLevel(level, name)
|
|
||||||
{
|
|
||||||
switch (level)
|
|
||||||
{
|
|
||||||
case "User":
|
|
||||||
case "Guest":
|
|
||||||
return "<span style='color: rgba(255, 255, 255, 0.85);'>" + name + "</span>";
|
|
||||||
case "Trusted":
|
|
||||||
case "Kick":
|
|
||||||
case "User":
|
|
||||||
return "<span style='color: rgba(116,147,99,1);''>" + name + "</span>";
|
|
||||||
case "Flagged":
|
|
||||||
case "Flag":
|
|
||||||
case "TempBan":
|
|
||||||
return "<span style='color: rgba(253, 139, 22, 0.85);'>" + name + "</span>";
|
|
||||||
case "Banned":
|
|
||||||
case "Ban":
|
|
||||||
case "Console":
|
|
||||||
return "<span style='color: rgba(255, 69, 69, 0.85);'>" + name + "</span>";
|
|
||||||
case "Moderator":
|
|
||||||
case "Warning":
|
|
||||||
case "Report":
|
|
||||||
return "<span style='color: rgba(235, 211, 101, 0.75);'>" + name + "</span>";
|
|
||||||
case "Administrator":
|
|
||||||
return "<span style='color: rgba(236, 130, 222, 0.69);'>" + name + "</span>";
|
|
||||||
case "SeniorAdmin":
|
|
||||||
return "<span style='color: rgba(50, 177, 185, 0.85);'>" + name + "</span>";
|
|
||||||
case "Owner":
|
|
||||||
return "<span style='color: rgb(0, 122, 204);'>" + name + "</span>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function formatMessages(messages)
|
|
||||||
{
|
|
||||||
var chats = "";
|
|
||||||
$.each(messages, function(i, chat) {
|
|
||||||
chats +=
|
|
||||||
"<div class='chatPlayerName tableCell'>" + $("<div/>").html(chat['Name']).text()+ ":</div><div class='chatPlayerMessage tableCell'>" + $("<div/>").html(chat['Message']).text() + "</div> \
|
|
||||||
<div style='display:table-row'></div>"
|
|
||||||
});
|
|
||||||
return chats;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getPages()
|
|
||||||
{
|
|
||||||
$.getJSON("/pages", function(result){
|
|
||||||
$.each(result, function(i, page){
|
|
||||||
if (page['visible'] == true)
|
|
||||||
$("#navContainer").append("<div class=navEntry><a href=\"" + page['pagePath'] + "\">" + page['pageName'] + "</a></div>");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function checkJustNow(timestr)
|
|
||||||
{
|
|
||||||
return timestr
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
<body>
|
|
||||||
<div id="header">
|
|
||||||
<div id="navContainer">
|
|
||||||
<div id="navHeader">IW4MAdmin</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="loader"></div>
|
|
||||||
<div id="content">
|
|
@ -1,333 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
||||||
|
|
||||||
<title>IW4MAdmin by RaidMax</title>
|
|
||||||
<meta name="description" content="Administration tool for IW4M servers. IW4MAdmin Created by RaidMax">
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/open-iconic/1.1.1/font/css/open-iconic-bootstrap.min.css" />
|
|
||||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
|
|
||||||
<script src="http://code.jquery.com/jquery-3.3.1.min.js"
|
|
||||||
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
|
|
||||||
crossorigin="anonymous"></script>
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
|
|
||||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
|
|
||||||
<style>
|
|
||||||
#profile_avatar {
|
|
||||||
height: 200px;
|
|
||||||
width: 200px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.profile-shortcode {
|
|
||||||
font-size: 150pt;
|
|
||||||
line-height: 175px;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.text-highlight {
|
|
||||||
color: rgb(0, 122, 204) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
#profile_info {
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
#profile_name {
|
|
||||||
font-size: 4em;
|
|
||||||
line-height: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
#profile_info > .text-muted {
|
|
||||||
font-size: 1.5em;
|
|
||||||
line-height: 1.25em;
|
|
||||||
}
|
|
||||||
|
|
||||||
#content,
|
|
||||||
.container-fluid, #profile_aliases, body {
|
|
||||||
background-color: rgb(34, 34, 34);
|
|
||||||
}
|
|
||||||
|
|
||||||
#profile_level > span.level {
|
|
||||||
color: rgba(236, 130, 222, 0.69);
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 1.5em;
|
|
||||||
line-height: 1.4em;
|
|
||||||
}
|
|
||||||
|
|
||||||
#profile_wrapper {
|
|
||||||
border-bottom: 2px rgb(0, 122, 204) solid;
|
|
||||||
}
|
|
||||||
|
|
||||||
.level-color-user, .level-color-guest {
|
|
||||||
color: rgba(255, 255, 255, 0.85);
|
|
||||||
}
|
|
||||||
|
|
||||||
.level-bgcolor-user, .level-bgcolor-guest {
|
|
||||||
background-color: rgba(255, 255, 255, 0.85);
|
|
||||||
}
|
|
||||||
|
|
||||||
.level-color-trusted, .level-color-user {
|
|
||||||
color: rgba(116,147,99,1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.level-bgcolor-trusted, .level-bgcolor-user {
|
|
||||||
background-color: rgba(116,147,99,1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.level-color-flagged {
|
|
||||||
color: rgba(253, 139, 22, 0.85);
|
|
||||||
}
|
|
||||||
|
|
||||||
.level-bgcolor-flagged {
|
|
||||||
background-color: rgba(253, 139, 22, 0.85);
|
|
||||||
}
|
|
||||||
|
|
||||||
.level-color-banned {
|
|
||||||
color: rgba(255, 69, 69, 0.85);
|
|
||||||
}
|
|
||||||
|
|
||||||
.level-bgcolor-banned {
|
|
||||||
background-color: rgba(255, 69, 69, 0.85);
|
|
||||||
}
|
|
||||||
|
|
||||||
.level-color-moderator {
|
|
||||||
color: rgba(235, 211, 101, 0.75);
|
|
||||||
}
|
|
||||||
|
|
||||||
.level-bgcolor-moderator {
|
|
||||||
background-color: rgba(235, 211, 101, 0.75);
|
|
||||||
}
|
|
||||||
|
|
||||||
.level-color-administrator {
|
|
||||||
color: rgba(236, 130, 222, 0.69);
|
|
||||||
}
|
|
||||||
|
|
||||||
.level-bgcolor-administrator {
|
|
||||||
background-color: rgba(236, 130, 222, 0.69);
|
|
||||||
}
|
|
||||||
|
|
||||||
.level-color-senioradmin {
|
|
||||||
color: rgba(50, 177, 185, 0.85);
|
|
||||||
}
|
|
||||||
|
|
||||||
.level-bgcolor-senioradmin {
|
|
||||||
background-color: rgba(50, 177, 185, 0.85);
|
|
||||||
}
|
|
||||||
|
|
||||||
.level-color-owner {
|
|
||||||
color: rgb(0, 122, 204);
|
|
||||||
}
|
|
||||||
|
|
||||||
.level-bgcolor-owner {
|
|
||||||
background-color: rgb(0, 122, 204);
|
|
||||||
}
|
|
||||||
|
|
||||||
.profile-meta-title {
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.profile-meta-entry {
|
|
||||||
font-size: 1.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.penalties-color-kick,
|
|
||||||
.penalties-color-unban {
|
|
||||||
color: rgba(116, 147, 99, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.penalties-color-report {
|
|
||||||
color: rgba(116, 147, 99, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.penalties-color-warning {
|
|
||||||
color: rgba(235, 211, 101, 0.75);
|
|
||||||
}
|
|
||||||
|
|
||||||
.penalties-color-tempban {
|
|
||||||
color: rgba(253, 139, 22, 0.85);
|
|
||||||
}
|
|
||||||
|
|
||||||
.penalties-color-flag {
|
|
||||||
color: rgba(253, 139, 22, 0.85);
|
|
||||||
}
|
|
||||||
|
|
||||||
.penalties-color-ban {
|
|
||||||
color: rgba(255, 69, 69, 0.85);
|
|
||||||
}
|
|
||||||
|
|
||||||
#profile_aliases_btn {
|
|
||||||
position: absolute;
|
|
||||||
top: auto;
|
|
||||||
margin-top: 0.7em;
|
|
||||||
font-size: 0.5em;
|
|
||||||
color: rgb(0, 122, 204);
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
#profile_aliases_btn:hover {
|
|
||||||
color: white;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
#profile_aliases {
|
|
||||||
position: relative;
|
|
||||||
display: none;
|
|
||||||
top: 0.2em;
|
|
||||||
font-size: 0.5em;
|
|
||||||
line-height: 1.2em;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<script>
|
|
||||||
function parseGet(val) {
|
|
||||||
var result = "undefined",
|
|
||||||
tmp = [];
|
|
||||||
location.search
|
|
||||||
.substr(1)
|
|
||||||
.split("&")
|
|
||||||
.forEach(function (item) {
|
|
||||||
tmp = item.split("=");
|
|
||||||
if (tmp[0] === val) result = decodeURIComponent(tmp[1]);
|
|
||||||
});
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
function penaltyToName(penaltyName) {
|
|
||||||
switch (penaltyName) {
|
|
||||||
case "Flag":
|
|
||||||
return "Flagged"
|
|
||||||
case "Warning":
|
|
||||||
return "Warned";
|
|
||||||
case "Report":
|
|
||||||
return "Reported";
|
|
||||||
case "Ban":
|
|
||||||
return "Banned";
|
|
||||||
case "Kick":
|
|
||||||
return "Kicked";
|
|
||||||
case "TempBan":
|
|
||||||
return "Temp Banned";
|
|
||||||
case "Unban":
|
|
||||||
return "Unbanned";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let playerInfo = undefined;
|
|
||||||
|
|
||||||
function loadMeta(meta) {
|
|
||||||
let eventString = '';
|
|
||||||
// it's a penalty
|
|
||||||
if (meta.Class.includes("Penalty")) {
|
|
||||||
if (meta.Value.PunisherId != playerInfo.playerID) {
|
|
||||||
eventString = `<div><span class="penalties-color-${meta.Value.Type.toLowerCase()}">${penaltyToName(meta.Value.Type)}</span> by <span class="text-highlight"> <a href="/profile?id=${meta.Value.PunisherId}">${meta.Value.PunisherName}</a></span > for <span style="color: white; ">${meta.Value.Offense}</span> ${meta.WhenString} ago </div>`;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
eventString = `<div><span class="penalties-color-${meta.Value.Type.toLowerCase()}">${penaltyToName(meta.Value.Type)} </span> <span class="text-highlight"><a href="/profile?id=${meta.Value.OffenderId}"> ${meta.Value.OffenderName}</a></span > for <span style="color: white; ">${meta.Value.Offense}</span> ${meta.WhenString} ago </div>`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// it's a message
|
|
||||||
else if (meta.Key.includes("Event")) {
|
|
||||||
eventString = `<div><span style="color:white;">></span><span class="text-muted"> ${meta.Value}</span></div>`;
|
|
||||||
}
|
|
||||||
$('#profile_events').append(eventString);
|
|
||||||
}
|
|
||||||
|
|
||||||
let count = 1;
|
|
||||||
$(window).scroll(function () {
|
|
||||||
if ($(window).scrollTop() == $(document).height() - $(window).height() || $(document).height() == $(window).height()) {
|
|
||||||
while (count % 40 != 0 && count < playerInfo.Meta.length) {
|
|
||||||
loadMeta(playerInfo.Meta[count - 1]);
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$(document).ready(function () {
|
|
||||||
$("#profile_aliases_btn").click(function (e) {
|
|
||||||
if ($("#profile_aliases").text() != '') {
|
|
||||||
$("#profile_aliases").slideToggle(150);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
jQuery.getJSON("/getplayer?profile=1&id=" + parseGet("id"), function (result) {
|
|
||||||
playerInfo = result[0];
|
|
||||||
|
|
||||||
let firstLetter = playerInfo.playerName.match(/[a-zA-Z]/);
|
|
||||||
if (firstLetter == undefined)
|
|
||||||
firstLetter = '?';
|
|
||||||
else
|
|
||||||
firstLetter = firstLetter.pop().toUpperCase();
|
|
||||||
|
|
||||||
$('#profile_avatar').addClass('level-bgcolor-' + playerInfo.playerLevel.toLowerCase());
|
|
||||||
$('#profile_avatar > .profile-shortcode').text(firstLetter);
|
|
||||||
$('#profile_name > .client-name').prepend(playerInfo.playerName);
|
|
||||||
$.each(playerInfo.playerAliases, function (index, alias) {
|
|
||||||
$("#profile_aliases").append(alias + "<br/>");
|
|
||||||
});
|
|
||||||
$('#profile_time_played > .text-highlight').text(playerInfo.TimePlayed);
|
|
||||||
$('#profile_level > span').text(playerInfo.playerLevel).addClass('level-color-' + playerInfo.playerLevel.toLowerCase());
|
|
||||||
$('#profile_first_seen > .text-highlight').text(playerInfo.FirstSeen);
|
|
||||||
$('#profile_last_seen > .text-highlight').text(playerInfo.LastSeen);
|
|
||||||
|
|
||||||
$("#profile_events").text("");
|
|
||||||
$.each(playerInfo.Meta, function (index, meta) {
|
|
||||||
if (!meta.Key.includes("Event")) {
|
|
||||||
let metaString = `<div class="profile-meta-entry"><span class="profile-meta-value text-highlight">${meta.Value}</span><span class="profile-meta-title"> ${meta.Key}</span></div>`;
|
|
||||||
$("#profile_meta").append(metaString);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$.each(playerInfo.Meta, function (index, meta) {
|
|
||||||
loadMeta(meta);
|
|
||||||
|
|
||||||
if (count % 40 == 0) {
|
|
||||||
count++;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
count++
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="container-fluid">
|
|
||||||
<div id="content" class="p-4">
|
|
||||||
<div id="profile_wrapper" class="row d-flex d-sm-inline-flex justify-content-center justify-content-left pb-4">
|
|
||||||
<div class="mr-auto ml-auto ml-sm-0 mr-sm-0">
|
|
||||||
<div id="profile_avatar" class="text-center">
|
|
||||||
<span class="profile-shortcode">_</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="profile_info" class="text-center text-sm-left pr-4 pl-4">
|
|
||||||
<div id="profile_name">
|
|
||||||
<span class="client-name"><span id="profile_aliases_btn" class="oi oi-caret-bottom pl-2"></span></span>
|
|
||||||
<div id="profile_aliases" class="pr-0 pr-sm-4 pb-2 mb-2 text-muted"></div>
|
|
||||||
</div>
|
|
||||||
<div id="profile_level" class="text-muted">
|
|
||||||
<span>_</span>
|
|
||||||
</div>
|
|
||||||
<div id="profile_time_played" class="text-muted">
|
|
||||||
Played <span class="text-highlight">_</span> hours
|
|
||||||
</div>
|
|
||||||
<div id="profile_first_seen" class="text-muted">
|
|
||||||
First seen <span class="text-highlight">_</span> ago
|
|
||||||
</div>
|
|
||||||
<div id="profile_last_seen" class="text-muted">
|
|
||||||
Last seen <span class="text-highlight">_</span> ago
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="profile_meta" class="text-center text-sm-right pt-2">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row d-md-flex pt-4">
|
|
||||||
<div id="profile_events" class="text-muted text-left ml-sm-0">
|
|
||||||
No recent events
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,54 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
||||||
<assemblyIdentity version="1.0.0.0" name="MyApplication.app" />
|
|
||||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
|
||||||
<security>
|
|
||||||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
|
||||||
<!-- UAC Manifest Options
|
|
||||||
If you want to change the Windows User Account Control level replace the
|
|
||||||
requestedExecutionLevel node with one of the following.
|
|
||||||
|
|
||||||
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
|
||||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
|
||||||
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
|
|
||||||
|
|
||||||
Specifying requestedExecutionLevel node will disable file and registry virtualization.
|
|
||||||
If you want to utilize File and Registry Virtualization for backward
|
|
||||||
compatibility then delete the requestedExecutionLevel node.
|
|
||||||
-->
|
|
||||||
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
|
||||||
</requestedPrivileges>
|
|
||||||
<applicationRequestMinimum>
|
|
||||||
<PermissionSet Unrestricted="true" ID="Custom" SameSite="site" />
|
|
||||||
<defaultAssemblyRequest permissionSetReference="Custom" />
|
|
||||||
</applicationRequestMinimum>
|
|
||||||
</security>
|
|
||||||
</trustInfo>
|
|
||||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
|
||||||
<application>
|
|
||||||
<!-- A list of all Windows versions that this application is designed to work with.
|
|
||||||
Windows will automatically select the most compatible environment.-->
|
|
||||||
<!-- If your application is designed to work with Windows Vista, uncomment the following supportedOS node-->
|
|
||||||
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS>-->
|
|
||||||
<!-- If your application is designed to work with Windows 7, uncomment the following supportedOS node-->
|
|
||||||
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>-->
|
|
||||||
<!-- If your application is designed to work with Windows 8, uncomment the following supportedOS node-->
|
|
||||||
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS>-->
|
|
||||||
<!-- If your application is designed to work with Windows 8.1, uncomment the following supportedOS node-->
|
|
||||||
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>-->
|
|
||||||
</application>
|
|
||||||
</compatibility>
|
|
||||||
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
|
|
||||||
<!-- <dependency>
|
|
||||||
<dependentAssembly>
|
|
||||||
<assemblyIdentity
|
|
||||||
type="win32"
|
|
||||||
name="Microsoft.Windows.Common-Controls"
|
|
||||||
version="6.0.0.0"
|
|
||||||
processorArchitecture="*"
|
|
||||||
publicKeyToken="6595b64144ccf1df"
|
|
||||||
language="*"
|
|
||||||
/>
|
|
||||||
</dependentAssembly>
|
|
||||||
</dependency>-->
|
|
||||||
</asmv1:assembly>
|
|
@ -1,44 +0,0 @@
|
|||||||
mp_rust:Rust
|
|
||||||
mp_highrise:Highrise
|
|
||||||
mp_terminal:Terminal
|
|
||||||
mp_crash:Crash
|
|
||||||
mp_nightshift:Skidrow
|
|
||||||
mp_quarry:Quarry
|
|
||||||
mp_afghan:Afghan
|
|
||||||
mp_derail:Derail
|
|
||||||
mp_estate:Estate
|
|
||||||
mp_favela:Favela
|
|
||||||
mp_highrise:Highrise
|
|
||||||
mp_invasion:Invasion
|
|
||||||
mp_checkpoint:Karachi
|
|
||||||
mp_quarry:Quarry
|
|
||||||
mp_rundown:Rundown
|
|
||||||
mp_boneyard:Scrapyard
|
|
||||||
mp_nightshift:Skidrow
|
|
||||||
mp_subbase:Sub Base
|
|
||||||
mp_underpass:Underpass
|
|
||||||
mp_brecourt:Wasteland
|
|
||||||
mp_overgrown:Overgrown
|
|
||||||
mp_strike:Strike
|
|
||||||
mp_vacant:Vacant
|
|
||||||
mp_abandon:Carnival
|
|
||||||
mp_trailerpark:Trailer Park
|
|
||||||
mp_fuel2:Fuel
|
|
||||||
mp_storm:Storm
|
|
||||||
mp_complex:Bailout
|
|
||||||
mp_compact:Salvage
|
|
||||||
mp_nuked:Nuketown
|
|
||||||
iw4_credits:IW4 Credits
|
|
||||||
mp_killhouse:Killhouse
|
|
||||||
mp_bog_sh:Bog
|
|
||||||
mp_cargoship_sh:Freighter
|
|
||||||
mp_shipment:Shipment
|
|
||||||
mp_shipment_long:Shipment - Long
|
|
||||||
mp_rust_long:Rust - Long
|
|
||||||
mp_firingrange:Firing Range
|
|
||||||
mp_storm_spring:Chemical Plant
|
|
||||||
mp_fav_tropical:Favela - Tropical
|
|
||||||
mp_estate_tropical:Estate - Tropical
|
|
||||||
mp_crash_tropical:Crash - Tropical
|
|
||||||
mp_bloc_sh:Forgotten City
|
|
||||||
mp_raidmax:^1L^23^33^4T^5M^6A^75^8T^93^0R
|
|
@ -1,8 +0,0 @@
|
|||||||
60
|
|
||||||
Over ^5{{TOTALPLAYTIME}} ^7man hours have been played on this server!
|
|
||||||
This server uses ^5IW4M Admin v{{VERSION}} ^7get it at ^5raidmax.org/IW4MAdmin
|
|
||||||
^5IW4M Admin ^7sees ^5YOU!
|
|
||||||
This server has harvested the information of ^5{{TOTALPLAYERS}} ^7players!
|
|
||||||
Cheaters are ^1unwelcome ^7 on this server
|
|
||||||
Did you know 8/10 people agree with unverified statistics?
|
|
||||||
^5{{TOTALKILLS}} ^7innocent people have been murdered in this server!
|
|
@ -1,6 +0,0 @@
|
|||||||
Cheating/Exploiting is not allowed
|
|
||||||
Respect other players
|
|
||||||
Administrators have the final say
|
|
||||||
No Racism or excessive trolling
|
|
||||||
Keep grenade launcher use to a minimum
|
|
||||||
Balance teams at ALL times
|
|
@ -1,2 +0,0 @@
|
|||||||
127.0.0.1
|
|
||||||
80
|
|
@ -1,4 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<packages>
|
|
||||||
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net45" />
|
|
||||||
</packages>
|
|
@ -1,71 +0,0 @@
|
|||||||
<script>
|
|
||||||
function printPlayer(player, i) {
|
|
||||||
var playerText = '<div class="admin-name"><a href="/profile?id=' + player.ClientId + '">' + player.Name + "</a></div>";
|
|
||||||
switch (player.Level) {
|
|
||||||
case 6:
|
|
||||||
$('#owner-privilege .clients').append(playerText);
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
$('#senioradmin-privilege .clients').append(playerText);
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
$('#admin-privilege .clients').append(playerText);
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
$('#mod-privilege .clients').append(playerText);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
$('#trusted-privilege .clients').append(playerText);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getAdmins() {
|
|
||||||
$.getJSON('/GetAdmins', function (result) {
|
|
||||||
$.each(result, function (i, player) {
|
|
||||||
printPlayer(player, i);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
$(document).ready(function () {
|
|
||||||
getAdmins();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="privilege" id="owner-privilege">
|
|
||||||
<div class="contentHeader table">
|
|
||||||
<div class="contentColumn tableCell">Owner</div>
|
|
||||||
</div>
|
|
||||||
<div class="clients"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="privilege" id="senioradmin-privilege">
|
|
||||||
<div class="contentHeader table">
|
|
||||||
<div class="contentColumn tableCell">Senior Administrator</div>
|
|
||||||
</div>
|
|
||||||
<div class="clients"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="privilege" id="admin-privilege">
|
|
||||||
<div class="contentHeader table">
|
|
||||||
<div class="contentColumn tableCell">Administrator</div>
|
|
||||||
</div>
|
|
||||||
<div class="clients"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="privilege" id="mod-privilege">
|
|
||||||
<div class="contentHeader table">
|
|
||||||
<div class="contentColumn tableCell">Moderator</div>
|
|
||||||
</div>
|
|
||||||
<div class="clients"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="privilege" id="trusted-privilege">
|
|
||||||
<div class="contentHeader table">
|
|
||||||
<div class="contentColumn tableCell">Trusted</div>
|
|
||||||
</div>
|
|
||||||
<div class="clients"></div>
|
|
||||||
</div>
|
|
||||||
<hr />
|
|
@ -1,5 +0,0 @@
|
|||||||
<div id="container">
|
|
||||||
<div class="h0" style="margin-top: 0; line-height:normal;">Penalties<br/><a style="padding: 0; margin: 0; font-size: 24px; float: right;" href="/">Back</a></div>
|
|
||||||
<div id="logo_shit"></div>
|
|
||||||
{{BANS}}
|
|
||||||
</div>
|
|
@ -1,48 +0,0 @@
|
|||||||
<script src="/webfront/scripts/wordcloud2.js"></script>
|
|
||||||
<div style="display:none;" class="chat-history">
|
|
||||||
<h2>Chat history </h2>
|
|
||||||
<br/>
|
|
||||||
</div>
|
|
||||||
<div id="word-cloud-wrapper" style="text-align: center; display: none;">
|
|
||||||
<canvas id="chat-word-cloud" width="750" height="750"></canvas>
|
|
||||||
</div>
|
|
||||||
<script>
|
|
||||||
if (parseGet("clientid") == "undefined") {
|
|
||||||
$('#word-cloud-wrapper').show();
|
|
||||||
$.getJSON("/_words", function (result) {
|
|
||||||
var wordList = [];
|
|
||||||
var largestWord = 0;
|
|
||||||
$.each(result, function (i, word) {
|
|
||||||
if (word.Count > largestWord)
|
|
||||||
largestWord = word.Count;
|
|
||||||
wordList.push([word.Word, word.Count]);
|
|
||||||
});
|
|
||||||
var _weightFactor = Math.min(1, (1 / largestWord) / 0.003599);
|
|
||||||
WordCloud(document.getElementById('chat-word-cloud'), { list: wordList, backgroundColor: "rgb(34,34,34)", color: "rgb(0, 122, 204)", wait: 0, weightFactor: _weightFactor });
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
else {
|
|
||||||
$('.chat-history').show();
|
|
||||||
$.getJSON("/_clientchat?clientid=" + parseGet("clientid"), function (result) {
|
|
||||||
result = result.sort(function (a, b) {
|
|
||||||
return new Date(b.TimeSent) - new Date(a.TimeSent);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (result.length == 0) {
|
|
||||||
$('.chat-history h2').append('is empty.');
|
|
||||||
}
|
|
||||||
|
|
||||||
else {
|
|
||||||
$('.chat-history h2').append('for <b>' + result[0].ClientName + '</b> (' + result.length + ' messages)');
|
|
||||||
}
|
|
||||||
|
|
||||||
$.each(result, function (i, chat) {
|
|
||||||
var date = new Date(chat.TimeSent);
|
|
||||||
$('.chat-history').append("<div><span>" + date.toLocaleString() + " — </span><span><b>" + chat.ClientName + "</b></span>: <span>" + chat.Message + "</span></div>");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -1,70 +0,0 @@
|
|||||||
<div id="consoleWrap">
|
|
||||||
<select id="serverSelection"></select>
|
|
||||||
<hr />
|
|
||||||
<div id="console">
|
|
||||||
</div>
|
|
||||||
<hr />
|
|
||||||
<div class="playerSearchWrap table">
|
|
||||||
<input type="text" class="search tableCell" placeholder="Enter Command..." />
|
|
||||||
<input type="button" class="searchButton tableCell" name="Search" value="Execute" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<script>
|
|
||||||
var cmdResultQueue = [];
|
|
||||||
$(document).ready(function () {
|
|
||||||
cmdResultQueue = [];
|
|
||||||
$.getJSON("/_servers", function (servers) {
|
|
||||||
$.each(servers, function (i, server) {
|
|
||||||
$('select').append("<option value=\"" + server['serverPort'] + "\">" + server['serverName'] + "</option>");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
function addCommandResult(line) {
|
|
||||||
// $.each(result, function (i, line) {
|
|
||||||
if (line == "You entered an invalid command!" || line == "All commands must start with '!'") {
|
|
||||||
line = getColorForLevel("Banned", line);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
line = getColorForLevel("Trusted", line);
|
|
||||||
}
|
|
||||||
if (cmdResultQueue.length > 12)
|
|
||||||
cmdResultQueue.shift();
|
|
||||||
|
|
||||||
cmdResultQueue.push(line);
|
|
||||||
// });
|
|
||||||
}
|
|
||||||
|
|
||||||
function formatCommandResults() {
|
|
||||||
$('#console').html("");
|
|
||||||
|
|
||||||
for (i = 0; i < cmdResultQueue.length; i++)
|
|
||||||
$('#console').append("<span class=\"commandResult\">"
|
|
||||||
+ cmdResultQueue[i] + "</span><br/>"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$('.searchButton').click(function () {
|
|
||||||
if ($('.search').val().length > 0) {
|
|
||||||
if ($('.search').val()[0] != '!') {
|
|
||||||
addCommandResult(["All commands must start with '!'"]);
|
|
||||||
formatCommandResults();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$.getJSON("/_console?command=" + $('.search').val() + "&server=" + $('select').val(), function (result) {
|
|
||||||
$.each(result, function (i, line) {
|
|
||||||
addCommandResult(line.Message)
|
|
||||||
});
|
|
||||||
}).done(function (data) { formatCommandResults(); $('.search').val(""); });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$(document).keypress(function (e) {
|
|
||||||
if (e.which == 13) {
|
|
||||||
$('.searchButton').click();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
@ -1,11 +0,0 @@
|
|||||||
<div id="container">
|
|
||||||
<div class="h0" style="margin-top: 0; line-height:normal;">ERROR!<br /><a style="padding: 0; margin: 0; font-size: 24px; float: right;" href="/">Back</a></div>
|
|
||||||
<div id="logo_shit"></div>
|
|
||||||
<div style="clear:both"></div>
|
|
||||||
<hr />
|
|
||||||
<div style="font-size: 16pt; text-align:center">
|
|
||||||
<br />
|
|
||||||
Uh Oh, it looks like there was an error processing your request. <br />
|
|
||||||
Reason: <span style="color: red;">{{ERROR}}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
@ -1,8 +0,0 @@
|
|||||||
</div>
|
|
||||||
<div id="footer">© RaidMax</div>
|
|
||||||
</body>
|
|
||||||
<script src="https://use.fontawesome.com/9c581fe29b.js"></script>
|
|
||||||
<script>
|
|
||||||
getPages();
|
|
||||||
</script>
|
|
||||||
</html>
|
|
Binary file not shown.
Before Width: | Height: | Size: 183 KiB |
Binary file not shown.
Before Width: | Height: | Size: 110 KiB |
@ -1,12 +0,0 @@
|
|||||||
<div class="infoBox">
|
|
||||||
<div class="header">Register</div>
|
|
||||||
<div class="alertBox">
|
|
||||||
</div>
|
|
||||||
<form id="login" method="get">
|
|
||||||
<input id="username" name="username" type="text"/>
|
|
||||||
<label for="username">Username</label>
|
|
||||||
<input id="password" name="password" type="password"/>
|
|
||||||
<label for="password">Password</label>
|
|
||||||
<input id="login" value="Login" type="submit"/>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
File diff suppressed because one or more lines are too long
@ -1,106 +0,0 @@
|
|||||||
<script>
|
|
||||||
function getPlayerHistoryChart(playerHistory, i) {
|
|
||||||
///////////////////////////////////////
|
|
||||||
|
|
||||||
// thanks to canvasjs :(
|
|
||||||
playerHistory.forEach(function(item, i) {
|
|
||||||
playerHistory[i].x = new Date(playerHistory[i].x);
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
return new CanvasJS.Chart(`graph-player-history-${i}`, {
|
|
||||||
backgroundColor: "#191919",
|
|
||||||
height: 100,
|
|
||||||
animationEnabled: true,
|
|
||||||
|
|
||||||
toolTip: {
|
|
||||||
contentFormatter: function (e) {
|
|
||||||
var date = new Date(e.entries[0].dataPoint.x);
|
|
||||||
return date.toLocaleTimeString('en-US', { timeZone: 'America/New_York', hour12: true }) + " - " + e.entries[0].dataPoint.y + " players";
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
axisX: {
|
|
||||||
interval: 1,
|
|
||||||
gridThickness: 0,
|
|
||||||
lineThickness: 0,
|
|
||||||
tickThickness: 0,
|
|
||||||
margin: 0,
|
|
||||||
valueFormatString: " ",
|
|
||||||
},
|
|
||||||
|
|
||||||
axisY: {
|
|
||||||
gridThickness: 0,
|
|
||||||
lineThickness: 0,
|
|
||||||
tickThickness: 0,
|
|
||||||
minimum: 0,
|
|
||||||
margin: 0,
|
|
||||||
valueFormatString: " ",
|
|
||||||
labelMaxWidth: 0,
|
|
||||||
},
|
|
||||||
|
|
||||||
legend: {
|
|
||||||
maxWidth: 0,
|
|
||||||
maxHeight: 0,
|
|
||||||
dockInsidePlotArea: true,
|
|
||||||
},
|
|
||||||
|
|
||||||
data: [{
|
|
||||||
showInLegend: false,
|
|
||||||
type: "splineArea",
|
|
||||||
color: "rgba(0, 122, 204, 0.432)",
|
|
||||||
markerSize: 0,
|
|
||||||
dataPoints: playerHistory,
|
|
||||||
}]
|
|
||||||
});
|
|
||||||
//////////////////////////////////////
|
|
||||||
}
|
|
||||||
|
|
||||||
function getServers() {
|
|
||||||
$.getJSON("/_servers", function (result) {
|
|
||||||
|
|
||||||
$.each(result, function (i, server) {
|
|
||||||
var selectedServer = $(`#server-${i}`);
|
|
||||||
|
|
||||||
if (selectedServer.length < 1) {
|
|
||||||
$('#serverList').append(`<div id="server-${i}"><div class="serverContainer"></div></div>`);
|
|
||||||
selectedServer = $(`#server-${i}`);
|
|
||||||
selectedServer.append(`<div class="player-history" id="graph-player-history-${i}"></div><hr/><br/><br/>`)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var template =
|
|
||||||
`
|
|
||||||
<div class ="serverInfo table">
|
|
||||||
<div class ="serverTitle tableCell">${server.serverName}</div>
|
|
||||||
<div class ="serverMap tableCell">${server.mapName}</div>
|
|
||||||
<div class ="serverPlayers tableCell">${server.currentPlayers}/${server.maxPlayers}</div>
|
|
||||||
</div>
|
|
||||||
<div class ="serverChatList table">${formatMessages(server.chatHistory)}</div>
|
|
||||||
<div class ="serverPlayerList table">${formatPlayers(server.players)}</div>
|
|
||||||
<div style="clear:both;"></div>
|
|
||||||
<hr/>`;
|
|
||||||
|
|
||||||
selectedServer.find('.serverContainer').html(template);
|
|
||||||
|
|
||||||
if (!selectedServer.find(`#graph-player-history-${i}`).children().length) {
|
|
||||||
var historyGraph = getPlayerHistoryChart(server.PlayerHistory, i);
|
|
||||||
$(document).trigger("graphready", [historyGraph]);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
$(document).ready(function () {
|
|
||||||
getServers();
|
|
||||||
setInterval(getServers, 1000);
|
|
||||||
});
|
|
||||||
|
|
||||||
$(document).on("graphready", function (e, graph) {
|
|
||||||
// why is this so slow I have to call it async?
|
|
||||||
setTimeout(graph.render, 1);
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div id="serverList">
|
|
||||||
</div>
|
|
@ -1,8 +0,0 @@
|
|||||||
@media screen and (max-width: 1200px)
|
|
||||||
{
|
|
||||||
div#content { padding-left: 0; margin-left: 1em; padding-right: 0; margin-right: 1em; }
|
|
||||||
div#view { width: 100%; }
|
|
||||||
div#threadContainer { width: 90%; }
|
|
||||||
div#userInfoBox { width: 95%; }
|
|
||||||
div#userCover { width: 100%; left: 0; }
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
<div id="container">
|
|
||||||
<div class="h0" style="margin-top: 0">IW4M Admin</div><div id="logo_shit"></div>
|
|
||||||
<h1 style="margin-top: 0; text-align:center">404 Page not found!</h1>
|
|
||||||
<hr />
|
|
||||||
</div>
|
|
@ -1,58 +0,0 @@
|
|||||||
<script>
|
|
||||||
var curFrom = 0;
|
|
||||||
|
|
||||||
function getNextPage() {
|
|
||||||
curFrom += 15;
|
|
||||||
return curFrom;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getPrevPage() {
|
|
||||||
if ((curFrom - 15) >= 0) {
|
|
||||||
curFrom -= 15;
|
|
||||||
return (curFrom);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
curFrom = 0;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getPenalties(from) {
|
|
||||||
$("#penaltyList").html("");
|
|
||||||
$(".loader").fadeIn();
|
|
||||||
$.getJSON("/_penalties?from=" + from, function (result) {
|
|
||||||
$.each(result, function (i, penalty) {
|
|
||||||
$("#penaltyList").append(
|
|
||||||
"<div class=\"playerPenalty table alternate_" + i % 2 + "\"> \
|
|
||||||
<div class=\"penaltyName tableCell\"><a href=\"/players?id="+ penalty['playerID'] + "\">" + penalty['playerName'] + "</a></div> \
|
|
||||||
<div class=\"penaltyType tableCell\">"+ getColorForLevel(penalty['penaltyType'], penalty['penaltyType']) + "</div> \
|
|
||||||
<div class=\"penaltyReason tableCell\">"+ penalty['penaltyReason'] + "</div> \
|
|
||||||
<div class=\"penaltyOrigin tableCell\">"+ getColorForLevel(penalty['adminLevel'], penalty['adminName']) + "</div> \
|
|
||||||
<div class=\"penaltyTime tableCell\">"+ penalty['penaltyTime'] + "</div> \
|
|
||||||
<div class=\" penaltyRemaining tableCell\">" + penalty['Expires'] + "</div> \
|
|
||||||
</div>"
|
|
||||||
)
|
|
||||||
});
|
|
||||||
|
|
||||||
}).done(function (data) { $(".loader").fadeOut(); });
|
|
||||||
}
|
|
||||||
$(document).ready(function () {
|
|
||||||
getPenalties(0);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div class="penaltyHeader table">
|
|
||||||
<div class="penaltyName tableCell">Name</div>
|
|
||||||
<div class="penaltyType tableCell">Type</div>
|
|
||||||
<div class="penaltyReason tableCell">Reason</div>
|
|
||||||
<div class="penaltyOrigin tableCell">Admin</div>
|
|
||||||
<div class="penaltyTime tableCell">Time</div>
|
|
||||||
<div class="penaltyRemaining tableCell">Remaining</div>
|
|
||||||
</div>
|
|
||||||
<div id="penaltyList">
|
|
||||||
</div>
|
|
||||||
<hr />
|
|
||||||
<div id="paginationButtons" class="table">
|
|
||||||
<div id="previousPage" class="tableCell"><a href=# onclick="getPenalties(getPrevPage())"><<</a></div>
|
|
||||||
<div id="nextPage" class="tableCell"><a href=# onclick="getPenalties(getNextPage())">>></a></div>
|
|
||||||
</div>
|
|
@ -1,117 +0,0 @@
|
|||||||
|
|
||||||
<script>
|
|
||||||
function escapeHtml(unsafe) {
|
|
||||||
return unsafe
|
|
||||||
.replace(/&/g, "&")
|
|
||||||
.replace(/</g, "<")
|
|
||||||
.replace(/>/g, ">")
|
|
||||||
.replace(/"/g, """)
|
|
||||||
.replace(/'/g, "'");
|
|
||||||
}
|
|
||||||
|
|
||||||
var curFrom = 0;
|
|
||||||
|
|
||||||
function getNextPage() {
|
|
||||||
curFrom += 15;
|
|
||||||
return curFrom;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getPrevPage() {
|
|
||||||
if ((curFrom - 15) >= 0) {
|
|
||||||
curFrom -= 15;
|
|
||||||
return (curFrom);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
curFrom = 0;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function printPlayer(player, i) {
|
|
||||||
var p = "";
|
|
||||||
p +=
|
|
||||||
"<div class=\"playerInfo table alternate_" + i % 2 + "\"> \
|
|
||||||
<div class=\"tableCell\"><a href=\"/profile?id=" + player['playerID'] + "\">" + escapeHtml(player['playerName']) + "</a></div> \
|
|
||||||
<div class=\"tableCell\">" + getColorForLevel(player['playerLevel'], player['playerLevel']) + "</div>";
|
|
||||||
|
|
||||||
p +=
|
|
||||||
"<div class=\"tableCell alignRight\">" + checkJustNow(player['LastSeen']) + " ago</div> \
|
|
||||||
</div>";
|
|
||||||
|
|
||||||
$("#playersTable").append(p);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getPlayer(ident, identValue) {
|
|
||||||
$("#playersTable").html("");
|
|
||||||
$(".loader").fadeIn();
|
|
||||||
|
|
||||||
$.getJSON("/getplayer?" + ident + "=" + identValue, function (result) {
|
|
||||||
$.each(result, function (i, player) {
|
|
||||||
printPlayer(player, i);
|
|
||||||
});
|
|
||||||
}).done(function (data) {
|
|
||||||
$(".loader").fadeOut();
|
|
||||||
}).fail(function () {
|
|
||||||
$(".loader").fadeOut();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function getRecentPlayers(offset) {
|
|
||||||
$("#playersTable").html("");
|
|
||||||
$(".loader").fadeIn();
|
|
||||||
|
|
||||||
$.getJSON("/getplayer?recent=1&offset=" + offset, function (result) {
|
|
||||||
$.each(result, function (i, player) {
|
|
||||||
printPlayer(player, i);
|
|
||||||
});
|
|
||||||
}).done(function (data) { $(".loader").fadeOut(); })
|
|
||||||
.error(function (data) { $(".loader").fadeOut(); })
|
|
||||||
}
|
|
||||||
|
|
||||||
$(document).ready(function () {
|
|
||||||
if (parseGet('id') != "undefined")
|
|
||||||
getPlayer('id', parseGet('id'));
|
|
||||||
else if (parseGet('name') != "undefined")
|
|
||||||
getPlayer('name', parseGet('name'));
|
|
||||||
else {
|
|
||||||
getRecentPlayers(0);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#content').on('click', 'div.hiddenWrapper span', function () {
|
|
||||||
$(this).parent().find('.hiddenElements').toggle()
|
|
||||||
});
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div class="playerSearchWrap">
|
|
||||||
<input type="button" class="searchButton" name="Search" value="Search" />
|
|
||||||
<input type="text" class="search" placeholder="Player Name..." />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="contentHeader table">
|
|
||||||
<div class="contentColumn tableCell">Name</div>
|
|
||||||
<div class="contentColumn tableCell">Level</div>
|
|
||||||
<div class="contentColumn tableCell alignRight">Last Seen</div>
|
|
||||||
</div>
|
|
||||||
<div id="playersTable">
|
|
||||||
</div>
|
|
||||||
<hr />
|
|
||||||
|
|
||||||
<div id="paginationButtons" class="table">
|
|
||||||
<div id="previousPage" class="tableCell"><a href=# onclick="getRecentPlayers(getPrevPage())"><<</a></div>
|
|
||||||
<div id="nextPage" class="tableCell"><a href=# onclick="getRecentPlayers(getNextPage())">>></a></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
$('.searchButton').click(function () {
|
|
||||||
if ($('.search').val().length > 0)
|
|
||||||
getPlayer('name', $('.search').val());
|
|
||||||
});
|
|
||||||
|
|
||||||
$(document).keypress(function (e) {
|
|
||||||
if (e.which == 13) {
|
|
||||||
$('.searchButton').click();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
File diff suppressed because it is too large
Load Diff
@ -1,146 +0,0 @@
|
|||||||
<div id="stats">
|
|
||||||
<div id="stats-info">
|
|
||||||
<input type="range" min="1" max="2500" value="100" class="slider" id="KillEventCount">
|
|
||||||
<label for="KillEventCount">Showing 100 Kills</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
var killsList = [];
|
|
||||||
var refreshInterval = 250;
|
|
||||||
|
|
||||||
function drawCircle(context, x, y, color) {
|
|
||||||
context.beginPath();
|
|
||||||
context.arc(x, y, 3.5, 0, 2 * Math.PI, false);
|
|
||||||
context.fillStyle = color;
|
|
||||||
context.fill();
|
|
||||||
context.lineWidth = 0.5;
|
|
||||||
context.strokeStyle = 'rgba(255, 255, 255, 0.5)';
|
|
||||||
context.stroke();
|
|
||||||
}
|
|
||||||
|
|
||||||
function drawLine(context, x1, y1, x2, y2, color) {
|
|
||||||
context.beginPath();
|
|
||||||
context.lineWidth = '1';
|
|
||||||
|
|
||||||
var grad = context.createLinearGradient(x1, y1, x2, y2);
|
|
||||||
grad.addColorStop(0, 'rgba(0, 255, 0, 0.75)');
|
|
||||||
grad.addColorStop(0.75, 'rgba(223, 66, 244, 0.8)');
|
|
||||||
context.strokeStyle = grad;
|
|
||||||
|
|
||||||
context.moveTo(x1, y1);
|
|
||||||
context.lineTo(x2, y2);
|
|
||||||
context.stroke();
|
|
||||||
}
|
|
||||||
|
|
||||||
function clearCanvas(canvas) {
|
|
||||||
var context = canvas[0].getContext("2d");
|
|
||||||
context.clearRect(0, 0, context.canvas.width, context.canvas.height);
|
|
||||||
}
|
|
||||||
|
|
||||||
function checkCanvasSize(canvas, context, minimap, minimapInfo) {
|
|
||||||
var height = minimap.height() - minimapInfo.Top - minimapInfo.Bottom;
|
|
||||||
var width = minimap.width() - minimapInfo.Left - minimapInfo.Right;
|
|
||||||
|
|
||||||
if (context.canvas.height != height || context.canvas.width != width) {
|
|
||||||
context.canvas.height = height;
|
|
||||||
context.canvas.width = width;
|
|
||||||
|
|
||||||
canvas.css('position', 'absolute');
|
|
||||||
canvas.css('left', minimapInfo.Left + minimap.offset().left);
|
|
||||||
canvas.css('top', minimapInfo.Top + minimap.offset().top);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function drawKill(opacity, canvas, server, kill) {
|
|
||||||
var context = canvas[0].getContext("2d");
|
|
||||||
var minimapInfo = server.Minimap[0];
|
|
||||||
|
|
||||||
var calcX1 = (minimapInfo.MaxLeft - kill.KillOrigin.Y) / (minimapInfo.Width / canvas.width());
|
|
||||||
var calcY1 = (minimapInfo.MaxTop - kill.KillOrigin.X) / (minimapInfo.Height / canvas.height());
|
|
||||||
|
|
||||||
var calcX2 = (minimapInfo.MaxLeft - kill.DeathOrigin.Y) / (minimapInfo.Width / canvas.width());
|
|
||||||
var calcY2 = (minimapInfo.MaxTop - kill.DeathOrigin.X) / (minimapInfo.Height / canvas.height());
|
|
||||||
|
|
||||||
drawCircle(context, calcX1, calcY1, 'rgba(0, 122, 204, ' + opacity + ')');
|
|
||||||
drawLine(context, calcX1, calcY1, calcX2, calcY2, 'rgba(0, 255, 0, 0.1)');
|
|
||||||
drawCircle(context, calcX2, calcY2, 'rgba(255, 0, 0, ' + opacity + ')');
|
|
||||||
}
|
|
||||||
|
|
||||||
function loadKills() {
|
|
||||||
$.getJSON("/_killstats?count=" + $('#KillEventCount').val(), function (result) {
|
|
||||||
|
|
||||||
$.each(result.Servers, function (i, server) {
|
|
||||||
|
|
||||||
if (server.Minimap.length == 0) {
|
|
||||||
//console.log("missing minimap data for " + server.ServerName);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($('#minimap-overlay-' + i).length == 0) {
|
|
||||||
var html = '<div style="clear: both;"></div><div id="stats-container-' + i + '"><div class="stats-minimap-container" id="stats-minimap-' + i + '"><h2 class="datThing">' + server.ServerName + '</h2><img class="stats-minimap-image" src="/webfront/images/minimap_' + server.Minimap[0].MapName + '.png" /> </div>';
|
|
||||||
html += '<div class="stats-serverinfo"></div><canvas id="minimap-overlay-' + i + '"></canvas></div>';
|
|
||||||
$('#stats').append(html);
|
|
||||||
}
|
|
||||||
|
|
||||||
server.MapKills = server.MapKills.reverse();
|
|
||||||
|
|
||||||
var newKills = [];
|
|
||||||
var oldKills = [];
|
|
||||||
if (killsList[i] != undefined) {
|
|
||||||
newKills = server.MapKills.filter(x => killsList[i].filter(x2 => x2.ID == x.ID).length == 0);
|
|
||||||
oldKills = server.MapKills.filter(x => newKills.findIndex(x2 => x2.ID == x.ID) === -1);
|
|
||||||
}
|
|
||||||
|
|
||||||
killsList[i] = server.MapKills;
|
|
||||||
|
|
||||||
var canvas = $('#minimap-overlay-' + i);
|
|
||||||
var minimap = $('#stats-minimap-' + i + ' img');
|
|
||||||
|
|
||||||
clearCanvas(canvas);
|
|
||||||
checkCanvasSize(canvas, canvas[0].getContext("2d"), minimap, server.Minimap[0]);
|
|
||||||
|
|
||||||
var furthestKill = 0;
|
|
||||||
|
|
||||||
$.each(newKills, function (i, kill) {
|
|
||||||
if (kill.Distance > furthestKill)
|
|
||||||
furthestKill = kill.Distance;
|
|
||||||
drawKill('1', canvas, server, kill);
|
|
||||||
});
|
|
||||||
|
|
||||||
$.each(oldKills, function (i, kill) {
|
|
||||||
if (kill.Distance > furthestKill)
|
|
||||||
furthestKill = kill.Distance;
|
|
||||||
drawKill('0.35', canvas, server, kill);
|
|
||||||
});
|
|
||||||
|
|
||||||
var html = '<span>' + server.ServerInfo.Uptime + ' of uptime</span><br/><span>Round started ' + server.ServerInfo.ElapsedRoundTime + '</span><br/>';
|
|
||||||
html += '<span>Furthest kill from ' + Math.round(furthestKill * 10) / 10 + ' meters</span><br/>';
|
|
||||||
if (newKills.length > 0) {
|
|
||||||
if (newKills[0].KillerPlayer != null)
|
|
||||||
html += '<span class="last-kill">' + newKills[0].KillerPlayer + ' killed ' + newKills[0].VictimPlayer + '</span><br/>';
|
|
||||||
else
|
|
||||||
html += `<span class="last-kill">Kill information pulled from database</span><br/>`;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
html += '<span class="last-kill">' + $('#stats-container-' + i).find('.last-kill').text() + '</span><br/>';
|
|
||||||
$('#stats-container-' + i + ' .stats-serverinfo').html(html);
|
|
||||||
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
setTimeout(loadKills, refreshInterval)
|
|
||||||
}
|
|
||||||
|
|
||||||
$(document).ready(function () {
|
|
||||||
$('#KillEventCount').on('input change', function () {
|
|
||||||
$(this).next().text('Showing ' + $(this).val() + ' Kills');
|
|
||||||
if ($(this).val() > 999)
|
|
||||||
refreshInterval = 5000;
|
|
||||||
else
|
|
||||||
refreshInterval = 250;
|
|
||||||
});
|
|
||||||
|
|
||||||
loadKills();
|
|
||||||
});
|
|
||||||
</script>
|
|
@ -1,18 +1,8 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio 15
|
# Visual Studio 15
|
||||||
VisualStudioVersion = 15.0.27130.2027
|
VisualStudioVersion = 15.0.27130.2036
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Application", "Admin\Application.csproj", "{DD5DCDA2-51DB-4B1A-922F-5705546E6115}"
|
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
|
||||||
{B8C2A759-8663-4F6F-9BA4-19595F5E12C1} = {B8C2A759-8663-4F6F-9BA4-19595F5E12C1}
|
|
||||||
{AF097E6B-48D5-4452-9CCF-0A81A21F341D} = {AF097E6B-48D5-4452-9CCF-0A81A21F341D}
|
|
||||||
{4785AB75-66F3-4391-985D-63A5A049A0FA} = {4785AB75-66F3-4391-985D-63A5A049A0FA}
|
|
||||||
{428D8EB9-ECA3-4A66-AA59-3A944378C33F} = {428D8EB9-ECA3-4A66-AA59-3A944378C33F}
|
|
||||||
{C9E821BF-23AD-4CB5-B7F9-B3B99B606650} = {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}
|
|
||||||
{D51EECEB-438A-47DA-870F-7D7B41BC24D6} = {D51EECEB-438A-47DA-870F-7D7B41BC24D6}
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StatsPlugin", "Plugins\SimpleStats\StatsPlugin.csproj", "{4785AB75-66F3-4391-985D-63A5A049A0FA}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StatsPlugin", "Plugins\SimpleStats\StatsPlugin.csproj", "{4785AB75-66F3-4391-985D-63A5A049A0FA}"
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
{D51EECEB-438A-47DA-870F-7D7B41BC24D6} = {D51EECEB-438A-47DA-870F-7D7B41BC24D6}
|
{D51EECEB-438A-47DA-870F-7D7B41BC24D6} = {D51EECEB-438A-47DA-870F-7D7B41BC24D6}
|
||||||
@ -46,6 +36,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Plugins\Tests\Test
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebfrontCore", "WebfrontCore\WebfrontCore.csproj", "{65340D7D-5831-406C-ACAD-B13BA634BDE2}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebfrontCore", "WebfrontCore\WebfrontCore.csproj", "{65340D7D-5831-406C-ACAD-B13BA634BDE2}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Config", "Config", "{4101CDED-AF1E-4FCF-9194-BEA2E634016E}"
|
||||||
|
ProjectSection(SolutionItems) = preProject
|
||||||
|
Admin\Config\maps.cfg = Admin\Config\maps.cfg
|
||||||
|
Admin\Config\messages.cfg = Admin\Config\messages.cfg
|
||||||
|
Admin\Config\rules.cfg = Admin\Config\rules.cfg
|
||||||
|
Admin\Config\web.cfg = Admin\Config\web.cfg
|
||||||
|
EndProjectSection
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@ -66,38 +64,6 @@ Global
|
|||||||
Release-Stable|x86 = Release-Stable|x86
|
Release-Stable|x86 = Release-Stable|x86
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
|
||||||
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
|
||||||
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Debug|x64.ActiveCfg = Debug|x64
|
|
||||||
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Debug|x64.Build.0 = Debug|x64
|
|
||||||
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Debug|x86.ActiveCfg = Debug|x86
|
|
||||||
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Debug|x86.Build.0 = Debug|x86
|
|
||||||
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release|Mixed Platforms.ActiveCfg = Release-Stable|x86
|
|
||||||
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release|Mixed Platforms.Build.0 = Release-Stable|x86
|
|
||||||
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release|x64.ActiveCfg = Release-Nightly|x64
|
|
||||||
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release|x64.Build.0 = Release-Nightly|x64
|
|
||||||
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release|x86.ActiveCfg = Release|x86
|
|
||||||
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release|x86.Build.0 = Release|x86
|
|
||||||
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Nightly|Any CPU.ActiveCfg = Release-Nightly|Any CPU
|
|
||||||
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Nightly|Any CPU.Build.0 = Release-Nightly|Any CPU
|
|
||||||
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Nightly|Mixed Platforms.ActiveCfg = Release-Nightly|x86
|
|
||||||
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Nightly|Mixed Platforms.Build.0 = Release-Nightly|x86
|
|
||||||
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Nightly|x64.ActiveCfg = Release-Nightly|x64
|
|
||||||
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Nightly|x64.Build.0 = Release-Nightly|x64
|
|
||||||
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Nightly|x86.ActiveCfg = Release-Nightly|x86
|
|
||||||
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Nightly|x86.Build.0 = Release-Nightly|x86
|
|
||||||
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Stable|Any CPU.ActiveCfg = Release-Stable|Any CPU
|
|
||||||
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Stable|Any CPU.Build.0 = Release-Stable|Any CPU
|
|
||||||
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Stable|Mixed Platforms.ActiveCfg = Release-Stable|x86
|
|
||||||
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Stable|Mixed Platforms.Build.0 = Release-Stable|x86
|
|
||||||
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Stable|x64.ActiveCfg = Release-Stable|x64
|
|
||||||
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Stable|x64.Build.0 = Release-Stable|x64
|
|
||||||
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Stable|x86.ActiveCfg = Release-Stable|x86
|
|
||||||
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Stable|x86.Build.0 = Release-Stable|x86
|
|
||||||
{4785AB75-66F3-4391-985D-63A5A049A0FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{4785AB75-66F3-4391-985D-63A5A049A0FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{4785AB75-66F3-4391-985D-63A5A049A0FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{4785AB75-66F3-4391-985D-63A5A049A0FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{4785AB75-66F3-4391-985D-63A5A049A0FA}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
{4785AB75-66F3-4391-985D-63A5A049A0FA}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||||
@ -384,6 +350,7 @@ Global
|
|||||||
{C9E821BF-23AD-4CB5-B7F9-B3B99B606650} = {26E8B310-269E-46D4-A612-24601F16065F}
|
{C9E821BF-23AD-4CB5-B7F9-B3B99B606650} = {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}
|
||||||
|
{4101CDED-AF1E-4FCF-9194-BEA2E634016E} = {8C8F3945-0AEF-4949-A1F7-B18E952E50BC}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {84F8F8E0-1F73-41E0-BD8D-BB6676E2EE87}
|
SolutionGuid = {84F8F8E0-1F73-41E0-BD8D-BB6676E2EE87}
|
||||||
|
@ -72,14 +72,8 @@
|
|||||||
<Compile Include="Plugin.cs" />
|
<Compile Include="Plugin.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<None Include="packages.config" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PostBuildEvent>copy /Y "$(TargetDir)$(TargetName).dll" "$(SolutionDir)BUILD\plugins\"</PostBuildEvent>
|
<PostBuildEvent>copy /Y "$(TargetDir)$(TargetName).dll" "$(SolutionDir)BUILD\plugins\"</PostBuildEvent>
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<packages>
|
|
||||||
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net45" />
|
|
||||||
</packages>
|
|
@ -59,7 +59,7 @@ namespace CountryLookupProj
|
|||||||
fileInput = new FileStream(fileName, FileMode.Open, FileAccess.Read);
|
fileInput = new FileStream(fileName, FileMode.Open, FileAccess.Read);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string lookupCountryCode(string str)
|
public string LookupCountryCode(string str)
|
||||||
{
|
{
|
||||||
IPAddress addr;
|
IPAddress addr;
|
||||||
try
|
try
|
||||||
@ -70,10 +70,10 @@ namespace CountryLookupProj
|
|||||||
{
|
{
|
||||||
return "--";
|
return "--";
|
||||||
}
|
}
|
||||||
return lookupCountryCode(addr);
|
return LookupCountryCode(addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
private long addrToNum(IPAddress addr)
|
private long AddrToNum(IPAddress addr)
|
||||||
{
|
{
|
||||||
long ipnum = 0;
|
long ipnum = 0;
|
||||||
byte[] b = BitConverter.GetBytes(addr.Address);
|
byte[] b = BitConverter.GetBytes(addr.Address);
|
||||||
@ -89,12 +89,12 @@ namespace CountryLookupProj
|
|||||||
return ipnum;
|
return ipnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string lookupCountryCode(IPAddress addr)
|
public string LookupCountryCode(IPAddress addr)
|
||||||
{
|
{
|
||||||
return (countryCode[(int)SeekCountry(0, addrToNum(addr), 31)]);
|
return (countryCode[(int)SeekCountry(0, AddrToNum(addr), 31)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string lookupCountryName(string str)
|
public string LookupCountryName(string str)
|
||||||
{
|
{
|
||||||
IPAddress addr;
|
IPAddress addr;
|
||||||
try
|
try
|
||||||
@ -105,12 +105,12 @@ namespace CountryLookupProj
|
|||||||
{
|
{
|
||||||
return "a third world country";
|
return "a third world country";
|
||||||
}
|
}
|
||||||
return lookupCountryName(addr);
|
return LookupCountryName(addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string lookupCountryName(IPAddress addr)
|
public string LookupCountryName(IPAddress addr)
|
||||||
{
|
{
|
||||||
return (countryName[(int)SeekCountry(0, addrToNum(addr), 31)]);
|
return (countryName[(int)SeekCountry(0, AddrToNum(addr), 31)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
private long SeekCountry(long offset, long ipnum, int depth)
|
private long SeekCountry(long offset, long ipnum, int depth)
|
||||||
|
@ -127,7 +127,7 @@ namespace Welcome_Plugin
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
CountryLookupProj.CountryLookup CLT = new CountryLookupProj.CountryLookup("Plugins/GeoIP.dat");
|
CountryLookupProj.CountryLookup CLT = new CountryLookupProj.CountryLookup("Plugins/GeoIP.dat");
|
||||||
msg = msg.Replace("{{ClientLocation}}", CLT.lookupCountryName(joining.IPAddressString));
|
msg = msg.Replace("{{ClientLocation}}", CLT.LookupCountryName(joining.IPAddressString));
|
||||||
}
|
}
|
||||||
|
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
|
@ -74,9 +74,9 @@ namespace SharedLibrary.Database
|
|||||||
context.SaveChanges();
|
context.SaveChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
catch (Exception e)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
var a = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recreateContext)
|
if (recreateContext)
|
||||||
@ -152,9 +152,9 @@ namespace SharedLibrary.Database
|
|||||||
context.SaveChanges();
|
context.SaveChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
catch (Exception e)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
var a = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recreateContext)
|
if (recreateContext)
|
||||||
@ -208,9 +208,9 @@ namespace SharedLibrary.Database
|
|||||||
context.SaveChanges();
|
context.SaveChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
catch (Exception e)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
var a = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recreateContext)
|
if (recreateContext)
|
||||||
|
@ -206,16 +206,13 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PostBuildEvent>move "$(TargetDir)Newtonsoft.Json.dll" "$(TargetDir)lib\Newtonsoft.Json.dll"
|
<PostBuildEvent>copy /Y "$(TargetDir)$(TargetName).dll" "$(SolutionDir)BUILD\lib"
|
||||||
move "$(TargetDir)Newtonsoft.Json.dll" "$(SolutionDir)BUILD\Lib\Newtonsoft.Json.dll"
|
|
||||||
copy /Y "$(TargetDir)$(TargetName).dll" "$(SolutionDir)BUILD\lib"
|
|
||||||
copy /Y "$(TargetDir)$(TargetName).dll" "$(SolutionDir)Admin\lib"
|
copy /Y "$(TargetDir)$(TargetName).dll" "$(SolutionDir)Admin\lib"
|
||||||
copy /Y "$(TargetDir)Newtonsoft.Json.dll" "$(SolutionDir)BUILD\lib"
|
|
||||||
copy /Y "$(TargetDir)Newtonsoft.Json.dll" "$(SolutionDir)Admin\lib"
|
if not exist "$(TargetDir)x86" md "$(TargetDir)x86"
|
||||||
if not exist "$(TargetDir)x86" md "$(TargetDir)x86"
|
xcopy /s /y "$(SolutionDir)packages\Microsoft.SqlServer.Compact.4.0.8876.1\NativeBinaries\x86\*.*" "$(TargetDir)x86"
|
||||||
xcopy /s /y "$(SolutionDir)packages\Microsoft.SqlServer.Compact.4.0.8876.1\NativeBinaries\x86\*.*" "$(TargetDir)x86"
|
if not exist "$(TargetDir)amd64" md "$(TargetDir)amd64"
|
||||||
if not exist "$(TargetDir)amd64" md "$(TargetDir)amd64"
|
xcopy /s /y "$(SolutionDir)packages\Microsoft.SqlServer.Compact.4.0.8876.1\NativeBinaries\amd64\*.*" "$(TargetDir)amd64"
|
||||||
xcopy /s /y "$(SolutionDir)packages\Microsoft.SqlServer.Compact.4.0.8876.1\NativeBinaries\amd64\*.*" "$(TargetDir)amd64"
|
|
||||||
|
|
||||||
|
|
||||||
xcopy /Y /I /E "$(TargetDir)*" "$(SolutionDir)BUILD\Lib"</PostBuildEvent>
|
xcopy /Y /I /E "$(TargetDir)*" "$(SolutionDir)BUILD\Lib"</PostBuildEvent>
|
||||||
|
@ -22,14 +22,12 @@ namespace IW4MAdmin
|
|||||||
static public ApplicationManager ServerManager = ApplicationManager.GetInstance();
|
static public ApplicationManager ServerManager = ApplicationManager.GetInstance();
|
||||||
public static string OperatingDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + Path.DirectorySeparatorChar;
|
public static string OperatingDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + Path.DirectorySeparatorChar;
|
||||||
|
|
||||||
public static void Main(string[] args)
|
public static void Start()
|
||||||
{
|
{
|
||||||
AppDomain.CurrentDomain.SetData("DataDirectory", OperatingDirectory);
|
AppDomain.CurrentDomain.SetData("DataDirectory", OperatingDirectory);
|
||||||
System.Diagnostics.Process.GetCurrentProcess().PriorityClass = System.Diagnostics.ProcessPriorityClass.BelowNormal;
|
System.Diagnostics.Process.GetCurrentProcess().PriorityClass = System.Diagnostics.ProcessPriorityClass.BelowNormal;
|
||||||
|
|
||||||
Version = 1.6;
|
Version = 1.6;
|
||||||
handler = new ConsoleEventDelegate(OnProcessExit);
|
|
||||||
SetConsoleCtrlHandler(handler, true);
|
|
||||||
|
|
||||||
//double.TryParse(CheckUpdate(), out double latestVersion);
|
//double.TryParse(CheckUpdate(), out double latestVersion);
|
||||||
Console.WriteLine("=====================================================");
|
Console.WriteLine("=====================================================");
|
||||||
@ -49,7 +47,6 @@ namespace IW4MAdmin
|
|||||||
Task.Run(() =>
|
Task.Run(() =>
|
||||||
{
|
{
|
||||||
ServerManager.Start();
|
ServerManager.Start();
|
||||||
/*
|
|
||||||
String userInput;
|
String userInput;
|
||||||
Player Origin = ServerManager.GetClientService().Get(1).Result.AsPlayer();
|
Player Origin = ServerManager.GetClientService().Get(1).Result.AsPlayer();
|
||||||
|
|
||||||
@ -68,7 +65,7 @@ namespace IW4MAdmin
|
|||||||
ServerManager.Servers[0].ExecuteEvent(E);
|
ServerManager.Servers[0].ExecuteEvent(E);
|
||||||
Console.Write('>');
|
Console.Write('>');
|
||||||
|
|
||||||
} while (ServerManager.Running);*/
|
} while (ServerManager.Running);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -80,43 +77,11 @@ namespace IW4MAdmin
|
|||||||
Console.ReadKey();
|
Console.ReadKey();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static ConsoleEventDelegate handler;
|
|
||||||
|
|
||||||
static private bool OnProcessExit(int e)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
ServerManager.Stop();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private delegate bool ConsoleEventDelegate(int eventType);
|
|
||||||
[DllImport("kernel32.dll", SetLastError = true)]
|
|
||||||
private static extern bool SetConsoleCtrlHandler(ConsoleEventDelegate callback, bool add);
|
|
||||||
|
|
||||||
static void CheckDirectories()
|
static void CheckDirectories()
|
||||||
{
|
{
|
||||||
string curDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + Path.DirectorySeparatorChar;
|
string curDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + Path.DirectorySeparatorChar;
|
||||||
if (!Directory.Exists($"{curDirectory}Lib"))
|
|
||||||
throw new Exception("Lib folder does not exist");
|
|
||||||
|
|
||||||
if (!Directory.Exists($"{curDirectory}Config"))
|
if (!Directory.Exists($"{curDirectory}Config"))
|
||||||
{
|
{
|
@ -28,8 +28,6 @@ namespace IW4MAdmin
|
|||||||
List<AsyncStatus> TaskStatuses;
|
List<AsyncStatus> TaskStatuses;
|
||||||
List<Command> Commands;
|
List<Command> Commands;
|
||||||
List<MessageToken> MessageTokens;
|
List<MessageToken> MessageTokens;
|
||||||
//WebService WebSvc;
|
|
||||||
Thread WebThread;
|
|
||||||
ClientService ClientSvc;
|
ClientService ClientSvc;
|
||||||
AliasService AliasSvc;
|
AliasService AliasSvc;
|
||||||
PenaltyService PenaltySvc;
|
PenaltyService PenaltySvc;
|
||||||
@ -221,7 +219,7 @@ namespace IW4MAdmin
|
|||||||
}
|
}
|
||||||
#if !DEBUG
|
#if !DEBUG
|
||||||
foreach (var S in Servers)
|
foreach (var S in Servers)
|
||||||
S.Broadcast("^1IW4MAdmin going offline!");
|
S.Broadcast("^1IW4MAdmin going offline!").Wait();
|
||||||
#endif
|
#endif
|
||||||
_servers.Clear();
|
_servers.Clear();
|
||||||
//WebSvc.WebScheduler.Stop();
|
//WebSvc.WebScheduler.Stop();
|
@ -21,7 +21,7 @@ namespace WebfrontCore
|
|||||||
.AddEnvironmentVariables();
|
.AddEnvironmentVariables();
|
||||||
Configuration = builder.Build();
|
Configuration = builder.Build();
|
||||||
|
|
||||||
IW4MAdmin.Program.Main(null);
|
IW4MAdmin.Program.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IConfigurationRoot Configuration { get; }
|
public IConfigurationRoot Configuration { get; }
|
||||||
|
@ -3,18 +3,24 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net452</TargetFramework>
|
<TargetFramework>net452</TargetFramework>
|
||||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
<PreserveCompilationContext>true</PreserveCompilationContext>
|
||||||
<AssemblyName>WebfrontCore</AssemblyName>
|
<AssemblyName>IW4MAdmin</AssemblyName>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<PackageId>WebfrontCore</PackageId>
|
<PackageId>WebfrontCore</PackageId>
|
||||||
<Platforms>AnyCPU;x86</Platforms>
|
<Platforms>AnyCPU;x86</Platforms>
|
||||||
|
<ApplicationIcon>wwwroot\favicon.ico</ApplicationIcon>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
<PlatformTarget>x86</PlatformTarget>
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Remove="Application\Kayak.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="App.config" />
|
<None Include="App.config" />
|
||||||
|
<None Include="Application\Kayak.cs" />
|
||||||
<None Update="wwwroot\**\*">
|
<None Update="wwwroot\**\*">
|
||||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||||
</None>
|
</None>
|
||||||
@ -49,9 +55,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Admin\Application.csproj">
|
|
||||||
<Private>true</Private>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\SharedLibrary\SharedLibrary.csproj">
|
<ProjectReference Include="..\SharedLibrary\SharedLibrary.csproj">
|
||||||
<Private>true</Private>
|
<Private>true</Private>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
@ -63,8 +66,8 @@
|
|||||||
</Content>
|
</Content>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||||
<Exec Command="xcopy /Y "$(SolutionDir)BUILD\Plugins" "$(TargetDir)Plugins\"" />
|
<Exec Command="xcopy /Y "$(SolutionDir)BUILD\Plugins" "$(TargetDir)Plugins\"
xcopy /Y /I /E "$(SolutionDir)BUILD\Lib" "$(TargetDir)"" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
Loading…
Reference in New Issue
Block a user