@model SharedLibraryCore.Dtos.ServerInfo @{ Layout = null; int half = Model.ClientCount == 0 || Model.Players.Count == 0 ? 0 : (int)Math.Ceiling(Model.ClientCount / 2.0); }
@{ for (int i = 0; i < Model.ChatHistory.Count; i++) { if (Model.ChatHistory[i] == null || Model.ChatHistory[i].Message == null || Model.ChatHistory[i].Name == null) { continue; } if (Model.ChatHistory[i].Message == "CONNECTED") { @Model.ChatHistory[i].Name
} if (Model.ChatHistory[i].Message == "DISCONNECTED") { @Model.ChatHistory[i].Name
} if (Model.ChatHistory[i].Message != "CONNECTED" && Model.ChatHistory[i].Message != "DISCONNECTED") { @Model.ChatHistory[i].Name — @Model.ChatHistory[i].Message.Substring(0, Math.Min(65, Model.ChatHistory[i].Message.Length))
} } }
@{ for (int i = 0; i < half; i++) { if (i > Model.Players.Count - 1) { continue; } string levelColorClass = !ViewBag.Authorized ? "" : $"level-color-{Model.Players[i].LevelInt}"; @Html.ActionLink(Model.Players[i].Name, "ProfileAsync", "Client", new { id = Model.Players[i].ClientId }, new { @class = levelColorClass })
} }
@{ for (int i = half; i < Math.Min(Model.ClientCount, Model.Players.Count); i++) { if (i > Model.Players.Count - 1) { continue; } string levelColorClass = !ViewBag.Authorized ? "" : $"level-color-{Model.Players[i].LevelInt}"; @Html.ActionLink(Model.Players[i].Name, "ProfileAsync", "Client", new { id = Model.Players[i].ClientId }, new { @class = levelColorClass })
} }
@if (Model.ChatHistory.Count > 0) {
}
@{ for (int i = 0; i < Model.ChatHistory.Count; i++) { if (Model.ChatHistory[i] == null || Model.ChatHistory[i].Message == null || Model.ChatHistory[i].Name == null) { continue; } if (Model.ChatHistory[i].Message == "CONNECTED") { @Model.ChatHistory[i].Name
} if (Model.ChatHistory[i].Message == "DISCONNECTED") { @Model.ChatHistory[i].Name
} if (Model.ChatHistory[i].Message != "CONNECTED" && Model.ChatHistory[i].Message != "DISCONNECTED") { @Model.ChatHistory[i].Name — @Model.ChatHistory[i].Message.Substring(0, Math.Min(65, Model.ChatHistory[i].Message.Length))
} } }