From 8b022b04a92fc82a6259191c82742bbeecb98b11 Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Sat, 24 Jan 2009 14:06:09 +0000 Subject: Fix order of LUA files --- src/Makefile.am | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index c0a4c250..2123b55d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -203,9 +203,9 @@ endif if BUILD_LUA tmwserv_game_SOURCES += \ - scripting/lua.cpp - scripting/luascript.cpp scripting/luascript.hpp - scripting/luautil.cpp + scripting/luascript.cpp scripting/luautil.hpp + scripting/luautil.cpp + scripting/lua.cpp endif -- cgit v1.2.3-60-g2f50 From be817190c8810c19c16447e6f8266ce6583257a7 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sun, 25 Jan 2009 13:19:41 +0100 Subject: Compile without warnings and made getIP() const --- src/account-server/accounthandler.cpp | 2 +- src/net/netcomputer.cpp | 16 ++++++---------- src/net/netcomputer.hpp | 13 +++++-------- 3 files changed, 12 insertions(+), 19 deletions(-) diff --git a/src/account-server/accounthandler.cpp b/src/account-server/accounthandler.cpp index 506d80f8..13c280fd 100644 --- a/src/account-server/accounthandler.cpp +++ b/src/account-server/accounthandler.cpp @@ -170,7 +170,7 @@ static void handleLoginMessage(AccountClient &computer, MessageIn &msg) } // get the IP address - int address = computer.getIP(); + //int address = computer.getIP(); // TODO: Check IP against blacklist diff --git a/src/net/netcomputer.cpp b/src/net/netcomputer.cpp index 2ce30c02..35b947ae 100644 --- a/src/net/netcomputer.cpp +++ b/src/net/netcomputer.cpp @@ -37,14 +37,12 @@ NetComputer::NetComputer(ENetPeer *peer): { } -bool -NetComputer::isConnected() +bool NetComputer::isConnected() { return (mPeer->state == ENET_PEER_STATE_CONNECTED); } -void -NetComputer::disconnect(const MessageOut &msg) +void NetComputer::disconnect(const MessageOut &msg) { if (isConnected()) { @@ -61,9 +59,8 @@ NetComputer::disconnect(const MessageOut &msg) } } -void -NetComputer::send(const MessageOut &msg, bool reliable, - unsigned int channel) +void NetComputer::send(const MessageOut &msg, bool reliable, + unsigned int channel) { LOG_DEBUG("Sending message " << msg << " to " << *this); @@ -84,8 +81,7 @@ NetComputer::send(const MessageOut &msg, bool reliable, } } -std::ostream& -operator <<(std::ostream &os, const NetComputer &comp) +std::ostream &operator <<(std::ostream &os, const NetComputer &comp) { // address.host contains the ip-address in network-byte-order if (utils::processor::isLittleEndian) @@ -104,7 +100,7 @@ operator <<(std::ostream &os, const NetComputer &comp) return os; } -int NetComputer::getIP() +int NetComputer::getIP() const { return mPeer->address.host; } diff --git a/src/net/netcomputer.hpp b/src/net/netcomputer.hpp index 2c4d706a..10ffe5ae 100644 --- a/src/net/netcomputer.hpp +++ b/src/net/netcomputer.hpp @@ -48,8 +48,7 @@ class NetComputer /** * Returns true if this computer is connected. */ - bool - isConnected(); + bool isConnected(); /** * Disconnects the computer from the server, after sending a message. @@ -58,8 +57,7 @@ class NetComputer * NetComputer does not know which handler is sending it * (could have been chat/game/account) */ - void - disconnect(const MessageOut &msg); + void disconnect(const MessageOut &msg); /** * Queues a message for sending to a client. @@ -77,14 +75,13 @@ class NetComputer * @param channel The channel number of which the packet should * be sent. */ - void - send(const MessageOut &msg, bool reliable = true, - unsigned int channel = 0); + void send(const MessageOut &msg, bool reliable = true, + unsigned int channel = 0); /** * Returns IP address of computer in 32bit int form */ - int getIP(); + int getIP() const; private: ENetPeer *mPeer; /**< Client peer */ -- cgit v1.2.3-60-g2f50 From a95fad458da513666da9486cd5ada3b8a15a5e78 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sun, 25 Jan 2009 13:29:19 +0100 Subject: Fixed Lua files to be included in compile Some slashes were missing. --- src/Makefile.am | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 2123b55d..f8923824 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -203,9 +203,9 @@ endif if BUILD_LUA tmwserv_game_SOURCES += \ - scripting/luascript.hpp - scripting/luascript.cpp + scripting/lua.cpp \ + scripting/luascript.cpp \ + scripting/luascript.hpp \ + scripting/luautil.cpp \ scripting/luautil.hpp - scripting/luautil.cpp - scripting/lua.cpp endif -- cgit v1.2.3-60-g2f50