#4570 Attemp to send logout message when lost network
To not leave a ghost behind and for faster reconnectmaster
parent
d5f748c91c
commit
f5423d4517
|
|
@ -4530,6 +4530,7 @@ void LLAppViewer::forceDisconnect(const std::string& mesg)
|
|||
}
|
||||
else
|
||||
{
|
||||
sendSimpleLogoutRequest();
|
||||
args["MESSAGE"] = big_reason;
|
||||
LLNotificationsUtil::add("YouHaveBeenLoggedOut", args, LLSD(), &finish_disconnect );
|
||||
}
|
||||
|
|
@ -5310,6 +5311,27 @@ void LLAppViewer::sendLogoutRequest()
|
|||
}
|
||||
}
|
||||
|
||||
void LLAppViewer::sendSimpleLogoutRequest()
|
||||
{
|
||||
if (!mLogoutRequestSent && gMessageSystem)
|
||||
{
|
||||
gLogoutInProgress = true;
|
||||
|
||||
LLMessageSystem* msg = gMessageSystem;
|
||||
msg->newMessageFast(_PREHASH_LogoutRequest);
|
||||
msg->nextBlockFast(_PREHASH_AgentData);
|
||||
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
|
||||
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
|
||||
gAgent.sendReliableMessage();
|
||||
|
||||
LL_INFOS("Agent") << "Logging out as agent: " << gAgent.getID() << " Session: " << gAgent.getSessionID() << LL_ENDL;
|
||||
|
||||
gLogoutTimer.reset();
|
||||
gLogoutMaxTime = LOGOUT_REQUEST_TIME;
|
||||
mLogoutRequestSent = true;
|
||||
}
|
||||
}
|
||||
|
||||
void LLAppViewer::updateNameLookupUrl(const LLViewerRegion * regionp)
|
||||
{
|
||||
if (!regionp || !regionp->capabilitiesReceived())
|
||||
|
|
|
|||
|
|
@ -310,6 +310,10 @@ private:
|
|||
void sendLogoutRequest();
|
||||
void disconnectViewer();
|
||||
|
||||
// Does not create a marker file. For lost network case,
|
||||
// to at least attempt to remove the ghost from the world.
|
||||
void sendSimpleLogoutRequest();
|
||||
|
||||
// *FIX: the app viewer class should be some sort of singleton, no?
|
||||
// Perhaps its child class is the singleton and this should be an abstract base.
|
||||
static LLAppViewer* sInstance;
|
||||
|
|
|
|||
Loading…
Reference in New Issue