Trying to fix the avatar problem.

This commit is contained in:
lotodore
2007-10-31 20:23:27 +00:00
parent 184eb4a577
commit e5f05c5359
4 changed files with 10 additions and 2 deletions
+2
View File
@@ -75,6 +75,8 @@ private:
mutable boost::mutex m_cacheDirMutex;
std::string m_cacheDir;
mutable boost::mutex m_loadMutex;
};
#endif
+3
View File
@@ -164,6 +164,9 @@ AvatarManager::ChunkReadAvatarFile(boost::shared_ptr<AvatarFileState> 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;
+2 -2
View File
@@ -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)
+3
View File
@@ -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<AvatarData>());