summaryrefslogtreecommitdiffstats
path: root/ProtoProxy/Server.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-09-04 22:21:23 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-09-04 22:21:23 +0200
commitd50f30c3c49db3c2884c98bb634e21a1fac98729 (patch)
tree8380f10ee25fd5248735127dd97542b6666cf02b /ProtoProxy/Server.cpp
parentDebugging in cByteBuffer::Write(); added the ReadAgain() method to allow ProtoProxy re-send the data it has parsed. (diff)
downloadcuberite-d50f30c3c49db3c2884c98bb634e21a1fac98729.tar
cuberite-d50f30c3c49db3c2884c98bb634e21a1fac98729.tar.gz
cuberite-d50f30c3c49db3c2884c98bb634e21a1fac98729.tar.bz2
cuberite-d50f30c3c49db3c2884c98bb634e21a1fac98729.tar.lz
cuberite-d50f30c3c49db3c2884c98bb634e21a1fac98729.tar.xz
cuberite-d50f30c3c49db3c2884c98bb634e21a1fac98729.tar.zst
cuberite-d50f30c3c49db3c2884c98bb634e21a1fac98729.zip
Diffstat (limited to '')
-rw-r--r--ProtoProxy/Server.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/ProtoProxy/Server.cpp b/ProtoProxy/Server.cpp
index e0abcb596..7eaa728ad 100644
--- a/ProtoProxy/Server.cpp
+++ b/ProtoProxy/Server.cpp
@@ -31,7 +31,9 @@ int cServer::Init(short a_ListenPort, short a_ConnectPort)
}
printf("Generating protocol encryption keypair...\n");
- AutoSeededRandomPool rng;
+ time_t CurTime = time(NULL);
+ RandomPool rng;
+ rng.Put((const byte *)&CurTime, sizeof(CurTime));
m_PrivateKey.GenerateRandomWithKeySize(rng, 1024);
RSA::PublicKey pk(m_PrivateKey);
m_PublicKey = pk;
@@ -40,7 +42,7 @@ int cServer::Init(short a_ListenPort, short a_ConnectPort)
sockaddr_in local;
memset(&local, 0, sizeof(local));
local.sin_family = AF_INET;
- local.sin_addr.s_addr = htonl(0x7f000001); // localhost
+ local.sin_addr.s_addr = 0; // All interfaces
local.sin_port = htons(a_ListenPort);
bind(m_ListenSocket, (sockaddr *)&local, sizeof(local));
listen(m_ListenSocket, 1);