summaryrefslogtreecommitdiff
path: root/src/net/manaserv
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2012-01-01 20:20:21 +0100
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2012-01-10 20:31:51 +0100
commit683da50e37fbbb2e3f70a4421a06dabd9bb912d8 (patch)
tree065526585f7af480df2eae40ed0acc1595331fd4 /src/net/manaserv
parent8a88347e9ee6ce9f14d638cf602f3a763bc3ff01 (diff)
downloadmana-683da50e37fbbb2e3f70a4421a06dabd9bb912d8.tar.gz
mana-683da50e37fbbb2e3f70a4421a06dabd9bb912d8.tar.bz2
mana-683da50e37fbbb2e3f70a4421a06dabd9bb912d8.tar.xz
mana-683da50e37fbbb2e3f70a4421a06dabd9bb912d8.zip
player_node -> local_player
Reviewed-by: Ablu
Diffstat (limited to 'src/net/manaserv')
-rw-r--r--src/net/manaserv/beinghandler.cpp10
-rw-r--r--src/net/manaserv/charhandler.cpp2
-rw-r--r--src/net/manaserv/chathandler.cpp4
-rw-r--r--src/net/manaserv/gamehandler.cpp2
-rw-r--r--src/net/manaserv/guildhandler.cpp10
-rw-r--r--src/net/manaserv/partyhandler.cpp8
-rw-r--r--src/net/manaserv/playerhandler.cpp14
7 files changed, 25 insertions, 25 deletions
diff --git a/src/net/manaserv/beinghandler.cpp b/src/net/manaserv/beinghandler.cpp
index 91c7d621..3e635d43 100644
--- a/src/net/manaserv/beinghandler.cpp
+++ b/src/net/manaserv/beinghandler.cpp
@@ -132,9 +132,9 @@ void BeingHandler::handleBeingEnterMessage(Net::MessageIn &msg)
case OBJECT_CHARACTER:
{
std::string name = msg.readString();
- if (player_node->getName() == name)
+ if (local_player->getName() == name)
{
- being = player_node;
+ being = local_player;
being->setId(id);
}
else
@@ -222,7 +222,7 @@ void BeingHandler::handleBeingsMoveMessage(Net::MessageIn &msg)
}
// Ignore messages from the server for the local player
- if (being == player_node)
+ if (being == local_player)
continue;
// If the position differs too much from the actual one, we resync
@@ -294,7 +294,7 @@ void BeingHandler::handleBeingActionChangeMessage(Net::MessageIn &msg)
being->setAction(action);
- if (action == Being::DEAD && being == player_node)
+ if (action == Being::DEAD && being == local_player)
{
static char const *const deadMsg[] =
{
@@ -346,7 +346,7 @@ void BeingHandler::handleBeingDirChangeMessage(Net::MessageIn &msg)
int data = msg.readInt8();
// The direction for the player's character is handled on client side.
- if (being != player_node)
+ if (being != local_player)
being->setDirection((BeingDirection) data);
}
diff --git a/src/net/manaserv/charhandler.cpp b/src/net/manaserv/charhandler.cpp
index 5017d6ea..8a072d26 100644
--- a/src/net/manaserv/charhandler.cpp
+++ b/src/net/manaserv/charhandler.cpp
@@ -252,7 +252,7 @@ void CharHandler::handleCharacterSelectResponse(Net::MessageIn &msg)
chatServer.port);
// Prevent the selected local player from being deleted
- player_node = mSelectedCharacter->dummy;
+ local_player = mSelectedCharacter->dummy;
PlayerInfo::setBackend(mSelectedCharacter->data);
mSelectedCharacter->dummy = 0;
diff --git a/src/net/manaserv/chathandler.cpp b/src/net/manaserv/chathandler.cpp
index b6749e7c..c3a9c964 100644
--- a/src/net/manaserv/chathandler.cpp
+++ b/src/net/manaserv/chathandler.cpp
@@ -43,7 +43,7 @@
#include <string>
#include <iostream>
-extern Being *player_node;
+extern Being *local_player;
extern Net::ChatHandler *chatHandler;
@@ -165,7 +165,7 @@ void ChatHandler::handleGameChatMessage(Net::MessageIn &msg)
std::string mes = being->getName() + " : " + chatMsg;
- Event event(being == player_node ? Event::Player
+ Event event(being == local_player ? Event::Player
: Event::Being);
event.setString("message", mes);
event.setString("text", chatMsg);
diff --git a/src/net/manaserv/gamehandler.cpp b/src/net/manaserv/gamehandler.cpp
index e9c2442a..99326be4 100644
--- a/src/net/manaserv/gamehandler.cpp
+++ b/src/net/manaserv/gamehandler.cpp
@@ -137,7 +137,7 @@ void GameHandler::gameLoading()
// Attack range from item DB
// TODO: Deharcode it through equipment handling
- player_node->setAttackRange(48);
+ local_player->setAttackRange(48);
}
} // namespace ManaServ
diff --git a/src/net/manaserv/guildhandler.cpp b/src/net/manaserv/guildhandler.cpp
index a2c571bc..1e656d87 100644
--- a/src/net/manaserv/guildhandler.cpp
+++ b/src/net/manaserv/guildhandler.cpp
@@ -119,7 +119,7 @@ void GuildHandler::handleMessage(Net::MessageIn &msg)
GuildMember *member;
short guildId = msg.readInt16();
- guild = player_node->getGuild(guildId);
+ guild = local_player->getGuild(guildId);
if (!guild)
return;
@@ -147,7 +147,7 @@ void GuildHandler::handleMessage(Net::MessageIn &msg)
char eventId = msg.readInt8();
GuildMember *member;
- Guild *guild = player_node->getGuild(guildId);
+ Guild *guild = local_player->getGuild(guildId);
if (guild)
{
switch(eventId)
@@ -226,12 +226,12 @@ void GuildHandler::handleMessage(Net::MessageIn &msg)
// Must remove tab first, as it wont find the guild
// name after its removed from the player
int guildId = msg.readInt16();
- Guild *guild = player_node->getGuild(guildId);
+ Guild *guild = local_player->getGuild(guildId);
if (guild)
{
Channel *channel = channelManager->findByName(guild->getName());
channelManager->removeChannel(channel);
- player_node->removeGuild(guildId);
+ local_player->removeGuild(guildId);
}
}
} break;
@@ -250,7 +250,7 @@ void GuildHandler::joinedGuild(Net::MessageIn &msg)
Guild *guild = Guild::getGuild(guildId);
guild->setName(guildName);
guild->setRights(permissions);
- player_node->addGuild(guild);
+ local_player->addGuild(guild);
Net::getGuildHandler()->memberList(guildId);
// Automatically create the guild channel
diff --git a/src/net/manaserv/partyhandler.cpp b/src/net/manaserv/partyhandler.cpp
index e1bcb624..ee2c7055 100644
--- a/src/net/manaserv/partyhandler.cpp
+++ b/src/net/manaserv/partyhandler.cpp
@@ -87,7 +87,7 @@ void PartyHandler::handleMessage(Net::MessageIn &msg)
switch (msg.readInt8())
{
case ERRMSG_OK:
- player_node->setParty(mParty);
+ local_player->setParty(mParty);
while (msg.getUnreadLength())
{
std::string name = msg.readString();
@@ -113,7 +113,7 @@ void PartyHandler::handleMessage(Net::MessageIn &msg)
if (msg.readInt8() == ERRMSG_OK)
{
mParty->clearMembers();
- player_node->setParty(NULL);
+ local_player->setParty(NULL);
}
} break;
@@ -128,8 +128,8 @@ void PartyHandler::handleMessage(Net::MessageIn &msg)
SERVER_NOTICE(strprintf(_("%s joined the party%s."),
name.c_str(), s.c_str()));
- if (name == player_node->getName())
- player_node->setParty(mParty);
+ if (name == local_player->getName())
+ local_player->setParty(mParty);
mParty->addMember(0, name);
} break;
diff --git a/src/net/manaserv/playerhandler.cpp b/src/net/manaserv/playerhandler.cpp
index d7c3dab6..43af40f5 100644
--- a/src/net/manaserv/playerhandler.cpp
+++ b/src/net/manaserv/playerhandler.cpp
@@ -105,7 +105,7 @@ void PlayerHandler::handleMessage(Net::MessageIn &msg)
gameServerConnection->disconnect();
Client::setState(STATE_CHANGE_MAP);
- player_node->setMap(0);
+ local_player->setMap(0);
} break;
case GPMSG_PLAYER_ATTRIBUTE_CHANGE:
@@ -154,7 +154,7 @@ void PlayerHandler::handleMessage(Net::MessageIn &msg)
paths.getStringValue("particles")
+ paths.getStringValue("levelUpEffectFile")
,0, 0);
- player_node->controlParticle(effect);
+ local_player->controlParticle(effect);
} break;
@@ -291,7 +291,7 @@ void PlayerHandler::handleMapChangeMessage(Net::MessageIn &msg)
// Switch the actual map, deleting the previous one
game->changeMap(mapName);
- const Vector &playerPos = player_node->getPosition();
+ const Vector &playerPos = local_player->getPosition();
float scrollOffsetX = 0.0f;
float scrollOffsetY = 0.0f;
@@ -304,9 +304,9 @@ void PlayerHandler::handleMapChangeMessage(Net::MessageIn &msg)
scrollOffsetY = y - (int) playerPos.y;
}
- player_node->setAction(Being::STAND);
- player_node->setPosition(x, y);
- player_node->setDestination(x, y);
+ local_player->setAction(Being::STAND);
+ local_player->setPosition(x, y);
+ local_player->setDestination(x, y);
logger->log("Adjust scrolling by %d,%d", (int) scrollOffsetX,
(int) scrollOffsetY);
@@ -373,7 +373,7 @@ void PlayerHandler::setDestination(int x, int y, int /* direction */)
void PlayerHandler::changeAction(Being::Action action)
{
- player_node->setAction(action);
+ local_player->setAction(action);
MessageOut msg(PGMSG_ACTION_CHANGE);
msg.writeInt8(action);