summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2006-09-02 11:58:35 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2006-09-02 11:58:35 +0000
commit2b322bf18d80acb464a9dc1820e581e7204cca1e (patch)
tree6938f1d8f63c8d8c1142b972117b42d2c50d1883 /src/net
parentda43e09d2b043d5c75ad0adb87dd43f1fe36fe8f (diff)
downloadmana-2b322bf18d80acb464a9dc1820e581e7204cca1e.tar.gz
mana-2b322bf18d80acb464a9dc1820e581e7204cca1e.tar.bz2
mana-2b322bf18d80acb464a9dc1820e581e7204cca1e.tar.xz
mana-2b322bf18d80acb464a9dc1820e581e7204cca1e.zip
Switched to short IDs for beings.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/beinghandler.cpp9
-rw-r--r--src/net/charserverhandler.cpp2
-rw-r--r--src/net/chathandler.cpp6
-rw-r--r--src/net/protocol.h9
4 files changed, 14 insertions, 12 deletions
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp
index e3eb6eba..8ccd3dd6 100644
--- a/src/net/beinghandler.cpp
+++ b/src/net/beinghandler.cpp
@@ -398,7 +398,7 @@ void
BeingHandler::handleBeingEnterMessage(MessageIn &msg)
{
int type = msg.readByte(); // type
- int id = msg.readLong();
+ int id = msg.readShort();
switch (type) {
case OBJECT_PLAYER:
@@ -431,8 +431,7 @@ BeingHandler::handleBeingEnterMessage(MessageIn &msg)
void BeingHandler::handleBeingLeaveMessage(MessageIn &msg)
{
- msg.readByte(); // type, assume player for now, TODO
- Being *being = beingManager->findBeing(msg.readLong());
+ Being *being = beingManager->findBeing(msg.readShort());
if (!being) return;
if (being == player_node->getTarget())
{
@@ -443,9 +442,9 @@ void BeingHandler::handleBeingLeaveMessage(MessageIn &msg)
void BeingHandler::handleBeingsMoveMessage(MessageIn &msg)
{
- for (int nb = (msg.getLength() - 2) / (4 + 4 * 2); nb > 0; --nb)
+ for (int nb = (msg.getLength() - 2) / (2 + 4 * 2); nb > 0; --nb)
{
- Uint32 id = msg.readLong();
+ Uint16 id = msg.readShort();
Being *being = beingManager->findBeing(id);
if (!being) continue;
int sx = msg.readShort(), sy = msg.readShort(),
diff --git a/src/net/charserverhandler.cpp b/src/net/charserverhandler.cpp
index d67949cc..4e251524 100644
--- a/src/net/charserverhandler.cpp
+++ b/src/net/charserverhandler.cpp
@@ -195,7 +195,7 @@ CharServerHandler::handleCharSelectResponse(MessageIn &msg)
LocalPlayer*
CharServerHandler::readPlayerData(MessageIn &msg, int &slot)
{
- LocalPlayer *tempPlayer = new LocalPlayer(mLoginData->account_ID, 0, NULL);
+ LocalPlayer *tempPlayer = new LocalPlayer;
slot = msg.readByte(); // character slot
tempPlayer->mName = msg.readString();
tempPlayer->setSex(msg.readByte());
diff --git a/src/net/chathandler.cpp b/src/net/chathandler.cpp
index 02f99c41..f765f0f4 100644
--- a/src/net/chathandler.cpp
+++ b/src/net/chathandler.cpp
@@ -59,12 +59,12 @@ void ChatHandler::handleMessage(MessageIn &msg)
{
Being *being;
std::string chatMsg;
- Sint16 chatMsgLength;
+ //Sint16 chatMsgLength;
switch (msg.getId())
{
case GPMSG_SAY:
- being = beingManager->findBeing(msg.readLong());
+ being = beingManager->findBeing(msg.readShort());
chatMsg = msg.readString();
if (being)
{
@@ -77,6 +77,7 @@ void ChatHandler::handleMessage(MessageIn &msg)
}
break;
+ /*
// Received speech from being
case SMSG_BEING_CHAT:
chatMsgLength = msg.readShort() - 8;
@@ -131,5 +132,6 @@ void ChatHandler::handleMessage(MessageIn &msg)
msg.readLong(); // id
chatWindow->chatLog("MVP player", BY_SERVER);
break;
+ */
}
}
diff --git a/src/net/protocol.h b/src/net/protocol.h
index 6feee9d4..f056f003 100644
--- a/src/net/protocol.h
+++ b/src/net/protocol.h
@@ -152,13 +152,14 @@ enum {
// [, S32 token, S server, W port]
PGMSG_PICKUP = 0x0110,
GPMSG_PICKUP_RESPONSE = 0x0111,
- GPMSG_BEING_ENTER = 0x0200, // B type, L being id
+ GPMSG_BEING_ENTER = 0x0200, // B type, W being id
// player: S name, B hair style, B hair color, B gender
- GPMSG_BEING_LEAVE = 0x0201, // B type, L being id
+ // monster: W type id
+ GPMSG_BEING_LEAVE = 0x0201, // W being id
PGMSG_WALK = 0x0260, // W*2 destination
- GPMSG_BEINGS_MOVE = 0x0280, // { L being id, W*2 position, W*2 destination }*
+ GPMSG_BEINGS_MOVE = 0x0280, // { W being id, W*2 position, W*2 destination }*
PGMSG_SAY = 0x02A0, // S text
- GPMSG_SAY = 0x02A1, // L being id, S text
+ GPMSG_SAY = 0x02A1, // W being id, S text
PGMSG_USE_ITEM = 0x0300, // L item id
GPMSG_USE_RESPONSE = 0x0301, // B error
PGMSG_EQUIP = 0x0302, // L item id, B slot