diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-04-07 21:16:24 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-04-07 21:23:27 -0600 |
commit | 73c773adfb8b65e1305242ab55607882a46e71c3 (patch) | |
tree | 5b6d767ce2f44e33283f4e78edbb5a08f0c2b52a /src/net/tmwserv/partyhandler.cpp | |
parent | aefbc69aac9f7c793725153eefce2631555bfd1f (diff) | |
download | mana-73c773adfb8b65e1305242ab55607882a46e71c3.tar.gz mana-73c773adfb8b65e1305242ab55607882a46e71c3.tar.bz2 mana-73c773adfb8b65e1305242ab55607882a46e71c3.tar.xz mana-73c773adfb8b65e1305242ab55607882a46e71c3.zip |
Implement TMWServ's PartyHandler
Diffstat (limited to 'src/net/tmwserv/partyhandler.cpp')
-rw-r--r-- | src/net/tmwserv/partyhandler.cpp | 59 |
1 files changed, 57 insertions, 2 deletions
diff --git a/src/net/tmwserv/partyhandler.cpp b/src/net/tmwserv/partyhandler.cpp index 08e58667..5aecca76 100644 --- a/src/net/tmwserv/partyhandler.cpp +++ b/src/net/tmwserv/partyhandler.cpp @@ -21,9 +21,11 @@ #include "net/tmwserv/partyhandler.h" -#include "net/tmwserv/chatserver/chatserver.h" #include "net/tmwserv/protocol.h" +#include "net/tmwserv/chatserver/chatserver.h" +#include "net/tmwserv/chatserver/party.h" + #include "net/messagein.h" #include "gui/partywindow.h" @@ -35,6 +37,10 @@ #include <iostream> +Net::PartyHandler *partyHandler; + +namespace TmwServ { + PartyHandler::PartyHandler() { static const Uint16 _messages[] = { @@ -47,7 +53,7 @@ PartyHandler::PartyHandler() 0 }; handledMessages = _messages; - + partyHandler = this; } void PartyHandler::handleMessage(MessageIn &msg) @@ -104,3 +110,52 @@ void PartyHandler::handleMessage(MessageIn &msg) } break; } } + +void PartyHandler::create(const std::string &name) +{ + // TODO +} + +void PartyHandler::join(int partyId) +{ + // TODO +} + +void PartyHandler::invite(Player *player) +{ + invite(player->getName()); +} + +void PartyHandler::invite(const std::string &name) +{ + Net::ChatServer::Party::invitePlayer(name); +} + +void PartyHandler::inviteResponse(const std::string &inviter, bool accept) +{ + if (accept) + Net::ChatServer::Party::acceptInvite(inviter); + // TODO: rejection +} + +void PartyHandler::leave() +{ + // TODO +} + +void PartyHandler::kick(int playerId) +{ + // TODO +} + +void PartyHandler::chat(const std::string &text) +{ + // TODO +} + +void PartyHandler::requestPartyMembers() +{ + // TODO +} + +} // namespace TmwServ |