Skip to content

Commit

Permalink
Merge branch 'RLV-anti-cheat-at-statup' into FS-master
Browse files Browse the repository at this point in the history
  • Loading branch information
Mya Ansome committed Nov 13, 2020
2 parents f4aad7e + 84b9460 commit 149030f
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions indra/newview/llstartup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@

#include "llviewerprecompiledheaders.h"

#include <thread>
#include <chrono>

#include "llappviewer.h"
#include "llstartup.h"
#include "llcallstack.h"
Expand Down Expand Up @@ -2266,11 +2269,44 @@ bool idle_startup()
return FALSE;
}


//---------------------------------------------------------------------
// World Wait
//---------------------------------------------------------------------
static LLUUID id;
if(STATE_WORLD_WAIT == LLStartUp::getStartupState())
{
// [RLVa]
// MK
// We are beginning a session that may or may not have the avatar wear stuff
// that restricts from seeing the location, names or even to look around.
// Make the viewer believe it has received a bunch of restrictions and let them
// be flushed out by the garbage collector later, after the actual restrictions
// have been received.
// For this, we simulate the reception of those commands from a non-existent object.
if (gRlvHandler.isEnabled())
{
if(id.isNull())
{
id.generate();
LLAvatarName name;
name.fromString("Viewer Startup");
LLAvatarNameCache::instance().insert(id, name);
}

std::string mesg = "camavdist:0=n,shownames=n,showloc=n,showworldmap=n,showminimap=n,tploc=n,tplm=n,tplure=n,camdrawmin:1=n,camdrawmax:1.1=n,camdrawalphamin:0=n,camdrawalphamax:1=n,camtextures=n";

boost_tokenizer tokens(mesg, boost::char_separator<char>(",", "", boost::drop_empty_tokens));
for (boost_tokenizer::iterator itToken = tokens.begin(); itToken != tokens.end(); ++itToken)
{
std::string strCmd = *itToken;

ERlvCmdRet eRet = gRlvHandler.processCommand(id, strCmd, true);
RLV_INFOS << "strCmd:" << strCmd << "eRet: " << eRet << RLV_ENDL;
}
}
// [/RLVa]

LL_DEBUGS("AppInit") << "Waiting for simulator ack...." << LL_ENDL;
set_startup_status(0.59f, LLTrans::getString("LoginWaitingForRegionHandshake"), gAgent.mMOTD);
if(gGotUseCircuitCodeAck)
Expand Down Expand Up @@ -3146,6 +3182,13 @@ bool idle_startup()
}
// </FS:PP>

// [RLVa]
new std::thread([]() {
std::this_thread::sleep_for(std::chrono::seconds(10));
gRlvHandler.processCommand(id, "clear", true);
});
// [/RLVa]

return TRUE;
}

Expand Down

0 comments on commit 149030f

Please sign in to comment.