summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorDavid Athay <ko2fan@gmail.com>2009-01-12 12:25:42 +0000
committerDavid Athay <ko2fan@gmail.com>2009-01-12 12:25:42 +0000
commitd1b73b1195f8e8b2ad64ff692e7ddb17ed0bbad1 (patch)
tree3cfb22ab8b13fc47284f808d5da37ec2fa97d6a1 /src/net
parent83ecbeff8d09b212cddc33b1879a63002fad46c0 (diff)
downloadmanaserv-d1b73b1195f8e8b2ad64ff692e7ddb17ed0bbad1.tar.gz
manaserv-d1b73b1195f8e8b2ad64ff692e7ddb17ed0bbad1.tar.bz2
manaserv-d1b73b1195f8e8b2ad64ff692e7ddb17ed0bbad1.tar.xz
manaserv-d1b73b1195f8e8b2ad64ff692e7ddb17ed0bbad1.zip
Added getting IP, and restricting time between logins
Diffstat (limited to 'src/net')
-rw-r--r--src/net/netcomputer.cpp5
-rw-r--r--src/net/netcomputer.hpp5
2 files changed, 10 insertions, 0 deletions
diff --git a/src/net/netcomputer.cpp b/src/net/netcomputer.cpp
index ff2bbb71..2ce30c02 100644
--- a/src/net/netcomputer.cpp
+++ b/src/net/netcomputer.cpp
@@ -103,3 +103,8 @@ operator <<(std::ostream &os, const NetComputer &comp)
return os;
}
+
+int NetComputer::getIP()
+{
+ return mPeer->address.host;
+}
diff --git a/src/net/netcomputer.hpp b/src/net/netcomputer.hpp
index b85456a6..2c4d706a 100644
--- a/src/net/netcomputer.hpp
+++ b/src/net/netcomputer.hpp
@@ -81,6 +81,11 @@ class NetComputer
send(const MessageOut &msg, bool reliable = true,
unsigned int channel = 0);
+ /**
+ * Returns IP address of computer in 32bit int form
+ */
+ int getIP();
+
private:
ENetPeer *mPeer; /**< Client peer */