diff options
Diffstat (limited to 'src/net/tmwserv')
-rw-r--r-- | src/net/tmwserv/playerhandler.cpp | 4 | ||||
-rw-r--r-- | src/net/tmwserv/playerhandler.h | 4 | ||||
-rw-r--r-- | src/net/tmwserv/skillhandler.cpp | 53 | ||||
-rw-r--r-- | src/net/tmwserv/skillhandler.h | 45 | ||||
-rw-r--r-- | src/net/tmwserv/tradehandler.cpp | 6 | ||||
-rw-r--r-- | src/net/tmwserv/tradehandler.h | 4 |
6 files changed, 112 insertions, 4 deletions
diff --git a/src/net/tmwserv/playerhandler.cpp b/src/net/tmwserv/playerhandler.cpp index a02c9a29..f13484eb 100644 --- a/src/net/tmwserv/playerhandler.cpp +++ b/src/net/tmwserv/playerhandler.cpp @@ -95,6 +95,8 @@ namespace { Net::PlayerHandler *playerHandler; +namespace TmwServ { + PlayerHandler::PlayerHandler() { static const Uint16 _messages[] = { @@ -391,3 +393,5 @@ void PlayerHandler::ingoreAll(bool ignore) { // TODO } + +} // namespace TmwServ diff --git a/src/net/tmwserv/playerhandler.h b/src/net/tmwserv/playerhandler.h index 17b1f684..5524415e 100644 --- a/src/net/tmwserv/playerhandler.h +++ b/src/net/tmwserv/playerhandler.h @@ -25,6 +25,8 @@ #include "net/messagehandler.h" #include "net/playerhandler.h" +namespace TmwServ { + class PlayerHandler : public MessageHandler, public Net::PlayerHandler { public: @@ -58,6 +60,6 @@ class PlayerHandler : public MessageHandler, public Net::PlayerHandler void handleMapChangeMessage(MessageIn &msg); }; -extern Net::PlayerHandler *playerHandler; +} // namespace TmwServ #endif diff --git a/src/net/tmwserv/skillhandler.cpp b/src/net/tmwserv/skillhandler.cpp new file mode 100644 index 00000000..e35b896a --- /dev/null +++ b/src/net/tmwserv/skillhandler.cpp @@ -0,0 +1,53 @@ +/* + * The Mana World + * Copyright (C) 2004 The Mana World Development Team + * + * This file is part of The Mana World. + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "net/tmwserv/skillhandler.h" + +Net::SkillHandler *skillHandler; + +namespace TmwServ { + +SkillHandler::SkillHandler() +{ + skillHandler = this; +} + +void SkillHandler::up(int skillId) +{ + // TODO +} + +void SkillHandler::use(int skillId, int level, int beingId) +{ + // TODO +} + +void SkillHandler::use(int skillId, int level, int x, int y) +{ + // TODO +} + +void SkillHandler::use(int skillId, const std::string &map) +{ + // TODO +} + +} // namespace TmwServ diff --git a/src/net/tmwserv/skillhandler.h b/src/net/tmwserv/skillhandler.h new file mode 100644 index 00000000..8c459c4f --- /dev/null +++ b/src/net/tmwserv/skillhandler.h @@ -0,0 +1,45 @@ +/* + * The Mana World + * Copyright (C) 2004 The Mana World Development Team + * + * This file is part of The Mana World. + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef NET_TMWSERV_SKILLHANDLER_H +#define NET_TMWSERV_SKILLHANDLER_H + +#include "net/skillhandler.h" + +namespace TmwServ { + +class SkillHandler : public Net::SkillHandler +{ + public: + SkillHandler(); + + void up(int skillId); + + void use(int skillId, int level, int beingId); + + void use(int skillId, int level, int x, int y); + + void use(int skillId, const std::string &map); +}; + +} // namespace TmwServ + +#endif diff --git a/src/net/tmwserv/tradehandler.cpp b/src/net/tmwserv/tradehandler.cpp index 07ed81e6..17a45a19 100644 --- a/src/net/tmwserv/tradehandler.cpp +++ b/src/net/tmwserv/tradehandler.cpp @@ -56,6 +56,8 @@ namespace { Net::TradeHandler *tradeHandler; +namespace TmwServ { + TradeHandler::TradeHandler(): mAcceptTradeRequests(true) { @@ -142,8 +144,6 @@ void TradeHandler::handleMessage(MessageIn &msg) void TradeHandler::request(Being *being) { - extern std::string tradePartnerName; - extern int tradePartnerID; tradePartnerName = being->getName(); tradePartnerID = being->getId(); Net::GameServer::Player::requestTrade(tradePartnerID); @@ -185,3 +185,5 @@ void TradeHandler::cancel() { Net::GameServer::Player::acceptTrade(false); } + +} // namespace TmwServ diff --git a/src/net/tmwserv/tradehandler.h b/src/net/tmwserv/tradehandler.h index 1abb30e3..dc9e070a 100644 --- a/src/net/tmwserv/tradehandler.h +++ b/src/net/tmwserv/tradehandler.h @@ -25,6 +25,8 @@ #include "net/messagehandler.h" #include "net/tradehandler.h" +namespace TmwServ { + class TradeHandler : public MessageHandler, public Net::TradeHandler { public: @@ -67,6 +69,6 @@ class TradeHandler : public MessageHandler, public Net::TradeHandler bool mAcceptTradeRequests; }; -extern Net::TradeHandler *tradeHandler; +} // namespace TmwServ #endif |