diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-11-03 10:18:25 -0700 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-11-03 10:18:25 -0700 |
commit | acd557f9472c711fe92b9c158ec336abf688bf7b (patch) | |
tree | 2295d13589411ee88afe16f4997bea65b4ebba94 /src/net/manaserv/gameserver | |
parent | c60d3a98dbbb20621742bfd82bbaaa6b7085a8ae (diff) | |
download | mana-client-acd557f9472c711fe92b9c158ec336abf688bf7b.tar.gz mana-client-acd557f9472c711fe92b9c158ec336abf688bf7b.tar.bz2 mana-client-acd557f9472c711fe92b9c158ec336abf688bf7b.tar.xz mana-client-acd557f9472c711fe92b9c158ec336abf688bf7b.zip |
Remove more _SUPPORT ifdefs and do some cleanup
Diffstat (limited to 'src/net/manaserv/gameserver')
-rw-r--r-- | src/net/manaserv/gameserver/gameserver.cpp | 17 | ||||
-rw-r--r-- | src/net/manaserv/gameserver/gameserver.h | 10 | ||||
-rw-r--r-- | src/net/manaserv/gameserver/internal.cpp | 2 | ||||
-rw-r--r-- | src/net/manaserv/gameserver/internal.h | 8 | ||||
-rw-r--r-- | src/net/manaserv/gameserver/player.cpp | 22 | ||||
-rw-r--r-- | src/net/manaserv/gameserver/player.h | 8 |
6 files changed, 37 insertions, 30 deletions
diff --git a/src/net/manaserv/gameserver/gameserver.cpp b/src/net/manaserv/gameserver/gameserver.cpp index 94015c20..ba3bd983 100644 --- a/src/net/manaserv/gameserver/gameserver.cpp +++ b/src/net/manaserv/gameserver/gameserver.cpp @@ -24,27 +24,30 @@ #include "internal.h" #include "net/manaserv/connection.h" +#include "net/manaserv/messageout.h" #include "net/manaserv/protocol.h" -#include "net/messageout.h" +namespace ManaServ +{ -void Net::GameServer::connect(Net::Connection *connection, - const std::string &token) +void GameServer::connect(Connection *connection, const std::string &token) { - Net::GameServer::connection = connection; + GameServer::connection = connection; MessageOut msg(PGMSG_CONNECT); msg.writeString(token, 32); - Net::GameServer::connection->send(msg); + GameServer::connection->send(msg); } -void Net::GameServer::logout(bool reconnectAccount) +void GameServer::logout(bool reconnectAccount) { MessageOut msg(PGMSG_DISCONNECT); msg.writeInt8((unsigned char) reconnectAccount); - Net::GameServer::connection->send(msg); + GameServer::connection->send(msg); +} + } diff --git a/src/net/manaserv/gameserver/gameserver.h b/src/net/manaserv/gameserver/gameserver.h index 6de82c2e..1f9e5b78 100644 --- a/src/net/manaserv/gameserver/gameserver.h +++ b/src/net/manaserv/gameserver/gameserver.h @@ -19,21 +19,21 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef NET_GAMESERVER_GAMESERVER_H -#define NET_GAMESERVER_GAMESERVER_H +#ifndef NET_MANASERV_GAMESERVER_GAMESERVER_H +#define NET_MANASERV_GAMESERVER_GAMESERVER_H #include <iosfwd> -namespace Net +namespace ManaServ { class Connection; namespace GameServer { - void connect(Net::Connection *connection, const std::string &token); + void connect(Connection *connection, const std::string &token); void logout(bool reconnectAccount); } } -#endif +#endif // NET_MANASERV_GAMESERVER_GAMESERVER_H diff --git a/src/net/manaserv/gameserver/internal.cpp b/src/net/manaserv/gameserver/internal.cpp index 27cb4a47..e998ced9 100644 --- a/src/net/manaserv/gameserver/internal.cpp +++ b/src/net/manaserv/gameserver/internal.cpp @@ -21,7 +21,7 @@ #include "internal.h" -namespace Net +namespace ManaServ { class Connection; diff --git a/src/net/manaserv/gameserver/internal.h b/src/net/manaserv/gameserver/internal.h index 6c6e2613..44cd3be2 100644 --- a/src/net/manaserv/gameserver/internal.h +++ b/src/net/manaserv/gameserver/internal.h @@ -19,10 +19,10 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef NET_GAMESERVER_INTERNAL_H -#define NET_GAMESERVER_INTERNAL_H +#ifndef NET_MANASERV_GAMESERVER_INTERNAL_H +#define NET_MANASERV_GAMESERVER_INTERNAL_H -namespace Net +namespace ManaServ { class Connection; @@ -32,4 +32,4 @@ namespace Net } } -#endif +#endif // NET_MANASERV_GAMESERVER_INTERNAL_H diff --git a/src/net/manaserv/gameserver/player.cpp b/src/net/manaserv/gameserver/player.cpp index e667c8b9..6fa146d4 100644 --- a/src/net/manaserv/gameserver/player.cpp +++ b/src/net/manaserv/gameserver/player.cpp @@ -24,34 +24,38 @@ #include "internal.h" #include "net/manaserv/connection.h" +#include "net/manaserv/messageout.h" #include "net/manaserv/protocol.h" -#include "net/messageout.h" - void RespawnRequestListener::action(const gcn::ActionEvent &event) { - Net::GameServer::Player::respawn(); + ManaServ::GameServer::Player::respawn(); } -void Net::GameServer::Player::walk(int x, int y) +namespace ManaServ +{ + +void GameServer::Player::walk(int x, int y) { MessageOut msg(PGMSG_WALK); msg.writeInt16(x); msg.writeInt16(y); - Net::GameServer::connection->send(msg); + GameServer::connection->send(msg); } -void Net::GameServer::Player::moveItem(int oldSlot, int newSlot, int amount) +void GameServer::Player::moveItem(int oldSlot, int newSlot, int amount) { MessageOut msg(PGMSG_MOVE_ITEM); msg.writeInt8(oldSlot); msg.writeInt8(newSlot); msg.writeInt8(amount); - Net::GameServer::connection->send(msg); + GameServer::connection->send(msg); } -void Net::GameServer::Player::respawn() +void GameServer::Player::respawn() { MessageOut msg(PGMSG_RESPAWN); - Net::GameServer::connection->send(msg); + GameServer::connection->send(msg); +} + } diff --git a/src/net/manaserv/gameserver/player.h b/src/net/manaserv/gameserver/player.h index 9a202c6e..40ba4b2b 100644 --- a/src/net/manaserv/gameserver/player.h +++ b/src/net/manaserv/gameserver/player.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef NET_GAMESERVER_PLAYER_H -#define NET_GAMESERVER_PLAYER_H +#ifndef NET_MANASERV_GAMESERVER_PLAYER_H +#define NET_MANASERV_GAMESERVER_PLAYER_H #include "being.h" @@ -34,7 +34,7 @@ struct RespawnRequestListener : public gcn::ActionListener void action(const gcn::ActionEvent &event); }; -namespace Net +namespace ManaServ { namespace GameServer { @@ -48,4 +48,4 @@ namespace Net } } -#endif +#endif // NET_MANASERV_GAMESERVER_PLAYER_H |