Also disable avatar retrieval on server. Fixed nasty send "wrong return value" (Linux only).
This commit is contained in:
@@ -248,7 +248,7 @@ ClientStateStartConnect::Process(ClientThread &client)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
int errCode = SOCKET_ERRNO();
|
int errCode = SOCKET_ERRNO();
|
||||||
if (errCode == SOCKET_ERR_WOULDBLOCK)
|
if (IS_SOCKET_ERR_WOULDBLOCK(errCode))
|
||||||
{
|
{
|
||||||
boost::timers::portable::microsec_timer connectTimer;
|
boost::timers::portable::microsec_timer connectTimer;
|
||||||
ClientStateConnecting::Instance().SetTimer(connectTimer);
|
ClientStateConnecting::Instance().SetTimer(connectTimer);
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ ReceiverHelper::Recv(SOCKET sock, ReceiveBuffer &buf)
|
|||||||
if (!IS_VALID_RECV(bytesRecvd))
|
if (!IS_VALID_RECV(bytesRecvd))
|
||||||
{
|
{
|
||||||
int errCode = SOCKET_ERRNO();
|
int errCode = SOCKET_ERRNO();
|
||||||
if (errCode != SOCKET_ERR_WOULDBLOCK)
|
if (!IS_SOCKET_ERR_WOULDBLOCK(errCode))
|
||||||
throw NetException(__FILE__, __LINE__, ERR_SOCK_RECV_FAILED, SOCKET_ERRNO());
|
throw NetException(__FILE__, __LINE__, ERR_SOCK_RECV_FAILED, SOCKET_ERRNO());
|
||||||
}
|
}
|
||||||
else if (bytesRecvd == 0)
|
else if (bytesRecvd == 0)
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ SenderThread::Main()
|
|||||||
{
|
{
|
||||||
// Never assume that this is a fatal error.
|
// Never assume that this is a fatal error.
|
||||||
int errCode = SOCKET_ERRNO();
|
int errCode = SOCKET_ERRNO();
|
||||||
if (errCode == SOCKET_ERR_WOULDBLOCK)
|
if (IS_SOCKET_ERR_WOULDBLOCK(errCode))
|
||||||
{
|
{
|
||||||
fd_set writeSet;
|
fd_set writeSet;
|
||||||
struct timeval timeout;
|
struct timeval timeout;
|
||||||
@@ -193,7 +193,7 @@ SenderThread::Main()
|
|||||||
{
|
{
|
||||||
// Never assume that this is a fatal error.
|
// Never assume that this is a fatal error.
|
||||||
int errCode = SOCKET_ERRNO();
|
int errCode = SOCKET_ERRNO();
|
||||||
if (errCode != SOCKET_ERR_WOULDBLOCK)
|
if (!IS_SOCKET_ERR_WOULDBLOCK(errCode))
|
||||||
{
|
{
|
||||||
// Skip this packet - this is bad, and is therefore reported.
|
// Skip this packet - this is bad, and is therefore reported.
|
||||||
// Ignore invalid or not connected sockets.
|
// Ignore invalid or not connected sockets.
|
||||||
|
|||||||
@@ -387,9 +387,9 @@ ServerLobbyThread::HandleNetPacketInit(SessionWrapper session, const NetPacketIn
|
|||||||
m_sessionManager.SetSessionPlayerData(session.sessionData->GetId(), tmpPlayerData);
|
m_sessionManager.SetSessionPlayerData(session.sessionData->GetId(), tmpPlayerData);
|
||||||
session.playerData = tmpPlayerData;
|
session.playerData = tmpPlayerData;
|
||||||
|
|
||||||
if (initData.showAvatar && !GetAvatarManager().HasAvatar(initData.avatar))
|
// if (initData.showAvatar && !GetAvatarManager().HasAvatar(initData.avatar))
|
||||||
RequestPlayerAvatar(session);
|
// RequestPlayerAvatar(session);
|
||||||
else
|
// else
|
||||||
EstablishSession(session);
|
EstablishSession(session);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
#define CLOSESOCKET closesocket
|
#define CLOSESOCKET closesocket
|
||||||
#define IOCTLSOCKET ioctlsocket
|
#define IOCTLSOCKET ioctlsocket
|
||||||
#define SOCKET_ERRNO() WSAGetLastError()
|
#define SOCKET_ERRNO() WSAGetLastError()
|
||||||
#define SOCKET_ERR_WOULDBLOCK WSAEWOULDBLOCK
|
#define IS_SOCKET_ERR_WOULDBLOCK(_e) ((_e) == WSAEWOULDBLOCK)
|
||||||
#define SOCKET_ERR_NOTCONN WSAENOTCONN
|
#define SOCKET_ERR_NOTCONN WSAENOTCONN
|
||||||
#define SOCKET_ERR_NOTSOCK WSAENOTSOCK
|
#define SOCKET_ERR_NOTSOCK WSAENOTSOCK
|
||||||
#define SOCKET_SEND_FLAGS 0
|
#define SOCKET_SEND_FLAGS 0
|
||||||
@@ -60,11 +60,12 @@ typedef unsigned char u_char;
|
|||||||
#define CLOSESOCKET close
|
#define CLOSESOCKET close
|
||||||
#define SOCKET_ERRNO() errno
|
#define SOCKET_ERRNO() errno
|
||||||
#define IOCTLSOCKET ioctl
|
#define IOCTLSOCKET ioctl
|
||||||
#define SOCKET_ERR_WOULDBLOCK EINPROGRESS
|
|
||||||
#define SOCKET_ERR_NOTCONN ENOTCONN
|
#define SOCKET_ERR_NOTCONN ENOTCONN
|
||||||
#define SOCKET_ERR_NOTSOCK ENOTSOCK
|
#define SOCKET_ERR_NOTSOCK ENOTSOCK
|
||||||
#define SOCKET_SEND_FLAGS MSG_NOSIGNAL
|
#define SOCKET_SEND_FLAGS MSG_NOSIGNAL
|
||||||
|
|
||||||
|
#define IS_SOCKET_ERR_WOULDBLOCK(_e) ((_e) == EINPROGRESS || (_e) == EAGAIN)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define IS_VALID_SOCKET(_s) ((_s) != INVALID_SOCKET)
|
#define IS_VALID_SOCKET(_s) ((_s) != INVALID_SOCKET)
|
||||||
|
|||||||
Reference in New Issue
Block a user