Example #1
0
 internal bool IsEqual(SteelBotLauncher.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);
 }
Example #2
0
        internal static ServerModel Create(SteelBotLauncher.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.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);
        }