diff options
author | faketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2011-10-21 23:25:29 +0200 |
---|---|---|
committer | faketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2011-10-21 23:25:29 +0200 |
commit | c7b4b9f819e0c1335ece87695599474fc14fcdcf (patch) | |
tree | d640af246fec0ea63c408a57a28c61ee4f5961dd /source/cClientHandle.cpp | |
parent | Setting files (diff) | |
download | cuberite-c7b4b9f819e0c1335ece87695599474fc14fcdcf.tar cuberite-c7b4b9f819e0c1335ece87695599474fc14fcdcf.tar.gz cuberite-c7b4b9f819e0c1335ece87695599474fc14fcdcf.tar.bz2 cuberite-c7b4b9f819e0c1335ece87695599474fc14fcdcf.tar.lz cuberite-c7b4b9f819e0c1335ece87695599474fc14fcdcf.tar.xz cuberite-c7b4b9f819e0c1335ece87695599474fc14fcdcf.tar.zst cuberite-c7b4b9f819e0c1335ece87695599474fc14fcdcf.zip |
Diffstat (limited to '')
-rw-r--r-- | source/cClientHandle.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/cClientHandle.cpp b/source/cClientHandle.cpp index f274795c1..68a70715e 100644 --- a/source/cClientHandle.cpp +++ b/source/cClientHandle.cpp @@ -4,6 +4,8 @@ #include <errno.h>
#endif
+#include "MCSocket.h"
+
#include "cClientHandle.h"
#include "cServer.h"
#include "cWorld.h"
@@ -68,6 +70,10 @@ #include "packets/cPacket_Ping.h"
+#ifndef _WIN32
+#define sprintf_s(dst, size, format, ...) sprintf(dst, format, __VA_ARGS__ )
+#endif
+
#define MAX_SEMAPHORES (2000)
typedef std::list<cPacket*> PacketList;
@@ -176,7 +182,7 @@ cClientHandle::~cClientHandle() Disconnect.m_Reason = "Server shut down? Kthnxbai";
Disconnect.Send( m_pState->Socket );
- closesocket( m_pState->Socket );
+ m_pState->Socket.CloseSocket();
m_pState->Socket = 0;
}
m_pState->SocketCriticalSection.Unlock();
@@ -218,7 +224,7 @@ void cClientHandle::Destroy() m_pState->SocketCriticalSection.Lock();
if( m_pState->Socket )
{
- closesocket( m_pState->Socket );
+ m_pState->Socket.CloseSocket();
m_pState->Socket = 0;
}
m_pState->SocketCriticalSection.Unlock();
|