2011-09-27 21:54:40 +00:00
|
|
|
#include "../global.h"
|
|
|
|
#include <boost/thread.hpp>
|
|
|
|
#include <boost/bind.hpp>
|
|
|
|
|
2011-10-11 13:16:28 +00:00
|
|
|
int main(int argc, const char **argv)
|
2011-09-27 21:54:40 +00:00
|
|
|
{
|
2011-10-01 15:07:07 +00:00
|
|
|
std::string runnername =
|
|
|
|
#ifdef _WIN32
|
|
|
|
"VCMI_BattleAiHost.exe"
|
|
|
|
#else
|
|
|
|
"./vcmirunner"
|
|
|
|
#endif
|
|
|
|
;
|
|
|
|
std::string servername =
|
|
|
|
#ifdef _WIN32
|
|
|
|
"VCMI_server.exe"
|
|
|
|
#else
|
|
|
|
"./vcmiserver"
|
|
|
|
#endif
|
2011-10-06 20:55:19 +00:00
|
|
|
;
|
|
|
|
|
2011-10-11 13:16:28 +00:00
|
|
|
std::string serverCommand = servername + " b1.json StupidAI MadAI"; // StupidAI MadAI
|
2011-10-06 20:55:19 +00:00
|
|
|
boost::thread t(boost::bind(std::system, serverCommand.c_str()));
|
2011-10-01 15:07:07 +00:00
|
|
|
boost::thread tt(boost::bind(std::system, runnername.c_str()));
|
|
|
|
boost::thread ttt(boost::bind(std::system, runnername.c_str()));
|
2011-09-29 21:53:39 +00:00
|
|
|
if(argc == 2)
|
|
|
|
{
|
|
|
|
boost::this_thread::sleep(boost::posix_time::millisec(500)); //FIXME
|
|
|
|
boost::thread tttt(boost::bind(std::system, "VCMI_Client.exe -battle"));
|
|
|
|
}
|
|
|
|
else if(argc == 1)
|
2011-10-01 15:07:07 +00:00
|
|
|
boost::thread tttt(boost::bind(std::system, runnername.c_str()));
|
2011-09-29 21:53:39 +00:00
|
|
|
|
2011-09-28 17:58:06 +00:00
|
|
|
//boost::this_thread::sleep(boost::posix_time::seconds(5));
|
2011-09-27 21:54:40 +00:00
|
|
|
|
2011-09-28 17:58:06 +00:00
|
|
|
t.join();
|
2011-09-27 21:54:40 +00:00
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|