public static IGameMode Create(EGameMode mode) { switch (mode) { case EGameMode.LastOneStanding: return(new LastOneStandingModel()); case EGameMode.TimedBattle: return(new TimedBattleModel()); } Debug.LogError(string.Format("Unhandled game mode: {0}", mode.ToString())); return(null); }
public void refreshMasterServer(ESteamServerList list, string filterMap, EPassword filterPassword, EWorkshop filterWorkshop, EPlugins filterPlugins, EAttendance filterAttendance, EVACProtectionFilter filterVACProtection, EBattlEyeProtectionFilter filterBattlEyeProtection, bool filterPro, ECombat filterCombat, ECheats filterCheats, EGameMode filterMode, ECameraMode filterCamera) { this._currentList = list; if (this.onMasterServerRemoved != null) { this.onMasterServerRemoved(); } this.cleanupServerListRequest(); this._serverList = new List <SteamServerInfo>(); if (list == ESteamServerList.HISTORY) { this.serverListRequest = SteamMatchmakingServers.RequestHistoryServerList(Provider.APP_ID, new MatchMakingKeyValuePair_t[0], 0u, this.serverListResponse); return; } if (list == ESteamServerList.FAVORITES) { this.serverListRequest = SteamMatchmakingServers.RequestFavoritesServerList(Provider.APP_ID, new MatchMakingKeyValuePair_t[0], 0u, this.serverListResponse); return; } if (list == ESteamServerList.LAN) { this.serverListRequest = SteamMatchmakingServers.RequestLANServerList(Provider.APP_ID, this.serverListResponse); return; } this.filters = new List <MatchMakingKeyValuePair_t>(); MatchMakingKeyValuePair_t item = default(MatchMakingKeyValuePair_t); item.m_szKey = "gamedir"; item.m_szValue = "unturned"; this.filters.Add(item); if (filterMap.Length > 0) { MatchMakingKeyValuePair_t item2 = default(MatchMakingKeyValuePair_t); item2.m_szKey = "map"; item2.m_szValue = filterMap.ToLower(); this.filters.Add(item2); } if (filterAttendance == EAttendance.EMPTY) { MatchMakingKeyValuePair_t item3 = default(MatchMakingKeyValuePair_t); item3.m_szKey = "noplayers"; item3.m_szValue = "1"; this.filters.Add(item3); } else if (filterAttendance == EAttendance.SPACE) { MatchMakingKeyValuePair_t item4 = default(MatchMakingKeyValuePair_t); item4.m_szKey = "notfull"; item4.m_szValue = "1"; this.filters.Add(item4); MatchMakingKeyValuePair_t item5 = default(MatchMakingKeyValuePair_t); item5.m_szKey = "hasplayers"; item5.m_szValue = "1"; this.filters.Add(item5); } MatchMakingKeyValuePair_t item6 = default(MatchMakingKeyValuePair_t); item6.m_szKey = "gamedataand"; if (filterPassword == EPassword.YES) { item6.m_szValue = "PASS"; } else if (filterPassword == EPassword.NO) { item6.m_szValue = "SSAP"; } if (filterVACProtection == EVACProtectionFilter.Secure) { item6.m_szValue += ","; item6.m_szValue += "VAC_ON"; MatchMakingKeyValuePair_t item7 = default(MatchMakingKeyValuePair_t); item7.m_szKey = "secure"; item7.m_szValue = "1"; this.filters.Add(item7); } else if (filterVACProtection == EVACProtectionFilter.Insecure) { item6.m_szValue += ","; item6.m_szValue += "VAC_OFF"; } item6.m_szValue += ","; item6.m_szValue += Provider.APP_VERSION; this.filters.Add(item6); MatchMakingKeyValuePair_t item8 = default(MatchMakingKeyValuePair_t); item8.m_szKey = "gametagsand"; if (filterWorkshop == EWorkshop.YES) { item8.m_szValue = "WORK"; } else if (filterWorkshop == EWorkshop.NO) { item8.m_szValue = "KROW"; } if (filterCombat == ECombat.PVP) { item8.m_szValue += ",PVP"; } else if (filterCombat == ECombat.PVE) { item8.m_szValue += ",PVE"; } if (filterCheats == ECheats.YES) { item8.m_szValue += ",CHEATS"; } else if (filterCheats == ECheats.NO) { item8.m_szValue += ",STAEHC"; } if (filterMode != EGameMode.ANY) { item8.m_szValue = item8.m_szValue + "," + filterMode.ToString(); } if (filterCamera != ECameraMode.ANY) { item8.m_szValue = item8.m_szValue + "," + filterCamera.ToString(); } if (filterPro) { item8.m_szValue += ",GOLDONLY"; } else { item8.m_szValue += ",YLNODLOG"; } if (filterBattlEyeProtection == EBattlEyeProtectionFilter.Secure) { item8.m_szValue += ",BATTLEYE_ON"; } else if (filterBattlEyeProtection == EBattlEyeProtectionFilter.Insecure) { item8.m_szValue += ",BATTLEYE_OFF"; } this.filters.Add(item8); if (list == ESteamServerList.INTERNET) { this.serverListRequest = SteamMatchmakingServers.RequestInternetServerList(Provider.APP_ID, this.filters.ToArray(), (uint)this.filters.Count, this.serverListResponse); return; } if (list == ESteamServerList.FRIENDS) { this.serverListRequest = SteamMatchmakingServers.RequestFriendsServerList(Provider.APP_ID, this.filters.ToArray(), (uint)this.filters.Count, this.serverListResponse); return; } }
public override string ToString() { return(HostName + " ; " + LevelName + " ; " + GameMode.ToString()); }