示例#1
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);
            }
        }
示例#2
0
        private static void AddOrUpdateServer(GameManagement.ServerPersister.ServerData servdata)
        {
            var existing = ServerList.FirstOrDefault(s => s.IsEqual(servdata));

            if (existing != null)
            {
                existing.ServerName        = servdata.ServerName;
                existing.ServerDescription = servdata.ServerDesc;
                existing.ServerIpAndPort   = servdata.ConnectionString;
                existing.RodatSetting      = servdata.RodatSetting;
                existing.VisibilitySetting = servdata.VisibilitySetting;
                existing.EMU = servdata.EMU;
            }
            else
            {
                ServerModel model = ServerModel.Create(servdata);
                ServerList.Add(model);
            }
        }