From 67571d58236c8d2db221ae5c8ea6da64c63ca1d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20W=2E=20Urba=C5=84czyk?= Date: Fri, 9 Dec 2011 23:09:21 +0000 Subject: [PATCH] [programming challenge] More fixes for paths. Logging AI name with PID in server logs. --- VCMI_VS10.sln | 2 -- lib/CGameInterface.cpp | 4 ++-- server/CVCMIServer.cpp | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/VCMI_VS10.sln b/VCMI_VS10.sln index 96557d0ba..cc011492a 100644 --- a/VCMI_VS10.sln +++ b/VCMI_VS10.sln @@ -22,8 +22,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Odpalarka", "Odpalarka\Odpa {B952FFC5-3039-4DE1-9F08-90ACDA483D8F} = {B952FFC5-3039-4DE1-9F08-90ACDA483D8F} EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8C710950-7839-490C-8412-C60AC4D5238B}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VCMI_client", "client\VCMI_client.vcxproj", "{8355EBA8-65C2-44A4-BC2D-78053E1BF2D6}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MadAI", "AI\MadAI\MadAI.vcxproj", "{DF931F3D-6DD2-4D1F-ADE9-F0098B5AE3F0}" diff --git a/lib/CGameInterface.cpp b/lib/CGameInterface.cpp index a30618f10..852437c8a 100644 --- a/lib/CGameInterface.cpp +++ b/lib/CGameInterface.cpp @@ -76,8 +76,8 @@ template rett * createAnyAI(std::string dllname, std::string methodName) { tlog1 << "Opening " << dllname<<"\n"; - - if(vstd::contains(dllname, '/')) + + if(vstd::contains(dllname, '/') || vstd::contains(dllname, '\\')) { tlog1 << "Assuming that AI is an absolute path.\n"; } diff --git a/server/CVCMIServer.cpp b/server/CVCMIServer.cpp index 95469a031..3cc56985b 100644 --- a/server/CVCMIServer.cpp +++ b/server/CVCMIServer.cpp @@ -625,7 +625,7 @@ void CVCMIServer::startDuel(const std::string &battle, const std::string &leftAI { if(aisSoFar < 2) { - tlog0 << " (PID=" << pidsFromConns[c] << ") will run " << (aisSoFar ? "right" : "left") << " AI " << std::endl; + tlog0 << " (PID=" << pidsFromConns[c] << ") will run " << (aisSoFar ? "right" : "left") << " AI: " << gh->ais[aisSoFar] << std::endl; *c << gh->ais[aisSoFar] << ui8(aisSoFar); PIDs[aisSoFar] = pidsFromConns[c]; aisSoFar++;