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