Example #1
0
        public void InstallGame(IPackage package, Action <int, int> onProgressUpdate = null)
        {
            if (onProgressUpdate == null)
            {
                onProgressUpdate = (i, i1) => { }
            }
            ;

            Log.InfoFormat("Installing game {0} {1}", package.Id, package.Title);
            try
            {
                onProgressUpdate(-1, 1);
                Log.InfoFormat("Creating path {0} {1}", package.Id, package.Title);
                var dirPath = Path.GetTempPath();
                dirPath = Path.Combine(dirPath, "o8ginstall-" + Guid.NewGuid());
                Log.InfoFormat("Extracting package {0} {1} {2}", dirPath, package.Id, package.Title);
                GameFeedManager.Get().ExtractPackage(dirPath, package, onProgressUpdate);
                onProgressUpdate(-1, 1);
                Log.InfoFormat("Making def path {0} {1}", package.Id, package.Title);
                var defPath = Path.Combine(dirPath, "def");
                if (!Directory.Exists(defPath))
                {
                    Log.WarnFormat("Def path doesn't exist in the game package {0} {1}", package.Id, package.Title);
                    return;
                }
                var di = new DirectoryInfo(defPath);
                Log.InfoFormat("Copying temp files {0} {1}", package.Id, package.Title);
                var files      = di.GetFiles("*", SearchOption.AllDirectories).ToArray();
                var curFileNum = 0;
                onProgressUpdate(curFileNum, files.Length);
                var packagePath     = Path.Combine(Config.Instance.Paths.DatabasePath, package.Id);
                var packagePathInfo = new DirectoryInfo(packagePath);
                if (packagePathInfo.Exists)
                {
                    Log.InfoFormat("Package path {0} exists.  Relocating.", packagePathInfo.FullName);
                    var curFiles = packagePathInfo.GetFiles("*", SearchOption.AllDirectories).ToArray();
                    Log.InfoFormat("Checking {0} for files that are no longer used.", packagePath);
                    foreach (var cf in curFiles)
                    {
                        var relPath = cf.FullName.Replace(packagePathInfo.FullName, "");
                        relPath = relPath.TrimStart('\\', '/');
                        var newPath     = Path.Combine(di.FullName, relPath);
                        var newFileInfo = new FileInfo(newPath);
                        if (!newFileInfo.Exists)
                        {
                            Log.DebugFormat("Removing {0}", relPath);
                            X.Instance.Retry(cf.Delete);
                        }
                        curFileNum++;
                        onProgressUpdate(curFileNum, curFiles.Length);
                    }
                }
                curFileNum = 0;
                onProgressUpdate(-1, 1);
                foreach (var f in files)
                {
                    try
                    {
                        Log.DebugFormat("Copying temp file {0} {1} {2}", f.FullName, package.Id, package.Title);
                        var relPath = f.FullName.Replace(di.FullName, "");
                        relPath = relPath.TrimStart('\\', '/');
                        var newPath = Path.Combine(Config.Instance.Paths.DatabasePath, package.Id);
                        newPath = Path.Combine(newPath, relPath);
                        var newFileInfo = new FileInfo(newPath);
                        if (newFileInfo.Directory != null)
                        {
                            Log.DebugFormat("Creating directory {0} {1} {2}", newFileInfo.Directory.FullName, package.Id, package.Title);
                            Directory.CreateDirectory(newFileInfo.Directory.FullName);
                        }
                        Log.DebugFormat("Copying file {0} {1} {2} {3}", f.FullName, newPath, package.Id, package.Title);
                        f.MegaCopyTo(newPath);
                        Log.DebugFormat("File copied {0} {1} {2} {3}", f.FullName, newPath, package.Id, package.Title);
                        curFileNum++;
                        onProgressUpdate(curFileNum, files.Length);
                    }
                    catch (Exception e)
                    {
                        Log.Warn(String.Format("InstallGame 1 {0} {1} {2}", f.FullName, package.Id, package.Title), e);
                        throw;
                    }
                }
                onProgressUpdate(-1, 1);
                //Sets//setid//Cards//Proxies

                var setsDir      = Path.Combine(Config.Instance.Paths.DatabasePath, package.Id, "Sets");
                var imageSetsDir = Path.Combine(Config.Instance.ImageDirectoryFull, package.Id, "Sets");
                if (!Directory.Exists(imageSetsDir))
                {
                    Directory.CreateDirectory(imageSetsDir);
                }

                var game = GameManager.Get().GetById(new Guid(package.Id));
                if (game == null)
                {
                    throw new UserMessageException(L.D.Exception__CanNotInstallGameTryRestart_Format, package.Title);
                }

                Log.InfoFormat("Installing plugins {0} {1}", package.Id, package.Title);
                if (Directory.Exists(Path.Combine(game.InstallPath, "Plugins")))
                {
                    var pluginFiles      = new DirectoryInfo(Path.Combine(game.InstallPath, "Plugins")).GetFiles("*.dll", SearchOption.AllDirectories).ToArray();
                    var curPluginFileNum = 0;
                    onProgressUpdate(curPluginFileNum, pluginFiles.Length);
                    foreach (var f in pluginFiles)
                    {
                        try
                        {
                            Log.DebugFormat("Found plugin file {0} {1} {2}", f.FullName, package.Id, package.Title);
                            var relPath = f.FullName.Replace(new DirectoryInfo(Path.Combine(game.InstallPath, "Plugins")).FullName, "").TrimStart('\\');
                            var newPath = Path.Combine(Config.Instance.Paths.PluginPath, relPath);
                            Log.DebugFormat("Creating directories {0} {1} {2}", f.FullName, package.Id, package.Title);
                            if (new DirectoryInfo(newPath).Exists)
                            {
                                Directory.Move(newPath, Config.Instance.Paths.GraveyardPath);
                            }
                            Directory.CreateDirectory(new FileInfo(newPath).Directory.FullName);
                            Log.DebugFormat("Copying plugin to {0} {1} {2} {3}", f.FullName, newPath, package.Id, package.Title);
                            f.MegaCopyTo(newPath);
                            curPluginFileNum++;
                            onProgressUpdate(curPluginFileNum, pluginFiles.Length);
                        }
                        catch (Exception e)
                        {
                            Log.Warn(String.Format("InstallGame Plugin {0} {1} {2}", f.FullName, package.Id, package.Title), e);
                            throw;
                        }
                    }
                }
                onProgressUpdate(-1, 1);

                var setsDeckFolders =
                    game.Sets()
                    .Select(x => new { Set = x, DeckDirectory = new DirectoryInfo(x.DeckPath) })
                    .Where(x => x.DeckDirectory.Exists)
                    .Select(x => new { Set = x.Set, DeckDirectory = x.DeckDirectory, files = x.DeckDirectory.GetFiles("*.o8d", SearchOption.AllDirectories) })
                    .ToArray();
                var max           = setsDeckFolders.SelectMany(x => x.files).Count();
                var curSetDeckNum = 0;
                onProgressUpdate(curSetDeckNum, max);
                foreach (var set in setsDeckFolders)
                {
                    foreach (var deck in set.files)
                    {
                        try
                        {
                            Log.DebugFormat("Found deck file {0} {1} {2} {3}", deck.FullName, setsDir, package.Id, package.Title);
                            var relPath = deck.FullName.Replace(set.DeckDirectory.FullName, "").TrimStart('\\');
                            var newPath = Path.Combine(Config.Instance.Paths.DeckPath, game.Name, relPath);
                            Log.DebugFormat("Creating directories {0} {1} {2} {3}", deck.FullName, setsDir, package.Id, package.Title);
                            Directory.CreateDirectory(new FileInfo(newPath).Directory.FullName);
                            Log.DebugFormat("Copying deck to {0} {1} {2} {3} {4}", deck.FullName, newPath, setsDir,
                                            package.Id, package.Title);
                            deck.MegaCopyTo(newPath);
                            curSetDeckNum++;
                            onProgressUpdate(curSetDeckNum, max);
                        }
                        catch (Exception e)
                        {
                            Log.Warn(String.Format("InstallGame 3 {0} {1} {2} {3}", deck.FullName, setsDir, package.Id, package.Title), e);
                            throw;
                        }
                    }
                }
                onProgressUpdate(-1, 1);

                Log.InfoFormat("Deleting proxy cards {0} {1} {2}", setsDir, package.Id, package.Title);
                // Clear out all proxies if they exist
                var proxyFiles           = new DirectoryInfo(imageSetsDir).GetDirectories().Select(x => new DirectoryInfo(Path.Combine(x.FullName, "Cards", "Proxies"))).Where(x => x.Exists).ToArray();
                var currentProxyFilesNum = 0;
                onProgressUpdate(currentProxyFilesNum, proxyFiles.Length);
                foreach (var pdir in proxyFiles)
                {
                    try
                    {
                        var pstring = pdir.FullName;
                        Log.DebugFormat("Deleting proxy dir {0} {1} {2}", pdir, package.Id, package.Title);
                        pdir.MoveTo(Config.Instance.Paths.GraveyardPath);
                        Log.DebugFormat("Deleted proxy dir {0} {1} {2}", pdir, package.Id, package.Title);
                        Directory.CreateDirectory(pstring);
                    }
                    catch (Exception)
                    {
                        Log.WarnFormat("Could not delete proxy directory {0}", pdir.FullName);
                    }
                    currentProxyFilesNum++;
                    onProgressUpdate(currentProxyFilesNum, proxyFiles.Length);
                }
                onProgressUpdate(-1, 1);
                Log.InfoFormat("Fire game list changed {0} {1}", package.Id, package.Title);
                this.OnGameListChanged();
                Log.InfoFormat("Game list changed fired {0} {1}", package.Id, package.Title);

                //copy images over to imagedatabase
                var cardImageList = new DirectoryInfo(setsDir)
                                    .GetDirectories()
                                    .Select(x => new { SetDirectory = x, CardsDirectory = new DirectoryInfo(Path.Combine(x.FullName, "Cards")) })
                                    .Where(x => x.CardsDirectory.Exists)
                                    .Select(x => new
                {
                    SetDirectory   = x.SetDirectory,
                    CardsDirectory = x.CardsDirectory,
                    ImageFiles     = x.CardsDirectory.GetFiles("*.*", SearchOption.TopDirectoryOnly).Where(s => !s.FullName.EndsWith(".xml", StringComparison.CurrentCultureIgnoreCase)).ToArray()
                })
                                    .SelectMany(x => x.ImageFiles.Select(i =>
                                                                         new
                {
                    SetDirectory   = x.SetDirectory,
                    CardsDirectory = x.CardsDirectory,
                    Image          = i
                }))
                                    .ToArray();

                X.Instance.ForEachProgress(cardImageList.Length, cardImageList,
                                           x =>
                {
                    string copyDirPath = Path.Combine(Config.Instance.ImageDirectoryFull, package.Id, "Sets", x.SetDirectory.Name, "Cards");
                    if (!Directory.Exists(copyDirPath))
                    {
                        Directory.CreateDirectory(copyDirPath);
                    }
                    x.Image.CopyTo(Path.Combine(copyDirPath, x.Image.Name), true);
                    x.Image.Delete();
                }, onProgressUpdate);
            }
            finally
            {
                Log.InfoFormat("Done {0} {1}", package.Id, package.Title);
            }
        }
Example #2
0
        public void InstallGame(IPackage package)
        {
            Log.InfoFormat("Installing game {0} {1}", package.Id, package.Title);
            try
            {
                Log.InfoFormat("Creating path {0} {1}", package.Id, package.Title);
                var dirPath = Path.GetTempPath();
                dirPath = Path.Combine(dirPath, "o8ginstall-" + Guid.NewGuid());
                Log.InfoFormat("Extracting package {0} {1} {2}", dirPath, package.Id, package.Title);
                GameFeedManager.Get().ExtractPackage(dirPath, package);
                Log.InfoFormat("Making def path {0} {1}", package.Id, package.Title);
                var defPath = Path.Combine(dirPath, "def");
                if (!Directory.Exists(defPath))
                {
                    Log.WarnFormat("Def path doesn't exist in the game package {0} {1}", package.Id, package.Title);
                    return;
                }
                var di = new DirectoryInfo(defPath);
                Log.InfoFormat("Copying temp files {0} {1}", package.Id, package.Title);
                foreach (var f in di.GetFiles("*", SearchOption.AllDirectories))
                {
                    Log.InfoFormat("Copying temp file {0} {1} {2}", f.FullName, package.Id, package.Title);
                    var relPath = f.FullName.Replace(di.FullName, "");
                    relPath = relPath.TrimStart('\\', '/');
                    var newPath = Path.Combine(Paths.Get().DatabasePath, package.Id);
                    newPath = Path.Combine(newPath, relPath);
                    var newFileInfo = new FileInfo(newPath);
                    if (newFileInfo.Directory != null)
                    {
                        Log.InfoFormat("Creating directory {0} {1} {2}", newFileInfo.Directory.FullName, package.Id, package.Title);
                        Directory.CreateDirectory(newFileInfo.Directory.FullName);
                    }
                    Log.InfoFormat("Copying file {0} {1} {2} {3}", f.FullName, newPath, package.Id, package.Title);
                    f.MegaCopyTo(newPath);
                    Log.InfoFormat("File copied {0} {1} {2} {3}", f.FullName, newPath, package.Id, package.Title);
                }
                //Sets//setid//Cards//Proxies

                var setsDir      = Path.Combine(Paths.Get().DatabasePath, package.Id, "Sets");
                var imageSetsDir = Path.Combine(Paths.Get().ImageDatabasePath, package.Id, "Sets");
                if (!Directory.Exists(imageSetsDir))
                {
                    Directory.CreateDirectory(imageSetsDir);
                }

                Log.InfoFormat("Installing decks {0} {1}", package.Id, package.Title);
                var game = GameManager.Get().GetById(new Guid(package.Id));
                if (game == null)
                {
                    throw new UserMessageException("Game {0} could not be installed. Please restart your computer and try again", package.Title);
                }
                if (Directory.Exists(Path.Combine(game.InstallPath, "Decks")))
                {
                    foreach (
                        var f in
                        new DirectoryInfo(Path.Combine(game.InstallPath, "Decks")).GetFiles(
                            "*.o8d", SearchOption.AllDirectories))
                    {
                        Log.InfoFormat("Found deck file {0} {1} {2}", f.FullName, package.Id, package.Title);
                        var relPath = f.FullName.Replace(new DirectoryInfo(Path.Combine(game.InstallPath, "Decks")).FullName, "").TrimStart('\\');
                        var newPath = Path.Combine(Paths.Get().DeckPath, game.Name, relPath);
                        Log.InfoFormat("Creating directories {0} {1} {2}", f.FullName, package.Id, package.Title);
                        if (new DirectoryInfo(newPath).Exists)
                        {
                            Directory.Move(newPath, Paths.Get().GraveyardPath);
                        }
                        Directory.CreateDirectory(new FileInfo(newPath).Directory.FullName);
                        Log.InfoFormat("Copying deck to {0} {1} {2} {3}", f.FullName, newPath, package.Id, package.Title);
                        f.MegaCopyTo(newPath);
                    }
                }

                foreach (var set in game.Sets())
                {
                    Log.InfoFormat("Checking set for decks {0} {1} {2}", setsDir, package.Id, package.Title);
                    var dp = set.DeckPath;
                    Log.InfoFormat("Got deck uri {0}", dp);
                    var decki = new DirectoryInfo(dp);
                    if (!decki.Exists)
                    {
                        Log.InfoFormat("No decks exist for set {0} {1} {2}", setsDir, package.Id, package.Title);
                        continue;
                    }
                    Log.InfoFormat("Finding deck files in set {0} {1} {2}", setsDir, package.Id, package.Title);
                    foreach (var f in decki.GetFiles("*.o8d", SearchOption.AllDirectories))
                    {
                        Log.InfoFormat("Found deck file {0} {1} {2} {3}", f.FullName, setsDir, package.Id, package.Title);
                        var relPath = f.FullName.Replace(decki.FullName, "").TrimStart('\\');
                        var newPath = Path.Combine(Paths.Get().DeckPath, game.Name, relPath);
                        Log.InfoFormat("Creating directories {0} {1} {2} {3}", f.FullName, setsDir, package.Id, package.Title);
                        Directory.CreateDirectory(new FileInfo(newPath).Directory.FullName);
                        Log.InfoFormat("Copying deck to {0} {1} {2} {3} {4}", f.FullName, newPath, setsDir, package.Id, package.Title);
                        f.MegaCopyTo(newPath);
                    }
                }

                Log.InfoFormat("Deleting proxy cards {0} {1} {2}", setsDir, package.Id, package.Title);
                // Clear out all proxies if they exist
                foreach (var setdir in new DirectoryInfo(imageSetsDir).GetDirectories())
                {
                    var dirString = Path.Combine(setdir.FullName, "Cards", "Proxies");
                    var pdir      = new DirectoryInfo(dirString);
                    Log.InfoFormat("Checking proxy dir {0} {1} {2}", pdir, package.Id, package.Title);
                    if (!pdir.Exists)
                    {
                        Log.InfoFormat("Proxy dir doesn't exist {0} {1} {2}", pdir, package.Id, package.Title);
                        continue;
                    }
                    try
                    {
                        Log.InfoFormat("Deleting proxy dir {0} {1} {2}", pdir, package.Id, package.Title);
                        pdir.MoveTo(Paths.Get().GraveyardPath);
                        Log.InfoFormat("Deleted proxy dir {0} {1} {2}", pdir, package.Id, package.Title);
                        Directory.CreateDirectory(dirString);
                    }
                    catch (Exception e)
                    {
                        Log.WarnFormat("Could not delete proxy directory {0}", pdir.FullName);
                    }
                }
                Log.InfoFormat("Fire game list changed {0} {1}", package.Id, package.Title);
                this.OnGameListChanged();
                Log.InfoFormat("Game list changed fired {0} {1}", package.Id, package.Title);

                //copy images over to imagedatabase
                foreach (var setdir in new DirectoryInfo(setsDir).GetDirectories())
                {
                    var cdir = new DirectoryInfo(Path.Combine(setdir.FullName, "Cards"));
                    if (cdir.Exists)
                    {
                        IEnumerable <FileInfo> fiArr = cdir.GetFiles("*.*", SearchOption.TopDirectoryOnly).Where(s => !s.FullName.EndsWith(".xml", StringComparison.CurrentCultureIgnoreCase));
                        foreach (FileInfo fi in fiArr)
                        {
                            string copyDirPath = Path.Combine(Paths.Get().ImageDatabasePath, package.Id, "Sets", setdir.Name, "Cards");
                            if (!Directory.Exists(copyDirPath))
                            {
                                Directory.CreateDirectory(copyDirPath);
                            }
                            fi.CopyTo(Path.Combine(copyDirPath, fi.Name), true);
                            fi.Delete();
                        }
                    }
                }
            }
            finally
            {
                Log.InfoFormat("Done {0} {1}", package.Id, package.Title);
            }
        }
Example #3
0
        public void InstallGame(IPackage package)
        {
            Log.InfoFormat("Installing game {0} {1}", package.Id, package.Title);
            try
            {
                Log.InfoFormat("Creating path {0} {1}", package.Id, package.Title);
                var dirPath = Path.GetTempPath();
                dirPath = Path.Combine(dirPath, "o8ginstall-" + Guid.NewGuid());
                Log.InfoFormat("Extracting package {0} {1} {2}", dirPath, package.Id, package.Title);
                GameFeedManager.Get().ExtractPackage(dirPath, package);
                Log.InfoFormat("Making def path {0} {1}", package.Id, package.Title);
                var defPath = Path.Combine(dirPath, "def");
                if (!Directory.Exists(defPath))
                {
                    Log.WarnFormat("Def path doesn't exist in the game package {0} {1}", package.Id, package.Title);
                    return;
                }
                var di = new DirectoryInfo(defPath);
                Log.InfoFormat("Copying temp files {0} {1}", package.Id, package.Title);
                foreach (var f in di.GetFiles("*", SearchOption.AllDirectories))
                {
                    Log.InfoFormat("Copying temp file {0} {1} {2}", f.FullName, package.Id, package.Title);
                    var relPath = f.FullName.Replace(di.FullName, "");
                    relPath = relPath.TrimStart('\\', '/');
                    var newPath = Path.Combine(Paths.Get().DataDirectory, "GameDatabase", package.Id);
                    newPath = Path.Combine(newPath, relPath);
                    var newFileInfo = new FileInfo(newPath);
                    if (newFileInfo.Directory != null)
                    {
                        Log.InfoFormat("Creating directory {0} {1} {2}", newFileInfo.Directory.FullName, package.Id, package.Title);
                        Directory.CreateDirectory(newFileInfo.Directory.FullName);
                    }
                    Log.InfoFormat("Copying file {0} {1} {2} {3}", f.FullName, newPath, package.Id, package.Title);
                    f.MegaCopyTo(newPath);
                    Log.InfoFormat("File copied {0} {1} {2} {3}", f.FullName, newPath, package.Id, package.Title);
                }
                //Sets//setid//Cards//Proxies

                var setsDir = Path.Combine(Paths.Get().DataDirectory, "GameDatabase", package.Id, "Sets");

                Log.InfoFormat("Installing decks {0} {1}", package.Id, package.Title);
                var game = GameManager.Get().GetById(new Guid(package.Id));

                if (Directory.Exists(Path.Combine(game.GetInstallPath(), "Decks")))
                {
                    foreach (
                        var f in
                        new DirectoryInfo(Path.Combine(game.GetInstallPath(), "Decks")).GetFiles(
                            "*.o8d", SearchOption.AllDirectories))
                    {
                        Log.InfoFormat("Found deck file {0} {1} {2}", f.FullName, package.Id, package.Title);
                        var relPath = f.FullName.Replace(new DirectoryInfo(Path.Combine(game.GetInstallPath(), "Decks")).FullName, "").TrimStart('\\');
                        var newPath = Path.Combine(Paths.Get().DeckPath, game.Name, relPath);
                        Log.InfoFormat("Creating directories {0} {1} {2}", f.FullName, package.Id, package.Title);
                        if (new DirectoryInfo(newPath).Exists)
                        {
                            Directory.Move(newPath, Paths.Get().GraveyardPath);
                        }
                        Directory.CreateDirectory(new FileInfo(newPath).Directory.FullName);
                        Log.InfoFormat("Copying deck to {0} {1} {2} {3}", f.FullName, newPath, package.Id, package.Title);
                        f.MegaCopyTo(newPath);
                    }
                }

                foreach (var set in game.Sets())
                {
                    Log.InfoFormat("Checking set for decks {0} {1} {2}", setsDir, package.Id, package.Title);
                    var dp = set.GetDeckUri();
                    Log.InfoFormat("Got deck uri {0}", dp);
                    var decki = new DirectoryInfo(dp);
                    if (!decki.Exists)
                    {
                        Log.InfoFormat("No decks exist for set {0} {1} {2}", setsDir, package.Id, package.Title);
                        continue;
                    }
                    Log.InfoFormat("Finding deck files in set {0} {1} {2}", setsDir, package.Id, package.Title);
                    foreach (var f in decki.GetFiles("*.o8d", SearchOption.AllDirectories))
                    {
                        Log.InfoFormat("Found deck file {0} {1} {2} {3}", f.FullName, setsDir, package.Id, package.Title);
                        var relPath = f.FullName.Replace(decki.FullName, "").TrimStart('\\');
                        var newPath = Path.Combine(Paths.Get().DeckPath, game.Name, relPath);
                        Log.InfoFormat("Creating directories {0} {1} {2} {3}", f.FullName, setsDir, package.Id, package.Title);
                        Directory.CreateDirectory(new FileInfo(newPath).Directory.FullName);
                        Log.InfoFormat("Copying deck to {0} {1} {2} {3} {4}", f.FullName, newPath, setsDir, package.Id, package.Title);
                        f.MegaCopyTo(newPath);
                    }
                }

                Log.InfoFormat("Deleting proxy cards {0} {1} {2}", setsDir, package.Id, package.Title);
                // Clear out all proxies if they exist
                foreach (var setdir in new DirectoryInfo(setsDir).GetDirectories())
                {
                    var pdir = new DirectoryInfo(Path.Combine(setdir.FullName, "Cards", "Proxies"));
                    Log.InfoFormat("Checking proxy dir {0} {1} {2}", pdir, package.Id, package.Title);
                    if (!pdir.Exists)
                    {
                        Log.InfoFormat("Proxy dir doesn't exist {0} {1} {2}", pdir, package.Id, package.Title);
                        continue;
                    }
                    try
                    {
                        Log.InfoFormat("Deleting proxy dir {0} {1} {2}", pdir, package.Id, package.Title);
                        pdir.MoveTo(Paths.Get().GraveyardPath);
                        Log.InfoFormat("Deleted proxy dir {0} {1} {2}", pdir, package.Id, package.Title);
                    }
                    catch (Exception e)
                    {
                        Log.WarnFormat("Could not delete proxy directory {0}", pdir.FullName);
                    }
                }
                Log.InfoFormat("Fire game list changed {0} {1}", package.Id, package.Title);
                this.OnGameListChanged();
                Log.InfoFormat("Game list changed fired {0} {1}", package.Id, package.Title);
            }
            finally
            {
                Log.InfoFormat("Done {0} {1}", package.Id, package.Title);
            }
        }