Exemplo n.º 1
0
        private async void CheckForUpdate()
        {
            try
            {
                var latest = await GitHub.CheckForUpdate("adnanc", "HDT.Plugins.MetaDetector", Version);

                if (latest != null)
                {
                    //_MainWindow.newVersionAvailable();
                    //VersionWindow newVersion = new VersionWindow();
                    //newVersion.Show();
                    string pluginDLL = Path.Combine(Config.Instance.DataDir, @"Plugins\MetaDetector\MetaDetector.tmp");

                    using (WebClient wc = new WebClient())
                    {
                        wc.DownloadFileCompleted += (wc_DownloadFileCompleted);
                        wc.DownloadFileAsync(new Uri("https://s3.amazonaws.com/metadetector/MetaDetector.dll"), pluginDLL);
                    }
                }
            }
            catch (Exception ex)
            {
                MetaLog.Error(ex);
            }
        }
Exemplo n.º 2
0
        internal async Task <string> sendCardStats()
        {
            try
            {
                MetaLog.Info("Uploading Game to MetaStats.net ...", "sendRequest");

                string url = "http://metastats.net/metadetector/stats.php?a=Stats&v=0.0.2";


                string postData = GetCardStats();

                if (postData != "")
                {
                    WebClient client = new WebClient();
                    byte[]    data   = Encoding.UTF8.GetBytes(postData);
                    //byte[] data = Compress.Zip(postData);
                    Uri uri      = new Uri(url);
                    var response = Encoding.UTF8.GetString(await client.UploadDataTaskAsync(uri, "POST", data));

                    MetaLog.Info("Game Upload Done", "sendRequest");

                    return(response);
                }

                return(null);
            }
            catch (Exception ex)
            {
                MetaLog.Error(ex);
                return(null);
            }
        }
Exemplo n.º 3
0
        internal void GameStart()
        {
            try
            {
                //MetaLog.Info("Opponent Class: " + Core.Game.MatchInfo.OpposingPlayer.Name, "GameStart");
                MetaLog.Info("Game Mode: " + Core.Game.CurrentGameMode, "GameStart");
                MetaLog.Info("Game Format: " + Core.Game.CurrentFormat, "GameStart");
                MetaLog.Info("Region: " + Core.Game.CurrentRegion, "GameStart");
                MetaLog.Info("Mode: " + Core.Game.CurrentMode, "GameStart");

                _trackOpponentCards.Clear();
                _trackPlayerCards.Clear();

                if (_validGameMode)
                {
                    _opponentTurnCount = 0;
                    _playerTurnCount   = 0;

                    MetaLog.Info("New Game Started. Waiting for opponent to play cards.", "GameStart");
                }
            }
            catch (Exception ex)
            {
                MetaLog.Error(ex);
            }
        }
        private void LoadMetaDecks()
        {
            try
            {
                if (checkNewVersion())
                {
                    return;
                }

                if (File.Exists(_deckFilename))
                {
                    _metaDecks = XmlManager <List <Deck> > .Load(_deckFilename);

                    _matchedDecks = new List <Deck>(_metaDecks);

                    //_mainWindow.updateDeckList(_metaDecks);
                    //Log.Info(code.ToString());
                }
                else
                {
                    if (!Directory.Exists(_deckDirectory))
                    {
                        Directory.CreateDirectory(_deckDirectory);
                    }

                    DownloadMetaFile();
                    //_metaDecks.Clear();
                    //XmlManager<List<Deck>>.Save(_deckFilename, _metaDecks);
                }
            }
            catch (Exception ex)
            {
                MetaLog.Error(ex);
            }
        }
        public bool checkNewVersion()
        {
            try
            {
                string   currentVersion = _appConfig.currentVersion;
                DateTime lastCheck      = _appConfig.lastCheck;

                if ((DateTime.Now - lastCheck).TotalDays > 3)
                {
                    MetaLog.Info("Checking for new version of Meta File");
                    WebClient client        = new WebClient();
                    String    versionNumber = client.DownloadString("http://ec2-54-88-223-252.compute-1.amazonaws.com/metaversion.php");

                    if (versionNumber.Trim() != "")
                    {
                        if (versionNumber != currentVersion)
                        {
                            DownloadMetaFile();

                            _appConfig.currentVersion = versionNumber;
                            _appConfig.lastCheck      = DateTime.Now;
                            _appConfig.Save();
                            return(true);
                        }
                    }
                }

                return(false);
            }
            catch (Exception ex)
            {
                MetaLog.Error(ex);
                return(false);
            }
        }
Exemplo n.º 6
0
        public void PlayerHeroPower()
        {
            try
            {
                CardInfo temp = new CardInfo();

                temp.cardId       = "HERO_POWER";
                temp.cardName     = "Hero Power";
                temp.turn         = Convert.ToInt16(Math.Ceiling(Core.Game.GameEntity.GetTag(GameTag.TURN) / 2.0));
                temp.mana         = Core.Game.OpponentEntity.GetTag(GameTag.RESOURCES);
                temp.manaOverload = Core.Game.OpponentEntity.GetTag(GameTag.OVERLOAD_OWED);
                temp.activePlayer = "Player";

                _trackPlayerCards.Add((_playerTurnCount * 500), temp);

                /*_cardsPlayed.Add("HERO_POWER", Convert.ToInt16(Math.Ceiling(Core.Game.GameEntity.GetTag(GameTag.TURN) / 2.0)), false, -1, false, -1,
                 *  Core.Game.MatchInfo.OpposingPlayer.StandardRank, Core.Game.MatchInfo.OpposingPlayer.StandardLegendRank, Core.Game.MatchInfo.LocalPlayer.StandardRank,
                 *  Core.Game.MatchInfo.LocalPlayer.StandardLegendRank, Core.Game.MatchInfo.RankedSeasonId,
                 *  "Hero Power", Core.Game.PlayerEntity.GetTag(GameTag.RESOURCES), Core.Game.PlayerEntity.GetTag(GameTag.OVERLOAD_OWED), "Player");
                 */
                MetaLog.Info("Turn " + _playerTurnCount + ": Player Hero Power", "PlayerHeroPower");
            }
            catch (Exception ex)
            {
                MetaLog.Error(ex);
            }
        }
Exemplo n.º 7
0
        public MetaStats(MetaConfig conf)
        {
            try
            {
                //_mainWindow = new OpDeckWindow();

                _appConfig           = conf;
                _opponentCardsPlayed = new List <Card>();
                bool showBubble = false;

                if (showBubble)
                {
                    try
                    {
                        NotificationWindow notify = new NotificationWindow();
                        notify.Show();
                    }
                    catch (Exception ex)
                    {
                        MetaLog.Error(ex);
                    }
                }

                MetaLog.Initialize();

                MetaLog.Info("Meta Stats Initialized", "MetaStats");
            }
            catch (Exception ex)
            {
                MetaLog.Error(ex);
            }
        }
Exemplo n.º 8
0
 private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
 {
     try
     {
         System.Diagnostics.Process.Start(e.Uri.ToString());
     }
     catch (Exception ex)
     {
         MetaLog.Error(ex);
     }
 }
Exemplo n.º 9
0
 public void PlayerDraw(Card c)
 {
     try
     {
         updatePlayerHandCards();
         //Core.Game.Player.PlayerCardList.Where(x => !x.IsCreated).ToDictionary( g=>g.Id, g=>g.Count);
     }
     catch (Exception ex)
     {
         MetaLog.Error(ex);
     }
 }
 public void OnButtonPress()
 {
     try
     {
         SettingsWindow wndSettings = new SettingsWindow(_appConfig.userKey);
         wndSettings.Show();
     }
     catch (Exception ex)
     {
         MetaLog.Error(ex);
     }
 }
        private void updateDecks()
        {
            if (_validGameMode)
            {
                try
                {
                    List <Deck> displayDecks = new List <Deck>();

                    if (_opponentCardCount > 0)
                    {
                        displayDecks = matchMetaDeck();

                        if (_matchedDecks.Count == 0 || _matchedDecks == null)
                        {
                            _mainWindow.updateText("No Decks Found.", Brushes.IndianRed);
                            return;
                        }
                        else if (_matchedDecks.Count > 0)
                        {
                            //_mainWindow.updateCardsCount(Core.Game.Opponent.RevealedEntities.Where(x => (x.IsInDeck || x.IsMinion || x.IsSpell || x.IsWeapon) && !x.Info.Created && !x.Info.Stolen).Count());
                            _mainWindow.updateCardsCount(Core.Game.Opponent.OpponentCardList.Where(x => !x.IsCreated).Count());

                            if (_opponentCardCount > _opponentCardCheck)
                            {
                                _opponentCardCheck = _opponentCardCount;

                                if (_opponentCardCount > 5)
                                {
                                    int count = _opponentCardCount;
                                    foreach (Deck d in _matchedDecks)
                                    {
                                        _metaDecks.Find(x => x.DeckId == d.DeckId).Note = (Convert.ToInt32(_metaDecks.Find(x => x.DeckId == d.DeckId).Note) + count).ToString();
                                    }
                                    _statsUpdated = true;
                                }
                            }
                        }

                        if (displayDecks != null)
                        {
                            _mainWindow.updateDeckList(displayDecks);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MetaLog.Error(ex);
                }
            }
        }
Exemplo n.º 12
0
        public void PlayerPlay(Card cardPlayed)
        {
            try
            {
                updatePlayerHandCards();
                updatePlayerBoardEntities();

                MetaLog.Info("Turn " + _playerTurnCount + ": Player Played - " + cardPlayed.Name, "PlayerPlay");
            }
            catch (Exception ex)
            {
                MetaLog.Error(ex);
            }
        }
Exemplo n.º 13
0
        internal void PlayerMulligan(Card c)
        {
            try
            {
                _trackPlayerCards.FirstOrDefault(x => x.Value.cardId == c.Id).Value.mulligan = true;
                //_trackPlayerCards.FirstOrDefault(x => x.Value.cardId == c.Id).Value.cardId = "";

                MetaLog.Info("Player Mulliganed " + c.Name, "PlayerMulligan");
            }
            catch (Exception ex)
            {
                MetaLog.Error(ex);
            }
        }
        public void OnLoad()
        {
            try
            {
                if (!Directory.Exists(pluginDir))
                {
                    Directory.CreateDirectory(pluginDir);
                }

                _appConfig = MetaConfig.Load();
                _appConfig.Save();

                _MetaStats            = new MetaStats(_appConfig);
                _MetaDetectorMenuItem = new PluginMenu(_appConfig.userKey);

                GameEvents.OnGameStart.Add(_MetaStats.GameStart);
                GameEvents.OnGameEnd.Add(_MetaStats.GameEnd);

                GameEvents.OnTurnStart.Add(_MetaStats.TurnStart);

                GameEvents.OnOpponentPlay.Add(_MetaStats.OpponentPlay);
                GameEvents.OnOpponentDraw.Add(_MetaStats.OpponentDraw);

                GameEvents.OnOpponentCreateInPlay.Add(_MetaStats.OpponentCreateInPlay);
                GameEvents.OnOpponentCreateInDeck.Add(_MetaStats.OpponentCreateInDeck);
                GameEvents.OnOpponentHeroPower.Add(_MetaStats.OpponentHeroPower);
                GameEvents.OnOpponentSecretTriggered.Add(_MetaStats.OpponentSecretTriggered);
                GameEvents.OnOpponentPlayToGraveyard.Add(_MetaStats.OpponentPlayToGraveyard);
                GameEvents.OnOpponentMulligan.Add(_MetaStats.OpponentMulligan);

                GameEvents.OnPlayerDraw.Add(_MetaStats.PlayerDraw);
                GameEvents.OnPlayerPlay.Add(_MetaStats.PlayerPlay);
                GameEvents.OnPlayerCreateInPlay.Add(_MetaStats.PlayerCreateInPlay);
                GameEvents.OnPlayerCreateInDeck.Add(_MetaStats.PlayerCreateInDeck);
                GameEvents.OnPlayerHeroPower.Add(_MetaStats.PlayerHeroPower);
                GameEvents.OnPlayerMulligan.Add(_MetaStats.PlayerMulligan);

                CheckForUpdate();

                //_MainWindow.Show();
                //_MainWindow.Visibility = System.Windows.Visibility.Hidden;
                MetaLog.Info("Plugin Load Successful");
            }
            catch (Exception ex)
            {
                MetaLog.Error(ex);
                MetaLog.Info("Plugin Load Unsuccessful");
            }
        }
Exemplo n.º 15
0
 public void OpponentPlay(Card cardPlayed)
 {
     try
     {
         updateOpponentCardsPlayed();
         if (cardPlayed != null)
         {
             MetaLog.Info("Turn " + _opponentTurnCount + ": Opponent Played - " + cardPlayed.Name, "OpponentPlay");
         }
     }
     catch (Exception ex)
     {
         MetaLog.Error(ex);
     }
 }
Exemplo n.º 16
0
        public void OpponentDraw()
        {
            try
            {
                foreach (Entity e in Core.Game.Entities.Select(x => x.Value).Where(x => !x.IsHero &&
                                                                                   !x.IsHeroPower && x.GetTag(GameTag.CONTROLLER) == Core.Game.Opponent.Id))
                {
                    if (e.CardId == null || e.CardId == "")
                    {
                        if (_trackOpponentCards.Where(x => x.Key == e.Id).Count() > 0)
                        {
                            _trackOpponentCards[e.Id].turnDrawn    = e.Info.Turn;
                            _trackOpponentCards[e.Id].mulligan     = e.Info.Mulliganed;
                            _trackOpponentCards[e.Id].isCreated    = e.Info.Created;
                            _trackOpponentCards[e.Id].activePlayer = "Opponent";

                            if (e.GetTag(GameTag.CREATOR) > 0)
                            {
                                _trackOpponentCards[e.Id].createdBy = Core.Game.Entities[e.GetTag(GameTag.CREATOR)].CardId;
                            }
                        }
                        else
                        {
                            CardInfo tempInfo = new CardInfo();

                            tempInfo.turnDrawn    = e.Info.Turn;
                            tempInfo.mulligan     = e.Info.Mulliganed;
                            tempInfo.isCreated    = e.Info.Created;
                            tempInfo.activePlayer = "Opponent";

                            if (e.GetTag(GameTag.CREATOR) > 0)
                            {
                                tempInfo.createdBy = Core.Game.Entities[e.GetTag(GameTag.CREATOR)].CardId;
                            }

                            _trackOpponentCards.Add(e.Id, tempInfo);

                            tempInfo = null;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MetaLog.Error(ex);
            }
        }
 private void DownloadMetaFile()
 {
     try
     {
         using (WebClient wc = new WebClient())
         {
             wc.DownloadProgressChanged += wc_DownloadProgressChanged;
             wc.DownloadFileCompleted   += (wc_DownloadFileCompleted);
             wc.DownloadFileAsync(new Uri("https://s3.amazonaws.com/metadetector/metaDecks.xml.gz"), _deckFilename + ".gz");
         }
     }
     catch (Exception ex)
     {
         _mainWindow.updateText("Unable to download Meta File.", Brushes.PaleVioletRed);
         MetaLog.Error(ex);
     }
 }
Exemplo n.º 18
0
 void wc_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
 {
     try
     {
         string tempFile  = Path.Combine(Config.Instance.DataDir, @"Plugins\MetaDetector\MetaDetector.tmp");
         string pluginDLL = Path.Combine(Config.Instance.DataDir, @"Plugins\MetaDetector\MetaDetector.dll");
         if (File.Exists(tempFile))
         {
             File.Copy(tempFile, pluginDLL, true);
             File.Delete(tempFile);
         }
     }
     catch (Exception ex)
     {
         MetaLog.Error(ex);
     }
 }
Exemplo n.º 19
0
        public string GetCardStats()
        {
            try
            {
                var serializer = new XmlSerializer(typeof(GameStats));

                using (StringWriter textWriter = new StringWriter())
                {
                    serializer.Serialize(textWriter, this);
                    return(textWriter.ToString());
                }
            }
            catch (Exception ex)
            {
                MetaLog.Error(ex);
                return("");
            }
        }
        void wc_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
        {
            try
            {
                _mainWindow.updateText("Meta File Downloaded", Brushes.LightGreen);
                FileInfo fi = new FileInfo(_deckFilename + ".gz");
                DecompressFile(fi);

                if (File.Exists(_deckFilename))
                {
                    _metaDecks = XmlManager <List <Deck> > .Load(_deckFilename);
                }
            }
            catch (Exception ex)
            {
                MetaLog.Error(ex);
            }
        }
Exemplo n.º 21
0
        public void Save()
        {
            try
            {
                if (!Directory.Exists(configDirectory))
                {
                    Directory.CreateDirectory(configDirectory);
                }

                var serializer = new XmlSerializer(typeof(MetaConfig));
                using (var writer = new StreamWriter(configPath))
                    serializer.Serialize(writer, this);
            }
            catch (Exception ex)
            {
                MetaLog.Error(ex);
            }
        }
        public NotificationWindow()
        {
            try
            {
                InitializeComponent();


                Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, new Action(() =>
                {
                    try
                    {
                        Window MainWindow = this;
                        if (MainWindow != null)
                        {
                            PresentationSource MainWindowPresentationSource = PresentationSource.FromVisual(MainWindow);
                            if (MainWindowPresentationSource != null)
                            {
                                Matrix m = MainWindowPresentationSource.CompositionTarget.TransformToDevice;
                                var thisDpiWidthFactor  = m.M11;
                                var thisDpiHeightFactor = m.M22;

                                var workingAreaWidth  = SystemParameters.WorkArea.Width * thisDpiWidthFactor;
                                var workingAreaHeight = SystemParameters.WorkArea.Height * thisDpiHeightFactor;

                                var transform = PresentationSource.FromVisual(this).CompositionTarget.TransformFromDevice;
                                var corner    = transform.Transform(new Point(workingAreaWidth, workingAreaHeight));


                                this.Left = corner.X - this.ActualWidth - 20;
                                this.Top  = corner.Y - this.ActualHeight - 20;
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        MetaLog.Error(ex);
                    }
                }));
            }
            catch (Exception ex)
            {
                MetaLog.Error(ex);
            }
        }
Exemplo n.º 23
0
 internal void TurnStart(ActivePlayer activePlayer)
 {
     try
     {
         if (ActivePlayer.Player == activePlayer)
         {
             _playerTurnCount = Convert.ToInt16(Math.Ceiling(Core.Game.GameEntity.GetTag(GameTag.TURN) / 2.0));
             updateOpponentCardsPlayed();
         }
         else
         {
             _opponentTurnCount = Convert.ToInt16(Math.Ceiling(Core.Game.GameEntity.GetTag(GameTag.TURN) / 2.0));
         }
     }
     catch (Exception ex)
     {
         MetaLog.Error(ex);
     }
 }
Exemplo n.º 24
0
        public void Save()
        {
            try
            {
                this.cardsPlayed = cardsPlayed.OrderBy(x => x.turn).ThenBy(x => x.activePlayer).ToList();
                if (!Directory.Exists(statsDirectory))
                {
                    Directory.CreateDirectory(statsDirectory);
                }

                var serializer = new XmlSerializer(typeof(GameStats));
                using (var writer = new StreamWriter(statsPath))
                    serializer.Serialize(writer, this);
            }
            catch (Exception ex)
            {
                MetaLog.Error(ex);
            }
        }
Exemplo n.º 25
0
        private void updatePlayerBoardEntities()
        {
            try
            {
                foreach (Entity e in Core.Game.Player.Board.Where(x => !x.IsHero && !x.IsHeroPower))
                {
                    CardInfo temp;
                    if (_trackPlayerCards.TryGetValue(e.Id, out temp))
                    {
                        _trackPlayerCards[e.Id].turn         = e.Info.Turn;
                        _trackPlayerCards[e.Id].cardName     = e.Card.Name;
                        _trackPlayerCards[e.Id].activePlayer = "Player";

                        if (e.GetTag(GameTag.CREATOR) > 0)
                        {
                            _trackPlayerCards[e.Id].isCreated = e.Info.Created;
                            _trackPlayerCards[e.Id].createdBy = Core.Game.Entities[e.GetTag(GameTag.CREATOR)].CardId;
                        }
                    }
                    else
                    {
                        CardInfo tempInfo = new CardInfo();

                        tempInfo.turn         = e.Info.Turn;
                        tempInfo.cardId       = e.CardId;
                        tempInfo.cardName     = e.Card.Name;
                        tempInfo.isCreated    = e.Info.Created;
                        tempInfo.activePlayer = "Player";

                        if (e.GetTag(GameTag.CREATOR) > 0)
                        {
                            tempInfo.createdBy = Core.Game.Entities[e.GetTag(GameTag.CREATOR)].CardId;
                        }

                        _trackPlayerCards.Add(e.Id, tempInfo);
                    }
                }
            }
            catch (Exception ex)
            {
                MetaLog.Error(ex);
            }
        }
Exemplo n.º 26
0
        private void updatePlayerHandCards()
        {
            try
            {
                foreach (var e in Core.Game.Entities.Where(x => x.Value.CardId != null && x.Value.CardId != "" &&
                                                           !x.Value.IsHero && !x.Value.IsHeroPower && x.Value.IsInHand &&
                                                           x.Value.GetTag(GameTag.CONTROLLER) == Core.Game.Player.Id).ToList())
                {
                    if (_trackPlayerCards.Where(x => x.Key == e.Value.Id).Count() > 0)
                    {
                        if (_trackPlayerCards[e.Value.Id].turnDrawn == 0 && e.Value.Info.Turn > 0)
                        {
                            _trackPlayerCards[e.Value.Id].turnDrawn = e.Value.Info.Turn;
                        }
                    }
                    else
                    {
                        MetaLog.Info("Turn " + _playerTurnCount + ": Player Draws " + e.Value.LocalizedName);
                        CardInfo tempInfo = new CardInfo();

                        tempInfo.turnDrawn    = e.Value.Info.Turn;
                        tempInfo.mulligan     = e.Value.Info.Mulliganed;
                        tempInfo.cardId       = e.Value.CardId;
                        tempInfo.cardName     = e.Value.Card.Name;
                        tempInfo.isCreated    = e.Value.Info.Created;
                        tempInfo.activePlayer = "Player";

                        if (e.Value.GetTag(GameTag.CREATOR) > 0)
                        {
                            tempInfo.createdBy = Core.Game.Entities[e.Value.GetTag(GameTag.CREATOR)].CardId;
                        }

                        _trackPlayerCards.Add(e.Value.Id, tempInfo);
                    }
                }
            }
            catch (Exception ex)
            {
                MetaLog.Error(ex);
            }
        }
        internal void GameEnd()
        {
            if (_validGameMode)
            {
                try
                {
                    if (_statsUpdated)
                    {
                        SaveMetaDeckStats();
                    }
                    _matchedDecks = new List <Deck>(_metaDecks);

                    _mainWindow.updateText("Waiting for new Game...", Brushes.White);
                    MetaLog.Info("Game Ended. Waiting for new Game");
                }
                catch (Exception ex)
                {
                    MetaLog.Error(ex);
                }
            }
        }
 public static MyConfig Load()
 {
     try
     {
         if (File.Exists(configPath))
         {
             var serializer = new XmlSerializer(typeof(MyConfig));
             using (var reader = new StreamReader(configPath))
                 return((MyConfig)serializer.Deserialize(reader));
         }
         else
         {
             return(new MyConfig("1", DateTime.Now, DateTime.Now));
         }
     }
     catch (Exception ex)
     {
         MetaLog.Error(ex);
         return(null);
     }
 }
Exemplo n.º 29
0
        public static MetaConfig Load()
        {
            var userAddr =
                (
                    from nic in NetworkInterface.GetAllNetworkInterfaces()
                    where nic.OperationalStatus == OperationalStatus.Up
                    select nic.GetPhysicalAddress().ToString()
                ).FirstOrDefault();

            userAddr = System.Convert.ToBase64String(Encoding.UTF8.GetBytes(userAddr));

            try
            {
                if (File.Exists(configPath))
                {
                    var serializer = new XmlSerializer(typeof(MetaConfig));

                    using (var reader = new StreamReader(configPath))
                    {
                        MetaConfig temp = (MetaConfig)serializer.Deserialize(reader);
                        if (temp.userKey == null)
                        {
                            temp.userKey = userAddr;
                        }
                        return(temp);
                    }
                }
                else
                {
                    return(new MetaConfig("1", DateTime.Now, DateTime.Now, userAddr));
                }
            }
            catch (Exception ex)
            {
                MetaLog.Error(ex);
                return(new MetaConfig("1", DateTime.Now, DateTime.Now, userAddr));
                //return null;
            }
        }
 private void LoadMetaDeckfromZip()
 {
     try
     {
         using (var file = File.OpenRead(_deckFilename))
             using (var zip = new ZipArchive(file, ZipArchiveMode.Read))
             {
                 foreach (var entry in zip.Entries)
                 {
                     using (var stream = entry.Open())
                     {
                         StreamReader reader = new StreamReader(stream);
                         string       text   = reader.ReadToEnd();
                         _metaDecks = XmlManager <List <Deck> > .LoadFromString(text);
                     }
                 }
             }
     }
     catch (Exception ex)
     {
         MetaLog.Error(ex);
     }
 }