fixed initialization error when no map set exists in config

fixed discord link showing when no invite specified
OpenGraph image set to absolute url
more changes to killcallback and logging
fixed some angle conversion stuff
This commit is contained in:
RaidMax
2018-03-25 23:51:25 -05:00
parent 77bf0710df
commit 979b1f2310
14 changed files with 316 additions and 268 deletions

View File

@ -46,6 +46,7 @@ namespace IW4MAdmin
return true;
}
#if !DEBUG
if (polledPlayer.Name.Length < 3)
{
Logger.WriteDebug($"Kicking {polledPlayer} because their name is too short");
@ -76,6 +77,7 @@ namespace IW4MAdmin
return false;
}
#endif
Logger.WriteDebug($"Client slot #{polledPlayer.ClientNumber} now reserved");
try
@ -656,7 +658,7 @@ namespace IW4MAdmin
LogFile = new IFile(logPath);
//#else
}
// LogFile = new RemoteFile("https://raidmax.org/IW4MAdmin/getlog.php");
LogFile = new RemoteFile("https://raidmax.org/IW4MAdmin/getlog.php");
//#endif
Logger.WriteInfo($"Log file is {logPath}");
#if !DEBUG

View File

@ -23,7 +23,10 @@ namespace WebfrontCore.Controllers
ViewBag.Authorized = Authorized;
ViewBag.Url = Startup.Configuration["Web:Address"];
string inviteLink = Manager.GetApplicationSettings().Configuration().DiscordInviteCode;
ViewBag.DiscordLink = inviteLink != null && inviteLink.Contains("http") ? inviteLink : $"https://discordapp.com/invite/{inviteLink}";
if (inviteLink != null)
ViewBag.DiscordLink = inviteLink.Contains("https") ? inviteLink : $"https://discordapp.com/invite/{inviteLink}";
else
ViewBag.DiscorLink = "";
base.OnActionExecuting(context);
}
}

View File

@ -24,7 +24,7 @@ namespace WebfrontCore.Controllers
public async Task<IActionResult> ListAsync(int offset = 0)
{
return View("_List", offset);
return await Task.FromResult(View("_List", offset));
}
public async Task<IActionResult> PublicAsync()

View File

@ -20,6 +20,22 @@
<span id="profile_aliases_btn" class="oi oi-caret-bottom pl-2"></span>
}
@{
if (ViewBag.Authorized)
{
if (Model.Level == SharedLibrary.Objects.Player.Permission.User.ToString())
{
<span id="profile_action_ban_btn" class="oi oi-ban text-danger" title="ban" aria-hidden="true"></span>
}
if (Model.Level == SharedLibrary.Objects.Player.Permission.Banned.ToString())
{
<span id="profile_action_unban_btn" class="iconic iconic-carriage-return text-success" title="carriage return" aria-hidden="true"></span>
}
}
}
</span>
</h1>
<div id="profile_aliases" class="pr-0 pr-sm-4 pb-2 mb-2 text-muted">

View File

@ -2,5 +2,5 @@
ViewData["Title"] = "Error";
}
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>
<h3 class="text-danger">Sorry!</h3>
<h4 class="text-danger">An error occurred while processing your request.</h4>

View File

@ -6,7 +6,7 @@
<title>@ViewBag.Title | IW4MAdmin</title>
<meta property="og:title" content="@ViewBag.Title | IW4MAdmin">
<meta property="og:type" content="website">
<meta property="og:image" content="/images/icon.png">
<meta property="og:image" content="@ViewBag.Url/images/icon.png">
<meta property="og:description" content="@ViewBag.Description">
<meta property="og:url" content="@ViewBag.Url">
<meta name="description" content="@ViewBag.Description">