1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

update projects to .NET Core 2.0.7

added instance and client count to api page
removed vestigial ConfigGenerator
This commit is contained in:
RaidMax
2018-04-23 16:03:50 -05:00
parent 5ef9b98a5c
commit 3918985406
18 changed files with 98 additions and 85 deletions

View File

@ -1,4 +1,5 @@
using SharedLibraryCore.Interfaces;
using System;
using System.Collections.Generic;
namespace SharedLibraryCore.Configuration
@ -6,7 +7,7 @@ namespace SharedLibraryCore.Configuration
public class ServerConfiguration : IBaseConfiguration
{
public string IPAddress { get; set; }
public short Port { get; set; }
public ushort Port { get; set; }
public string Password { get; set; }
public List<string> Rules { get; set; }
public List<string> AutoMessages { get; set; }
@ -16,11 +17,34 @@ namespace SharedLibraryCore.Configuration
public IBaseConfiguration Generate()
{
UseT6MParser = Utilities.PromptBool(Utilities.CurrentLocalization.LocalizationSet["SETUP_SERVER_USET6M"]);
var loc = Utilities.CurrentLocalization.LocalizationSet;
while (string.IsNullOrEmpty(IPAddress))
{
string input = Utilities.PromptString(loc["SETUP_SERVER_IP"]);
if (System.Net.IPAddress.TryParse(input, out System.Net.IPAddress ip))
IPAddress = input;
}
while(Port < 1)
{
string input = Utilities.PromptString(loc["SETUP_SERVER_PORT"]);
if (UInt16.TryParse(input, System.Globalization.NumberStyles.Integer, System.Globalization.CultureInfo.CurrentCulture, out ushort port))
Port = port;
}
Password = Utilities.PromptString(loc["SETUP_SERVER_RCON"]);
AutoMessages = new List<string>();
Rules = new List<string>();
UseT6MParser = Utilities.PromptBool(loc["SETUP_SERVER_USET6M"]);
if (!UseT6MParser)
UseIW5MParser = Utilities.PromptBool(Utilities.CurrentLocalization.LocalizationSet["SETUP_SERVER_USEIW5M"]);
UseIW5MParser = Utilities.PromptBool(loc["SETUP_SERVER_USEIW5M"]);
if (UseIW5MParser)
ManualLogPath = Utilities.PromptString(Utilities.CurrentLocalization.LocalizationSet["SETUP_SERVER_MANUALLOG"]);
ManualLogPath = Utilities.PromptString(loc["SETUP_SERVER_MANUALLOG"]);
return this;
}

View File

@ -23,6 +23,10 @@
<PackageReference Include="SimpleCrypto.NetCore" Version="1.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="Microsoft.NETCore.App" Version="2.0.7" />
</ItemGroup>
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Exec Command="if not exist &quot;$(SolutionDir)BUILD&quot; (&#xD;&#xA;md &quot;$(SolutionDir)BUILD&quot;&#xD;&#xA;)&#xD;&#xA;if not exist &quot;$(SolutionDir)BUILD\Plugins&quot; (&#xD;&#xA;md &quot;$(SolutionDir)BUILD\Plugins&quot;&#xD;&#xA;)" />
</Target>