mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-30 04:30:42 +02:00
[programming challenge] Logs go to logs fodler.
This commit is contained in:
parent
8b6f0f699d
commit
3fbaaac6d9
@ -32,7 +32,7 @@ int main(int argc, char **argv)
|
||||
("aiLeft,l", po::value<std::string>()->default_value("StupidAI"), "Left AI path")
|
||||
("aiRight,r", po::value<std::string>()->default_value("StupidAI"), "Right AI path")
|
||||
("battle,b", po::value<std::string>()->default_value("b1.json"), "Duel file path")
|
||||
("resultsOut,o", po::value<std::string>()->default_value("./results.json"), "Output file when results will be appended")
|
||||
("resultsOut,o", po::value<std::string>()->default_value("./results.txt"), "Output file when results will be appended")
|
||||
("logsDir,d", po::value<std::string>()->default_value("."), "Directory where log files will be created")
|
||||
("visualization,v", "Runs a client to display a visualization of battle");
|
||||
|
||||
|
@ -60,7 +60,7 @@ CondSh<BattleResult *> battleResult(NULL);
|
||||
std::ptrdiff_t randomizer (ptrdiff_t i) {return rand();}
|
||||
std::ptrdiff_t (*p_myrandom)(std::ptrdiff_t) = randomizer;
|
||||
|
||||
extern std::string RESULTS_PATH;
|
||||
extern std::string RESULTS_PATH, LOGS_DIR;
|
||||
|
||||
template <typename T> class CApplyOnGH;
|
||||
|
||||
@ -461,7 +461,7 @@ void CGameHandler::endBattle(int3 tile, const CGHeroInstance *hero1, const CGHer
|
||||
|
||||
if(duel)
|
||||
{
|
||||
CSaveFile resultFile("result.vdrst");
|
||||
CSaveFile resultFile(LOGS_DIR + "/result.vdrst");
|
||||
resultFile << *battleResult.data;
|
||||
|
||||
int casualtiesPoints = 0;
|
||||
|
@ -642,7 +642,7 @@ void CVCMIServer::startDuel(const std::string &battle, const std::string &leftAI
|
||||
testMem.set(true);
|
||||
boost::thread* memMon = new boost::thread(boost::bind(memoryMonitor, PIDs[0], PIDs[1], PIDs[2]));
|
||||
|
||||
std::string logFName = "duel_log.vdat";
|
||||
std::string logFName = LOGS_DIR + "/duel_log.vdat";
|
||||
tlog0 << "Logging battle activities (for replay possibility) in " << logFName << std::endl;
|
||||
gh->gameLog = new CSaveFile(logFName);
|
||||
gh->gameLog->smartPointerSerialization = false;
|
||||
|
@ -1,5 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
hash make 2>&- || { echo >&2 "I require make but it's not installed. Aborting."; exit 1; }
|
||||
hash autoreconf 2>&- || { echo >&2 "I require aureconf but it's not installed. Aborting."; exit 1; }
|
||||
hash unzip 2>&- || { echo >&2 "I require unzip but it's not installed. Aborting."; exit 1; }
|
||||
hash svn 2>&- || { echo >&2 "I require svn but it's not installed. Aborting."; exit 1; }
|
||||
|
||||
|
||||
function errorcheck(){
|
||||
if [ "$?" -gt 0 ]; then
|
||||
echo "Error during $1"
|
||||
@ -53,6 +59,7 @@ if [ "$1" == "--install" ]; then
|
||||
fi
|
||||
autoreconf -f
|
||||
errorcheck "autoreconf -f"
|
||||
wget http://sourceforge.net/apps/trac/vcmi/export/2443/branches/programmingChallenge/vcmipack.zip
|
||||
cd ..
|
||||
vcmi/configure --datadir=`pwd` --bindir=`pwd`vcmi --libdir=`pwd`
|
||||
errorcheck "configure"
|
||||
@ -83,4 +90,4 @@ elif [ "$1" = "--help" ]; then
|
||||
echo "--install micro unpacks vcmipack.zip and makes appropriate symbolic links."
|
||||
else
|
||||
incusage
|
||||
fi
|
||||
fi
|
Loading…
x
Reference in New Issue
Block a user