private void AttachToProfileCore(ServerProfile profile) { UnregisterForUpdates(); this.ProfileSnapshot = new RuntimeProfileSnapshot { InstallDirectory = profile.InstallDirectory, QueryPort = profile.ServerPort, ServerConnectionPort = profile.ServerConnectionPort, ServerIP = String.IsNullOrWhiteSpace(profile.ServerIP) ? IPAddress.Loopback.ToString() : profile.ServerIP, LastInstalledVersion = profile.LastInstalledVersion, ProfileName = profile.ProfileName, RCONEnabled = profile.RCONEnabled, RCONPort = profile.RCONPort, ServerName = profile.ServerName, ServerArgs = profile.GetServerArgs(), AdminPassword = profile.AdminPassword }; Version lastInstalled; if (Version.TryParse(profile.LastInstalledVersion, out lastInstalled)) { this.Version = lastInstalled; } RegisterForUpdates(); }
private void AttachToProfileCore(ServerProfile profile) { UnregisterForUpdates(); this.ProfileSnapshot = new RuntimeProfileSnapshot { ProfileName = profile.ProfileName, InstallDirectory = profile.InstallDirectory, AltSaveDirectoryName = profile.AltSaveDirectoryName, AdminPassword = profile.AdminPassword, ServerName = profile.ServerName, ServerArgs = profile.GetServerArgs(), ServerIP = String.IsNullOrWhiteSpace(profile.ServerIP) ? IPAddress.Loopback.ToString() : profile.ServerIP, ServerConnectionPort = profile.ServerConnectionPort, QueryPort = profile.ServerPort, UseRawSockets = profile.UseRawSockets, RCONEnabled = profile.RCONEnabled, RCONPort = profile.RCONPort, SotFServer = profile.SOTF_Enabled, ServerMap = ServerProfile.GetProfileMapName(profile), ServerMapModId = ServerProfile.GetProfileMapModId(profile), TotalConversionModId = profile.TotalConversionModId ?? string.Empty, ServerModIds = ModUtils.GetModIdList(profile.ServerModIds), LastInstalledVersion = string.IsNullOrWhiteSpace(profile.LastInstalledVersion) ? new Version(0, 0).ToString() : profile.LastInstalledVersion, }; Version lastInstalled; if (Version.TryParse(profile.LastInstalledVersion, out lastInstalled)) { this.Version = lastInstalled; } RegisterForUpdates(); }