diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-02-08 11:24:07 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-02-08 11:24:07 +0200 |
commit | b0971f4459fd37813dd4779f2ddaf9b38cf5f776 (patch) | |
tree | 3a839ab26708e7891a32f5125bb2fdde47cc2ae3 /src/socket.cpp | |
parent | 15f27a19378345c22b07e37ab324581d55ad9c5b (diff) | |
download | minetest-b0971f4459fd37813dd4779f2ddaf9b38cf5f776.tar.gz minetest-b0971f4459fd37813dd4779f2ddaf9b38cf5f776.tar.bz2 minetest-b0971f4459fd37813dd4779f2ddaf9b38cf5f776.zip |
local game connects to 127.0.0.1 instead of localhost (windows returns an ipv6 address sometimes which is not supported)
Diffstat (limited to 'src/socket.cpp')
-rw-r--r-- | src/socket.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/socket.cpp b/src/socket.cpp index 499ee504e..b159fa14c 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -26,7 +26,9 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "utility.h" // Debug printing options +// Set to 1 for debug output #define DP 0 +// This is prepended to everything printed here #define DPS "" bool g_sockets_initialized = false; @@ -108,6 +110,12 @@ void Address::setAddress(unsigned int address) m_address = address; } +void Address::setAddress(unsigned int a, unsigned int b, + unsigned int c, unsigned int d) +{ + m_address = (a<<24) | (b<<16) | ( c<<8) | d; +} + void Address::setPort(unsigned short port) { m_port = port; |