Example #1
0
        public static void LoadServerLists()
        {
            try
            {
                string folder              = GetServerDataFolder();
                var    persister           = new GameManagement.ServerPersister(folder);
                var    publishedGDLServers = persister.GetPublishedGDLServerList();
                var    publishedAceServers = persister.GetPublishedACEServerList();
                var    userServers         = persister.ReadUserServers();

                var servers = new List <GameManagement.ServerPersister.ServerData>();
                servers.AddRange(publishedGDLServers);
                servers.AddRange(publishedAceServers);
                servers.AddRange(userServers);
                var distinctServers = servers.Distinct().ToList();
                foreach (var sdata in distinctServers)
                {
                    AddOrUpdateServer(sdata);
                }
                IsLoaded = true;
            }
            catch (Exception exc)
            {
                Logger.WriteError("Unable to Load server list: " + exc.ToString());
            }
        }
Example #2
0
        internal static void SaveServerListToDisk()
        {
            var userServers = ServerList.Where(s => s.ServerSource != ServerModel.ServerSourceEnum.Published);

            var persister = new GameManagement.ServerPersister(GetServerDataFolder());

            persister.WriteServerListToFile(userServers);
        }
Example #3
0
        private void LoadServers()
        {
            _serverModels.Clear();
            var persister = new GameManagement.ServerPersister(ServerManager.GetServerDataFolder());

            var allServers       = persister.GetWildWestServerList();
            var availableServers = allServers.Where(q => !IsInOurServers(q));

            foreach (var servdata in availableServers)
            {
                ServerModel model = ServerModel.Create(servdata);
                _serverModels.Add(model);
            }
        }