protected void Page_Load(object sender, EventArgs e) { IGameServerContainerDiagnostics gameContainerDiag = GameServerContainer.Instance; ContainerDiagInfo gameContainerDiagInfo = gameContainerDiag.GetContainerDiagInfo(); GameServerDiagInfo gameServerDiagInfo = gameContainerDiag.GetDiagInfo(); BindGameServerDiagInfo(gameContainerDiagInfo, gameServerDiagInfo); DDLMatchNumber.DataSource = MatchServer.Containers.Select(kvp => kvp.Key).ToArray(); DDLMatchNumber.DataBind(); if (!string.IsNullOrEmpty(DDLMatchNumber.SelectedValue)) { MatchServerPanel.Visible = true; IMatchServerContainerDiagnostics matchContainerDiag = MatchServer.Containers.Where(kvp => kvp.Key == new Guid(DDLMatchNumber.SelectedValue)).Select(kvp => kvp.Value).FirstOrDefault(); ContainerDiagInfo matchContainerDiagInfo = matchContainerDiag.GetContainerDiagInfo(); MatchServerDiagInfo matchServerDiagInfo = matchContainerDiag.GetDiagInfo(); BindMatchServerDiagInfo(matchContainerDiagInfo, matchServerDiagInfo); } else { MatchServerPanel.Visible = false; } }
protected override void UpdateDiagInfo() { base.UpdateDiagInfo(); IGameServerDiagnostics diag = (IGameServerDiagnostics)m_gameServer; m_gameServerDiagInfo = diag.GetDiagInfo(); }
private void BindGameServerDiagInfo(ContainerDiagInfo diagInfo, GameServerDiagInfo gsDiagInfo) { GSConnections.Text = diagInfo.ConnectionsCount.ToString(); GSRegisteredClients.Text = diagInfo.RegisteredClientsCount.ToString(); GSIsMainThreadRunning.Text = diagInfo.IsMainThreadRunning.ToString(); GSISecondaryThreadRunning.Text = diagInfo.IsSecondaryThreadRunning.ToString(); GSActiveReplays.Text = gsDiagInfo.ActiveReplaysCount.ToString(); GSClientsJoinedToRooms.Text = gsDiagInfo.ClientsJoinedToRoomsCount.ToString(); GSCreatedRooms.Text = gsDiagInfo.CreatedRoomsCount.ToString(); GSClientsWithPlayers.Text = gsDiagInfo.ClinetsWithPlayersCount.ToString(); GSLoggedInPlayers.Text = gsDiagInfo.LoggedInPlayersCount.ToString(); GSLoggedInBots.Text = gsDiagInfo.LoggedInBotsCount.ToString(); GSRunningMatches.Text = gsDiagInfo.RunningMatchesCount.ToString(); }