Trying to fix the avatar problem.
This commit is contained in:
@@ -75,6 +75,8 @@ private:
|
|||||||
|
|
||||||
mutable boost::mutex m_cacheDirMutex;
|
mutable boost::mutex m_cacheDirMutex;
|
||||||
std::string m_cacheDir;
|
std::string m_cacheDir;
|
||||||
|
|
||||||
|
mutable boost::mutex m_loadMutex;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -164,6 +164,9 @@ AvatarManager::ChunkReadAvatarFile(boost::shared_ptr<AvatarFileState> fileState,
|
|||||||
int
|
int
|
||||||
AvatarManager::AvatarFileToNetPackets(const string &fileName, unsigned requestId, NetPacketList &packets)
|
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;
|
int retVal = ERR_NET_INVALID_AVATAR_FILE;
|
||||||
unsigned fileSize;
|
unsigned fileSize;
|
||||||
AvatarFileType fileType;
|
AvatarFileType fileType;
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ using namespace std;
|
|||||||
#define SEND_ERROR_NORMAL_TIMEOUT_MSEC 20000
|
#define SEND_ERROR_NORMAL_TIMEOUT_MSEC 20000
|
||||||
#define SEND_ERROR_LOW_PRIO_TIMEOUT_MSEC 10000
|
#define SEND_ERROR_LOW_PRIO_TIMEOUT_MSEC 10000
|
||||||
#define SEND_TIMEOUT_MSEC 10
|
#define SEND_TIMEOUT_MSEC 10
|
||||||
#define SEND_QUEUE_SIZE 1000
|
#define SEND_QUEUE_SIZE 10000
|
||||||
#define SEND_LOW_PRIO_QUEUE_SIZE 50000
|
#define SEND_LOW_PRIO_QUEUE_SIZE 10000000
|
||||||
|
|
||||||
SenderThread::SenderThread(SenderCallback &cb)
|
SenderThread::SenderThread(SenderCallback &cb)
|
||||||
: m_tmpOutBufSize(0), m_tmpIsLowPrio(false), m_callback(cb)
|
: m_tmpOutBufSize(0), m_tmpIsLowPrio(false), m_callback(cb)
|
||||||
|
|||||||
@@ -461,7 +461,10 @@ ServerLobbyThread::HandleNetPacketAvatarEnd(SessionWrapper session, const NetPac
|
|||||||
if (avatarSize == tmpAvatar->reportedSize)
|
if (avatarSize == tmpAvatar->reportedSize)
|
||||||
{
|
{
|
||||||
if (!GetAvatarManager().StoreAvatarInCache(avatarMD5, tmpAvatar->fileType, &tmpAvatar->fileData[0], avatarSize))
|
if (!GetAvatarManager().StoreAvatarInCache(avatarMD5, tmpAvatar->fileType, &tmpAvatar->fileData[0], avatarSize))
|
||||||
|
{
|
||||||
|
session.playerData->SetAvatarMD5(MD5Buf());
|
||||||
LOG_ERROR("Failed to store avatar in cache directory.");
|
LOG_ERROR("Failed to store avatar in cache directory.");
|
||||||
|
}
|
||||||
|
|
||||||
// Free memory.
|
// Free memory.
|
||||||
session.playerData->SetNetAvatarData(boost::shared_ptr<AvatarData>());
|
session.playerData->SetNetAvatarData(boost::shared_ptr<AvatarData>());
|
||||||
|
|||||||
Reference in New Issue
Block a user