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

Added AfterPublish commands to copy files to the right directory on publish

fixed profile name not being centered if no aliases
removed old build event command lines
This commit is contained in:
RaidMax
2018-03-24 23:32:54 -05:00
parent 995d861a42
commit dc13ce7050
11 changed files with 72 additions and 64 deletions

View File

@ -88,9 +88,6 @@ namespace IW4MAdmin
{
string curDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + Path.DirectorySeparatorChar;
if (!Directory.Exists($"{curDirectory}Logs"))
Directory.CreateDirectory($"{curDirectory}Logs");
if (!Directory.Exists($"{curDirectory}Plugins"))
Directory.CreateDirectory($"{curDirectory}Plugins");
}

View File

@ -46,7 +46,7 @@ namespace IW4MAdmin
private ApplicationManager()
{
Logger = new Logger($@"{Utilities.OperatingDirectory}Logs{Path.DirectorySeparatorChar}IW4MAdmin.log");
Logger = new Logger($@"{Utilities.OperatingDirectory}IW4MAdmin.log");
_servers = new List<Server>();
Commands = new List<Command>();
TaskStatuses = new List<AsyncStatus>();
@ -82,7 +82,6 @@ namespace IW4MAdmin
.ToList();
#endregion
#region CONFIG
var config = ConfigHandler.Configuration();
if (config?.Servers == null)
@ -246,8 +245,6 @@ namespace IW4MAdmin
S.Broadcast("^1IW4MAdmin going offline!").Wait();
#endif
_servers.Clear();
//WebSvc.WebScheduler.Stop();
//WebSvc.SchedulerThread.Join();
}

View File

@ -31,7 +31,7 @@ namespace IW4MAdmin
override public async Task<bool> AddPlayer(Player polledPlayer)
{
if (/*polledPlayer.Ping == 999 ||*/ polledPlayer.Ping < 1 || polledPlayer.ClientNumber > (MaxClients) || polledPlayer.ClientNumber < 0)
if (polledPlayer.Ping == 999 || polledPlayer.Ping < 1 || polledPlayer.ClientNumber > (MaxClients) || polledPlayer.ClientNumber < 0)
{
//Logger.WriteDebug($"Skipping client not in connected state {P}");
return true;

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<PublishProvider>FileSystem</PublishProvider>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>x86</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<ProjectGuid>65340d7d-5831-406c-acad-b13ba634bde2</ProjectGuid>
<publishUrl>D:\IW4M-Admin\Publish</publishUrl>
<DeleteExistingFiles>False</DeleteExistingFiles>
<TargetFramework>net452</TargetFramework>
<RuntimeIdentifier>win7-x86</RuntimeIdentifier>
</PropertyGroup>
</Project>

View File

@ -2,6 +2,7 @@
@{
string match = System.Text.RegularExpressions.Regex.Match(Model.Name.ToUpper(), "[A-Z]").Value;
string shortCode = match == string.Empty ? "?" : match;
string marginClass = Model.Aliases.Count > 0 ? "mr-4" : "";
}
<div id="profile_wrapper" class="row d-flex d-sm-inline-flex justify-content-center justify-content-left pb-3">
<div class="mr-auto ml-auto ml-sm-0 mr-sm-0">
@ -12,7 +13,7 @@
<div id="profile_info" class="text-center text-sm-left pr-3 pl-3">
<div id="profile_name">
<h1>
<span class="client-name mr-4">
<span class="client-name @marginClass">
@Model.Name
@if (Model.Aliases.Count > 0 || ViewBag.Authorized)
{

View File

@ -67,12 +67,12 @@
</div>
<environment names="Development">
<script type="text/javascript" src="~/lib/jQuery/dist/jquery.js"></script>
<script type="text/javascript" src="~/lib/popper.js/dist/popper.js"></script>
<!--<script type="text/javascript" src="~/lib/popper.js/dist/popper.js"></script>-->
<script type="text/javascript" src="~/lib/bootstrap/dist/js/bootstrap.js"></script>
</environment>
<environment names="Production">
<script type="text/javascript" src="~/lib/jQuery/dist/jquery.min.js"></script>
<script type="text/javascript" src="~/lib/popper.js/dist/popper.min.js"></script>
<!--<script type="text/javascript" src="~/lib/popper.js/dist/popper.min.js"></script>-->
<script type="text/javascript" src="~/lib/bootstrap/dist/js/bootstrap.min.js"></script>
</environment>
@RenderSection("scripts", required: false)

View File

@ -19,10 +19,6 @@
<OutputPath>bin\x86\Debug\</OutputPath>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Application\Kayak.cs" />
</ItemGroup>
<ItemGroup>
<None Update="wwwroot\**\*">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
@ -45,12 +41,13 @@
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="1.1.3" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
<Exec Command="$(ProjectDir)..\AfterPublish.bat &quot;$(ProjectDir)..\&quot;" />
</Target>
<ItemGroup>
@ -69,8 +66,7 @@
</Content>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="xcopy /Y &quot;$(SolutionDir)BUILD\Plugins&quot; &quot;$(TargetDir)Plugins\&quot;&#xD;&#xA;" />
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Exec Command="if not &quot;$(SolutionDir)&quot;==&quot;*Undefined*&quot; (&#xD;&#xA; xcopy /Y &quot;$(SolutionDir)BUILD\Plugins&quot; &quot;$(TargetDir)Plugins\&quot;&#xD;&#xA;)" />
</Target>
</Project>