force bots to all use the same profile

use C# 7.1 for projects
This commit is contained in:
RaidMax 2019-05-04 09:17:18 -05:00
parent db11a5f480
commit 43c4d4af38
16 changed files with 17 additions and 15 deletions

View File

@ -34,6 +34,7 @@
<TieredCompilation>true</TieredCompilation>
<AssemblyVersion>2.2.7.1</AssemblyVersion>
<FileVersion>2.2.7.1</FileVersion>
<LangVersion>7.1</LangVersion>
</PropertyGroup>
<ItemGroup>

View File

@ -579,7 +579,6 @@ namespace IW4MAdmin.Application
}
#endregion
}
private async Task SendHeartbeat(object state)
{
var heartbeatState = (HeartbeatState)state;

View File

@ -215,7 +215,7 @@ namespace IW4MAdmin
var existingClient = GetClientsAsList().FirstOrDefault(_client => _client.Equals(E.Origin));
// they're already connected
if (existingClient != null)
if (existingClient != null && !E.Origin.IsBot)
{
Logger.WriteWarning($"detected preconnect for {E.Origin}, but they are already connected");
return false;

View File

@ -159,12 +159,6 @@ namespace IW4MAdmin.Application.RconParsers
State = EFClient.ClientState.Connecting
};
//// they've not fully connected yet
//if (!client.IsBot && ping == 999)
//{
// continue;
//}
StatusPlayers.Add(client);
}
}

View File

@ -3,10 +3,11 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<LangVersion>7.1</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SyndicationFeed.ReaderWriter" Version="1.0.2"/>
<PackageReference Include="Microsoft.SyndicationFeed.ReaderWriter" Version="1.0.2" />
</ItemGroup>
<ItemGroup>
@ -14,8 +15,8 @@
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)BUILD\Plugins&quot;"/>
<Exec Command="copy &quot;$(TargetDir)Microsoft.SyndicationFeed.ReaderWriter.dll&quot; &quot;$(SolutionDir)BUILD\Plugins&quot;"/>
<Exec Command="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)BUILD\Plugins&quot;" />
<Exec Command="copy &quot;$(TargetDir)Microsoft.SyndicationFeed.ReaderWriter.dll&quot; &quot;$(SolutionDir)BUILD\Plugins&quot;" />
</Target>
</Project>

View File

@ -7,6 +7,7 @@
<ApplicationIcon />
<StartupObject />
<Configurations>Debug;Release;Prerelease</Configurations>
<LangVersion>7.1</LangVersion>
</PropertyGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">

View File

@ -11,6 +11,7 @@
<Company>Forever None</Company>
<Product>Login Plugin for IW4MAdmin</Product>
<Configurations>Debug;Release;Prerelease</Configurations>
<LangVersion>7.1</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

View File

@ -13,6 +13,7 @@
<Description>Warns and kicks players for using profanity</Description>
<Copyright>2018</Copyright>
<Configurations>Debug;Release;Prerelease</Configurations>
<LangVersion>7.1</LangVersion>
</PropertyGroup>
<ItemGroup>

View File

@ -13,6 +13,7 @@
<Description>Client Statistics Plugin for IW4MAdmin</Description>
<Copyright>2018</Copyright>
<Configurations>Debug;Release;Prerelease</Configurations>
<LangVersion>7.1</LangVersion>
</PropertyGroup>
<ItemGroup>

View File

@ -6,6 +6,7 @@
<RuntimeFrameworkVersion>2.2.2</RuntimeFrameworkVersion>
<ApplicationIcon />
<StartupObject />
<LangVersion>7.1</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

View File

@ -4,6 +4,7 @@
<RazorCompileOnBuild Condition="'$(CONFIG)'!='Debug'">true</RazorCompileOnBuild>
<RazorCompiledOnPublish Condition="'$(CONFIG)'!='Debug'">true</RazorCompiledOnPublish>
<Configurations>Debug;Release;Prerelease</Configurations>
<LangVersion>7.1</LangVersion>
</PropertyGroup>
<ItemGroup>

View File

@ -13,6 +13,7 @@
<Description>Welcome plugin for IW4MAdmin welcomes clients to the server</Description>
<Copyright>2018</Copyright>
<Configurations>Debug;Release;Prerelease</Configurations>
<LangVersion>7.1</LangVersion>
</PropertyGroup>
<ItemGroup>

View File

@ -730,7 +730,7 @@ namespace SharedLibraryCore.Database.Models
public override int GetHashCode()
{
return (int)NetworkId;
return IsBot ? ClientNumber : (int)NetworkId;
}
}
}

View File

@ -12,6 +12,7 @@
<Company>Forever None</Company>
<Configurations>Debug;Release;Prerelease</Configurations>
<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
<LangVersion>7.1</LangVersion>
</PropertyGroup>
<ItemGroup>

View File

@ -270,7 +270,6 @@ namespace SharedLibraryCore
{
str = str.Substring(0, Math.Min(str.Length, 16));
var bot = Regex.Match(str, @"bot[0-9]+").Value;
int maxBots = 18;
// this is a special case for Plutonium T6
if (str.Length <= 11 &&
@ -285,8 +284,7 @@ namespace SharedLibraryCore
else if (!string.IsNullOrEmpty(bot))
{
// should set their GUID to the negation of their 1 based index (-1 - -18)
id = -(Convert.ToInt64(bot.Substring(3)) + 1) % maxBots;
id = -1;
}
if (id == 0)

View File

@ -27,6 +27,7 @@
<PropertyGroup>
<ServerGarbageCollection>true</ServerGarbageCollection>
<TieredCompilation>true</TieredCompilation>
<LangVersion>7.1</LangVersion>
</PropertyGroup>
<ItemGroup>