@model SharedLibraryCore.Dtos.ServerInfo @{ Layout = null; int half = (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++) { 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 < Model.ClientCount; i++) { 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))
} } }