internal static ServerModel Create(ThwargLauncher.GameManagement.ServerPersister.ServerData data) { ServerModel server = new ServerModel(); server.ServerId = data.ServerId; server.ServerName = data.ServerName; server.ServerAlias = data.ServerAlias; server.ServerDescription = data.ServerDesc; server.ServerIpAndPort = data.ConnectionString; server.GameApiUrl = data.GameApiUrl; server.LoginServerUrl = data.LoginServerUrl; server.DiscordUrl = data.DiscordUrl; server.WebsiteUrl = data.WebsiteUrl; server.EMU = data.EMU; server.RodatSetting = data.RodatSetting; server.SecureSetting = data.SecureSetting; server.VisibilitySetting = data.VisibilitySetting; server.ServerSource = data.ServerSource; server.ConnectionStatus = "?"; server.ConnectionColor = System.Windows.Media.Brushes.AntiqueWhite; server.UpStatus = ServerUpStatusEnum.Unknown; server.StatusOfflineIntervalSeconds = 15; server.StatusOnlineIntervalSeconds = 300; return(server); }
internal bool IsEqual(ThwargLauncher.GameManagement.ServerPersister.ServerData data) { if (ServerName != data.ServerName) { return(false); } if (ServerIpAndPort != data.ConnectionString) { return(false); } if (ServerId != data.ServerId) { return(false); } // using exact Id match, not just equivalent data return(true); }