summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorLloyd Bryant <lloyd_bryant@netzero.net>2008-07-18 00:48:14 +0000
committerLloyd Bryant <lloyd_bryant@netzero.net>2008-07-18 00:48:14 +0000
commit159285c5aa24611ceee7e3847a87bf9ea5f7fb7a (patch)
treefa48eb8bb8ed1e62ede1e7a2f95632c2243facab /src/net
parent4dbc9b7af344d3ff006a40e3e0c06ce160f365f9 (diff)
downloadmana-client-159285c5aa24611ceee7e3847a87bf9ea5f7fb7a.tar.gz
mana-client-159285c5aa24611ceee7e3847a87bf9ea5f7fb7a.tar.bz2
mana-client-159285c5aa24611ceee7e3847a87bf9ea5f7fb7a.tar.xz
mana-client-159285c5aa24611ceee7e3847a87bf9ea5f7fb7a.zip
Import of client tree
Diffstat (limited to 'src/net')
-rw-r--r--src/net/beinghandler.cpp51
-rw-r--r--src/net/beinghandler.h2
-rw-r--r--src/net/buysellhandler.cpp2
-rw-r--r--src/net/buysellhandler.h2
-rw-r--r--src/net/charserverhandler.cpp2
-rw-r--r--src/net/charserverhandler.h2
-rw-r--r--src/net/chathandler.cpp2
-rw-r--r--src/net/chathandler.h2
-rw-r--r--src/net/equipmenthandler.cpp2
-rw-r--r--src/net/equipmenthandler.h2
-rw-r--r--src/net/inventoryhandler.cpp2
-rw-r--r--src/net/inventoryhandler.h2
-rw-r--r--src/net/itemhandler.cpp2
-rw-r--r--src/net/itemhandler.h2
-rw-r--r--src/net/loginhandler.cpp16
-rw-r--r--src/net/loginhandler.h6
-rw-r--r--src/net/maploginhandler.cpp2
-rw-r--r--src/net/maploginhandler.h2
-rw-r--r--src/net/messagehandler.cpp2
-rw-r--r--src/net/messagehandler.h2
-rw-r--r--src/net/messagein.cpp2
-rw-r--r--src/net/messagein.h2
-rw-r--r--src/net/messageout.cpp2
-rw-r--r--src/net/messageout.h2
-rw-r--r--src/net/network.cpp4
-rw-r--r--src/net/network.h2
-rw-r--r--src/net/npchandler.cpp2
-rw-r--r--src/net/npchandler.h2
-rw-r--r--src/net/partyhandler.cpp127
-rw-r--r--src/net/partyhandler.h41
-rw-r--r--src/net/playerhandler.cpp29
-rw-r--r--src/net/playerhandler.h2
-rw-r--r--src/net/protocol.cpp2
-rw-r--r--src/net/protocol.h27
-rw-r--r--src/net/skillhandler.cpp2
-rw-r--r--src/net/skillhandler.h2
-rw-r--r--src/net/tradehandler.cpp2
-rw-r--r--src/net/tradehandler.h2
38 files changed, 297 insertions, 64 deletions
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp
index be8412d9..e077ab14 100644
--- a/src/net/beinghandler.cpp
+++ b/src/net/beinghandler.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: beinghandler.cpp 4321 2008-06-02 11:42:26Z b_lindeijer $
*/
#include "beinghandler.h"
@@ -55,6 +55,8 @@ BeingHandler::BeingHandler()
SMSG_PLAYER_UPDATE_1,
SMSG_PLAYER_UPDATE_2,
SMSG_PLAYER_MOVE,
+ SMSG_PLAYER_STOP,
+ SMSG_PLAYER_MOVE_TO_ATTACK,
0x0119,
0
};
@@ -122,7 +124,7 @@ void BeingHandler::handleMessage(MessageIn *msg)
headTop = msg->readInt16();
headMid = msg->readInt16();
hairColor = msg->readInt16();
- msg->readInt16(); // clothes color -not used
+ msg->readInt16(); // clothes color -not used
msg->readInt16(); // head dir
msg->readInt16(); // guild
msg->readInt16(); // unknown
@@ -133,9 +135,9 @@ void BeingHandler::handleMessage(MessageIn *msg)
dstBeing->setGender(1 - msg->readInt8()); // gender
// Set these after the gender, as the sprites may be gender-specific
- dstBeing->setSprite(Being::BOTTOMCLOTHES_SPRITE, headBottom);
- dstBeing->setSprite(Being::TOPCLOTHES_SPRITE, headMid);
- dstBeing->setSprite(Being::HAT_SPRITE, headTop);
+ dstBeing->setSprite(Being::BOTTOMCLOTHES_SPRITE, headBottom);
+ dstBeing->setSprite(Being::TOPCLOTHES_SPRITE, headMid);
+ dstBeing->setSprite(Being::HAT_SPRITE, headTop);
dstBeing->setHairStyle(hairStyle, hairColor);
if (msg->getId() == SMSG_BEING_MOVE)
@@ -257,7 +259,7 @@ void BeingHandler::handleMessage(MessageIn *msg)
case SMSG_BEING_CHANGE_LOOKS2:
{
/*
- * SMSG_BEING_CHANGE_LOOKS (0x00c3) and
+ * SMSG_BEING_CHANGE_LOOKS (0x00c3) and
* SMSG_BEING_CHANGE_LOOKS2 (0x01d7) do basically the same
* thing. The difference is that ...LOOKS carries a single
* 8 bit value, where ...LOOKS2 carries two 16 bit values.
@@ -288,7 +290,7 @@ void BeingHandler::handleMessage(MessageIn *msg)
case 1: // eAthena LOOK_HAIR
dstBeing->setHairStyle(id, -1);
break;
- case 2: // Weapon ID in id, Shield ID in id2
+ case 2: // Weapon ID in id, Shield ID in id2
dstBeing->setSprite(Being::WEAPON_SPRITE, id);
dstBeing->setSprite(Being::SHIELD_SPRITE, id2);
break;
@@ -304,6 +306,9 @@ void BeingHandler::handleMessage(MessageIn *msg)
case 6: // eAthena LOOK_HAIR_COLOR
dstBeing->setHairStyle(-1, id);
break;
+ case 8: // eAthena LOOK_SHIELD
+ dstBeing->setSprite(Being::SHIELD_SPRITE, id);
+ break;
case 9: // eAthena LOOK_SHOES
dstBeing->setSprite(Being::SHOE_SPRITE, id);
break;
@@ -345,7 +350,7 @@ void BeingHandler::handleMessage(MessageIn *msg)
hairStyle = msg->readInt16();
dstBeing->setSprite(Being::WEAPON_SPRITE, msg->readInt16());
dstBeing->setSprite(Being::SHIELD_SPRITE, msg->readInt16());
- headBottom = msg->readInt16();
+ headBottom = msg->readInt16();
if (msg->getId() == SMSG_PLAYER_MOVE)
{
@@ -355,7 +360,7 @@ void BeingHandler::handleMessage(MessageIn *msg)
headTop = msg->readInt16();
headMid = msg->readInt16();
hairColor = msg->readInt16();
- msg->readInt16(); // clothes color - not used
+ msg->readInt16(); // clothes color - not used
msg->readInt16(); // head dir
msg->readInt32(); // guild
msg->readInt32(); // emblem
@@ -364,7 +369,7 @@ void BeingHandler::handleMessage(MessageIn *msg)
dstBeing->setGender(1 - msg->readInt8()); // gender
// Set these after the gender, as the sprites may be gender-specific
- dstBeing->setSprite(Being::BOTTOMCLOTHES_SPRITE, headBottom);
+ dstBeing->setSprite(Being::BOTTOMCLOTHES_SPRITE, headBottom);
dstBeing->setSprite(Being::TOPCLOTHES_SPRITE, headMid);
dstBeing->setSprite(Being::HAT_SPRITE, headTop);
dstBeing->setHairStyle(hairStyle, hairColor);
@@ -406,6 +411,32 @@ void BeingHandler::handleMessage(MessageIn *msg)
dstBeing->mFrame = 0;
break;
+ case SMSG_PLAYER_STOP:
+ // Instruction from server to stop walking at x, y.
+ id = msg->readInt32();
+ dstBeing = beingManager->findBeing(id);
+
+ if (dstBeing) {
+ dstBeing->mX = msg->readInt16();
+ dstBeing->mY = msg->readInt16();
+ if (dstBeing->mAction == Being::WALK) {
+ dstBeing->mFrame = 0;
+ dstBeing->setAction(Being::STAND);
+ }
+ } else {
+ logger->log("0x0088: Non-existent being %d", id);
+ }
+ break;
+
+ case SMSG_PLAYER_MOVE_TO_ATTACK:
+ /*
+ * This is an *advisory* message, telling the client that
+ * it needs to move the character before attacking
+ * a target (out of range, obstruction in line of fire).
+ * We can safely ignore this...
+ */
+ break;
+
case 0x0119:
// Change in players look
logger->log("0x0119 %i %i %i %x %i", msg->readInt32(),
diff --git a/src/net/beinghandler.h b/src/net/beinghandler.h
index 03012f39..5429d962 100644
--- a/src/net/beinghandler.h
+++ b/src/net/beinghandler.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: beinghandler.h 2112 2006-01-22 13:31:13Z der_doener $
*/
#ifndef _TMW_NET_BEINGHANDLER_H
diff --git a/src/net/buysellhandler.cpp b/src/net/buysellhandler.cpp
index 26261664..b4e2cf30 100644
--- a/src/net/buysellhandler.cpp
+++ b/src/net/buysellhandler.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: buysellhandler.cpp 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#include "buysellhandler.h"
diff --git a/src/net/buysellhandler.h b/src/net/buysellhandler.h
index 673aaac1..4da52c95 100644
--- a/src/net/buysellhandler.h
+++ b/src/net/buysellhandler.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: buysellhandler.h 2112 2006-01-22 13:31:13Z der_doener $
*/
#ifndef _TMW_NET_BUYSELLHANDLER_H
diff --git a/src/net/charserverhandler.cpp b/src/net/charserverhandler.cpp
index 5cc53f7d..91f098ba 100644
--- a/src/net/charserverhandler.cpp
+++ b/src/net/charserverhandler.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: charserverhandler.cpp 4330 2008-06-04 08:53:01Z b_lindeijer $
*/
#include "charserverhandler.h"
diff --git a/src/net/charserverhandler.h b/src/net/charserverhandler.h
index ab4ca1c7..663de94d 100644
--- a/src/net/charserverhandler.h
+++ b/src/net/charserverhandler.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: charserverhandler.h 3228 2007-03-22 23:53:13Z b_lindeijer $
*/
#ifndef _TMW_NET_CHARSERVERHANDLER_H
diff --git a/src/net/chathandler.cpp b/src/net/chathandler.cpp
index 524911d3..bee19112 100644
--- a/src/net/chathandler.cpp
+++ b/src/net/chathandler.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: chathandler.cpp 4237 2008-05-14 18:57:32Z b_lindeijer $
*/
#include "chathandler.h"
diff --git a/src/net/chathandler.h b/src/net/chathandler.h
index eed19206..08a560f3 100644
--- a/src/net/chathandler.h
+++ b/src/net/chathandler.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: chathandler.h 2112 2006-01-22 13:31:13Z der_doener $
*/
#ifndef _TMW_NET_CHATHANDLER_H
diff --git a/src/net/equipmenthandler.cpp b/src/net/equipmenthandler.cpp
index 85790b42..7b15ee8b 100644
--- a/src/net/equipmenthandler.cpp
+++ b/src/net/equipmenthandler.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: equipmenthandler.cpp 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#include "equipmenthandler.h"
diff --git a/src/net/equipmenthandler.h b/src/net/equipmenthandler.h
index 656f7a73..0121e6ad 100644
--- a/src/net/equipmenthandler.h
+++ b/src/net/equipmenthandler.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: equipmenthandler.h 2112 2006-01-22 13:31:13Z der_doener $
*/
#ifndef _TMW_NET_EQUIPMENTHANDLER_H
diff --git a/src/net/inventoryhandler.cpp b/src/net/inventoryhandler.cpp
index 48cf18ff..c0661710 100644
--- a/src/net/inventoryhandler.cpp
+++ b/src/net/inventoryhandler.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: inventoryhandler.cpp 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#include "inventoryhandler.h"
diff --git a/src/net/inventoryhandler.h b/src/net/inventoryhandler.h
index aedbc3a1..64ef8464 100644
--- a/src/net/inventoryhandler.h
+++ b/src/net/inventoryhandler.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: inventoryhandler.h 2112 2006-01-22 13:31:13Z der_doener $
*/
#ifndef _TMW_NET_INVENTORYHANDLER_H
diff --git a/src/net/itemhandler.cpp b/src/net/itemhandler.cpp
index 567a5382..9af2be10 100644
--- a/src/net/itemhandler.cpp
+++ b/src/net/itemhandler.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: itemhandler.cpp 2150 2006-02-06 02:56:48Z der_doener $
*/
#include "itemhandler.h"
diff --git a/src/net/itemhandler.h b/src/net/itemhandler.h
index b2104722..702e193a 100644
--- a/src/net/itemhandler.h
+++ b/src/net/itemhandler.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: itemhandler.h 2112 2006-01-22 13:31:13Z der_doener $
*/
#ifndef _TMW_NET_ITEMHANDLER_H
diff --git a/src/net/loginhandler.cpp b/src/net/loginhandler.cpp
index ab788e41..6505e39f 100644
--- a/src/net/loginhandler.cpp
+++ b/src/net/loginhandler.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: loginhandler.cpp 3233 2007-03-24 01:57:39Z b_lindeijer $
*/
#include "loginhandler.h"
@@ -37,6 +37,7 @@ extern SERVER_INFO **server_info;
LoginHandler::LoginHandler()
{
static const Uint16 _messages[] = {
+ 0x0063,
0x0069,
0x006a,
0
@@ -48,6 +49,16 @@ void LoginHandler::handleMessage(MessageIn *msg)
{
switch (msg->getId())
{
+ case 0x0063:
+ int len;
+
+ len = msg->readInt16() - 4;
+ mUpdateHost = msg->readString(len);
+
+ logger->log("Received update host \"%s\" from login server",
+ mUpdateHost.c_str());
+ break;
+
case 0x0069:
// Skip the length word
msg->skip(2);
@@ -70,6 +81,7 @@ void LoginHandler::handleMessage(MessageIn *msg)
server_info[i]->port = msg->readInt16();
server_info[i]->name = msg->readString(20);
server_info[i]->online_users = msg->readInt32();
+ server_info[i]->updateHost = mUpdateHost;
msg->skip(2); // unknown
logger->log("Network: Server: %s (%s:%d)",
@@ -77,7 +89,7 @@ void LoginHandler::handleMessage(MessageIn *msg)
iptostring(server_info[i]->address),
server_info[i]->port);
}
- state = CHAR_SERVER_STATE;
+ state = CHAR_SERVER_STATE;
break;
case 0x006a:
diff --git a/src/net/loginhandler.h b/src/net/loginhandler.h
index 52014559..797655c3 100644
--- a/src/net/loginhandler.h
+++ b/src/net/loginhandler.h
@@ -18,13 +18,14 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: loginhandler.h 2137 2006-02-04 16:54:35Z der_doener $
*/
#ifndef _TMW_NET_LOGINHANDLER_H
#define _TMW_NET_LOGINHANDLER_H
#include "messagehandler.h"
+#include <string>
struct LoginData;
@@ -39,6 +40,9 @@ class LoginHandler : public MessageHandler
protected:
LoginData *mLoginData;
+
+ private:
+ std::string mUpdateHost;
};
#endif
diff --git a/src/net/maploginhandler.cpp b/src/net/maploginhandler.cpp
index 0afc8357..15f70baf 100644
--- a/src/net/maploginhandler.cpp
+++ b/src/net/maploginhandler.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: maploginhandler.cpp 2239 2006-03-09 05:16:27Z der_doener $
*/
#include "maploginhandler.h"
diff --git a/src/net/maploginhandler.h b/src/net/maploginhandler.h
index fe597549..6ff6bc00 100644
--- a/src/net/maploginhandler.h
+++ b/src/net/maploginhandler.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: maploginhandler.h 2112 2006-01-22 13:31:13Z der_doener $
*/
#ifndef _TMW_NET_MAPLOGINHANDLER_H
diff --git a/src/net/messagehandler.cpp b/src/net/messagehandler.cpp
index 849b6716..370a01ab 100644
--- a/src/net/messagehandler.cpp
+++ b/src/net/messagehandler.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: messagehandler.cpp 2112 2006-01-22 13:31:13Z der_doener $
*/
#include "messagehandler.h"
diff --git a/src/net/messagehandler.h b/src/net/messagehandler.h
index c09037f6..90ffa489 100644
--- a/src/net/messagehandler.h
+++ b/src/net/messagehandler.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: messagehandler.h 2112 2006-01-22 13:31:13Z der_doener $
*/
#ifndef _TMW_NET_MESSAGEHANDLER_H
diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp
index bbc0a44c..bec47a5a 100644
--- a/src/net/messagein.cpp
+++ b/src/net/messagein.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: messagein.cpp 2369 2006-06-26 21:32:52Z b_lindeijer $
*/
#include "messagein.h"
diff --git a/src/net/messagein.h b/src/net/messagein.h
index d97cd8b6..0a6b8b8b 100644
--- a/src/net/messagein.h
+++ b/src/net/messagein.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: messagein.h 1879 2005-10-16 21:18:11Z der_doener $
*/
#ifndef _TMW_MESSAGEIN_
diff --git a/src/net/messageout.cpp b/src/net/messageout.cpp
index 9c87e69e..f5f3dad9 100644
--- a/src/net/messageout.cpp
+++ b/src/net/messageout.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: messageout.cpp 3754 2007-11-20 15:19:50Z b_lindeijer $
*/
#include <cstring>
diff --git a/src/net/messageout.h b/src/net/messageout.h
index f6468adb..33deb1bb 100644
--- a/src/net/messageout.h
+++ b/src/net/messageout.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: messageout.h 2112 2006-01-22 13:31:13Z der_doener $
*/
#ifndef _TMW_MESSAGEOUT_
diff --git a/src/net/network.cpp b/src/net/network.cpp
index fa5964d6..4db0df54 100644
--- a/src/net/network.cpp
+++ b/src/net/network.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: network.cpp 3550 2007-08-30 16:46:21Z b_lindeijer $
*/
#include "network.h"
@@ -41,7 +41,7 @@ short packet_lengths[] = {
// #0x0040
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 55, 17, 3, 37, 46, -1, 23, -1, 3,108, 3, 2,
+ 0, 0, 0, -1, 55, 17, 3, 37, 46, -1, 23, -1, 3,108, 3, 2,
3, 28, 19, 11, 3, -1, 9, 5, 54, 53, 58, 60, 41, 2, 6, 6,
// #0x0080
7, 3, 2, 2, 2, 5, 16, 12, 10, 7, 29, 23, -1, -1, -1, 0,
diff --git a/src/net/network.h b/src/net/network.h
index d6fec761..53800b1e 100644
--- a/src/net/network.h
+++ b/src/net/network.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: network.h 3234 2007-03-24 13:05:27Z b_lindeijer $
*/
#ifndef _TMW_NETWORK_
diff --git a/src/net/npchandler.cpp b/src/net/npchandler.cpp
index da21b2a5..29855fc0 100644
--- a/src/net/npchandler.cpp
+++ b/src/net/npchandler.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: npchandler.cpp 2883 2006-12-03 17:00:07Z b_lindeijer $
*/
#include "npchandler.h"
diff --git a/src/net/npchandler.h b/src/net/npchandler.h
index 903ecd10..7abd7495 100644
--- a/src/net/npchandler.h
+++ b/src/net/npchandler.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: npchandler.h 2112 2006-01-22 13:31:13Z der_doener $
*/
#ifndef _TMW_NET_NPCHANDLER_H
diff --git a/src/net/partyhandler.cpp b/src/net/partyhandler.cpp
new file mode 100644
index 00000000..c1f2ba2e
--- /dev/null
+++ b/src/net/partyhandler.cpp
@@ -0,0 +1,127 @@
+/*
+ * The Mana World
+ * Copyright 2004 The Mana World Development Team
+ *
+ * This file is part of The Mana World.
+ *
+ * The Mana World is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * The Mana World is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with The Mana World; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id: partyhandler.cpp
+ */
+
+#include "partyhandler.h"
+
+#include "protocol.h"
+#include "messagein.h"
+
+#include "../gui/chat.h"
+#include "../gui/confirm_dialog.h"
+
+#include "../game.h"
+#include "../party.h"
+#include "../beingmanager.h"
+
+#include <guichan/actionlistener.hpp>
+
+PartyHandler::PartyHandler(Party *party) : mParty(party)
+{
+ static const Uint16 _messages[] = {
+ SMSG_PARTY_CREATE,
+ SMSG_PARTY_INFO,
+ SMSG_PARTY_INVITE,
+ SMSG_PARTY_INVITED,
+ SMSG_PARTY_SETTINGS,
+ SMSG_PARTY_MEMBER_INFO,
+ SMSG_PARTY_LEAVE,
+ SMSG_PARTY_UPDATE_HP,
+ SMSG_PARTY_UPDATE_COORDS,
+ SMSG_PARTY_MESSAGE,
+ 0
+ };
+ handledMessages = _messages;
+}
+
+void
+PartyHandler::handleMessage(MessageIn *msg)
+{
+ switch (msg->getId())
+ {
+ case SMSG_PARTY_CREATE:
+ mParty->createResponse(msg->readInt8());
+ break;
+ case SMSG_PARTY_INFO:
+ break;
+ case SMSG_PARTY_INVITE:
+ {
+ std::string nick = msg->readString(24);
+ int status = msg->readInt8();
+ mParty->inviteResponse(nick, status);
+ break;
+ }
+ case SMSG_PARTY_INVITED:
+ {
+ int id = msg->readInt32();
+ Being *being = beingManager->findBeing(id);
+ if (being == NULL)
+ {
+ break;
+ }
+ std::string nick;
+ int gender = 0;
+ std::string partyName = "";
+ if (being->getType() != Being::PLAYER)
+ {
+ nick = "";
+ }
+ else
+ {
+ nick = being->getName();
+ gender = being->getGender();
+ partyName = msg->readString(24);
+ }
+ mParty->invitedAsk(nick, gender, partyName);
+ break;
+ }
+ case SMSG_PARTY_SETTINGS:
+ break;
+ case SMSG_PARTY_MEMBER_INFO:
+ break;
+ case SMSG_PARTY_LEAVE:
+ {
+ /*int id = */msg->readInt32();
+ std::string nick = msg->readString(24);
+ /*int fail = */msg->readInt8();
+ mParty->leftResponse(nick);
+ break;
+ }
+ case SMSG_PARTY_UPDATE_HP:
+ break;
+ case SMSG_PARTY_UPDATE_COORDS:
+ break;
+ case SMSG_PARTY_MESSAGE:
+ { // new block to enable local variables
+ int msgLength = msg->readInt16() - 8;
+ if (msgLength <= 0)
+ {
+ return;
+ }
+ int id = msg->readInt32();
+ Being *being = beingManager->findBeing(id);
+ std::string chatMsg = msg->readString(msgLength);
+ mParty->receiveChat(being, chatMsg);
+ }
+ break;
+ }
+}
diff --git a/src/net/partyhandler.h b/src/net/partyhandler.h
new file mode 100644
index 00000000..de97d084
--- /dev/null
+++ b/src/net/partyhandler.h
@@ -0,0 +1,41 @@
+/*
+ * The Mana World
+ * Copyright 2004 The Mana World Development Team
+ *
+ * This file is part of The Mana World.
+ *
+ * The Mana World is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * The Mana World is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with The Mana World; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id: partyhandler.h
+ */
+
+#ifndef _TMW_NET_PARTYHANDLER_H
+#define _TMW_NET_PARTYHANDLER_H
+
+#include "messagehandler.h"
+
+class Party;
+
+class PartyHandler : public MessageHandler
+{
+ public:
+ PartyHandler(Party *party);
+
+ void handleMessage(MessageIn *msg);
+ private:
+ Party *mParty;
+};
+
+#endif
diff --git a/src/net/playerhandler.cpp b/src/net/playerhandler.cpp
index 2502c144..7f9e455a 100644
--- a/src/net/playerhandler.cpp
+++ b/src/net/playerhandler.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: playerhandler.cpp 4190 2008-04-26 17:37:03Z peaveydk $
*/
#include "playerhandler.h"
@@ -109,10 +109,16 @@ void PlayerHandler::handleMessage(MessageIn *msg)
switch (msg->getId())
{
case SMSG_WALK_RESPONSE:
- // It is assumed by the client any request to walk actually
- // succeeds on the server. The plan is to have a correction
- // message when the server senses the client has the wrong
- // idea.
+ /*
+ * This client assumes that all walk messages succeed,
+ * and that the server will send a correction notice
+ * otherwise.
+ *
+ * Note that this packet is also used by eAthena to notify
+ * the client of a server-generated auto-move. A patch has
+ * been submitted to Mantis to eliminate these auto moves,
+ * since they're inconsistent with the client design.
+ */
break;
case SMSG_PLAYER_WARP:
@@ -345,18 +351,5 @@ void PlayerHandler::handleMessage(MessageIn *msg)
}
}
break;
-
- //Stop walking
- //case 0x0088: // Disabled because giving some problems
- //if (being = beingManager->findBeing(readInt32(2))) {
- // if (being->getId() != player_node->getId()) {
- // being->action = STAND;
- // being->mFrame = 0;
- // set_coordinates(being->coordinates,
- // readWord(6), readWord(8),
- // get_direction(being->coordinates));
- // }
- //}
- //break;
}
}
diff --git a/src/net/playerhandler.h b/src/net/playerhandler.h
index b28a23f5..f7c0672d 100644
--- a/src/net/playerhandler.h
+++ b/src/net/playerhandler.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: playerhandler.h 2112 2006-01-22 13:31:13Z der_doener $
*/
#ifndef _TMW_NET_PLAYERHANDLER_H
diff --git a/src/net/protocol.cpp b/src/net/protocol.cpp
index d3db50bf..791b7fe5 100644
--- a/src/net/protocol.cpp
+++ b/src/net/protocol.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: protocol.cpp 2158 2006-02-07 10:37:54Z der_doener $
*/
#include "protocol.h"
diff --git a/src/net/protocol.h b/src/net/protocol.h
index 811d5481..f90fcba3 100644
--- a/src/net/protocol.h
+++ b/src/net/protocol.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: protocol.h 4321 2008-06-02 11:42:26Z b_lindeijer $
*/
#ifndef _TMW_PROTOCOL_
@@ -29,6 +29,8 @@
#define SMSG_PLAYER_UPDATE_1 0x01d8
#define SMSG_PLAYER_UPDATE_2 0x01d9
#define SMSG_PLAYER_MOVE 0x01da /**< A nearby player moves */
+#define SMSG_PLAYER_STOP 0x0088 /**< Stop walking, set position */
+#define SMSG_PLAYER_MOVE_TO_ATTACK 0x0139 /**< Move to within attack range */
#define SMSG_PLAYER_STAT_UPDATE_1 0x00b0
#define SMSG_PLAYER_STAT_UPDATE_2 0x00b1
#define SMSG_PLAYER_STAT_UPDATE_3 0x0141
@@ -63,6 +65,7 @@
#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_NPC_MESSAGE 0x00b4
#define SMSG_NPC_NEXT 0x00b5
#define SMSG_NPC_CLOSE 0x00b6
@@ -72,11 +75,13 @@
#define SMSG_NPC_SELL 0x00c7
#define SMSG_NPC_BUY_RESPONSE 0x00ca
#define SMSG_NPC_SELL_RESPONSE 0x00cb
+
#define SMSG_PLAYER_CHAT 0x008e /**< Player talks */
#define SMSG_WHISPER 0x0097 /**< Whisper Recieved */
#define SMSG_WHISPER_RESPONSE 0x0098
#define SMSG_GM_CHAT 0x009a /**< GM announce */
#define SMSG_WALK_RESPONSE 0x0087
+
#define SMSG_TRADE_REQUEST 0x00e5 /**< Receiving a request to trade */
#define SMSG_TRADE_RESPONSE 0x00e7
#define SMSG_TRADE_ITEM_ADD 0x00e9
@@ -85,6 +90,17 @@
#define SMSG_TRADE_CANCEL 0x00ee
#define SMSG_TRADE_COMPLETE 0x00f0
+#define SMSG_PARTY_CREATE 0x00fa
+#define SMSG_PARTY_INFO 0x00fb
+#define SMSG_PARTY_INVITE 0x00fd
+#define SMSG_PARTY_INVITED 0x00fe
+#define SMSG_PARTY_SETTINGS 0x0102
+#define SMSG_PARTY_MEMBER_INFO 0x0104
+#define SMSG_PARTY_LEAVE 0x0105
+#define SMSG_PARTY_UPDATE_HP 0x0106
+#define SMSG_PARTY_UPDATE_COORDS 0x0107
+#define SMSG_PARTY_MESSAGE 0x0109
+
// Packets from client to server
#define CMSG_TRADE_RESPONSE 0x00e6
#define CMSG_ITEM_PICKUP 0x009f
@@ -93,6 +109,8 @@
#define CMSG_NPC_BUY_SELL_REQUEST 0x00c5
#define CMSG_CHAT_MESSAGE 0x008c
#define CMSG_CHAT_WHISPER 0x0096
+#define CMSG_CHAT_ANNOUNCE 0x0099
+#define CMSG_CHAT_WHO 0x00c1
#define CMSG_NPC_LIST_CHOICE 0x00b8
#define CMSG_NPC_NEXT_REQUEST 0x00b9
#define CMSG_NPC_SELL_REQUEST 0x00c9
@@ -109,6 +127,13 @@
#define CMSG_PLAYER_EQUIP 0x00a9
#define CMSG_PLAYER_UNEQUIP 0x00ab
+#define CMSG_PARTY_CREATE 0x00f9
+#define CMSG_PARTY_INVITE 0x00fc
+#define CMSG_PARTY_INVITED 0x00ff
+#define CMSG_PARTY_LEAVE 0x0100 /** Undocumented */
+#define CMSG_PARTY_SETTINGS 0x0101
+#define CMSG_PARTY_MESSAGE 0x0108
+
/** Encodes coords and direction in 3 bytes data */
void set_coordinates(char *data, unsigned short x, unsigned short y, unsigned char direction);
diff --git a/src/net/skillhandler.cpp b/src/net/skillhandler.cpp
index 828c2378..1f9403f4 100644
--- a/src/net/skillhandler.cpp
+++ b/src/net/skillhandler.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: skillhandler.cpp 2832 2006-11-05 20:57:59Z b_lindeijer $
*/
#include "skillhandler.h"
diff --git a/src/net/skillhandler.h b/src/net/skillhandler.h
index 820a7b6a..734772b4 100644
--- a/src/net/skillhandler.h
+++ b/src/net/skillhandler.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: skillhandler.h 2112 2006-01-22 13:31:13Z der_doener $
*/
#ifndef _TMW_NET_SKILLHANDLER_H
diff --git a/src/net/tradehandler.cpp b/src/net/tradehandler.cpp
index 9599fa9d..cfd24977 100644
--- a/src/net/tradehandler.cpp
+++ b/src/net/tradehandler.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: tradehandler.cpp 4354 2008-06-17 16:52:44Z the_enemy $
*/
#include "tradehandler.h"
diff --git a/src/net/tradehandler.h b/src/net/tradehandler.h
index a1971004..22e01f48 100644
--- a/src/net/tradehandler.h
+++ b/src/net/tradehandler.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: tradehandler.h 4237 2008-05-14 18:57:32Z b_lindeijer $
*/
#ifndef _TMW_NET_TRADEHANDLER_H