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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user