diff options
author | David Athay <ko2fan@gmail.com> | 2009-01-12 12:25:42 +0000 |
---|---|---|
committer | David Athay <ko2fan@gmail.com> | 2009-01-12 12:25:42 +0000 |
commit | d1b73b1195f8e8b2ad64ff692e7ddb17ed0bbad1 (patch) | |
tree | 3cfb22ab8b13fc47284f808d5da37ec2fa97d6a1 /src/net | |
parent | 83ecbeff8d09b212cddc33b1879a63002fad46c0 (diff) | |
download | manaserv-d1b73b1195f8e8b2ad64ff692e7ddb17ed0bbad1.tar.gz 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.cpp | 5 | ||||
-rw-r--r-- | src/net/netcomputer.hpp | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/net/netcomputer.cpp b/src/net/netcomputer.cpp index ff2bbb7..2ce30c0 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 b85456a..2c4d706 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 */ |