Further VarRegion slurl updates and fixes

master
Beq 2021-05-17 20:23:39 +01:00
parent a1f1fb3ff4
commit 71eb75382e
10 changed files with 85 additions and 19 deletions

View File

@ -938,8 +938,8 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge
{
region_name = LLWeb::escapeURL(revised_text.substr(command.length() + 1));
LLVector3d agentPos = gAgent.getPositionGlobal();
agent_x = ll_round((F32)fmod(agentPos.mdV[VX], (F64)REGION_WIDTH_METERS));
agent_y = ll_round((F32)fmod(agentPos.mdV[VY], (F64)REGION_WIDTH_METERS));
agent_x = ll_round((F32)agentPos.mdV[VX]);
agent_y = ll_round((F32)agentPos.mdV[VY]);
agent_z = ll_round((F32)agentPos.mdV[VZ]);
if (!sFSCmdLineMapToKeepPos)
{

View File

@ -50,6 +50,7 @@
#include "llpanelplaceprofile.h"
#include "llpanellandmarkinfo.h"
#include "llparcel.h"
#include "llregionhandle.h" // <FS:Beq/> Var region support
#include "llteleporthistorystorage.h"
#include "llviewercontrol.h"
#include "llviewermessage.h"
@ -355,7 +356,15 @@ void FSFloaterPlaceDetails::onOpen(const LLSD& key)
key["z"].asReal());
mPanelPlaceInfo->setParcelDetailLoadedCallback(boost::bind(&FSFloaterPlaceDetails::processParcelDetails, this, _1));
mPanelPlaceInfo->displayParcelInfo(LLUUID(), mGlobalPos);
if(key.has("ox"))
{
auto region_handle = to_region_handle(key["ox"].asInteger(), key["oy"].asInteger());
mPanelPlaceInfo->displayParcelInfo(LLUUID(), region_handle, mGlobalPos);
}
else
{
mPanelPlaceInfo->displayParcelInfo(LLUUID(), mGlobalPos);
}
}
updateVerbs();

View File

@ -713,10 +713,16 @@ void LLFloaterWorldMap::requestParcelInfo(const LLVector3d& pos_global)
{
return;
}
LLVector3 pos_region((F32)fmod(pos_global.mdV[VX], (F64)REGION_WIDTH_METERS),
(F32)fmod(pos_global.mdV[VY], (F64)REGION_WIDTH_METERS),
(F32)pos_global.mdV[VZ]);
// <FS:Beq> VarRegion slurl shenanigans
// agent_x = ll_round(region_pos.mV[VX]);
// agent_y = ll_round(region_pos.mV[VY]);
// agent_z = ll_round(region_pos.mV[VZ]);
// LLVector3 pos_region((F32)fmod(pos_global.mdV[VX], (F64)REGION_WIDTH_METERS),
// (F32)fmod(pos_global.mdV[VY], (F64)REGION_WIDTH_METERS),
// (F32)pos_global.mdV[VZ]);
auto region_origin = region->getOriginGlobal();
auto pos_region = LLVector3(pos_global - region_origin);
// </FS:Beq>
LLSD body;
std::string url = region->getCapability("RemoteParcelRequest");

View File

@ -173,7 +173,7 @@ void LLPanelPlaceInfo::displayParcelInfo(const LLUUID& region_id,
mPosRegion.setVec((F32)fmod(pos_global.mdV[VX], (F64)REGION_WIDTH_METERS),
(F32)fmod(pos_global.mdV[VY], (F64)REGION_WIDTH_METERS),
(F32)pos_global.mdV[VZ]);
LLSD body;
std::string url = region->getCapability("RemoteParcelRequest");
if (!url.empty())
@ -186,6 +186,29 @@ void LLPanelPlaceInfo::displayParcelInfo(const LLUUID& region_id,
mDescEditor->setText(getString("server_update_text"));
}
}
// <FS:Beq> FIRE-30768, FIRE-30534 more OS Var region fixups
void LLPanelPlaceInfo::displayParcelInfo(const LLUUID& region_id,
const U64 region_handle,
const LLVector3d& pos_global)
{
auto region_origin = from_region_handle(region_handle);
mPosRegion.setVec(LLVector3(pos_global - region_origin));
LLViewerRegion* region = gAgent.getRegion();
if (!region)
return;
LLSD body;
std::string url = region->getCapability("RemoteParcelRequest");
if (!url.empty())
{
LLRemoteParcelInfoProcessor::getInstance()->requestRegionParcelInfo(url,
region_id, mPosRegion, pos_global, getObserverHandle());
}
else
{
mDescEditor->setText(getString("server_update_text"));
}
}
// </FS:Beq>
// virtual
void LLPanelPlaceInfo::setErrorStatus(S32 status, const std::string& reason)

View File

@ -85,6 +85,11 @@ public:
// Sends a request to the server.
void displayParcelInfo(const LLUUID& region_id,
const LLVector3d& pos_global);
// <FS:Beq> FIRE-30768, FIRE-30534 more OS Var region fixups
void displayParcelInfo(const LLUUID& region_id,
const U64 region_handle,
const LLVector3d& pos_global);
// </FS:Beq>
/*virtual*/ void setErrorStatus(S32 status, const std::string& reason);

View File

@ -410,9 +410,14 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel,
parcel_data.name = parcel->getName();
parcel_data.sim_name = region->getName();
parcel_data.snapshot_id = parcel->getSnapshotID();
mPosRegion.setVec((F32)fmod(pos_global.mdV[VX], (F64)REGION_WIDTH_METERS),
(F32)fmod(pos_global.mdV[VY], (F64)REGION_WIDTH_METERS),
(F32)pos_global.mdV[VZ]);
// <FS:Beq> FIRE-30768, FIRE-30534 more OS Var region fixups
// mPosRegion.setVec((F32)fmod(pos_global.mdV[VX], (F64)REGION_WIDTH_METERS),
// (F32)fmod(pos_global.mdV[VY], (F64)REGION_WIDTH_METERS),
// (F32)pos_global.mdV[VZ]);
auto region_origin = region->getOriginGlobal();
mPosRegion.setVec(LLVector3(pos_global - region_origin));
LL_DEBUGS("SLURL") << "LM INFO: global " << pos_global << " region_orig " << region_origin << " pos_region " << mPosRegion << LL_ENDL;
// </FS:Beq>
parcel_data.global_x = pos_global.mdV[VX];
parcel_data.global_y = pos_global.mdV[VY];
parcel_data.global_z = pos_global.mdV[VZ];

View File

@ -34,6 +34,7 @@
#include "llinventory.h"
#include "lllandmark.h"
#include "llparcel.h"
#include "llregionhandle.h" // <FS:Beq/> Var region support
#include "llcombobox.h"
#include "llfiltereditor.h"
@ -486,6 +487,14 @@ void LLPanelPlaces::onOpen(const LLSD& key)
mPosGlobal = LLVector3d(key["x"].asReal(),
key["y"].asReal(),
key["z"].asReal());
// <FS:Beq> Var region support
if(key.has("ox"))
{
auto region_handle = to_region_handle(key["ox"].asInteger(), key["oy"].asInteger());
mPlaceProfile->displayParcelInfo(LLUUID(), region_handle, mPosGlobal);
}
else
// </FS:Beq>
mPlaceProfile->displayParcelInfo(LLUUID(), mPosGlobal);
}

View File

@ -353,6 +353,7 @@ LLSLURL::LLSLURL(const std::string& region,
// create a slurl from a global position
LLSLURL::LLSLURL(const std::string& grid,
const std::string& region,
const LLVector3d& , // <FS:Beq pp Oren> FIRE-30768: SLURL's don't work in VarRegions *unused param in SL builds*
const LLVector3d& global_position)
{
*this = LLSLURL(LLGridManager::getInstance()->getGridId(grid),
@ -366,13 +367,14 @@ LLSLURL::LLSLURL(const std::string& region,
const LLVector3d& region_origin, // <FS:Beq pp Oren> FIRE-30768: SLURL's don't work in VarRegions
const LLVector3d& global_position)
{
// <FS:Beq pp Oren> FIRE-30768: SLURL's don't work in VarRegions
// *this = LLSLURL(LLGridManager::getInstance()->getGridId(),
// region, global_position);
*this = LLSLURL(LLGridManager::getInstance()->getGridId(),
// <FS:Beq pp Oren> FIRE-30768: SLURL's don't work in VarRegions
// region, global_position);
region,
region_origin,
global_position);
// </FS:Beq pp Oren>
// </FS:Beq pp Oren>
}
LLSLURL::LLSLURL(const std::string& command, const LLUUID&id, const std::string& verb)

View File

@ -72,8 +72,8 @@ public:
LLSLURL(const std::string& region, const LLVector3& position);
LLSLURL(const std::string& grid, const std::string& region, const LLVector3& position);
// <FS:Beq pp Oren> FIRE-30768: SLURL's don't work in VarRegions
//LLSLURL(const std::string& grid, const std::string& region, const LLVector3d& global_position);
//LLSLURL(const std::string& region, const LLVector3d& global_position);
// LLSLURL(const std::string& grid, const std::string& region, const LLVector3d& global_position);
// LLSLURL(const std::string& region, const LLVector3d& global_position);
LLSLURL(const std::string& grid, const std::string& region, const LLVector3d& region_origin, const LLVector3d& global_position);
LLSLURL(const std::string& region, const LLVector3d& region_origin, const LLVector3d& global_position);
// </FS:Beq pp Oren>

View File

@ -283,9 +283,12 @@ void LLURLDispatcherImpl::regionHandleCallback(U64 region_handle, const LLSLURL&
#endif // OPENSIM
// </FS:AW optional opensim support>
LLVector3d global_pos = from_region_handle(region_handle);
global_pos += LLVector3d(slurl.getPosition());
// <FS:Beq> make Var Regions work
// LLVector3d global_pos = from_region_handle(region_handle);
// global_pos += LLVector3d(slurl.getPosition());
LLVector3d origin_pos = from_region_handle(region_handle);
LLVector3d global_pos{origin_pos + LLVector3d(slurl.getPosition())};
// </FS:Beq>
if (teleport)
{
gAgent.teleportViaLocation(global_pos);
@ -302,6 +305,10 @@ void LLURLDispatcherImpl::regionHandleCallback(U64 region_handle, const LLSLURL&
key["x"] = global_pos.mdV[VX];
key["y"] = global_pos.mdV[VY];
key["z"] = global_pos.mdV[VZ];
// <FS:Beq> support Var regions
key["ox"] = origin_pos.mdV[VX];
key["oy"] = origin_pos.mdV[VY];
// </FS:Beq>
// <FS:Ansariel> FIRE-817: Separate place details floater
//LLFloaterSidePanelContainer::showPanel("places", key);