* fixed some threading problems (1 possible crash: SceneCharSelection window resized or reloaded while WorldSession is destroyed)
This commit is contained in:
parent
29f133c1e7
commit
aa0450df9e
@ -64,6 +64,7 @@ protected:
|
|||||||
SceneState _scenestate;
|
SceneState _scenestate;
|
||||||
uint32 scenedata[SCENEDATA_SIZE]; // generic storage for anything the PseuInstance thread wants to tell us
|
uint32 scenedata[SCENEDATA_SIZE]; // generic storage for anything the PseuInstance thread wants to tell us
|
||||||
SCPDatabase *textdb;
|
SCPDatabase *textdb;
|
||||||
|
ZThread::FastMutex mutex;
|
||||||
};
|
};
|
||||||
|
|
||||||
class SceneGuiStart : public Scene
|
class SceneGuiStart : public Scene
|
||||||
@ -148,7 +149,6 @@ private:
|
|||||||
ShTlTerrainSceneNode *terrain;
|
ShTlTerrainSceneNode *terrain;
|
||||||
MCameraFPS *camera;
|
MCameraFPS *camera;
|
||||||
MyEventReceiver *eventrecv;
|
MyEventReceiver *eventrecv;
|
||||||
ZThread::FastMutex mutex;
|
|
||||||
uint32 map_gridX, map_gridY;
|
uint32 map_gridX, map_gridY;
|
||||||
WorldSession *wsession;
|
WorldSession *wsession;
|
||||||
World *world;
|
World *world;
|
||||||
|
|||||||
@ -162,6 +162,7 @@ void SceneCharSelection::OnResize(void)
|
|||||||
GetStringFromDB(ISCENE_CHARSEL_BUTTONS, DSCENE_CHARSEL_BUTTON_DELCHAR).c_str());
|
GetStringFromDB(ISCENE_CHARSEL_BUTTONS, DSCENE_CHARSEL_BUTTON_DELCHAR).c_str());
|
||||||
|
|
||||||
realmwin = NULL;
|
realmwin = NULL;
|
||||||
|
mutex.acquire();
|
||||||
if(scenedata[ISCENE_CHARSEL_REALMFIRST])
|
if(scenedata[ISCENE_CHARSEL_REALMFIRST])
|
||||||
{
|
{
|
||||||
dimension2d<s32> dim;
|
dimension2d<s32> dim;
|
||||||
@ -260,6 +261,7 @@ void SceneCharSelection::OnResize(void)
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
mutex.release();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -701,7 +701,7 @@ void WorldSession::EnterWorldWithCharacter(std::string name)
|
|||||||
|
|
||||||
WorldPacket pkt(CMSG_PLAYER_LOGIN,8);
|
WorldPacket pkt(CMSG_PLAYER_LOGIN,8);
|
||||||
pkt << _myGUID;
|
pkt << _myGUID;
|
||||||
SendWorldPacket(pkt);
|
AddSendWorldPacket(pkt); // it can be called from gui thread also, use threadsafe version
|
||||||
|
|
||||||
// close realm session when logging into world
|
// close realm session when logging into world
|
||||||
if(!MustDie() && _socket->IsOk() && GetInstance()->GetRSession())
|
if(!MustDie() && _socket->IsOk() && GetInstance()->GetRSession())
|
||||||
|
|||||||
@ -127,5 +127,6 @@ void WorldSocket::InitCrypt(BigNumber *k)
|
|||||||
{
|
{
|
||||||
_crypt.SetKey(k);
|
_crypt.SetKey(k);
|
||||||
_crypt.Init();
|
_crypt.Init();
|
||||||
logdebug("WorldSocket: Crypt initialized");
|
std::string tmp = toHexDump(_crypt.GetKey(),_crypt.GetKeySize(), false);
|
||||||
|
logdebug("WorldSocket: Crypt initialized [%s]",tmp.c_str());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,6 +36,8 @@ class AuthCrypt
|
|||||||
void Init();
|
void Init();
|
||||||
|
|
||||||
void SetKey(BigNumber *);
|
void SetKey(BigNumber *);
|
||||||
|
inline uint8 *GetKey(void) { return &_key[0]; }
|
||||||
|
inline uint32 GetKeySize(void) { return _key.size(); }
|
||||||
|
|
||||||
void DecryptRecv(uint8 *, size_t);
|
void DecryptRecv(uint8 *, size_t);
|
||||||
void EncryptSend(uint8 *, size_t);
|
void EncryptSend(uint8 *, size_t);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user