summaryrefslogtreecommitdiff
path: root/src/net/manaserv/playerhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/manaserv/playerhandler.cpp')
-rw-r--r--src/net/manaserv/playerhandler.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/net/manaserv/playerhandler.cpp b/src/net/manaserv/playerhandler.cpp
index 8ee9ed80..edae6be6 100644
--- a/src/net/manaserv/playerhandler.cpp
+++ b/src/net/manaserv/playerhandler.cpp
@@ -96,7 +96,7 @@ void PlayerHandler::handleMessage(MessageIn &msg)
netToken = msg.readString(32);
std::string address = msg.readString();
int port = msg.readInt16();
- logger->log("Changing server to %s:%d", address.c_str(), port);
+ Log::info("Changing server to %s:%d", address.c_str(), port);
gameServer.hostname = address;
gameServer.port = port;
@@ -147,14 +147,14 @@ void PlayerHandler::handleMessage(MessageIn &msg)
} break;
case ATTRIBMOD_INVALID_ATTRIBUTE:
{
- logger->log("Warning: Server denied increase of attribute %d (unknown attribute) ", attrNum);
+ Log::warn("Server denied increase of attribute %d (unknown attribute) ", attrNum);
} break;
case ATTRIBMOD_NO_POINTS_LEFT:
{
// when the server says "you got no points" it
// has to be correct. The server is always right!
// undo attribute change and set points to 0
- logger->log("Warning: Server denied increase of attribute %d (no points left) ", attrNum);
+ Log::warn("Server denied increase of attribute %d (no points left) ", attrNum);
int attrValue = PlayerInfo::getStatBase(attrNum) - 1;
PlayerInfo::setAttribute(CHAR_POINTS, 0);
PlayerInfo::setStatBase(attrNum, attrValue);
@@ -162,7 +162,7 @@ void PlayerHandler::handleMessage(MessageIn &msg)
case ATTRIBMOD_DENIED:
{
// undo attribute change
- logger->log("Warning: Server denied increase of attribute %d (reason unknown) ", attrNum);
+ Log::warn("Server denied increase of attribute %d (reason unknown) ", attrNum);
int points = PlayerInfo::getAttribute(CHAR_POINTS) - 1;
PlayerInfo::setAttribute(CHAR_POINTS, points);
@@ -184,14 +184,14 @@ void PlayerHandler::handleMessage(MessageIn &msg)
} break;
case ATTRIBMOD_INVALID_ATTRIBUTE:
{
- logger->log("Warning: Server denied reduction of attribute %d (unknown attribute) ", attrNum);
+ Log::warn("Server denied reduction of attribute %d (unknown attribute) ", attrNum);
} break;
case ATTRIBMOD_NO_POINTS_LEFT:
{
// when the server says "you got no points" it
// has to be correct. The server is always right!
// undo attribute change and set points to 0
- logger->log("Warning: Server denied reduction of attribute %d (no points left) ", attrNum);
+ Log::warn("Server denied reduction of attribute %d (no points left) ", attrNum);
int attrValue = PlayerInfo::getStatBase(attrNum) + 1;
// TODO are these right?
PlayerInfo::setAttribute(CHAR_POINTS, 0);
@@ -201,7 +201,7 @@ void PlayerHandler::handleMessage(MessageIn &msg)
case ATTRIBMOD_DENIED:
{
// undo attribute change
- logger->log("Warning: Server denied reduction of attribute %d (reason unknown) ", attrNum);
+ Log::warn("Server denied reduction of attribute %d (reason unknown) ", attrNum);
int charaPoints = PlayerInfo::getAttribute(CHAR_POINTS) - 1;
PlayerInfo::setAttribute(CHAR_POINTS, charaPoints);
@@ -245,7 +245,7 @@ void PlayerHandler::handleMessage(MessageIn &msg)
BY_SERVER);
break;
default:
- logger->log("0x013b: Unhandled message %i", type);
+ Log::info("0x013b: Unhandled message %i", type);
break;
}
}
@@ -263,7 +263,7 @@ void PlayerHandler::handleMapChangeMessage(MessageIn &msg)
Game *game = Game::instance();
const bool sameMap = (game->getCurrentMapName() == mapName);
- logger->log("Changing map to %s (%d, %d)", mapName.c_str(), x, y);
+ Log::info("Changing map to %s (%d, %d)", mapName.c_str(), x, y);
// Switch the actual map, deleting the previous one
game->changeMap(mapName);
@@ -285,8 +285,8 @@ void PlayerHandler::handleMapChangeMessage(MessageIn &msg)
local_player->setPosition(x, y);
local_player->setDestination(x, y);
- logger->log("Adjust scrolling by %d,%d", (int) scrollOffsetX,
- (int) scrollOffsetY);
+ Log::info("Adjust scrolling by %d,%d", (int) scrollOffsetX,
+ (int) scrollOffsetY);
viewport->scrollBy(scrollOffsetX, scrollOffsetY);
}
@@ -295,7 +295,7 @@ void PlayerHandler::attack(int id)
auto ability = AbilityDB::find("Strike");
if (!ability)
{
- logger->log("PlayerHandler::attack: 'Strike' ability not found.");
+ Log::info("PlayerHandler::attack: 'Strike' ability not found.");
return;
}
@@ -304,7 +304,7 @@ void PlayerHandler::attack(int id)
abilityHandler->useOn(ability->id, id);
break;
case AbilityInfo::TARGET_POINT:
- logger->log("PlayerHandler::attack: Unsupported target mode 'point' for 'Strike' ability.");
+ Log::info("PlayerHandler::attack: Unsupported target mode 'point' for 'Strike' ability.");
break;
case AbilityInfo::TARGET_DIRECTION:
abilityHandler->useInDirection(ability->id, local_player->getDirection());
@@ -420,8 +420,8 @@ Vector PlayerHandler::getPixelsPerSecondMoveSpeed(const Vector &speed, Map *map)
if (!map)
{
- logger->log("Manaserv::PlayerHandler: Speed wasn't given back"
- " because Map not initialized.");
+ Log::info("Manaserv::PlayerHandler: Speed wasn't given back"
+ " because Map not initialized.");
return speedInPixels;
}