FIRE-12004: Add timer for refreshing attachments if attachments were attempted to get killed after the actual TP finished

master
Ansariel 2019-08-15 18:41:57 +02:00
parent 693e6710fd
commit cce6f93dd7
1 changed files with 49 additions and 15 deletions

View File

@ -147,6 +147,7 @@
#include "fslightshare.h" // <FS:CR> FIRE-5118 - Lightshare support
#include "fslslbridge.h"
#include "fsmoneytracker.h"
#include "llattachmentsmgr.h"
#include "llfloaterbump.h"
#include "llfloaterreg.h"
#include "llfriendcard.h"
@ -185,6 +186,34 @@ const U8 AU_FLAGS_NONE = 0x00;
const U8 AU_FLAGS_HIDETITLE = 0x01;
const U8 AU_FLAGS_CLIENT_AUTOPILOT = 0x02;
// <FS:Ansariel> Trigger refresh attachments if attachments get detached after TP finished
class FSHelloToKokuaRefreshAttachmentsTimer : public LLEventTimer
{
public:
FSHelloToKokuaRefreshAttachmentsTimer() : LLEventTimer(5.f)
{
mEventTimer.stop();
}
BOOL tick()
{
if (gSavedSettings.getBOOL("FSExperimentalLostAttachmentsFixReport"))
{
report_to_nearby_chat("Refreshing attachments...");
}
mEventTimer.stop();
LLAttachmentsMgr::instance().refreshAttachments();
return FALSE;
}
void triggerRefresh()
{
mEventTimer.start();
}
};
FSHelloToKokuaRefreshAttachmentsTimer gFSRefreshAttachmentsTimer;
// </FS:Ansariel>
void accept_friendship_coro(std::string url, LLSD notification)
{
LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID);
@ -4562,24 +4591,29 @@ void process_kill_object(LLMessageSystem *mesgsys, void **user_data)
objectp->permYouOwner())
{
// Simply ignore the request and don't kill the object - this should work...
std::string reason;
if (gAgent.getTeleportState() != LLAgent::TELEPORT_NONE)
{
reason = "tp";
}
else if (gAgentAvatarp->isCrossingRegion())
{
reason = "crossing";
}
else
{
reason = "timer";
gFSRefreshAttachmentsTimer.triggerRefresh();
}
std::string message = "Region \"" + regionp->getName() + "\" tried to kill attachment: " + objectp->getAttachmentItemName() + " (" + reason + ") - Agent region: \"" + gAgent.getRegion()->getName() + "\"";
LL_WARNS("Messaging") << message << LL_ENDL;
if (gSavedSettings.getBOOL("FSExperimentalLostAttachmentsFixReport"))
{
std::string reason;
if (gAgent.getTeleportState() != LLAgent::TELEPORT_NONE)
{
reason = "tp";
}
else if (gAgentAvatarp->isCrossingRegion())
{
reason = "crossing";
}
else
{
reason = "timer";
}
report_to_nearby_chat("Region \"" + regionp->getName() + "\" tried to kill attachment: " + objectp->getAttachmentItemName() + " (" + reason + ") - Agent region: \"" + gAgent.getRegion()->getName() + "\"");
report_to_nearby_chat(message);
}
continue;
}
// </FS:Ansariel>