Commit 6f4b6c9d authored by Gerhard Stein's avatar Gerhard Stein

Added some headers required for other ports

parent 8aaecf18
......@@ -6,6 +6,7 @@
#include <deque>
#include <list>
#include <memory>
#include <ctime>
struct CEvent { virtual ~CEvent(); };
......
No preview for this file type
......@@ -32,7 +32,6 @@ ENDIF(WIN32)
FILE(GLOB CACHE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/vfsroot/cache/*.png")
INSTALL(FILES ${CACHE_FILES} DESTINATION ${DOCDIR}/cache)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/vfsroot/gameCatalogue.xml DESTINATION ${DOCDIR})
......
......@@ -179,7 +179,9 @@ int downloadFile(const std::string &filename, int &progress,
}
bool GameDownloader::readGamesNode(boost::property_tree::ptree &pt)
#define TRACE_NODE(x) gLogging << #x"=" << x;
bool GameDownloader::readGamesNode(const boost::property_tree::ptree &pt)
{
try
{
......@@ -189,12 +191,15 @@ bool GameDownloader::readGamesNode(boost::property_tree::ptree &pt)
if(gameNode.first == "<xmlcomment>")
continue;
GameCatalogueEntry gce;
GameCatalogueEntry gce;
gce.mVersionCode = gameNode.second.get<int>("<xmlattr>.versioncode");
TRACE_NODE(gce.mVersionCode);
gce.mName = gameNode.second.get<std::string>("<xmlattr>.name");
TRACE_NODE(gce.mName);
gce.mLink = gameNode.second.get<std::string>("<xmlattr>.link");
TRACE_NODE(gce.mLink);
if(gce.mVersionCode > CGVERSIONCODE)
......@@ -206,7 +211,9 @@ bool GameDownloader::readGamesNode(boost::property_tree::ptree &pt)
gce.mDescription = gameNode.second.get<std::string>("<xmlattr>.description");
TRACE_NODE(gce.mDescription);
gce.mPictureFile = gameNode.second.get<std::string>("<xmlattr>.picture");
TRACE_NODE(gce.mPictureFile);
const auto filePath = JoinPaths("cache", gce.mPictureFile);
......@@ -219,15 +226,21 @@ bool GameDownloader::readGamesNode(boost::property_tree::ptree &pt)
mGameCatalogue.push_back(gce);
}
}
catch(std::exception const& ex)
{
gLogging << "Exception while reading game node: " << ex.what() << "\n";
return false;
}
catch(...)
{
gLogging << "Unknown Exception while reading game node\n.";
return false;
}
return true;
}
bool GameDownloader::readLegacyCatalogue(boost::property_tree::ptree &pt)
bool GameDownloader::readLegacyCatalogue(const boost::property_tree::ptree &pt)
{
try
{
......@@ -255,8 +268,14 @@ bool GameDownloader::readLegacyCatalogue(boost::property_tree::ptree &pt)
mGameCatalogue.push_back(gce);
}
}
catch(std::exception const& ex)
{
gLogging << "Exception while reading game node (Legacy): " << ex.what() << "\n";
return false;
}
catch(...)
{
gLogging << "Unknown Exception while reading game node\n.";
return false;
}
......@@ -284,7 +303,9 @@ bool GameDownloader::loadCatalogue(const std::string &catalogueFile)
bool ok = false;
gLogging << "Reading Games from Store...\n" ;
ok |= readGamesNode(pt);
gLogging << "Reading Games from Store (Legacy)...\n" ;
ok |= readLegacyCatalogue(pt);
return ok;
......@@ -380,6 +401,8 @@ bool GameDownloader::checkForMissingGames( std::vector< std::string > &missingLi
const auto downloadGamePath = JoinPaths(downloadPath, gameFile);
gLogging << "Scanning \"" << gameEntry.mName << "\"\n";
if( !IsFileAvailable(downloadGamePath) )
{
missingList.push_back(gameEntry.mName);
......
......@@ -46,7 +46,7 @@ public:
* @param pt Node ref
* @return
*/
bool readGamesNode(boost::property_tree::ptree &pt);
bool readGamesNode(const boost::property_tree::ptree &pt);
/**
......@@ -55,7 +55,7 @@ public:
* @param pt Node ref
* @return true if something was read
*/
bool readLegacyCatalogue(boost::property_tree::ptree &pt);
bool readLegacyCatalogue(const boost::property_tree::ptree &pt);
/**
* @brief loadCatalogue Load the game catalogue
......
......@@ -12,6 +12,7 @@
#include <vector>
#include <iostream>
#include <fstream>
#include <cstring>
#include <base/GsLogging.h>
#include <base/GsEvent.h>
......
<?xml version="1.0" encoding="utf-8"?>
<Catalogue>
<Game name="Keen 1 Special"
link="KEEN1-Special.zip"
description="Get your ship parts back!"
picture="keen1special.png"/>
<Game name="Keen 1"
link="keen1.zip"
description="Get your ship parts back!"
picture="keen1special.png"/>
<Game name="Keen Dreams"
link="KeenDreams.zip"
description="Fight against evil veggies"
picture="kdreams.png"/>
<Game name="Keen Dreams Plus"
link="KeenDreamsPlus.zip"
description="More evil veggies, more levels!"
picture="kdreamsplus.png"/>
<Game name="Keen 4"
link="keen4.zip"
description="Rescue the members of the High Council of Gnosticus IV!"
picture="keen4special.png"/>
<Game name="Keen 4 Plus"
link="Keen4Plus.zip"
description="Rescue the members of the High Council of Gnosticus IV!"
picture="keen4special.png"/>
<Game name="Keen 6 Demo"
link="K6DEMO.zip"
description="DEMO: Alien ate my Babysitter"
picture="K6DEMO.png"/>
<Game name="Keen 7"
link="Keen7.zip"
description="Universe is toast Part I"
picture="keen7.png"/>
<Game name="The Eight Accumulators"
link="Eight-Accumulators.zip"
description="The story continues on from the Battle of the Brains ending."
picture="eightacc.png"/>
<Game name="Perilous Persuit"
link="Perilous.zip"
description="Goodbye Galaxy meets Vorticon Keen Engine"
picture="perilous.png"/>
<Game name="Silcar 1"
link="silcar1.zip"
description="Nightmare Before Teatime"
picture="silcar1.png"/>
</Catalogue>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment