summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-30 17:35:30 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-30 17:35:30 +0300
commit5ecad5ededdeace6024d8bcd59681677cf4953e1 (patch)
treee502bbc75784b8b025bddaac55cb2804606b1ed2
parent4d03a4b3e2c1a6571f41e75239d6767dcf44e918 (diff)
downloadManaVerse-5ecad5ededdeace6024d8bcd59681677cf4953e1.tar.gz
ManaVerse-5ecad5ededdeace6024d8bcd59681677cf4953e1.tar.bz2
ManaVerse-5ecad5ededdeace6024d8bcd59681677cf4953e1.tar.xz
ManaVerse-5ecad5ededdeace6024d8bcd59681677cf4953e1.zip
Remove additional parameters from processPlayerMoveUpdate function.
-rw-r--r--src/net/ea/beinghandler.h3
-rw-r--r--src/net/eathena/beinghandler.cpp38
-rw-r--r--src/net/eathena/beinghandler.h3
-rw-r--r--src/net/tmwa/beinghandler.cpp38
-rw-r--r--src/net/tmwa/beinghandler.h3
5 files changed, 40 insertions, 45 deletions
diff --git a/src/net/ea/beinghandler.h b/src/net/ea/beinghandler.h
index 6f4a28668..cec1f8b35 100644
--- a/src/net/ea/beinghandler.h
+++ b/src/net/ea/beinghandler.h
@@ -70,9 +70,6 @@ class BeingHandler notfinal : public Net::BeingHandler
virtual void processBeingChangeDirection(Net::MessageIn &msg) const;
- virtual void processPlayerMoveUpdate(Net::MessageIn &msg,
- const int type) const = 0;
-
virtual void processPlayerStop(Net::MessageIn &msg) const;
virtual void processPlayerMoveToAttack(Net::MessageIn &msg) const;
diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp
index 54626ce3c..36c3de56c 100644
--- a/src/net/eathena/beinghandler.cpp
+++ b/src/net/eathena/beinghandler.cpp
@@ -175,24 +175,9 @@ void BeingHandler::handleMessage(Net::MessageIn &msg)
case SMSG_PLAYER_UPDATE_1:
case SMSG_PLAYER_UPDATE_2:
case SMSG_PLAYER_MOVE:
- int type;
- switch (msg.getId())
- {
- case SMSG_PLAYER_UPDATE_1:
- type = 1;
- break;
- case SMSG_PLAYER_UPDATE_2:
- type = 2;
- break;
- case SMSG_PLAYER_MOVE:
- type = 3;
- break;
- default:
- return;
- }
- processPlayerMoveUpdate(msg, type);
-
+ processPlayerMoveUpdate(msg);
break;
+
case SMSG_PLAYER_STOP:
processPlayerStop(msg);
break;
@@ -421,12 +406,27 @@ void BeingHandler::processNameResponse2(Net::MessageIn &msg)
}
}
-void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
- const int msgType) const
+void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg) const
{
if (!actorManager || !localPlayer)
return;
+ int msgType;
+ switch (msg.getId())
+ {
+ case SMSG_PLAYER_UPDATE_1:
+ msgType = 1;
+ break;
+ case SMSG_PLAYER_UPDATE_2:
+ msgType = 2;
+ break;
+ case SMSG_PLAYER_MOVE:
+ msgType = 3;
+ break;
+ default:
+ return;
+ }
+
// An update about a player, potentially including movement.
const int id = msg.readInt32();
const int16_t speed = msg.readInt16();
diff --git a/src/net/eathena/beinghandler.h b/src/net/eathena/beinghandler.h
index 34cce3dc6..7f694cf3c 100644
--- a/src/net/eathena/beinghandler.h
+++ b/src/net/eathena/beinghandler.h
@@ -50,8 +50,7 @@ class BeingHandler final : public MessageHandler, public Ea::BeingHandler
static void processNameResponse2(Net::MessageIn &msg);
- void processPlayerMoveUpdate(Net::MessageIn &msg,
- const int type) const;
+ void processPlayerMoveUpdate(Net::MessageIn &msg) const;
};
} // namespace EAthena
diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp
index b66ad64be..0687c8e17 100644
--- a/src/net/tmwa/beinghandler.cpp
+++ b/src/net/tmwa/beinghandler.cpp
@@ -183,24 +183,9 @@ void BeingHandler::handleMessage(Net::MessageIn &msg)
case SMSG_PLAYER_UPDATE_1:
case SMSG_PLAYER_UPDATE_2:
case SMSG_PLAYER_MOVE:
- int type;
- switch (msg.getId())
- {
- case SMSG_PLAYER_UPDATE_1:
- type = 1;
- break;
- case SMSG_PLAYER_UPDATE_2:
- type = 2;
- break;
- case SMSG_PLAYER_MOVE:
- type = 3;
- break;
- default:
- return;
- }
- processPlayerMoveUpdate(msg, type);
-
+ processPlayerMoveUpdate(msg);
break;
+
case SMSG_PLAYER_STOP:
processPlayerStop(msg);
break;
@@ -453,8 +438,7 @@ void BeingHandler::processNameResponse2(Net::MessageIn &msg)
BLOCK_END("BeingHandler::processNameResponse2")
}
-void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
- const int msgType) const
+void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg) const
{
BLOCK_START("BeingHandler::processPlayerMoveUpdate")
if (!actorManager || !localPlayer)
@@ -463,6 +447,22 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
return;
}
+ int msgType;
+ switch (msg.getId())
+ {
+ case SMSG_PLAYER_UPDATE_1:
+ msgType = 1;
+ break;
+ case SMSG_PLAYER_UPDATE_2:
+ msgType = 2;
+ break;
+ case SMSG_PLAYER_MOVE:
+ msgType = 3;
+ break;
+ default:
+ return;
+ }
+
// An update about a player, potentially including movement.
const int id = msg.readInt32();
const int16_t speed = msg.readInt16();
diff --git a/src/net/tmwa/beinghandler.h b/src/net/tmwa/beinghandler.h
index 235b4da9d..ae5513af0 100644
--- a/src/net/tmwa/beinghandler.h
+++ b/src/net/tmwa/beinghandler.h
@@ -50,8 +50,7 @@ class BeingHandler final : public MessageHandler, public Ea::BeingHandler
static void processNameResponse2(Net::MessageIn &msg);
- void processPlayerMoveUpdate(Net::MessageIn &msg,
- const int type) const;
+ void processPlayerMoveUpdate(Net::MessageIn &msg) const;
static void processBeingMove3(Net::MessageIn &msg);
};