diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-11-03 18:59:10 -0700 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-11-03 18:59:10 -0700 |
commit | 6ec98a246ee9915cdcc4a58f5de6882e415adc2f (patch) | |
tree | 45add22f8dfc85c45910cad41db79c979310c113 /src/gui | |
parent | 75dbcb1b780fe3fc2f09cbcdc05f9559446ef482 (diff) | |
download | mana-6ec98a246ee9915cdcc4a58f5de6882e415adc2f.tar.gz mana-6ec98a246ee9915cdcc4a58f5de6882e415adc2f.tar.bz2 mana-6ec98a246ee9915cdcc4a58f5de6882e415adc2f.tar.xz mana-6ec98a246ee9915cdcc4a58f5de6882e415adc2f.zip |
Move ManaServ guild code into GuildHandler
Ad start eAthena's GuildHandler
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/guildwindow.cpp | 18 | ||||
-rw-r--r-- | src/gui/guildwindow.h | 5 |
2 files changed, 13 insertions, 10 deletions
diff --git a/src/gui/guildwindow.cpp b/src/gui/guildwindow.cpp index 83ff12a1..1868de6a 100644 --- a/src/gui/guildwindow.cpp +++ b/src/gui/guildwindow.cpp @@ -38,7 +38,8 @@ #include "log.h" #include "localplayer.h" -#include "net/manaserv/chatserver/guild.h" +#include "net/guildhandler.h" +#include "net/net.h" #include "utils/dtor.h" #include "utils/gettext.h" @@ -132,7 +133,7 @@ void GuildWindow::action(const gcn::ActionEvent &event) short guild = getSelectedGuild(); if (guild) { - ManaServ::ChatServer::Guild::quitGuild(guild); + Net::getGuildHandler()->leave(guild); localChatTab->chatLog(strprintf(_("Guild %s quit."), mGuildTabs->getSelectedTab()->getCaption().c_str()), BY_SERVER); } @@ -146,7 +147,7 @@ void GuildWindow::action(const gcn::ActionEvent &event) return; } // Process guild name to be created, and unfocus. - ManaServ::ChatServer::Guild::createGuild(name); + Net::getGuildHandler()->create(name); // Defocus dialog mFocus = false; @@ -160,7 +161,7 @@ void GuildWindow::action(const gcn::ActionEvent &event) short selectedGuild = getSelectedGuild(); // Process invited user to be created and unfocus. - ManaServ::ChatServer::Guild::invitePlayer(name, selectedGuild); + Net::getGuildHandler()->invite(selectedGuild, name); // Defocus dialog mFocus = false; @@ -170,7 +171,7 @@ void GuildWindow::action(const gcn::ActionEvent &event) else if (eventId == "yes") { logger->log("Sending invitation acceptance."); - ManaServ::ChatServer::Guild::acceptInvite(invitedGuild); + Net::getGuildHandler()->inviteResponse(invitedGuildId, true); } } @@ -238,7 +239,8 @@ short GuildWindow::getSelectedGuild() } void GuildWindow::openAcceptDialog(const std::string &inviterName, - const std::string &guildName) + const std::string &guildName, + const int guildId) { std::string msg = strprintf(_("%s has invited you to join the guild %s."), inviterName.c_str(), guildName.c_str()); @@ -247,13 +249,13 @@ void GuildWindow::openAcceptDialog(const std::string &inviterName, acceptDialog = new ConfirmDialog(_("Accept Guild Invite"), msg, this); acceptDialog->addActionListener(this); - invitedGuild = guildName; + invitedGuildId = guildId; } void GuildWindow::requestMemberList(short guildId) { // Get the list of members for displaying in the guild window. - ManaServ::ChatServer::Guild::getGuildMembers(guildId); + Net::getGuildHandler()->memberList(guildId); } void GuildWindow::removeTab(int guildId) diff --git a/src/gui/guildwindow.h b/src/gui/guildwindow.h index 15f35b00..5afe01dd 100644 --- a/src/gui/guildwindow.h +++ b/src/gui/guildwindow.h @@ -84,7 +84,8 @@ public: /** * Create a dialog for accepting an invite */ - void openAcceptDialog(const std::string &inviterName, const std::string &guildName); + void openAcceptDialog(const std::string &inviterName, + const std::string &guildName, const int guildId); /** * Request member list @@ -117,7 +118,7 @@ private: TabbedArea *mGuildTabs; ScrollArea *mScrollArea; bool mFocus; - std::string invitedGuild; + int invitedGuildId; typedef std::map<std::string, GuildListBox*> GuildListMap; GuildListMap mGuildLists; }; |