1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

- Integrated the logging API into the server project - Simplified CBasicLogConfigurator usage(exception handling, logging, log file appending)

This commit is contained in:
beegee1
2013-04-10 17:18:01 +00:00
parent abf96a5b66
commit 6827fcdb53
6 changed files with 151 additions and 140 deletions

View File

@@ -17,12 +17,12 @@
boost::unique_lock<boost::mutex> lock(*c->wmx); \
*c << &temp_message; \
} \
tlog1<<"Player is not allowed to perform this action!\n"; \
logNetwork->errorStream()<<"Player is not allowed to perform this action!"; \
return false;} while(0)
#define WRONG_PLAYER_MSG(expectedplayer) do {std::ostringstream oss;\
oss << "You were identified as player " << gh->getPlayerAt(c) << " while expecting " << expectedplayer;\
tlog1 << oss.str() << std::endl; \
logNetwork->errorStream() << oss.str(); \
if(c) { SystemMessage temp_message(oss.str()); boost::unique_lock<boost::mutex> lock(*c->wmx); *c << &temp_message; } } while(0)
#define ERROR_IF_NOT_OWNS(id) do{if(!PLAYER_OWNS(id)){WRONG_PLAYER_MSG(gh->getOwner(id)); ERROR_AND_RETURN; }}while(0)
@@ -295,7 +295,7 @@ bool SetSelection::applyGh( CGameHandler *gh )
ERROR_IF_NOT(player);
if(!gh->getObj(id))
{
tlog1 << "No such object...\n";
logNetwork->errorStream() << "No such object...";
ERROR_AND_RETURN;
}
gh->sendAndApply(this);