summaryrefslogtreecommitdiff
path: root/src/net/netcomputer.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-01-25 13:19:41 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-01-25 13:19:41 +0100
commitbe817190c8810c19c16447e6f8266ce6583257a7 (patch)
tree7703079dd1d1855fa8bd1789e15aa8b91a58b18b /src/net/netcomputer.cpp
parent8b022b04a92fc82a6259191c82742bbeecb98b11 (diff)
downloadmanaserv-be817190c8810c19c16447e6f8266ce6583257a7.tar.gz
manaserv-be817190c8810c19c16447e6f8266ce6583257a7.tar.bz2
manaserv-be817190c8810c19c16447e6f8266ce6583257a7.tar.xz
manaserv-be817190c8810c19c16447e6f8266ce6583257a7.zip
Compile without warnings and made getIP() const
Diffstat (limited to 'src/net/netcomputer.cpp')
-rw-r--r--src/net/netcomputer.cpp16
1 files changed, 6 insertions, 10 deletions
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;
}