1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Little more logging.

This commit is contained in:
Michał W. Urbańczyk 2013-02-18 23:10:46 +00:00
parent d45a554fec
commit 6fdf64c2b1
2 changed files with 6 additions and 3 deletions

View File

@ -98,6 +98,7 @@ struct OCM_HLP_CGIN
CPlayerInterface::CPlayerInterface(int Player) CPlayerInterface::CPlayerInterface(int Player)
{ {
tlog5 << "\tHuman player interface for player " << Player << " being constructed\n";
observerInDuelMode = false; observerInDuelMode = false;
howManyPeople++; howManyPeople++;
GH.defActionsDef = 0; GH.defActionsDef = 0;
@ -115,6 +116,7 @@ CPlayerInterface::CPlayerInterface(int Player)
firstCall = 1; //if loading will be overwritten in serialize firstCall = 1; //if loading will be overwritten in serialize
autosaveCount = 0; autosaveCount = 0;
} }
CPlayerInterface::~CPlayerInterface() CPlayerInterface::~CPlayerInterface()
{ {
howManyPeople--; howManyPeople--;

View File

@ -355,12 +355,13 @@ void CClient::newGame( CConnection *con, StartInfo *si )
int sensibleAILimit = settings["session"]["oneGoodAI"].Bool() ? 1 : GameConstants::PLAYER_LIMIT; int sensibleAILimit = settings["session"]["oneGoodAI"].Bool() ? 1 : GameConstants::PLAYER_LIMIT;
for(auto it = gs->scenarioOps->playerInfos.begin(); for(auto it = gs->scenarioOps->playerInfos.begin();
it != gs->scenarioOps->playerInfos.end(); ++it)//initializing interfaces for players it != gs->scenarioOps->playerInfos.end(); ++it)//initializing interfaces for players
{ {
TPlayerColor color = it->first; TPlayerColor color = it->first;
gs->currentPlayer = color; gs->currentPlayer = color;
if(!vstd::contains(myPlayers, color)) if(!vstd::contains(myPlayers, color))
continue; continue;
tlog5 << "Preparing interface for player " << (int)color << std::endl;
if(si->mode != StartInfo::DUEL) if(si->mode != StartInfo::DUEL)
{ {
auto cb = make_shared<CCallback>(gs,color,this); auto cb = make_shared<CCallback>(gs,color,this);
@ -381,6 +382,7 @@ void CClient::newGame( CConnection *con, StartInfo *si )
} }
battleints[color] = playerint[color]; battleints[color] = playerint[color];
tlog5 << "\tInitializing the interface\n";
playerint[color]->init(cb.get()); playerint[color]->init(cb.get());
battleCallbacks[color] = callbacks[color] = cb; battleCallbacks[color] = callbacks[color] = cb;
} }
@ -683,7 +685,6 @@ template void CClient::serialize( COSer<CSaveFile> &h, const int version );
void CServerHandler::startServer() void CServerHandler::startServer()
{ {
th.update(); th.update();
serverThread = new boost::thread(&CServerHandler::callServer, this); //runs server executable; serverThread = new boost::thread(&CServerHandler::callServer, this); //runs server executable;
if(verbose) if(verbose)
tlog0 << "Setting up thread calling server: " << th.getDiff() << std::endl; tlog0 << "Setting up thread calling server: " << th.getDiff() << std::endl;
@ -723,7 +724,7 @@ CServerHandler::CServerHandler(bool runServer /*= false*/)
serverThread = NULL; serverThread = NULL;
shared = NULL; shared = NULL;
port = boost::lexical_cast<std::string>(settings["server"]["port"].Float()); port = boost::lexical_cast<std::string>(settings["server"]["port"].Float());
verbose = false; verbose = true;
boost::interprocess::shared_memory_object::remove("vcmi_memory"); //if the application has previously crashed, the memory may not have been removed. to avoid problems - try to destroy it boost::interprocess::shared_memory_object::remove("vcmi_memory"); //if the application has previously crashed, the memory may not have been removed. to avoid problems - try to destroy it
try try