summaryrefslogtreecommitdiffstats
path: root/src/Server.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-07-26 13:27:27 +0200
committerHowaner <franzi.moos@googlemail.com>2014-07-26 13:27:27 +0200
commitef4d68adfd70488df0887f3a5fba1c9aad7a0108 (patch)
tree1ea3acb0e6b16e8badf7d1d56301bf3dd3a5d99e /src/Server.cpp
parentAdd armor items directly to the armor slots. (diff)
parentGit: Ignore AllFiles.lst (generated by cmake) (diff)
downloadcuberite-ef4d68adfd70488df0887f3a5fba1c9aad7a0108.tar
cuberite-ef4d68adfd70488df0887f3a5fba1c9aad7a0108.tar.gz
cuberite-ef4d68adfd70488df0887f3a5fba1c9aad7a0108.tar.bz2
cuberite-ef4d68adfd70488df0887f3a5fba1c9aad7a0108.tar.lz
cuberite-ef4d68adfd70488df0887f3a5fba1c9aad7a0108.tar.xz
cuberite-ef4d68adfd70488df0887f3a5fba1c9aad7a0108.tar.zst
cuberite-ef4d68adfd70488df0887f3a5fba1c9aad7a0108.zip
Diffstat (limited to 'src/Server.cpp')
-rw-r--r--src/Server.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/Server.cpp b/src/Server.cpp
index bc9644804..42ad133f1 100644
--- a/src/Server.cpp
+++ b/src/Server.cpp
@@ -30,7 +30,8 @@
#include <sstream>
#include <iostream>
-extern "C" {
+extern "C"
+{
#include "zlib/zlib.h"
}
@@ -105,8 +106,8 @@ void cServer::cTickThread::Execute(void)
// cServer:
cServer::cServer(void) :
- m_ListenThreadIPv4(*this, cSocket::IPv4, "Client IPv4"),
- m_ListenThreadIPv6(*this, cSocket::IPv6, "Client IPv6"),
+ m_ListenThreadIPv4(*this, cSocket::IPv4, "Client"),
+ m_ListenThreadIPv6(*this, cSocket::IPv6, "Client"),
m_PlayerCount(0),
m_PlayerCountDiff(0),
m_ClientViewDistance(0),
@@ -221,12 +222,14 @@ bool cServer::InitServer(cIniFile & a_SettingsIni)
bool HasAnyPorts = false;
AString Ports = a_SettingsIni.GetValueSet("Server", "Port", "25565");
+ m_ListenThreadIPv4.SetReuseAddr(true);
if (m_ListenThreadIPv4.Initialize(Ports))
{
HasAnyPorts = true;
}
Ports = a_SettingsIni.GetValueSet("Server", "PortsIPv6", "25565");
+ m_ListenThreadIPv6.SetReuseAddr(true);
if (m_ListenThreadIPv6.Initialize(Ports))
{
HasAnyPorts = true;
@@ -395,7 +398,7 @@ void cServer::TickClients(float a_Dt)
{
if ((*itr)->IsDestroyed())
{
- // Remove the client later, when CS is not held, to avoid deadlock ( http://forum.mc-server.org/showthread.php?tid=374 )
+ // Remove the client later, when CS is not held, to avoid deadlock: http://forum.mc-server.org/showthread.php?tid=374
RemoveClients.push_back(*itr);
itr = m_Clients.erase(itr);
continue;
@@ -628,7 +631,7 @@ void cServer::Shutdown(void)
cRoot::Get()->SaveAllChunks();
cCSLock Lock(m_CSClients);
- for( ClientList::iterator itr = m_Clients.begin(); itr != m_Clients.end(); ++itr )
+ for (ClientList::iterator itr = m_Clients.begin(); itr != m_Clients.end(); ++itr)
{
(*itr)->Destroy();
delete *itr;