diff --git a/src/core/avatarmanager.h b/src/core/avatarmanager.h index af80b4a6..99f2b7c9 100644 --- a/src/core/avatarmanager.h +++ b/src/core/avatarmanager.h @@ -75,6 +75,8 @@ private: mutable boost::mutex m_cacheDirMutex; std::string m_cacheDir; + + mutable boost::mutex m_loadMutex; }; #endif diff --git a/src/core/common/avatarmanager.cpp b/src/core/common/avatarmanager.cpp index 96450dc2..94ba0610 100644 --- a/src/core/common/avatarmanager.cpp +++ b/src/core/common/avatarmanager.cpp @@ -164,6 +164,9 @@ AvatarManager::ChunkReadAvatarFile(boost::shared_ptr fileState, int AvatarManager::AvatarFileToNetPackets(const string &fileName, unsigned requestId, NetPacketList &packets) { + // Serialize avatar access for now. + boost::mutex::scoped_lock lock(m_loadMutex); + int retVal = ERR_NET_INVALID_AVATAR_FILE; unsigned fileSize; AvatarFileType fileType; diff --git a/src/net/common/senderthread.cpp b/src/net/common/senderthread.cpp index 930e93b3..f1ebe44d 100644 --- a/src/net/common/senderthread.cpp +++ b/src/net/common/senderthread.cpp @@ -32,8 +32,8 @@ using namespace std; #define SEND_ERROR_NORMAL_TIMEOUT_MSEC 20000 #define SEND_ERROR_LOW_PRIO_TIMEOUT_MSEC 10000 #define SEND_TIMEOUT_MSEC 10 -#define SEND_QUEUE_SIZE 1000 -#define SEND_LOW_PRIO_QUEUE_SIZE 50000 +#define SEND_QUEUE_SIZE 10000 +#define SEND_LOW_PRIO_QUEUE_SIZE 10000000 SenderThread::SenderThread(SenderCallback &cb) : m_tmpOutBufSize(0), m_tmpIsLowPrio(false), m_callback(cb) diff --git a/src/net/common/serverlobbythread.cpp b/src/net/common/serverlobbythread.cpp index 4663492f..146982bc 100644 --- a/src/net/common/serverlobbythread.cpp +++ b/src/net/common/serverlobbythread.cpp @@ -461,7 +461,10 @@ ServerLobbyThread::HandleNetPacketAvatarEnd(SessionWrapper session, const NetPac if (avatarSize == tmpAvatar->reportedSize) { if (!GetAvatarManager().StoreAvatarInCache(avatarMD5, tmpAvatar->fileType, &tmpAvatar->fileData[0], avatarSize)) + { + session.playerData->SetAvatarMD5(MD5Buf()); LOG_ERROR("Failed to store avatar in cache directory."); + } // Free memory. session.playerData->SetNetAvatarData(boost::shared_ptr());