mirror of
https://github.com/vcmi/vcmi.git
synced 2025-12-01 23:12:49 +02:00
Further changes for duel mode. It is possible to pass names of AIs to be used by command line. Moved things in battle AI.
This commit is contained in:
@@ -410,10 +410,18 @@ void CClient::newGame( CConnection *con, StartInfo *si )
|
||||
{
|
||||
auto cbc = make_shared<CBattleCallback>(gs, color, this);
|
||||
battleCallbacks[color] = cbc;
|
||||
if(color == PlayerColor(0))
|
||||
battleints[color] = CDynLibHandler::getNewBattleAI(settings["server"]["neutralAI"].String());
|
||||
else
|
||||
battleints[color] = CDynLibHandler::getNewBattleAI("StupidAI");
|
||||
|
||||
std::string AItoGive = it->second.name;
|
||||
if(AItoGive.empty())
|
||||
{
|
||||
if(color == PlayerColor(0))
|
||||
battleints[color] = CDynLibHandler::getNewBattleAI(settings["server"]["neutralAI"].String());
|
||||
else
|
||||
battleints[color] = CDynLibHandler::getNewBattleAI("StupidAI");
|
||||
}
|
||||
|
||||
|
||||
battleints[color] = CDynLibHandler::getNewBattleAI(AItoGive);
|
||||
battleints[color]->init(cbc.get());
|
||||
}
|
||||
}
|
||||
@@ -802,7 +810,7 @@ void CServerHandler::callServer()
|
||||
{
|
||||
setThreadName("CServerHandler::callServer");
|
||||
std::string logName = VCMIDirs::get().localPath() + "/server_log.txt";
|
||||
std::string comm = VCMIDirs::get().serverPath() + " " + port + " > " + logName;
|
||||
std::string comm = VCMIDirs::get().serverPath() + " --port=" + port + " > " + logName;
|
||||
int result = std::system(comm.c_str());
|
||||
if (result == 0)
|
||||
logNetwork->infoStream() << "Server closed correctly";
|
||||
|
||||
Reference in New Issue
Block a user