summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorDavid Athay <ko2fan@gmail.com>2008-11-13 18:12:37 +0000
committerDavid Athay <ko2fan@gmail.com>2008-11-13 18:12:37 +0000
commit5624bb7719cbed3b0eaa93cf5b55906ab9ad83a5 (patch)
tree1f351bf23da992f97cfff4db38d0919090b5cf75 /src/net
parent218ab7cb408cee2148e87a15f8177b0a0a82c66a (diff)
downloadmana-5624bb7719cbed3b0eaa93cf5b55906ab9ad83a5.tar.gz
mana-5624bb7719cbed3b0eaa93cf5b55906ab9ad83a5.tar.bz2
mana-5624bb7719cbed3b0eaa93cf5b55906ab9ad83a5.tar.xz
mana-5624bb7719cbed3b0eaa93cf5b55906ab9ad83a5.zip
Added avatars to party window
Diffstat (limited to 'src/net')
-rw-r--r--src/net/partyhandler.cpp26
-rw-r--r--src/net/protocol.h6
2 files changed, 26 insertions, 6 deletions
diff --git a/src/net/partyhandler.cpp b/src/net/partyhandler.cpp
index f3a2e2f5..af5190a3 100644
--- a/src/net/partyhandler.cpp
+++ b/src/net/partyhandler.cpp
@@ -41,6 +41,8 @@ PartyHandler::PartyHandler()
CPMSG_PARTY_INVITED,
CPMSG_PARTY_ACCEPT_INVITE_RESPONSE,
CPMSG_PARTY_QUIT_RESPONSE,
+ CPMSG_PARTY_NEW_MEMBER,
+ CPMSG_PARTY_MEMBER_LEFT,
0
};
handledMessages = _messages;
@@ -55,10 +57,7 @@ void PartyHandler::handleMessage(MessageIn &msg)
{
if (msg.readInt8() == ERRMSG_OK)
{
- if (!player_node->getInParty())
- player_node->setInParty(true);
- std::string memberName = msg.readString();
- partyWindow->addPartyMember(memberName);
+
}
} break;
@@ -73,6 +72,7 @@ void PartyHandler::handleMessage(MessageIn &msg)
if (msg.readInt8() == ERRMSG_OK)
{
player_node->setInParty(true);
+ chatWindow->chatLog("Joined party");
}
}
@@ -83,5 +83,23 @@ void PartyHandler::handleMessage(MessageIn &msg)
player_node->setInParty(false);
}
} break;
+
+ case CPMSG_PARTY_NEW_MEMBER:
+ {
+ int id = msg.readInt16();
+ std::string name = msg.readString();
+
+ chatWindow->chatLog(name + " joined the party");
+
+ if (!player_node->getInParty())
+ player_node->setInParty(true);
+
+ partyWindow->addPartyMember(name);
+ } break;
+
+ case CPMSG_PARTY_MEMBER_LEFT:
+ {
+ partyWindow->removePartyMember(msg.readString());
+ } break;
}
}
diff --git a/src/net/protocol.h b/src/net/protocol.h
index c0bffb50..2ed414a8 100644
--- a/src/net/protocol.h
+++ b/src/net/protocol.h
@@ -157,12 +157,14 @@ enum {
// Party
PCMSG_PARTY_INVITE = 0x03A0, // S name
- CPMSG_PARTY_INVITE_RESPONSE = 0x03A1, // B error, S name
+ CPMSG_PARTY_INVITE_RESPONSE = 0x03A1, // B error
CPMSG_PARTY_INVITED = 0x03A2, // S name
PCMSG_PARTY_ACCEPT_INVITE = 0x03A5, // S name
- CPMSG_PARTY_ACCEPT_INVITE_RESPONSE = 0x03A6, // B error
+ CPMSG_PARTY_ACCEPT_INVITE_RESPONSE = 0x03A6, // B error, { S name }
PCMSG_PARTY_QUIT = 0x03AA, // -
CPMSG_PARTY_QUIT_RESPONSE = 0x03AB, // B error
+ CPMSG_PARTY_NEW_MEMBER = 0x03B0, // W being id, S name
+ CPMSG_PARTY_MEMBER_LEFT = 0x03B1, // W being id
// Chat
CPMSG_ERROR = 0x0401, // B error