private void ServerResponded(gameserveritem_t server) { Debug.Log("AutoJoin: Server ping succeeded"); Debug.Log("Starting dedicated client"); SteamDSConfig.isDedicatedServer = false; CoopPeerStarter.DedicatedHost = false; SteamClientDSConfig.isDedicatedClient = true; string[] array = server.GetGameTags().Split(new char[] { ';' }); string guid = (array == null || array.Length <= 0) ? string.Empty : array[0]; SteamClientDSConfig.Guid = guid; SteamClientDSConfig.Server = server; SteamClientDSConfig.serverAddress = server.m_NetAdr.GetConnectionAddressString(); if (!string.IsNullOrEmpty(this.invitedToPassword)) { SteamClientDSConfig.password = SteamDSConfig.PasswordToHash(this.invitedToPassword); } else { SteamClientDSConfig.password = string.Empty; } SteamClientDSConfig.adminPassword = string.Empty; SteamClientDSConfig.EndPoint = UdpEndPoint.Parse(SteamClientDSConfig.serverAddress); }
public void OnClientConnectDs(gameserveritem_t server) { bool flag = server.m_nPlayers >= server.m_nMaxPlayers; string[] array = server.GetGameTags().Split(new char[] { ';' }); string item = (array == null || array.Length <= 0) ? string.Empty : array[0]; string a = (array == null || array.Length <= 1) ? "-1" : array[1]; bool flag2 = a != "__E3C26D06F07B6AB14EC25F4823E9A30D6B4ED0450527C1E768739D96C9F061AE"; if (flag2 || flag) { this._joinDsScreen._adminPassword.gameObject.SetActive(false); this._joinDsScreen._password.gameObject.SetActive(false); this._joinDsScreen._newButtonLabel.transform.parent.gameObject.SetActive(false); this._joinDsScreen._continueButtonLabel.transform.parent.gameObject.SetActive(false); } else { this._joinDsScreen._newButtonLabel.transform.parent.gameObject.SetActive(true); if (this.PreviouslyPlayedServers.Contains(item)) { this._joinDsScreen._continueButtonLabel.transform.parent.gameObject.SetActive(true); this._joinDsScreen._continueButtonLabel.text = UiTranslationDatabase.TranslateKey("CONTINUE", "Continue", this._allCapsTexts); } else { this._joinDsScreen._continueButtonLabel.transform.parent.gameObject.SetActive(false); } this._joinDsScreen._adminPassword.gameObject.SetActive(true); this._joinDsScreen._password.gameObject.SetActive(server.m_bPassword); } this._joinDsScreen._prefabDbVersionMissmatch.SetActive(flag2); this._joinDsScreen._prefabServerIsFull.SetActive(flag && !flag2); this._joinDsScreen._serverName.text = server.GetServerName(); this.JoiningServer = server; this._joinDsScreen._ip.text = server.m_NetAdr.GetConnectionAddressString(); if (this._joinDsScreen._ping) { this._joinDsScreen._ping.text = server.m_nPing + "ms"; } this._joinDsScreen._playerLimit.text = StringEx.TryFormat("{0} / {1}", new object[] { server.m_nPlayers, server.m_nMaxPlayers }); this._joinDsScreen._password.value = string.Empty; this._joinDsScreen._adminPassword.value = string.Empty; this.OpenScreen(CoopSteamNGUI.Screens.JoinDS); }
private void ProcessServerResponded(HServerListRequest hRequest, int iServer) { this.listCount++; gameserveritem_t serverDetails = SteamMatchmakingServers.GetServerDetails(hRequest, iServer); if (serverDetails.m_nAppID == 242760u || serverDetails.m_nAppID == 556450u) { MpDedicatedServerRow mpDedicatedServerRow = UnityEngine.Object.Instantiate <MpDedicatedServerRow>(this._rowPrefab); mpDedicatedServerRow.transform.parent = this._mainUI._gameBrowserScreenDS._grid.transform; mpDedicatedServerRow.transform.localScale = this._rowPrefab.transform.localScale; mpDedicatedServerRow.gameObject.SetActive(true); this._previusInstantiateServerRowIsFinished = true; mpDedicatedServerRow._gameName.text = serverDetails.GetServerName(); mpDedicatedServerRow._ip.text = serverDetails.m_NetAdr.GetConnectionAddressString(); mpDedicatedServerRow._ping.text = serverDetails.m_nPing + "ms"; mpDedicatedServerRow._VACProtected.SetActive(serverDetails.m_bSecure); mpDedicatedServerRow._passwordProtected.SetActive(serverDetails.m_bPassword); mpDedicatedServerRow.Server = serverDetails; mpDedicatedServerRow._playerLimit.text = string.Format("{0} / {1}", serverDetails.m_nPlayers, serverDetails.m_nMaxPlayers); this._rows.Add(mpDedicatedServerRow); string[] array = serverDetails.GetGameTags().Split(new char[] { ';' }); string item = (array == null || array.Length <= 0) ? string.Empty : array[0]; string a = (array == null || array.Length <= 1) ? "-1" : array[1]; bool flag = a != "__F486E3E06B8E13E0388571BE0FDC8A35182D8BE83E9256BA53BC5FBBDBCF23BC"; mpDedicatedServerRow._versionMismatch = flag; mpDedicatedServerRow._prefabDbVersionMissmatch.SetActive(flag); mpDedicatedServerRow._previousPlayed = this._mainUI.PreviouslyPlayedServers.Contains(item); mpDedicatedServerRow.RefreshName(this._sortOptions); bool flag2 = !string.IsNullOrEmpty(this._mainUI._gameBrowserScreenDS._filter.value); if (flag2) { string value = this._mainUI._gameBrowserScreenDS._filter.value.ToLowerInvariant(); bool flag3 = mpDedicatedServerRow._gameName.text.ToLowerInvariant().Contains(value); if (mpDedicatedServerRow.gameObject.activeSelf != flag3) { mpDedicatedServerRow.transform.parent = ((!flag3) ? this._mainUI._gameBrowserScreenDS._grid.transform.parent : this._mainUI._gameBrowserScreenDS._grid.transform); mpDedicatedServerRow.gameObject.SetActive(flag3); } } else if (!mpDedicatedServerRow.gameObject.activeSelf) { mpDedicatedServerRow.transform.parent = this._mainUI._gameBrowserScreenDS._grid.transform; mpDedicatedServerRow.gameObject.SetActive(true); } this._mainUI._gameBrowserScreenDS._grid.repositionNow = true; this._mainUI._gameBrowserScreenDS._scrollview.UpdateScrollbars(); } }
public void FromGameServerItem(gameserveritem_t item) { serverID = item.m_steamID; serverName = item.GetServerName(); serverDescription = item.GetGameDescription(); mapName = item.GetMap(); isPasswordProtected = item.m_bPassword; isVAC = item.m_bSecure; maxPlayerCount = item.m_nMaxPlayers; currentPlayerCount = item.m_nPlayers; botPlayers = item.m_nBotPlayers; ping = item.m_nPing; serverVersion = item.m_nServerVersion; tags = item.GetGameTags(); address = item.m_NetAdr; lastTimePlayed = SteamUtilities.ConvertUnixDate(item.m_ulTimeLastPlayed); }
private void ProcessServerData(gameserveritem_t server) { this._processedServers++; MpDedicatedServerRow row = this.GetRow(); row._gameName.text = server.GetServerName(); row._ping.text = server.m_nPing + "ms"; if (row._passwordProtected.activeSelf != server.m_bPassword) { row._passwordProtected.SetActive(server.m_bPassword); } row.Server = server; row._playerLimit.text = string.Format("{0} / {1}", server.m_nPlayers, server.m_nMaxPlayers); this._rows.Add(row); string[] array = server.GetGameTags().Split(new char[] { ';' }); string item = (array == null || array.Length <= 0) ? string.Empty : array[0]; string a = (array == null || array.Length <= 1) ? "-1" : array[1]; bool flag = a != "__E3C26D06F07B6AB14EC25F4823E9A30D6B4ED0450527C1E768739D96C9F061AE"; row._versionMismatch = flag; if (row._prefabDbVersionMissmatch.activeSelf != flag) { row._prefabDbVersionMissmatch.SetActive(flag); } row._previousPlayed = this._mainUI.PreviouslyPlayedServers.Contains(item); row.RefreshName(this._sortOptions); bool flag2 = !string.IsNullOrEmpty(this._lastFilterValue); if (flag2) { bool flag3 = row._gameName.text.ToLowerInvariant().Contains(this._lastFilterValue); if (row.gameObject.activeInHierarchy != flag3) { row.transform.SetParent((!flag3) ? this._offGridRows.transform : this._mainUI._gameBrowserScreenDS._grid.transform); } } else if (!row.gameObject.activeInHierarchy) { row.transform.SetParent(this._mainUI._gameBrowserScreenDS._grid.transform); } }
// Token: 0x06000975 RID: 2421 RVA: 0x00045884 File Offset: 0x00043A84 private void OnServerResponded(HServerListRequest request, int iServer) { gameserveritem_t serverDetails = SteamMatchmakingServers.GetServerDetails(request, iServer); string serverName = serverDetails.GetServerName(); ServerData serverData = new ServerData(); serverData.m_name = serverName; serverData.m_steamHostAddr.SetIPv4(serverDetails.m_NetAdr.GetIP(), serverDetails.m_NetAdr.GetConnectionPort()); serverData.m_password = serverDetails.m_bPassword; serverData.m_players = serverDetails.m_nPlayers; serverData.m_version = serverDetails.GetGameTags(); this.m_dedicatedServers.Add(serverData); this.m_updateTriggerAccumulator++; if (this.m_updateTriggerAccumulator > 100) { this.m_updateTriggerAccumulator = 0; this.m_serverListRevision++; } }
private string GameServerItemFormattedString(gameserveritem_t gsi) { return("m_NetAdr: " + gsi.m_NetAdr.GetConnectionAddressString() + "\n" + "m_nPing: " + gsi.m_nPing + "\n" + "m_bHadSuccessfulResponse: " + gsi.m_bHadSuccessfulResponse + "\n" + "m_bDoNotRefresh: " + gsi.m_bDoNotRefresh + "\n" + "m_szGameDir: " + gsi.GetGameDir() + "\n" + "m_szMap: " + gsi.GetMap() + "\n" + "m_szGameDescription: " + gsi.GetGameDescription() + "\n" + "m_nAppID: " + gsi.m_nAppID + "\n" + "m_nPlayers: " + gsi.m_nPlayers + "\n" + "m_nMaxPlayers: " + gsi.m_nMaxPlayers + "\n" + "m_nBotPlayers: " + gsi.m_nBotPlayers + "\n" + "m_bPassword: "******"\n" + "m_bSecure: " + gsi.m_bSecure + "\n" + "m_ulTimeLastPlayed: " + gsi.m_ulTimeLastPlayed + "\n" + "m_nServerVersion: " + gsi.m_nServerVersion + "\n" + "m_szServerName: " + gsi.GetServerName() + "\n" + "m_szGameTags: " + gsi.GetGameTags() + "\n" + "m_steamID: " + gsi.m_steamID + "\n"); }
public void OnClientContinueGameDS(gameserveritem_t server) { Debug.Log("Starting dedicated client"); SteamDSConfig.isDedicatedServer = false; CoopPeerStarter.DedicatedHost = false; SteamClientDSConfig.isDedicatedClient = true; string[] array = server.GetGameTags().Split(new char[] { ';' }); string guid = (array == null || array.Length <= 0) ? string.Empty : array[0]; SteamClientDSConfig.Guid = guid; SteamClientDSConfig.Server = server; SteamClientDSConfig.serverAddress = server.m_NetAdr.GetConnectionAddressString(); if (!string.IsNullOrEmpty(this._joinDsScreen._password.value)) { SteamClientDSConfig.password = SteamDSConfig.PasswordToHash(this._joinDsScreen._password.value); this._joinDsScreen._password.value = string.Empty; } else { SteamClientDSConfig.password = string.Empty; } if (!string.IsNullOrEmpty(this._joinDsScreen._adminPassword.value)) { SteamClientDSConfig.adminPassword = SteamDSConfig.PasswordToHash(this._joinDsScreen._adminPassword.value); this._joinDsScreen._adminPassword.value = string.Empty; } else { SteamClientDSConfig.adminPassword = string.Empty; } SteamClientDSConfig.EndPoint = UdpEndPoint.Parse(SteamClientDSConfig.serverAddress); GameSetup.SetInitType(InitTypes.Continue); UnityEngine.Object.Destroy(base.gameObject); SceneManager.LoadScene("SteamStartSceneDedicatedServer_Client"); }
// Token: 0x06003089 RID: 12425 RVA: 0x0013EC70 File Offset: 0x0013D070 public SteamServerInfo(gameserveritem_t data) { this._steamID = data.m_steamID; this._ip = data.m_NetAdr.GetIP(); this._port = data.m_NetAdr.GetConnectionPort(); this._name = data.GetServerName(); if (OptionsSettings.filter) { this._name = ChatManager.filter(this.name); } this._map = data.GetMap(); string gameTags = data.GetGameTags(); if (gameTags.Length > 0) { this._isPvP = (gameTags.IndexOf("PVP") != -1); this._hasCheats = (gameTags.IndexOf("CHEATS") != -1); this._isWorkshop = (gameTags.IndexOf("WORK") != -1); if (gameTags.IndexOf("EASY") != -1) { this._mode = EGameMode.EASY; } else if (gameTags.IndexOf("HARD") != -1) { this._mode = EGameMode.HARD; } else { this._mode = EGameMode.NORMAL; } if (gameTags.IndexOf("FIRST") != -1) { this._cameraMode = ECameraMode.FIRST; } else if (gameTags.IndexOf("THIRD") != -1) { this._cameraMode = ECameraMode.THIRD; } else if (gameTags.IndexOf("BOTH") != -1) { this._cameraMode = ECameraMode.BOTH; } else { this._cameraMode = ECameraMode.VEHICLE; } if (gameTags.IndexOf("GOLDONLY") != -1) { this._isPro = true; } else { this._isPro = false; } this.IsBattlEyeSecure = (gameTags.IndexOf("BATTLEYE_ON") != -1); int num = gameTags.IndexOf(",GAMEMODE:"); int num2 = gameTags.IndexOf(",", num + 1); if (num != -1 && num2 != -1) { num += 10; this.gameMode = gameTags.Substring(num, num2 - num); } else { this.gameMode = null; } } else { this._isPvP = true; this._hasCheats = false; this._mode = EGameMode.NORMAL; this._cameraMode = ECameraMode.FIRST; this._isPro = true; this.IsBattlEyeSecure = false; this.gameMode = null; } this._ping = data.m_nPing; this._players = data.m_nPlayers; this._maxPlayers = data.m_nMaxPlayers; this._isPassworded = data.m_bPassword; this.IsVACSecure = data.m_bSecure; }