fixed bug with lifetime hit ratio causing erroneous ban
ip lookup on profile shows error if failed truncate chat messages over 50 characters removed html raw on client messages :c show client rank colors on server overview if authorized break long messages on profile page prevent masked status showing up to non privileged users in webfront
This commit is contained in:
@ -45,7 +45,7 @@ namespace WebfrontCore.Controllers
|
||||
var administeredPenaltiesMeta = await Manager.GetPenaltyService()
|
||||
.ReadGetClientPenaltiesAsync(client.ClientId, false);
|
||||
|
||||
if (client.Level > SharedLibrary.Objects.Player.Permission.Trusted)
|
||||
if (Authorized && client.Level > SharedLibrary.Objects.Player.Permission.Trusted)
|
||||
clientDto.Meta.Add(new ProfileMeta()
|
||||
{
|
||||
Key = "Masked",
|
||||
|
@ -30,7 +30,8 @@ namespace WebfrontCore.Controllers
|
||||
Players = s.Players.Where(p => p != null).Select(p => new PlayerInfo
|
||||
{
|
||||
Name = p.Name,
|
||||
ClientId = p.ClientId
|
||||
ClientId = p.ClientId,
|
||||
Level = p.Level.ToString()
|
||||
}).ToList(),
|
||||
ChatHistory = s.ChatHistory.OrderBy(c => c.Time).Take((int)Math.Ceiling(s.ClientNum / 2.0)).ToArray(),
|
||||
PlayerHistory = s.PlayerHistory.ToArray()
|
||||
|
@ -8,7 +8,7 @@
|
||||
@{
|
||||
for (int i = 0; i < Model.ChatHistory.Length; i++)
|
||||
{
|
||||
string message = "– " + @Model.ChatHistory[i].Message;
|
||||
string message = @Model.ChatHistory[i].Message;
|
||||
if (Model.ChatHistory[i].Message == "CONNECTED")
|
||||
{
|
||||
<span class="text-light"><span class="oi oi-account-login mr-2 text-success"> </span>@Model.ChatHistory[i].Name</span><br />
|
||||
@ -20,7 +20,7 @@
|
||||
}
|
||||
if (Model.ChatHistory[i].Message != "CONNECTED" && Model.ChatHistory[i].Message != "DISCONNECTED")
|
||||
{
|
||||
<span class="text-light">@Model.ChatHistory[i].Name</span><span> @Html.Raw(@message) </span><br />
|
||||
<span class="text-light">@Model.ChatHistory[i].Name</span><span> — @message.Substring(0, Math.Min(50, message.Length - 1)) </span><br />
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -31,7 +31,8 @@
|
||||
@{
|
||||
for (int i = 0; i < half; i++)
|
||||
{
|
||||
<span>@Html.ActionLink(Model.Players[i].Name, "ProfileAsync", "Client", new { id = Model.Players[i].ClientId })</span><br />
|
||||
string levelColorClass = !ViewBag.Authorized ? "" : $"level-color-{Model.Players[i].Level.ToLower()}";
|
||||
<span>@Html.ActionLink(Model.Players[i].Name, "ProfileAsync", "Client", new { id = Model.Players[i].ClientId }, new { @class=levelColorClass })</span><br />
|
||||
}
|
||||
}
|
||||
</div>
|
||||
@ -39,7 +40,8 @@
|
||||
@{
|
||||
for (int i = half; i < Model.ClientCount; i++)
|
||||
{
|
||||
<span>@Html.ActionLink(Model.Players[i].Name, "ProfileAsync", "Client", new { id = Model.Players[i].ClientId })</span><br />
|
||||
string levelColorClass = !ViewBag.Authorized ? "" : $"level-color-{Model.Players[i].Level.ToLower()}";
|
||||
<span>@Html.ActionLink(Model.Players[i].Name, "ProfileAsync", "Client", new { id = Model.Players[i].ClientId }, new { @class = levelColorClass })</span><br />
|
||||
}
|
||||
}
|
||||
</div>
|
||||
|
@ -46,6 +46,7 @@
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<!-- Main Modal -->
|
||||
<div class="modal fade" id="mainModal" tabindex="-1" role="dialog" aria-labelledby="mainModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content bg-dark">
|
||||
@ -60,6 +61,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Main Modal -->
|
||||
|
||||
<!-- Action Modal -->
|
||||
<div class="modal fade" id="actionModal" tabindex="-1" role="dialog" aria-labelledby="actionModalLabel" aria-hidden="true">
|
||||
|
@ -3,14 +3,14 @@
|
||||
}
|
||||
|
||||
.level-color-user, .level-color-guest {
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
color: rgba(255, 255, 255, 0.7);
|
||||
}
|
||||
|
||||
.level-bgcolor-user, .level-bgcolor-guest {
|
||||
background-color: rgba(255, 255, 255, 0.85);
|
||||
}
|
||||
|
||||
.level-color-trusted, .level-color-user {
|
||||
.level-color-trusted {
|
||||
color: rgba(116,147,99,1);
|
||||
}
|
||||
|
||||
@ -158,3 +158,7 @@
|
||||
.profile-action:hover {
|
||||
opacity: 0.75;
|
||||
}
|
||||
|
||||
#profile_events span {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
@ -57,12 +57,17 @@ $(document).ready(function () {
|
||||
const ip = $(this).data("ip");
|
||||
$.getJSON("http://ip-api.com/json/" + ip)
|
||||
.done(function (response) {
|
||||
$('.modal-title').text(ip);
|
||||
$('.modal-body').text("");
|
||||
$('.modal-body').append("ASN — " + response["as"] + "<br/>");
|
||||
$('.modal-body').append("ISP — " + response["isp"] + "<br/>");
|
||||
$('.modal-body').append("Organization — " + response["org"] + "<br/>");
|
||||
$('.modal-body').append("Location — " + response["city"] + ", " + response["regionName"] + ", " + response["country"] + "<br/>");
|
||||
$('#mainModal .modal-title').text(ip);
|
||||
$('#mainModal .modal-body').text("");
|
||||
$('#mainModal .modal-body').append("ASN — " + response["as"] + "<br/>");
|
||||
$('#mainModal .modal-body').append("ISP — " + response["isp"] + "<br/>");
|
||||
$('#mainModal .modal-body').append("Organization — " + response["org"] + "<br/>");
|
||||
$('#mainModal .modal-body').append("Location — " + response["city"] + ", " + response["regionName"] + ", " + response["country"] + "<br/>");
|
||||
$('#mainModal').modal();
|
||||
})
|
||||
.fail(function (jqxhr, textStatus, error) {
|
||||
$('#mainModal .modal-title').text("Error");
|
||||
$('#mainModal .modal-body').html('<span class="text-danger">—'+ error + '</span>');
|
||||
$('#mainModal').modal();
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user