summaryrefslogtreecommitdiff
path: root/src/net/manaserv/partyhandler.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-11-03 12:06:48 -0700
committerJared Adams <jaxad0127@gmail.com>2009-11-03 12:06:48 -0700
commite07e2a6db902f2ce0095b65708a98fa4dbf40aa0 (patch)
treeb91b3e3d3f06199dcc34e32834941964a263e0be /src/net/manaserv/partyhandler.cpp
parente2897e4a7cb7eb0c4a7e46d72a9a19b909368c26 (diff)
downloadmana-e07e2a6db902f2ce0095b65708a98fa4dbf40aa0.tar.gz
mana-e07e2a6db902f2ce0095b65708a98fa4dbf40aa0.tar.bz2
mana-e07e2a6db902f2ce0095b65708a98fa4dbf40aa0.tar.xz
mana-e07e2a6db902f2ce0095b65708a98fa4dbf40aa0.zip
Simplify ManaServ netcode some more
Diffstat (limited to 'src/net/manaserv/partyhandler.cpp')
-rw-r--r--src/net/manaserv/partyhandler.cpp34
1 files changed, 23 insertions, 11 deletions
diff --git a/src/net/manaserv/partyhandler.cpp b/src/net/manaserv/partyhandler.cpp
index ea968649..2426f17e 100644
--- a/src/net/manaserv/partyhandler.cpp
+++ b/src/net/manaserv/partyhandler.cpp
@@ -21,12 +21,10 @@
#include "net/manaserv/partyhandler.h"
-#include "net/manaserv/protocol.h"
+#include "net/manaserv/connection.h"
#include "net/manaserv/messagein.h"
#include "net/manaserv/messageout.h"
-
-#include "net/manaserv/chatserver/chatserver.h"
-#include "net/manaserv/chatserver/party.h"
+#include "net/manaserv/protocol.h"
#include "gui/partywindow.h"
@@ -44,6 +42,8 @@ Net::PartyHandler *partyHandler;
namespace ManaServ {
+extern Connection *chatServerConnection;
+
PartyHandler::PartyHandler()
{
static const Uint16 _messages[] = {
@@ -140,20 +140,28 @@ void PartyHandler::invite(Player *player)
void PartyHandler::invite(const std::string &name)
{
- ChatServer::Party::invitePlayer(name);
+ MessageOut msg(PCMSG_PARTY_INVITE);
+
+ msg.writeString(name);
+
+ chatServerConnection->send(msg);
}
void PartyHandler::inviteResponse(const std::string &inviter, bool accept)
{
- if (accept)
- ChatServer::Party::acceptInvite(inviter);
- else
- ChatServer::Party::rejectInvite(inviter);
+ MessageOut msg = MessageOut(accept ? PCMSG_PARTY_ACCEPT_INVITE :
+ PCMSG_PARTY_REJECT_INVITE);
+
+ msg.writeString(inviter);
+
+ chatServerConnection->send(msg);
}
void PartyHandler::leave()
{
- ChatServer::Party::quitParty();
+ MessageOut msg(PCMSG_PARTY_QUIT);
+
+ chatServerConnection->send(msg);
}
void PartyHandler::kick(Player *player)
@@ -173,7 +181,11 @@ void PartyHandler::chat(const std::string &text)
void PartyHandler::requestPartyMembers()
{
- // TODO
+ //MessageOut msg(PCMSG_GUILD_GET_MEMBERS);
+
+ //msg.writeInt16(guildId);
+
+ //chatServerConnection->send(msg);
}
} // namespace ManaServ