diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-06-28 02:19:35 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-06-28 02:20:49 +0300 |
commit | 574181b2e5dfff30a2d4f766492226ab7b5a5a17 (patch) | |
tree | b27f40c42b9cbd9081474883a048ec888654395c /src/net/manaserv/partyhandler.cpp | |
parent | 8611b3c1ea3316bfc4740149b8f41c35dacee7c1 (diff) | |
download | mv-574181b2e5dfff30a2d4f766492226ab7b5a5a17.tar.gz mv-574181b2e5dfff30a2d4f766492226ab7b5a5a17.tar.bz2 mv-574181b2e5dfff30a2d4f766492226ab7b5a5a17.tar.xz mv-574181b2e5dfff30a2d4f766492226ab7b5a5a17.zip |
Remove for now manaserv net code.
Possible it will be restored in the future.
Diffstat (limited to 'src/net/manaserv/partyhandler.cpp')
-rw-r--r-- | src/net/manaserv/partyhandler.cpp | 202 |
1 files changed, 0 insertions, 202 deletions
diff --git a/src/net/manaserv/partyhandler.cpp b/src/net/manaserv/partyhandler.cpp deleted file mode 100644 index e2b0fabd9..000000000 --- a/src/net/manaserv/partyhandler.cpp +++ /dev/null @@ -1,202 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2008-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2012 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#include "net/manaserv/partyhandler.h" - -#include "depricatedevent.h" -#include "logger.h" -#include "localplayer.h" - -#include "gui/socialwindow.h" - -#include "net/manaserv/connection.h" -#include "net/manaserv/messagein.h" -#include "net/manaserv/messageout.h" -#include "net/manaserv/protocol.h" - -#include "utils/gettext.h" -#include "utils/stringutils.h" - -#include <iostream> - -#define PARTY_ID 1 - -extern Net::PartyHandler *partyHandler; - -namespace ManaServ -{ - -extern Connection *chatServerConnection; - -PartyHandler::PartyHandler(): - mParty(Party::getParty(PARTY_ID)) -{ - static const uint16_t _messages[] = - { - CPMSG_PARTY_INVITE_RESPONSE, - CPMSG_PARTY_INVITED, - CPMSG_PARTY_ACCEPT_INVITE_RESPONSE, - CPMSG_PARTY_QUIT_RESPONSE, - CPMSG_PARTY_NEW_MEMBER, - CPMSG_PARTY_MEMBER_LEFT, - CPMSG_PARTY_REJECTED, - 0 - }; - handledMessages = _messages; - partyHandler = this; -} - -void PartyHandler::handleMessage(Net::MessageIn &msg) -{ - switch (msg.getId()) - { - case CPMSG_PARTY_INVITE_RESPONSE: - { - if (msg.readInt8() == ERRMSG_OK) - { - - } - } break; - - case CPMSG_PARTY_INVITED: - { - socialWindow->showPartyInvite(msg.readString()); - } break; - - case CPMSG_PARTY_ACCEPT_INVITE_RESPONSE: - { - if (msg.readInt8() == ERRMSG_OK) - { - // - SERVER_NOTICE(_("Joined party.")); - } - } - - case CPMSG_PARTY_QUIT_RESPONSE: - { - if (msg.readInt8() == ERRMSG_OK) - { - mParty->clearMembers(); - player_node->setParty(nullptr); - } - } break; - - case CPMSG_PARTY_NEW_MEMBER: - { - int id = msg.readInt16(); // being id - std::string name = msg.readString(); - - SERVER_NOTICE(strprintf(_("%s joined the party."), - name.c_str())); - - if (id == player_node->getId()) - player_node->setParty(mParty); - - mParty->addMember(id, name); - } break; - - case CPMSG_PARTY_MEMBER_LEFT: - { - mParty->removeMember(msg.readString()); - } break; - - case CPMSG_PARTY_REJECTED: - { - std::string name = msg.readString(); - SERVER_NOTICE(strprintf( - _("%s rejected your invite."), name.c_str())); - } break; - default: - break; - } -} - -void PartyHandler::create(const std::string &name A_UNUSED) -{ - // TODO -} - -void PartyHandler::join(int partyId A_UNUSED) -{ - // TODO -} - -void PartyHandler::invite(Being *being) -{ - invite(being->getName()); -} - -void PartyHandler::invite(const std::string &name) -{ - MessageOut msg(PCMSG_PARTY_INVITE); - - msg.writeString(name); - - chatServerConnection->send(msg); -} - -void PartyHandler::inviteResponse(const std::string &inviter, bool accept) -{ - MessageOut msg = MessageOut(accept ? PCMSG_PARTY_ACCEPT_INVITE : - PCMSG_PARTY_REJECT_INVITE); - - msg.writeString(inviter); - - chatServerConnection->send(msg); -} - -void PartyHandler::leave() -{ - MessageOut msg(PCMSG_PARTY_QUIT); - - chatServerConnection->send(msg); -} - -void PartyHandler::kick(Being *being A_UNUSED) -{ - // TODO -} - -void PartyHandler::kick(const std::string &name A_UNUSED) -{ - // TODO -} - -void PartyHandler::chat(const std::string &text A_UNUSED) -{ - // TODO -} - -void PartyHandler::requestPartyMembers() const -{ - //MessageOut msg(PCMSG_GUILD_GET_MEMBERS); - - //msg.writeInt16(guildId); - - //chatServerConnection->send(msg); -} - -void PartyHandler::clear() -{ -} - -} // namespace ManaServ |