summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/net/ea/beinghandler.cpp13
-rw-r--r--src/net/ea/partyhandler.cpp5
-rw-r--r--src/net/ea/partyhandler.h2
-rw-r--r--src/net/ea/playerhandler.cpp4
-rw-r--r--src/net/ea/protocol.h2
-rw-r--r--src/net/partyhandler.h2
6 files changed, 27 insertions, 1 deletions
diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp
index 7fc28f15..8ad15f76 100644
--- a/src/net/ea/beinghandler.cpp
+++ b/src/net/ea/beinghandler.cpp
@@ -57,6 +57,7 @@ BeingHandler::BeingHandler(bool enableSync):
SMSG_BEING_CHANGE_LOOKS,
SMSG_BEING_CHANGE_LOOKS2,
SMSG_BEING_NAME_RESPONSE,
+ SMSG_BEING_CHANGE_DIRECTION,
SMSG_PLAYER_UPDATE_1,
SMSG_PLAYER_UPDATE_2,
SMSG_PLAYER_MOVE,
@@ -414,6 +415,18 @@ void BeingHandler::handleMessage(MessageIn &msg)
}
break;
+ case SMSG_BEING_CHANGE_DIRECTION:
+ if (!(dstBeing = beingManager->findBeing(msg.readInt32())))
+ {
+ break;
+ }
+
+ msg.readInt16(); // unused
+
+ dstBeing->setDirection(msg.readInt8());
+
+ break;
+
case SMSG_PLAYER_UPDATE_1:
case SMSG_PLAYER_UPDATE_2:
case SMSG_PLAYER_MOVE:
diff --git a/src/net/ea/partyhandler.cpp b/src/net/ea/partyhandler.cpp
index a021c6d7..863765d5 100644
--- a/src/net/ea/partyhandler.cpp
+++ b/src/net/ea/partyhandler.cpp
@@ -225,6 +225,11 @@ void PartyHandler::invite(int playerId)
outMsg.writeInt32(playerId);
}
+void PartyHandler::invite(const std::string &name)
+{
+ // TODO
+}
+
void PartyHandler::inviteResponse(bool accept)
{
MessageOut outMsg(CMSG_PARTY_INVITED);
diff --git a/src/net/ea/partyhandler.h b/src/net/ea/partyhandler.h
index df38bd6c..d156cdc1 100644
--- a/src/net/ea/partyhandler.h
+++ b/src/net/ea/partyhandler.h
@@ -41,6 +41,8 @@ class PartyHandler : public MessageHandler, public Net::PartyHandler
void invite(int playerId);
+ void invite(const std::string &name);
+
void inviteResponse(bool accept);
void leave();
diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp
index 8c9b6f5e..3b8b86af 100644
--- a/src/net/ea/playerhandler.cpp
+++ b/src/net/ea/playerhandler.cpp
@@ -491,7 +491,9 @@ void PlayerHandler::pickUp(FloorItem *floorItem)
void PlayerHandler::setDirection(char direction)
{
- // TODO
+ MessageOut outMsg(CMSG_PLAYER_CHANGE_DIR);
+ outMsg.writeInt16(0);
+ outMsg.writeInt8(direction);
}
void PlayerHandler::setDestination(int x, int y, int direction)
diff --git a/src/net/ea/protocol.h b/src/net/ea/protocol.h
index 4dc7db36..a9028f7e 100644
--- a/src/net/ea/protocol.h
+++ b/src/net/ea/protocol.h
@@ -73,6 +73,7 @@ static const int STORAGE_OFFSET = 1;
#define SMSG_BEING_ACTION 0x008a /**< Attack, sit, stand up, ... */
#define SMSG_BEING_CHAT 0x008d /**< A being talks */
#define SMSG_BEING_NAME_RESPONSE 0x0095 /**< Has to be requested */
+#define SMSG_BEING_CHANGE_DIRECTION 0x009c
#define SMSG_NPC_MESSAGE 0x00b4
#define SMSG_NPC_NEXT 0x00b5
@@ -147,6 +148,7 @@ static const int STORAGE_OFFSET = 1;
#define CMSG_PLAYER_INVENTORY_DROP 0x00a2
#define CMSG_PLAYER_EQUIP 0x00a9
#define CMSG_PLAYER_UNEQUIP 0x00ab
+#define CMSG_PLAYER_CHANGE_DIR 0x009b
#define CMSG_NPC_TALK 0x0090
#define CMSG_NPC_NEXT_REQUEST 0x00b9
diff --git a/src/net/partyhandler.h b/src/net/partyhandler.h
index 2d61d9cd..af84a746 100644
--- a/src/net/partyhandler.h
+++ b/src/net/partyhandler.h
@@ -35,6 +35,8 @@ class PartyHandler
virtual void invite(int playerId) = 0;
+ virtual void invite(const std::string &name) = 0;
+
virtual void inviteResponse(bool accept) = 0;
virtual void leave() = 0;