From 99a9258d5217565d9c4e4753a5697857b6b339b7 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 25 Sep 2024 18:03:57 -0700 Subject: Issue #2687: Honor flag sent by server indicating server side autopilot is engaged. When flag is set allow sever to update local avatar rotation. --- indra/llprimitive/object_flags.h | 12 ++++++------ indra/newview/llviewerobject.cpp | 6 ++++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/indra/llprimitive/object_flags.h b/indra/llprimitive/object_flags.h index e2cdba072a..06e216ba49 100644 --- a/indra/llprimitive/object_flags.h +++ b/indra/llprimitive/object_flags.h @@ -57,16 +57,16 @@ const U32 FLAGS_CAMERA_SOURCE = (1U << 22); //const U32 FLAGS_UNUSED_001 = (1U << 23); // was FLAGS_CAST_SHADOWS -//const U32 FLAGS_UNUSED_002 = (1U << 24); -//const U32 FLAGS_UNUSED_003 = (1U << 25); -//const U32 FLAGS_UNUSED_004 = (1U << 26); -//const U32 FLAGS_UNUSED_005 = (1U << 27); +const U32 FLAGS_SERVER_AUTOPILOT = (1U << 24); // Update was for an agent AND that agent is being autopiloted from the server +//const U32 FLAGS_UNUSED_002 = (1U << 25); +//const U32 FLAGS_UNUSED_003 = (1U << 26); +//const U32 FLAGS_UNUSED_004 = (1U << 27); const U32 FLAGS_OBJECT_OWNER_MODIFY = (1U << 28); const U32 FLAGS_TEMPORARY_ON_REZ = (1U << 29); -//const U32 FLAGS_UNUSED_006 = (1U << 30); // was FLAGS_TEMPORARY -//const U32 FLAGS_UNUSED_007 = (1U << 31); // was FLAGS_ZLIB_COMPRESSED +//const U32 FLAGS_UNUSED_005 = (1U << 30); // was FLAGS_TEMPORARY +//const U32 FLAGS_UNUSED_006 = (1U << 31); // was FLAGS_ZLIB_COMPRESSED const U32 FLAGS_LOCAL = FLAGS_ANIM_SOURCE | FLAGS_CAMERA_SOURCE; const U32 FLAGS_WORLD = FLAGS_USE_PHYSICS | FLAGS_PHANTOM | FLAGS_TEMPORARY_ON_REZ; diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 86440fca48..b87b17e3cf 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2325,6 +2325,12 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, // Set the rotation of the object followed by adjusting for the accumulated angular velocity (llSetTargetOmega) setRotation(new_rot * mAngularVelocityRot); + if ((mFlags & FLAGS_SERVER_AUTOPILOT) && asAvatar() && asAvatar()->isSelf()) + { + gAgent.resetAxes(); + gAgent.rotate(new_rot); + gAgentCamera.resetView(); + } setChanged(ROTATED | SILHOUETTE); } -- cgit v1.2.3 From 81df0476b5194ca50b7b473e9fb1a33c0831c28a Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 14 Oct 2024 12:49:43 -0700 Subject: Private Issue #297: Accept new flags in ScriptTeleportRequest message. Flags indicate if the world map should be opened and focused. --- indra/llcommon/indra_constants.h | 2 ++ indra/llui/llfloater.h | 6 ++++-- indra/newview/llfloaterworldmap.cpp | 7 +++++-- indra/newview/llviewermessage.cpp | 18 ++++++++++++++++-- scripts/messages/message_template.msg | 20 ++++++++++++-------- scripts/messages/message_template.msg.sha1 | 2 +- 6 files changed, 40 insertions(+), 15 deletions(-) diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h index d2de88ff0a..c6bdab007f 100644 --- a/indra/llcommon/indra_constants.h +++ b/indra/llcommon/indra_constants.h @@ -355,5 +355,7 @@ const U8 CLICK_ACTION_DISABLED = 8; const U8 CLICK_ACTION_IGNORE = 9; // DO NOT CHANGE THE SEQUENCE OF THIS LIST!! +constexpr U32 BEACON_SHOW_MAP = 0x0001; +constexpr U32 BEACON_FOCUS_MAP = 0x0002; #endif diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 9be2240f6f..eae2435117 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -377,6 +377,10 @@ public: void enableResizeCtrls(bool enable, bool width = true, bool height = true); bool isPositioning(LLFloaterEnums::EOpenPositioning p) const { return (p == mPositioning); } + + void setAutoFocus(bool focus) { mAutoFocus = focus; } // whether to automatically take focus when opened + bool getAutoFocus() const { return mAutoFocus; } + protected: void applyControlsAndPosition(LLFloater* other); @@ -401,8 +405,6 @@ protected: void setExpandedRect(const LLRect& rect) { mExpandedRect = rect; } // size when not minimized const LLRect& getExpandedRect() const { return mExpandedRect; } - void setAutoFocus(bool focus) { mAutoFocus = focus; } // whether to automatically take focus when opened - bool getAutoFocus() const { return mAutoFocus; } LLDragHandle* getDragHandle() const { return mDragHandle; } void destroy(); // Don't call this directly. You probably want to call closeFloater() diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 30ed723db6..a798ba31ee 100755 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -486,8 +486,11 @@ void LLFloaterWorldMap::onOpen(const LLSD& key) const LLUUID landmark_folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK); LLInventoryModelBackgroundFetch::instance().start(landmark_folder_id); - mLocationEditor->setFocus( true); - gFocusMgr.triggerFocusFlash(); + if (hasFocus()) + { + mLocationEditor->setFocus( true); + gFocusMgr.triggerFocusFlash(); + } buildAvatarIDList(); buildLandmarkIDLists(); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 1d4828fd33..fe6de38dd7 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -6610,7 +6610,6 @@ void process_initiate_download(LLMessageSystem* msg, void**) (void**)new std::string(viewer_filename)); } - void process_script_teleport_request(LLMessageSystem* msg, void**) { if (!gSavedSettings.getBOOL("ScriptsCanShowUI")) return; @@ -6624,6 +6623,11 @@ void process_script_teleport_request(LLMessageSystem* msg, void**) msg->getString("Data", "SimName", sim_name); msg->getVector3("Data", "SimPosition", pos); msg->getVector3("Data", "LookAt", look_at); + U32 flags = (BEACON_SHOW_MAP | BEACON_FOCUS_MAP); + if (msg->has("Options")) + { + msg->getU32("Options", "Flags", flags); + } LLFloaterWorldMap* instance = LLFloaterWorldMap::getInstance(); if(instance) @@ -6634,7 +6638,17 @@ void process_script_teleport_request(LLMessageSystem* msg, void**) << LL_ENDL; instance->trackURL(sim_name, (S32)pos.mV[VX], (S32)pos.mV[VY], (S32)pos.mV[VZ]); - LLFloaterReg::showInstance("world_map", "center"); + if (flags & BEACON_SHOW_MAP) + { + bool old_auto_focus = instance->getAutoFocus(); + instance->setAutoFocus(false); + instance->openFloater("center"); + if (flags & BEACON_FOCUS_MAP) + { + instance->setFocus(true); + } + instance->setAutoFocus(old_auto_focus); + } } // remove above two lines and replace with below line diff --git a/scripts/messages/message_template.msg b/scripts/messages/message_template.msg index 1450c111c2..70c2bdf53a 100755 --- a/scripts/messages/message_template.msg +++ b/scripts/messages/message_template.msg @@ -4370,14 +4370,18 @@ version 2.0 // ScriptTeleportRequest // reliable { - ScriptTeleportRequest Low 195 Trusted Unencoded - { - Data Single - { ObjectName Variable 1 } - { SimName Variable 1 } - { SimPosition LLVector3 } - { LookAt LLVector3 } - } + ScriptTeleportRequest Low 195 Trusted Unencoded + { + Data Single + { ObjectName Variable 1 } + { SimName Variable 1 } + { SimPosition LLVector3 } + { LookAt LLVector3 } + } + { + Options Variable + { Flags U32 } + } } diff --git a/scripts/messages/message_template.msg.sha1 b/scripts/messages/message_template.msg.sha1 index efa5f3cf48..eb436d0627 100755 --- a/scripts/messages/message_template.msg.sha1 +++ b/scripts/messages/message_template.msg.sha1 @@ -1 +1 @@ -d7915d67467e59287857630bd89bf9529d065199 \ No newline at end of file +b98fc0af5fa88601f5afa4f3c83f08188316e9a8 \ No newline at end of file -- cgit v1.2.3 From 3dc945c1df2a8961363528df0e383519c9d63d1f Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 14 Oct 2024 15:45:04 -0700 Subject: Private Issue #297: Code review feedback. --- indra/newview/llviewermessage.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index fe6de38dd7..e52a40ef85 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -6641,12 +6641,8 @@ void process_script_teleport_request(LLMessageSystem* msg, void**) if (flags & BEACON_SHOW_MAP) { bool old_auto_focus = instance->getAutoFocus(); - instance->setAutoFocus(false); + instance->setAutoFocus(flags & BEACON_FOCUS_MAP); instance->openFloater("center"); - if (flags & BEACON_FOCUS_MAP) - { - instance->setFocus(true); - } instance->setAutoFocus(old_auto_focus); } } -- cgit v1.2.3 From 7cd50ceaceaf3fa83c37ab6d7cf85e3e22609d9c Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 21 Oct 2024 16:35:23 -0700 Subject: Issue #2907: Process metadata sent along with chats of type IM_NOTHING_SPECIAL, The metadata can contain information about the bot status of the sender. It may also contain a system-injected notification that is displayed to the agent as part of the 1:1 chat window. --- indra/llmessage/message_prehash.cpp | 1 + indra/llmessage/message_prehash.h | 1 + indra/newview/llimprocessing.cpp | 47 ++++++++++++++++++++++++-- indra/newview/llimprocessing.h | 1 + indra/newview/llimview.cpp | 2 +- indra/newview/llviewermessage.cpp | 18 +++++++++- indra/newview/skins/default/xui/da/strings.xml | 4 +++ indra/newview/skins/default/xui/de/strings.xml | 4 +++ indra/newview/skins/default/xui/en/strings.xml | 4 +++ indra/newview/skins/default/xui/es/strings.xml | 4 +++ indra/newview/skins/default/xui/fr/strings.xml | 4 +++ indra/newview/skins/default/xui/it/strings.xml | 4 +++ indra/newview/skins/default/xui/ja/strings.xml | 4 +++ indra/newview/skins/default/xui/pl/strings.xml | 4 +++ indra/newview/skins/default/xui/pt/strings.xml | 4 +++ indra/newview/skins/default/xui/ru/strings.xml | 4 +++ indra/newview/skins/default/xui/tr/strings.xml | 4 +++ indra/newview/skins/default/xui/zh/strings.xml | 4 +++ scripts/messages/message_template.msg | 8 +++++ scripts/messages/message_template.msg.sha1 | 2 +- 20 files changed, 122 insertions(+), 6 deletions(-) diff --git a/indra/llmessage/message_prehash.cpp b/indra/llmessage/message_prehash.cpp index c264a9f086..21dbf35783 100644 --- a/indra/llmessage/message_prehash.cpp +++ b/indra/llmessage/message_prehash.cpp @@ -1402,3 +1402,4 @@ char const* const _PREHASH_HoverHeight = LLMessageStringTable::getInstance()->ge char const* const _PREHASH_Experience = LLMessageStringTable::getInstance()->getString("Experience"); char const* const _PREHASH_ExperienceID = LLMessageStringTable::getInstance()->getString("ExperienceID"); char const* const _PREHASH_LargeGenericMessage = LLMessageStringTable::getInstance()->getString("LargeGenericMessage"); +char const* const _PREHASH_MetaData = LLMessageStringTable::getInstance()->getString("MetaData"); diff --git a/indra/llmessage/message_prehash.h b/indra/llmessage/message_prehash.h index 1d30b69b67..8a2ad1587c 100644 --- a/indra/llmessage/message_prehash.h +++ b/indra/llmessage/message_prehash.h @@ -1403,5 +1403,6 @@ extern char const* const _PREHASH_HoverHeight; extern char const* const _PREHASH_Experience; extern char const* const _PREHASH_ExperienceID; extern char const* const _PREHASH_LargeGenericMessage; +extern char const* const _PREHASH_MetaData; #endif diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp index 590cd09a31..5d1317f00f 100644 --- a/indra/newview/llimprocessing.cpp +++ b/indra/newview/llimprocessing.cpp @@ -422,6 +422,7 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, U8 *binary_bucket, S32 binary_bucket_size, LLHost &sender, + LLSD metadata, LLUUID aux_id) { LLChat chat; @@ -451,6 +452,30 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, bool is_linden = chat.mSourceType != CHAT_SOURCE_OBJECT && LLMuteList::isLinden(name); + /*** + * The simulator has flagged this sender as a bot, if the viewer would like to display + * the chat text in a different color or font, the below code is how the viewer can + * tell if the sender is a bot. + *----------------------------------------------------- + bool is_bot = false; + if (metadata.has("sender")) + { // The server has identified this sender as a bot. + is_bot = metadata["sender"]["bot"].asBoolean(); + } + *----------------------------------------------------- + */ + + bool is_system_notice = false; + std::string notice_id; + LLSD notice_args; + if (metadata.has("notice")) + { // The server has injected a notice into the IM conversation. + // These will be things like bot notifications, etc. + is_system_notice = true; + notice_id = metadata["notice"]["id"].asString(); + notice_args = metadata["notice"]["data"]; + } + chat.mMuted = is_muted; chat.mFromID = from_id; chat.mFromName = name; @@ -544,7 +569,7 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, } else { - // standard message, not from system + // standard message, server may have injected a notice into the conversation. std::string saved; if (offline == IM_OFFLINE) { @@ -579,8 +604,16 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, region_message = true; } } - gIMMgr->addMessage( - session_id, + + if (is_system_notice) + { // The simulator has injected some sort of notice into the conversation. + // findString will only replace the contents of buffer if the notice_id is found. + LLTrans::findString(buffer, notice_id, notice_args); + name = SYSTEM_FROM; + from_id = LLUUID::null; + } + + gIMMgr->addMessage(session_id, from_id, name, buffer, @@ -592,6 +625,7 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, position, region_message, timestamp); + } else { @@ -1627,6 +1661,12 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url) from_group = message_data["from_group"].asString() == "Y"; } + LLSD metadata; + if (message_data.has("metadata")) + { + metadata = message_data["metadata"]; + } + EInstantMessage dialog = static_cast(message_data["dialog"].asInteger()); LLUUID session_id = message_data["transaction-id"].asUUID(); if (session_id.isNull() && dialog == IM_FROM_TASK) @@ -1654,6 +1694,7 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url) local_bin_bucket.data(), S32(local_bin_bucket.size()), local_sender, + metadata, message_data["asset_id"].asUUID()); }); diff --git a/indra/newview/llimprocessing.h b/indra/newview/llimprocessing.h index 030d28b198..66ffc59ae0 100644 --- a/indra/newview/llimprocessing.h +++ b/indra/newview/llimprocessing.h @@ -48,6 +48,7 @@ public: U8 *binary_bucket, S32 binary_bucket_size, LLHost &sender, + LLSD metadata, LLUUID aux_id = LLUUID::null); // Either receives list of offline messages from 'ReadOfflineMsgs' capability diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 34a4b5b230..7a2f1486ae 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -3142,7 +3142,7 @@ void LLIMMgr::addMessage( const LLUUID& region_id, const LLVector3& position, bool is_region_msg, - U32 timestamp) // May be zero + U32 timestamp) // May be zero { LLUUID other_participant_id = target_id; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 1d4828fd33..f2335319a8 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2137,6 +2137,21 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) EInstantMessage dialog = (EInstantMessage)d; LLHost sender = msg->getSender(); + LLSD metadata; + if (msg->getNumberOfBlocksFast(_PREHASH_MetaData) > 0) + { + S32 metadata_size = msg->getSizeFast(_PREHASH_MetaData, 0, _PREHASH_Data); + std::string metadata_buffer; + metadata_buffer.resize(metadata_size, 0); + + msg->getBinaryDataFast(_PREHASH_MetaData, _PREHASH_Data, &metadata_buffer[0], metadata_size, 0, metadata_size ); + std::stringstream metadata_stream(metadata_buffer); + if (LLSDSerialize::fromBinary(metadata, metadata_stream, metadata_size) == LLSDParser::PARSE_FAILURE) + { + metadata.clear(); + } + } + LLIMProcessing::processNewMessage(from_id, from_group, to_id, @@ -2151,7 +2166,8 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) position, binary_bucket, binary_bucket_size, - sender); + sender, + metadata); } void send_do_not_disturb_message (LLMessageSystem* msg, const LLUUID& from_id, const LLUUID& session_id) diff --git a/indra/newview/skins/default/xui/da/strings.xml b/indra/newview/skins/default/xui/da/strings.xml index e4f99d14e9..c4275d43f7 100644 --- a/indra/newview/skins/default/xui/da/strings.xml +++ b/indra/newview/skins/default/xui/da/strings.xml @@ -3723,6 +3723,10 @@ Hvis du bliver ved med at modtage denne besked, kontakt venligst [SUPPORT_SITE]. Konference med [AGENT_NAME] + +Du chatter med en bot, [NAME]. Del ikke personlige oplysninger. +Læs mere på https://second.life/scripted-agents. + (IM session eksisterer ikke) diff --git a/indra/newview/skins/default/xui/de/strings.xml b/indra/newview/skins/default/xui/de/strings.xml index a9e7626dc5..44355940c4 100644 --- a/indra/newview/skins/default/xui/de/strings.xml +++ b/indra/newview/skins/default/xui/de/strings.xml @@ -1614,6 +1614,10 @@ Falls diese Meldung weiterhin angezeigt wird, wenden Sie sich bitte an [SUPPORT_ Konferenz mit [AGENT_NAME] Inventarobjekt „[ITEM_NAME]“ angeboten Inventarordner „[ITEM_NAME]“ angeboten + + Sie chatten mit einem Bot, [NAME]. Geben Sie keine persönlichen Informationen weiter. +Erfahren Sie mehr unter https://second.life/scripted-agents. + Objekte aus dem Inventar hier her ziehen Sie haben auf Facebook gepostet. Sie haben auf Flickr gepostet. diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index f0a26f9c56..9102a30e1d 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -3717,6 +3717,10 @@ Please reinstall viewer from https://secondlife.com/support/downloads/ and cont Inventory folder '[ITEM_NAME]' offered + + You are chatting with a bot, [NAME]. Do not share any personal information. +Learn more at https://second.life/scripted-agents. + Drag items from inventory here diff --git a/indra/newview/skins/default/xui/es/strings.xml b/indra/newview/skins/default/xui/es/strings.xml index cd8e7687ae..f23f6e1c07 100644 --- a/indra/newview/skins/default/xui/es/strings.xml +++ b/indra/newview/skins/default/xui/es/strings.xml @@ -1585,6 +1585,10 @@ Si sigues recibiendo este mensaje, contacta con [SUPPORT_SITE]. Conferencia con [AGENT_NAME] Ítem del inventario '[ITEM_NAME]' ofrecido Carpeta del inventario '[ITEM_NAME]' ofrecida + +Estás conversando con un bot, [NAME]. No compartas información personal. +Más información en https://second.life/scripted-agents. + Arrastra los ítems desde el invenbtario hasta aquí Has publicado en Facebook. Has publicado en Flickr. diff --git a/indra/newview/skins/default/xui/fr/strings.xml b/indra/newview/skins/default/xui/fr/strings.xml index 0a3fbeb603..cfa6cb5001 100644 --- a/indra/newview/skins/default/xui/fr/strings.xml +++ b/indra/newview/skins/default/xui/fr/strings.xml @@ -1615,6 +1615,10 @@ Si ce message persiste, veuillez aller sur la page [SUPPORT_SITE]. Conférence avec [AGENT_NAME] Objet de l’inventaire [ITEM_NAME] offert Dossier de l’inventaire [ITEM_NAME] offert + +Vous discutez avec un bot, [NAME]. Ne partagez pas d’informations personnelles. +En savoir plus sur https://second.life/scripted-agents. + Faire glisser les objets de l'inventaire ici Vous avez publié sur Facebook. Vous avez publié sur Flickr. diff --git a/indra/newview/skins/default/xui/it/strings.xml b/indra/newview/skins/default/xui/it/strings.xml index 178bb90ca6..2a430ad840 100644 --- a/indra/newview/skins/default/xui/it/strings.xml +++ b/indra/newview/skins/default/xui/it/strings.xml @@ -1587,6 +1587,10 @@ Se il messaggio persiste, contatta [SUPPORT_SITE]. Chiamata in conferenza con [AGENT_NAME] Offerto oggetto di inventario "[ITEM_NAME]" Offerta cartella di inventario "[ITEM_NAME]" + +Stai parlando con un bot, [NAME]. Non condividere informazioni personali. +Scopri di più su https://second.life/scripted-agents. + Hai pubblicato su Facebook. Hai pubblicato su Flickr. Hai pubblicato su Twitter. diff --git a/indra/newview/skins/default/xui/ja/strings.xml b/indra/newview/skins/default/xui/ja/strings.xml index fa6c329fe7..ff3b1a53a2 100644 --- a/indra/newview/skins/default/xui/ja/strings.xml +++ b/indra/newview/skins/default/xui/ja/strings.xml @@ -6150,6 +6150,10 @@ www.secondlife.com から最新バージョンをダウンロードしてくだ フォルダ「[ITEM_NAME]」がインベントリに送られてきました。 + +[NAME]とチャットしています。個人情報を共有しないでください。 +詳細は https://second.life/scripted-agents をご覧ください。 + インベントリからここにアイテムをドラッグします。 diff --git a/indra/newview/skins/default/xui/pl/strings.xml b/indra/newview/skins/default/xui/pl/strings.xml index 26ec6cc9dc..d26272ca54 100644 --- a/indra/newview/skins/default/xui/pl/strings.xml +++ b/indra/newview/skins/default/xui/pl/strings.xml @@ -4413,6 +4413,10 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Zaoferowano folder: '[ITEM_NAME]' + +Rozmawiasz z botem [NAME]. Nie udostępniaj żadnych danych osobowych. +Dowiedz się więcej na https://second.life/scripted-agents. + Przeciągaj tutaj rzeczy z Szafy diff --git a/indra/newview/skins/default/xui/pt/strings.xml b/indra/newview/skins/default/xui/pt/strings.xml index 6db5da2e89..4ce5694c01 100644 --- a/indra/newview/skins/default/xui/pt/strings.xml +++ b/indra/newview/skins/default/xui/pt/strings.xml @@ -1550,6 +1550,10 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. Conversa com [AGENT_NAME] Item do inventário '[ITEM_NAME]' oferecido Pasta do inventário '[ITEM_NAME]' oferecida + +Você está conversando com um bot, [NAME]. Não compartilhe informações pessoais. +Saiba mais em https://second.life/scripted-agents. + Você publicou no Facebook. Você publicou no Flickr. Você publicou no Twitter. diff --git a/indra/newview/skins/default/xui/ru/strings.xml b/indra/newview/skins/default/xui/ru/strings.xml index 61d836a2d1..9a26accdde 100644 --- a/indra/newview/skins/default/xui/ru/strings.xml +++ b/indra/newview/skins/default/xui/ru/strings.xml @@ -4577,6 +4577,10 @@ support@secondlife.com. Предложена папка инвентаря «[ITEM_NAME]» + +Вы общаетесь с ботом [NAME]. Не передавайте личные данные. +Подробнее на https://second.life/scripted-agents. + Перетаскивайте вещи из инвентаря сюда diff --git a/indra/newview/skins/default/xui/tr/strings.xml b/indra/newview/skins/default/xui/tr/strings.xml index e709a4c5d6..157b48c32a 100644 --- a/indra/newview/skins/default/xui/tr/strings.xml +++ b/indra/newview/skins/default/xui/tr/strings.xml @@ -4580,6 +4580,10 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. "[ITEM_NAME]" envanter klasörü sunuldu + +Bir bot ile sohbet ediyorsunuz, [NAME]. Kişisel bilgilerinizi paylaşmayın. +Daha fazla bilgi için: https://second.life/scripted-agents. + Envanterinizden buraya öğeler sürükleyin diff --git a/indra/newview/skins/default/xui/zh/strings.xml b/indra/newview/skins/default/xui/zh/strings.xml index bdb16c9bf1..a3a9915dc4 100644 --- a/indra/newview/skins/default/xui/zh/strings.xml +++ b/indra/newview/skins/default/xui/zh/strings.xml @@ -4573,6 +4573,10 @@ http://secondlife.com/support 求助解決問題。 收納區資料夾'[ITEM_NAME]'已向人提供 + +您正在与人工智能机器人 [NAME] 聊天。请勿分享任何个人信息。 +了解更多:https://second.life/scripted-agents。 + 將收納區物品拖曳到這裡 diff --git a/scripts/messages/message_template.msg b/scripts/messages/message_template.msg index 1450c111c2..dfe6ce60fc 100755 --- a/scripts/messages/message_template.msg +++ b/scripts/messages/message_template.msg @@ -5664,6 +5664,14 @@ version 2.0 { Message Variable 2 } { BinaryBucket Variable 2 } } + { + EstateBlock Single + { EstateID U32 } + } + { + MetaData Variable + { Data Variable 2 } + } } // RetrieveInstantMessages - used to get instant messages that diff --git a/scripts/messages/message_template.msg.sha1 b/scripts/messages/message_template.msg.sha1 index efa5f3cf48..f7f26d3cf6 100755 --- a/scripts/messages/message_template.msg.sha1 +++ b/scripts/messages/message_template.msg.sha1 @@ -1 +1 @@ -d7915d67467e59287857630bd89bf9529d065199 \ No newline at end of file +0d9706a9dfe23358140642a21db48980b3d016b2 \ No newline at end of file -- cgit v1.2.3 From a097f887282f6ddb20ed8a7d50f506554216a0a2 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 23 Oct 2024 11:31:29 -0700 Subject: Issue #2907: Code review comments. --- indra/newview/llimprocessing.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp index 5d1317f00f..f5b149335b 100644 --- a/indra/newview/llimprocessing.cpp +++ b/indra/newview/llimprocessing.cpp @@ -453,7 +453,7 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, LLMuteList::isLinden(name); /*** - * The simulator has flagged this sender as a bot, if the viewer would like to display + * The simulator may have flagged this sender as a bot, if the viewer would like to display * the chat text in a different color or font, the below code is how the viewer can * tell if the sender is a bot. *----------------------------------------------------- @@ -465,14 +465,12 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, *----------------------------------------------------- */ - bool is_system_notice = false; - std::string notice_id; + std::string notice_name; LLSD notice_args; if (metadata.has("notice")) { // The server has injected a notice into the IM conversation. // These will be things like bot notifications, etc. - is_system_notice = true; - notice_id = metadata["notice"]["id"].asString(); + notice_name = metadata["notice"]["id"].asString(); notice_args = metadata["notice"]["data"]; } @@ -605,10 +603,10 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, } } - if (is_system_notice) + if (!notice_name.empty()) { // The simulator has injected some sort of notice into the conversation. // findString will only replace the contents of buffer if the notice_id is found. - LLTrans::findString(buffer, notice_id, notice_args); + LLTrans::findString(buffer, notice_name, notice_args); name = SYSTEM_FROM; from_id = LLUUID::null; } -- cgit v1.2.3 From 48ccb0f75b078670ced1f8fe8d4942abe0a6f293 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 25 Oct 2024 15:52:10 -0700 Subject: Issue #2907: When passing the injected notification message into addMessage on behalf of the system, optionally specify the agent id and name that should be used. (cherry picked from commit 7ff297ec3fc5f878cc9a916678987c0033b7eb8a) --- indra/newview/llimprocessing.cpp | 10 ++++++---- indra/newview/llimview.cpp | 13 ++++++++++--- indra/newview/llimview.h | 4 +++- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp index f5b149335b..e050fb77e0 100644 --- a/indra/newview/llimprocessing.cpp +++ b/indra/newview/llimprocessing.cpp @@ -603,12 +603,13 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, } } + std::string real_name; + if (!notice_name.empty()) { // The simulator has injected some sort of notice into the conversation. // findString will only replace the contents of buffer if the notice_id is found. LLTrans::findString(buffer, notice_name, notice_args); - name = SYSTEM_FROM; - from_id = LLUUID::null; + real_name = SYSTEM_FROM; } gIMMgr->addMessage(session_id, @@ -622,8 +623,9 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, region_id, position, region_message, - timestamp); - + timestamp, + LLUUID::null, + real_name); } else { diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 7a2f1486ae..21c255f226 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -3142,9 +3142,16 @@ void LLIMMgr::addMessage( const LLUUID& region_id, const LLVector3& position, bool is_region_msg, - U32 timestamp) // May be zero + U32 timestamp, // May be zero + LLUUID display_id, + std::string_view display_name) { LLUUID other_participant_id = target_id; + std::string message_display_name = (display_name.empty()) ? from : std::string(display_name); + if (display_id.isNull() && (display_name.empty())) + { + display_id = other_participant_id; + } LLUUID new_session_id = session_id; if (new_session_id.isNull()) @@ -3240,7 +3247,7 @@ void LLIMMgr::addMessage( } //Play sound for new conversations - if (!skip_message & !gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundNewConversation"))) + if (!skip_message && !gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundNewConversation"))) { make_ui_sound("UISndNewIncomingIMSession"); } @@ -3254,7 +3261,7 @@ void LLIMMgr::addMessage( if (!LLMuteList::getInstance()->isMuted(other_participant_id, LLMute::flagTextChat) && !skip_message) { - LLIMModel::instance().addMessage(new_session_id, from, other_participant_id, msg, true, is_region_msg, timestamp); + LLIMModel::instance().addMessage(new_session_id, message_display_name, display_id, msg, true, is_region_msg, timestamp); } // Open conversation floater if offline messages are present diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 61776860e3..23f90ca795 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -368,7 +368,9 @@ public: const LLUUID& region_id = LLUUID::null, const LLVector3& position = LLVector3::zero, bool is_region_msg = false, - U32 timestamp = 0); + U32 timestamp = 0, + LLUUID display_id = LLUUID::null, + std::string_view display_name = ""); void addSystemMessage(const LLUUID& session_id, const std::string& message_name, const LLSD& args); -- cgit v1.2.3 From 09af45daa3e63bc6a5df064e1cc40e3ec4e18e70 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 8 Nov 2024 16:49:34 -0800 Subject: Server Issue #1493: New notification message for llTransferOwnership. --- indra/newview/skins/default/xui/en/notifications.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index b5f742e5fb..36d6ef8dbf 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -10326,6 +10326,14 @@ You are now the owner of object [OBJECT_NAME] + fail +You are now the owner of object [OBJECT_NAME] and it has been placed in your inventory. + + + fail -- cgit v1.2.3 From 942527ddf39925e3e77d5c4e30a0fdc245156ada Mon Sep 17 00:00:00 2001 From: William Weaver Date: Tue, 11 Mar 2025 21:34:45 +0300 Subject: **fix: Correctly update shadows on RenderShadowResolutionScale change** MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Shadows were not updating correctly after a shader change occurred in-session and then the RenderShadowResolutionScale setting was adjusted. This issue is present in Second Life Release 7.1.12.1355088671 (64-bit) and Second Life Test 7.1.12.250701803 (64-bit). **Specifically, after any shader-related setting is changed in-session (such as toggling Advanced Graphics options like SSAO, HDR, Depth of Field, SSR, Antialiasing, or changing the Graphics Quality preset), subsequent adjustments to `RenderShadowResolutionScale` via Debug Settings result in broken shadow rendering.** The shadows become corrupted or disappear entirely and do not reflect the new resolution scale. Correct shadow rendering is only restored by toggling a shader or restarting the viewer. This behavior is inconsistent with other render settings that update immediately after modification and degrades the user experience when dynamically adjusting shadow quality. This commit changes the signal listener for "RenderShadowResolutionScale" in **llviewercontrol.cpp** from `handleShadowsResized` to `handleSetShaderChanged`. `handleSetShaderChanged` ensures a full shader update, which is necessary for this setting to take effect immediately—similar to other render settings like RenderDeferredSSAO. This change ensures that shadows update correctly and immediately when the resolution scale is changed in Debug Settings, even after prior shader changes in the session, without requiring additional shader toggling or viewer restarts. This provides a smoother and more responsive experience for advanced users adjusting shadow quality in various rendering scenarios. --- **Steps to Reproduce (Bug)** _Verified in Second Life Release 7.1.12.1355088671 (64-bit) and Second Life Test 7.1.12.250701803 (64-bit):_ 1. **Fresh Install Preparation:** Ensure a clean Second Life installation state. Ideally, uninstall and reinstall the viewer or clear/rename all folders in `AppData\Local\Second Life` and `AppData\Roaming\Second Life` before launching. 2. Launch the Second Life Viewer and log in. 3. Enable the Debug Menu: Open Preferences (Ctrl+P), go to the "Advanced" tab, and check "Show Advanced Settings". 4. Open Debug Settings: Click the "Advanced" menu in the menu bar and select "Debug Settings." 5. Locate the `RenderShadowResolutionScale` setting (which should be set to 1.0 on a clean install). 6. Initially, changing `RenderShadowResolutionScale` at this point may not exhibit the bug. Proceed to the next steps to reliably trigger it. 7. **Trigger the Bug:** Open Preferences (Ctrl+P) again and go to the "Graphics" tab. 8. Click the "Advanced Settings" button. 9. **Toggle *any* of the following Advanced Graphics options:** - Screen Space Ambient Occlusion - HDR and Emissive Rendering - Depth of Field - Screen Space Reflections - Antialiasing - *Alternatively*, change the "Graphics Quality" preset slider (e.g., Low to Ultra or any other change). 10. Return to the Debug Settings floater. 11. Change the value of `RenderShadowResolutionScale` to a different value (e.g., from 1.0 to 0.5 or 2.0). 12. **Observe the Bug:** Notice that shadow rendering does not update correctly—shadows become corrupted or disappear. 13. **Workaround (in buggy version):** To restore correct shadow rendering without the fix, either: - Toggle a different shader (e.g., change graphics presets in Preferences, or toggle SSAO, SSR, etc.), or - Restart the viewer. **Steps to Verify (Fix):** 1. Build the viewer with this commit applied. 2. Launch the viewer and log in. 3. Repeat steps 1–9 from "Steps to Reproduce (Bug)" to ensure an Advanced Graphics setting is toggled before proceeding. 4. Open Debug Settings and locate `RenderShadowResolutionScale`. 5. Change the value of `RenderShadowResolutionScale` (e.g., from 1.0 to 0.5 or 2.0). 6. **Verify the Fix:** Confirm that shadow rendering updates immediately and correctly—even after toggling Advanced Graphics settings—with the shadows visibly changing resolution in real time. No shader toggling or viewer restart is required. --- - No specific regression testing is required for this targeted fix. However, standard viewer functionality should be verified after building to ensure no unintended side effects have been introduced. Pay particular attention to shadow rendering in various environments and lighting conditions to confirm the fix has not negatively impacted other shadow-related features. --- - No documentation changes are needed as this is a bug fix for an existing debug setting. --- indra/newview/llviewercontrol.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 598ad89907..1f5ac61040 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -809,7 +809,9 @@ void settings_setup_listeners() setting_setup_signal_listener(gSavedSettings, "RenderSpecularResY", handleLUTBufferChanged); setting_setup_signal_listener(gSavedSettings, "RenderSpecularExponent", handleLUTBufferChanged); setting_setup_signal_listener(gSavedSettings, "RenderAnisotropic", handleAnisotropicChanged); - setting_setup_signal_listener(gSavedSettings, "RenderShadowResolutionScale", handleShadowsResized); + // Ensure shader update on shadow resolution scale change for correct shadow rendering. + // setting_setup_signal_listener(gSavedSettings, "RenderShadowResolutionScale", handleShadowsResized); // Original line commented out + setting_setup_signal_listener(gSavedSettings, "RenderShadowResolutionScale", handleSetShaderChanged); setting_setup_signal_listener(gSavedSettings, "RenderGlow", handleReleaseGLBufferChanged); setting_setup_signal_listener(gSavedSettings, "RenderGlow", handleSetShaderChanged); setting_setup_signal_listener(gSavedSettings, "RenderGlowResolutionPow", handleReleaseGLBufferChanged); -- cgit v1.2.3 From 76db64e0c8c7dd40ce2a85ef19183c3c245f1dc8 Mon Sep 17 00:00:00 2001 From: William Weaver Date: Wed, 12 Mar 2025 19:52:56 +0300 Subject: Fixes: Add guard to prevent shadow texture resize with invalid mRT dimensions after shader changes; **Replaces forced shader refresh with lightweight guard** MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit introduces a guard in `LLPipeline::resizeShadowTexture()` to prevent shadow texture resizing when the shadow render target (mRT) has invalid (zero) dimensions. **This replaces a previous, less efficient approach of forcing a full shader recompile whenever `RenderShadowResolutionScale` was changed in-session.** **Background and Problem:** Previously, the code forced a full shader recompile whenever `RenderShadowResolutionScale` changed in-session (after toggling advanced graphics settings like SSAO or HDR). While this “sledgehammer” approach did fix broken shadow rendering, it unnecessarily thrashed the shader cache and reset many pipeline states. **Solution:** This commit removes the forced shader recompile in favor of a guard check in `LLPipeline::resizeShadowTexture()`. The guard ensures mRT (the shadow render target) has non-zero dimensions before resizing. If mRT is zero for that frame, the resize operation is skipped, and a warning is logged. Once mRT becomes valid (usually in the next frame), the shadow texture is resized successfully without requiring a full shader refresh. **Detailed changes:** - Reverted the binding of `RenderShadowResolutionScale` to `handleSetShaderChanged`. - Restored the original `handleShadowsResized` listener for `RenderShadowResolutionScale` in `llviewercontrol.cpp`. - Added guard checks in `LLPipeline::resizeShadowTexture()` to skip resizing when `mRT->width` or `mRT->height` is zero. - Added logging statements to track how many frames are skipped. **Benefits:** - Prevents shader thrashing while still avoiding shadow corruption. - Shadows now update correctly as soon as mRT dimensions are valid. - Maintains a detailed record of frames skipped. - **Lightweight and targeted interim solution, much less disruptive than a full shader recompile.** Testing: 1. Reproduce the bug as described in the bug report (toggle SSAO, then change RenderShadowResolutionScale). 2. Verify that shadows are no longer broken after these steps. 3. Check the logs for the warning message indicating skipped frames when the bug is triggered. 4. Confirm that under normal operation (without shader changes causing mRT issues), shadow resizing works as expected without excessive warnings. Documentation: No user-facing documentation changes are needed for this interim fix. However, internal developer documentation should note this guard and the ongoing investigation into the root cause. Further Development: This guard is a temporary fix. The root cause of why mRT becomes invalid after shader changes needs to be investigated and resolved. See the bug report for detailed next steps for investigation. --- indra/newview/llviewercontrol.cpp | 4 +--- indra/newview/pipeline.cpp | 25 ++++++++++++++++++++++++- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 1f5ac61040..598ad89907 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -809,9 +809,7 @@ void settings_setup_listeners() setting_setup_signal_listener(gSavedSettings, "RenderSpecularResY", handleLUTBufferChanged); setting_setup_signal_listener(gSavedSettings, "RenderSpecularExponent", handleLUTBufferChanged); setting_setup_signal_listener(gSavedSettings, "RenderAnisotropic", handleAnisotropicChanged); - // Ensure shader update on shadow resolution scale change for correct shadow rendering. - // setting_setup_signal_listener(gSavedSettings, "RenderShadowResolutionScale", handleShadowsResized); // Original line commented out - setting_setup_signal_listener(gSavedSettings, "RenderShadowResolutionScale", handleSetShaderChanged); + setting_setup_signal_listener(gSavedSettings, "RenderShadowResolutionScale", handleShadowsResized); setting_setup_signal_listener(gSavedSettings, "RenderGlow", handleReleaseGLBufferChanged); setting_setup_signal_listener(gSavedSettings, "RenderGlow", handleSetShaderChanged); setting_setup_signal_listener(gSavedSettings, "RenderGlowResolutionPow", handleReleaseGLBufferChanged); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 18dd694246..691d155a3c 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -121,7 +121,7 @@ #include "SMAAAreaTex.h" #include "SMAASearchTex.h" - +#include "llerror.h" #ifndef LL_WINDOWS #define A_GCC 1 #pragma GCC diagnostic ignored "-Wunused-function" @@ -727,6 +727,29 @@ void LLPipeline::requestResizeShadowTexture() void LLPipeline::resizeShadowTexture() { + // A static counter to keep track of skipped frames + static int sSkippedFrameCount = 0; + + if (!mRT || mRT->width == 0 || mRT->height == 0) + { + sSkippedFrameCount++; + LL_WARNS("Render") << "Shadow texture resizing aborted: render target dimensions invalid. Skipped " + << sSkippedFrameCount << " frame(s) so far." << LL_ENDL; + return; + } + + // If there were skipped frames before mRT became valid, log that information. + if (sSkippedFrameCount > 0) + { + LL_INFOS("Render") << "Render target now valid after " + << sSkippedFrameCount << " skipped frame(s)." << LL_ENDL; + sSkippedFrameCount = 0; + } + + LL_WARNS() << "LLPipeline::resizeShadowTexture() called." << LL_ENDL; + LL_INFOS() << "Resizing shadow texture. mRT->width = " + << mRT->width << " mRT->height = " << mRT->height << LL_ENDL; + releaseSunShadowTargets(); releaseSpotShadowTargets(); allocateShadowBuffer(mRT->width, mRT->height); -- cgit v1.2.3 From 1a92e392ead323d2ae5555fb68ce8a333baee5ea Mon Sep 17 00:00:00 2001 From: AndrewMeadows Date: Mon, 17 Mar 2025 13:01:47 -0700 Subject: message_template.msg to agree with master-message-template --- scripts/messages/message_template.msg | 12622 ++++++++++++++------------- scripts/messages/message_template.msg.sha1 | 2 +- 2 files changed, 6386 insertions(+), 6238 deletions(-) diff --git a/scripts/messages/message_template.msg b/scripts/messages/message_template.msg index 70c2bdf53a..40ba2cc6b6 100755 --- a/scripts/messages/message_template.msg +++ b/scripts/messages/message_template.msg @@ -4,9 +4,9 @@ version 2.0 // The Version 2.0 template requires preservation of message // numbers. Each message must be numbered relative to the -// other messages of that type. The current highest number +// other messages of that type. The current highest number // for each type is listed below: -// Low: 430 +// Low: 431 // Medium: 18 // High: 30 // PLEASE UPDATE THIS WHEN YOU ADD A NEW MESSAGE! @@ -19,17 +19,17 @@ version 2.0 // Test Message { - TestMessage Low 1 NotTrusted Zerocoded - { - TestBlock1 Single - { Test1 U32 } - } - { - NeighborBlock Multiple 4 - { Test0 U32 } - { Test1 U32 } - { Test2 U32 } - } + TestMessage Low 1 NotTrusted Zerocoded + { + TestBlock1 Single + { Test1 U32 } + } + { + NeighborBlock Multiple 4 + { Test0 U32 } + { Test1 U32 } + { Test2 U32 } + } } // ************************************************************************* @@ -43,28 +43,28 @@ version 2.0 // Packet Ack - Ack a list of packets sent reliable { - PacketAck Fixed 0xFFFFFFFB NotTrusted Unencoded - { - Packets Variable - { ID U32 } - } + PacketAck Fixed 0xFFFFFFFB NotTrusted Unencoded + { + Packets Variable + { ID U32 } + } } // OpenCircuit - Tells the recipient's messaging system to open the descibed circuit { - OpenCircuit Fixed 0xFFFFFFFC NotTrusted Unencoded UDPBlackListed - { - CircuitInfo Single - { IP IPADDR } - { Port IPPORT } - } + OpenCircuit Fixed 0xFFFFFFFC NotTrusted Unencoded UDPBlackListed + { + CircuitInfo Single + { IP IPADDR } + { Port IPPORT } + } } // CloseCircuit - Tells the recipient's messaging system to close the descibed circuit { - CloseCircuit Fixed 0xFFFFFFFD NotTrusted Unencoded + CloseCircuit Fixed 0xFFFFFFFD NotTrusted Unencoded } @@ -76,22 +76,22 @@ version 2.0 // PingID is used to determine how backlogged the ping was that was // returned (or how hosed the other side is) { - StartPingCheck High 1 NotTrusted Unencoded - { - PingID Single - { PingID U8 } - { OldestUnacked U32 } // Current oldest "unacked" packet on the sender side - } + StartPingCheck High 1 NotTrusted Unencoded + { + PingID Single + { PingID U8 } + { OldestUnacked U32 } // Current oldest "unacked" packet on the sender side + } } // CompletePingCheck - used to measure circuit ping times { - CompletePingCheck High 2 NotTrusted Unencoded - { - PingID Single - { PingID U8 } - } + CompletePingCheck High 2 NotTrusted Unencoded + { + PingID Single + { PingID U8 } + } } // space->sim @@ -99,13 +99,13 @@ version 2.0 // AddCircuitCode - Tells the recipient's messaging system that this code // is for a legal circuit { - AddCircuitCode Low 2 Trusted Unencoded - { - CircuitCode Single - { Code U32 } - { SessionID LLUUID } - { AgentID LLUUID } // WARNING - may be null in valid message - } + AddCircuitCode Low 2 Trusted Unencoded + { + CircuitCode Single + { Code U32 } + { SessionID LLUUID } + { AgentID LLUUID } // WARNING - may be null in valid message + } } // viewer->sim @@ -115,13 +115,13 @@ version 2.0 // id of the process, which every server will generate on startup and // the viewer will be handed after login. { - UseCircuitCode Low 3 NotTrusted Unencoded - { - CircuitCode Single - { Code U32 } - { SessionID LLUUID } - { ID LLUUID } // agent id - } + UseCircuitCode Low 3 NotTrusted Unencoded + { + CircuitCode Single + { Code U32 } + { SessionID LLUUID } + { ID LLUUID } // agent id + } } @@ -131,17 +131,17 @@ version 2.0 // Neighbor List - Passed anytime neighbors change { - NeighborList High 3 Trusted Unencoded - { - NeighborBlock Multiple 4 - { IP IPADDR } - { Port IPPORT } - { PublicIP IPADDR } - { PublicPort IPPORT } - { RegionID LLUUID } - { Name Variable 1 } // string - { SimAccess U8 } - } + NeighborList High 3 Trusted Unencoded + { + NeighborBlock Multiple 4 + { IP IPADDR } + { Port IPPORT } + { PublicIP IPADDR } + { PublicPort IPPORT } + { RegionID LLUUID } + { Name Variable 1 } // string + { SimAccess U8 } + } } @@ -149,22 +149,22 @@ version 2.0 // simulator -> dataserver // reliable { - AvatarTextureUpdate Low 4 Trusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { TexturesChanged BOOL } - } - { - WearableData Variable - { CacheID LLUUID } - { TextureIndex U8 } - { HostName Variable 1 } - } - { - TextureData Variable - { TextureID LLUUID } - } + AvatarTextureUpdate Low 4 Trusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { TexturesChanged BOOL } + } + { + WearableData Variable + { CacheID LLUUID } + { TextureIndex U8 } + { HostName Variable 1 } + } + { + TextureData Variable + { TextureID LLUUID } + } } @@ -172,11 +172,11 @@ version 2.0 // simulator -> dataserver // reliable { - SimulatorMapUpdate Low 5 Trusted Unencoded - { - MapData Single - { Flags U32 } - } + SimulatorMapUpdate Low 5 Trusted Unencoded + { + MapData Single + { Flags U32 } + } } // SimulatorSetMap @@ -184,27 +184,27 @@ version 2.0 // reliable // Used to upload a map image into the database (currently used only for Land For Sale) { - SimulatorSetMap Low 6 Trusted Unencoded - { - MapData Single - { RegionHandle U64 } - { Type S32 } - { MapImage LLUUID } - } + SimulatorSetMap Low 6 Trusted Unencoded + { + MapData Single + { RegionHandle U64 } + { Type S32 } + { MapImage LLUUID } + } } // SubscribeLoad // spaceserver -> simulator // reliable { - SubscribeLoad Low 7 Trusted Unencoded + SubscribeLoad Low 7 Trusted Unencoded } // UnsubscribeLoad // spaceserver -> simulator // reliable { - UnsubscribeLoad Low 8 Trusted Unencoded + UnsubscribeLoad Low 8 Trusted Unencoded } @@ -215,95 +215,95 @@ version 2.0 // SimulatorReady - indicates the sim has finished loading its state // and is ready to receive updates from others { - SimulatorReady Low 9 Trusted Zerocoded - { - SimulatorBlock Single - { SimName Variable 1 } - { SimAccess U8 } - { RegionFlags U32 } - { RegionID LLUUID } - { EstateID U32 } - { ParentEstateID U32 } - } - { - TelehubBlock Single - { HasTelehub BOOL } - { TelehubPos LLVector3 } - } + SimulatorReady Low 9 Trusted Zerocoded + { + SimulatorBlock Single + { SimName Variable 1 } + { SimAccess U8 } + { RegionFlags U32 } + { RegionID LLUUID } + { EstateID U32 } + { ParentEstateID U32 } + } + { + TelehubBlock Single + { HasTelehub BOOL } + { TelehubPos LLVector3 } + } } // TelehubInfo - fill in the UI for telehub creation floater. // sim -> viewer // reliable { - TelehubInfo Low 10 Trusted Unencoded - { - TelehubBlock Single - { ObjectID LLUUID } // null if no telehub - { ObjectName Variable 1 } // string - { TelehubPos LLVector3 } // fallback if viewer can't find object - { TelehubRot LLQuaternion } - } - { - SpawnPointBlock Variable - { SpawnPointPos LLVector3 } // relative to telehub position - } + TelehubInfo Low 10 Trusted Unencoded + { + TelehubBlock Single + { ObjectID LLUUID } // null if no telehub + { ObjectName Variable 1 } // string + { TelehubPos LLVector3 } // fallback if viewer can't find object + { TelehubRot LLQuaternion } + } + { + SpawnPointBlock Variable + { SpawnPointPos LLVector3 } // relative to telehub position + } } // SimulatorPresentAtLocation - indicates that the sim is present at a grid // location and passes what it believes its neighbors are { - SimulatorPresentAtLocation Low 11 Trusted Unencoded - { - SimulatorPublicHostBlock Single - { Port IPPORT } - { SimulatorIP IPADDR } - { GridX U32 } - { GridY U32 } - } - { - NeighborBlock Multiple 4 - { IP IPADDR } - { Port IPPORT } - } - { - SimulatorBlock Single - { SimName Variable 1 } - { SimAccess U8 } - { RegionFlags U32 } - { RegionID LLUUID } - { EstateID U32 } - { ParentEstateID U32 } - } - { - TelehubBlock Variable - { HasTelehub BOOL } - { TelehubPos LLVector3 } - } + SimulatorPresentAtLocation Low 11 Trusted Unencoded + { + SimulatorPublicHostBlock Single + { Port IPPORT } + { SimulatorIP IPADDR } + { GridX U32 } + { GridY U32 } + } + { + NeighborBlock Multiple 4 + { IP IPADDR } + { Port IPPORT } + } + { + SimulatorBlock Single + { SimName Variable 1 } + { SimAccess U8 } + { RegionFlags U32 } + { RegionID LLUUID } + { EstateID U32 } + { ParentEstateID U32 } + } + { + TelehubBlock Variable + { HasTelehub BOOL } + { TelehubPos LLVector3 } + } } // SimulatorLoad // simulator -> spaceserver // reliable { - SimulatorLoad Low 12 Trusted Unencoded - { - SimulatorLoad Single - { TimeDilation F32 } - { AgentCount S32 } - { CanAcceptAgents BOOL } - } - { - AgentList Variable - { CircuitCode U32 } - { X U8 } - { Y U8 } - } + SimulatorLoad Low 12 Trusted Unencoded + { + SimulatorLoad Single + { TimeDilation F32 } + { AgentCount S32 } + { CanAcceptAgents BOOL } + } + { + AgentList Variable + { CircuitCode U32 } + { X U8 } + { Y U8 } + } } // Simulator Shutdown Request - Tells spaceserver that a simulator is trying to shutdown { - SimulatorShutdownRequest Low 13 Trusted Unencoded + SimulatorShutdownRequest Low 13 Trusted Unencoded } // **************************************************************************** @@ -312,37 +312,37 @@ version 2.0 // sim -> dataserver { - RegionPresenceRequestByRegionID Low 14 Trusted Unencoded - { - RegionData Variable - { RegionID LLUUID } - } + RegionPresenceRequestByRegionID Low 14 Trusted Unencoded + { + RegionData Variable + { RegionID LLUUID } + } } // sim -> dataserver { - RegionPresenceRequestByHandle Low 15 Trusted Unencoded - { - RegionData Variable - { RegionHandle U64 } - } + RegionPresenceRequestByHandle Low 15 Trusted Unencoded + { + RegionData Variable + { RegionHandle U64 } + } } // dataserver -> sim { - RegionPresenceResponse Low 16 Trusted Zerocoded - { - RegionData Variable - { RegionID LLUUID } - { RegionHandle U64 } - { InternalRegionIP IPADDR } - { ExternalRegionIP IPADDR } - { RegionPort IPPORT } - { ValidUntil F64 } - { Message Variable 1 } - } + RegionPresenceResponse Low 16 Trusted Zerocoded + { + RegionData Variable + { RegionID LLUUID } + { RegionHandle U64 } + { InternalRegionIP IPADDR } + { ExternalRegionIP IPADDR } + { RegionPort IPPORT } + { ValidUntil F64 } + { Message Variable 1 } + } } - + // **************************************************************************** // Simulator to dataserver messages @@ -350,42 +350,42 @@ version 2.0 // Updates SimName, EstateID and SimAccess using RegionID as a key { - UpdateSimulator Low 17 Trusted Unencoded - { - SimulatorInfo Single - { RegionID LLUUID } - { SimName Variable 1 } - { EstateID U32 } - { SimAccess U8 } - } + UpdateSimulator Low 17 Trusted Unencoded + { + SimulatorInfo Single + { RegionID LLUUID } + { SimName Variable 1 } + { EstateID U32 } + { SimAccess U8 } + } } // record dwell time. { - LogDwellTime Low 18 Trusted Unencoded - { - DwellInfo Single - { AgentID LLUUID } - { SessionID LLUUID } - { Duration F32 } - { SimName Variable 1 } - { RegionX U32 } - { RegionY U32 } - { AvgAgentsInView U8 } - { AvgViewerFPS U8 } - } + LogDwellTime Low 18 Trusted Unencoded + { + DwellInfo Single + { AgentID LLUUID } + { SessionID LLUUID } + { Duration F32 } + { SimName Variable 1 } + { RegionX U32 } + { RegionY U32 } + { AvgAgentsInView U8 } + { AvgViewerFPS U8 } + } } // Disabled feature response message { - FeatureDisabled Low 19 Trusted Unencoded - { - FailureInfo Single - { ErrorMessage Variable 1 } - { AgentID LLUUID } - { TransactionID LLUUID } - } + FeatureDisabled Low 19 Trusted Unencoded + { + FailureInfo Single + { ErrorMessage Variable 1 } + { AgentID LLUUID } + { TransactionID LLUUID } + } } @@ -393,47 +393,47 @@ version 2.0 // from either the simulator or the dataserver, depending on how // the transaction failed. { - LogFailedMoneyTransaction Low 20 Trusted Unencoded - { - TransactionData Single - { TransactionID LLUUID } - { TransactionTime U32 } // utc seconds since epoch - { TransactionType S32 } // see lltransactiontypes.h - { SourceID LLUUID } - { DestID LLUUID } // destination of the transfer - { Flags U8 } - { Amount S32 } - { SimulatorIP IPADDR } // U32 encoded IP - { GridX U32 } - { GridY U32 } - { FailureType U8 } - } + LogFailedMoneyTransaction Low 20 Trusted Unencoded + { + TransactionData Single + { TransactionID LLUUID } + { TransactionTime U32 } // utc seconds since epoch + { TransactionType S32 } // see lltransactiontypes.h + { SourceID LLUUID } + { DestID LLUUID } // destination of the transfer + { Flags U8 } + { Amount S32 } + { SimulatorIP IPADDR } // U32 encoded IP + { GridX U32 } + { GridY U32 } + { FailureType U8 } + } } // complaint/bug-report - sim -> dataserver. see UserReport for details. // reliable { - UserReportInternal Low 21 Trusted Zerocoded - { - ReportData Single - { ReportType U8 } - { Category U8 } - { ReporterID LLUUID } - { ViewerPosition LLVector3 } - { AgentPosition LLVector3 } - { ScreenshotID LLUUID } - { ObjectID LLUUID } - { OwnerID LLUUID } - { LastOwnerID LLUUID } - { CreatorID LLUUID } - { RegionID LLUUID } - { AbuserID LLUUID } - { AbuseRegionName Variable 1 } - { AbuseRegionID LLUUID } - { Summary Variable 1 } - { Details Variable 2 } - { VersionString Variable 1 } - } + UserReportInternal Low 21 Trusted Zerocoded + { + ReportData Single + { ReportType U8 } + { Category U8 } + { ReporterID LLUUID } + { ViewerPosition LLVector3 } + { AgentPosition LLVector3 } + { ScreenshotID LLUUID } + { ObjectID LLUUID } + { OwnerID LLUUID } + { LastOwnerID LLUUID } + { CreatorID LLUUID } + { RegionID LLUUID } + { AbuserID LLUUID } + { AbuseRegionName Variable 1 } + { AbuseRegionID LLUUID } + { Summary Variable 1 } + { Details Variable 2 } + { VersionString Variable 1 } + } } // SetSimStatusInDatabase @@ -441,18 +441,18 @@ version 2.0 // sim -> dataserver // reliable { - SetSimStatusInDatabase Low 22 Trusted Unencoded - { - Data Single - { RegionID LLUUID } - { HostName Variable 1 } - { X S32 } - { Y S32 } - { PID S32 } - { AgentCount S32 } - { TimeToLive S32 } // in seconds - { Status Variable 1 } - } + SetSimStatusInDatabase Low 22 Trusted Unencoded + { + Data Single + { RegionID LLUUID } + { HostName Variable 1 } + { X S32 } + { Y S32 } + { PID S32 } + { AgentCount S32 } + { TimeToLive S32 } // in seconds + { Status Variable 1 } + } } // SetSimPresenceInDatabase @@ -460,18 +460,18 @@ version 2.0 // that a given simulator is present and valid for a set amount of // time { - SetSimPresenceInDatabase Low 23 Trusted Unencoded - { - SimData Single - { RegionID LLUUID } - { HostName Variable 1 } - { GridX U32 } - { GridY U32 } - { PID S32 } - { AgentCount S32 } - { TimeToLive S32 } // in seconds - { Status Variable 1 } - } + SetSimPresenceInDatabase Low 23 Trusted Unencoded UDPDeprecated + { + SimData Single + { RegionID LLUUID } + { HostName Variable 1 } + { GridX U32 } + { GridY U32 } + { PID S32 } + { AgentCount S32 } + { TimeToLive S32 } // in seconds + { Status Variable 1 } + } } // *************************************************************************** @@ -480,32 +480,32 @@ version 2.0 // once we use local stats, this will include a region handle { - EconomyDataRequest Low 24 NotTrusted Unencoded + EconomyDataRequest Low 24 NotTrusted Unencoded } // dataserver to sim, response w/ econ data { - EconomyData Low 25 Trusted Zerocoded - { - Info Single - { ObjectCapacity S32 } - { ObjectCount S32 } - { PriceEnergyUnit S32 } - { PriceObjectClaim S32 } - { PricePublicObjectDecay S32 } - { PricePublicObjectDelete S32 } - { PriceParcelClaim S32 } - { PriceParcelClaimFactor F32 } - { PriceUpload S32 } - { PriceRentLight S32 } - { TeleportMinPrice S32 } - { TeleportPriceExponent F32 } - { EnergyEfficiency F32 } - { PriceObjectRent F32 } - { PriceObjectScaleFactor F32 } - { PriceParcelRent S32 } - { PriceGroupCreate S32 } - } + EconomyData Low 25 Trusted Zerocoded + { + Info Single + { ObjectCapacity S32 } + { ObjectCount S32 } + { PriceEnergyUnit S32 } + { PriceObjectClaim S32 } + { PricePublicObjectDecay S32 } + { PricePublicObjectDelete S32 } + { PriceParcelClaim S32 } + { PriceParcelClaimFactor F32 } + { PriceUpload S32 } + { PriceRentLight S32 } + { TeleportMinPrice S32 } + { TeleportPriceExponent F32 } + { EnergyEfficiency F32 } + { PriceObjectRent F32 } + { PriceObjectScaleFactor F32 } + { PriceParcelRent S32 } + { PriceGroupCreate S32 } + } } // *************************************************************************** @@ -517,75 +517,75 @@ version 2.0 // viewer -> sim -> data // reliable { - AvatarPickerRequest Low 26 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { QueryID LLUUID } - } - { - Data Single - { Name Variable 1 } - } + AvatarPickerRequest Low 26 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { QueryID LLUUID } + } + { + Data Single + { Name Variable 1 } + } } // backend implementation which tracks if the user is a god. { - AvatarPickerRequestBackend Low 27 Trusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { QueryID LLUUID } - { GodLevel U8 } - } - { - Data Single - { Name Variable 1 } - } + AvatarPickerRequestBackend Low 27 Trusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { QueryID LLUUID } + { GodLevel U8 } + } + { + Data Single + { Name Variable 1 } + } } // AvatarPickerReply // List of names to select a person // reliable { - AvatarPickerReply Low 28 Trusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { QueryID LLUUID } - } - { - Data Variable - { AvatarID LLUUID } - { FirstName Variable 1 } - { LastName Variable 1 } - } + AvatarPickerReply Low 28 Trusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { QueryID LLUUID } + } + { + Data Variable + { AvatarID LLUUID } + { FirstName Variable 1 } + { LastName Variable 1 } + } } // PlacesQuery // Used for getting a list of places for the group land panel // and the user land holdings panel. NOT for the directory. { - PlacesQuery Low 29 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { QueryID LLUUID } - } - { - TransactionData Single - { TransactionID LLUUID } - } - { - QueryData Single - { QueryText Variable 1 } - { QueryFlags U32 } - { Category S8 } - { SimName Variable 1 } - } + PlacesQuery Low 29 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { QueryID LLUUID } + } + { + TransactionData Single + { TransactionID LLUUID } + } + { + QueryData Single + { QueryText Variable 1 } + { QueryFlags U32 } + { Category S8 } + { SimName Variable 1 } + } } // PlacesReply @@ -594,112 +594,112 @@ version 2.0 // global x,y,z. Otherwise, use center of the AABB. // reliable { - PlacesReply Low 30 Trusted Zerocoded UDPDeprecated - { - AgentData Single - { AgentID LLUUID } - { QueryID LLUUID } - } - { - TransactionData Single - { TransactionID LLUUID } - } - { - QueryData Variable - { OwnerID LLUUID } - { Name Variable 1 } - { Desc Variable 1 } - { ActualArea S32 } - { BillableArea S32 } - { Flags U8 } - { GlobalX F32 } // meters - { GlobalY F32 } // meters - { GlobalZ F32 } // meters - { SimName Variable 1 } - { SnapshotID LLUUID } - { Dwell F32 } - { Price S32 } - //{ ProductSKU Variable 1 } - } + PlacesReply Low 30 Trusted Zerocoded UDPDeprecated + { + AgentData Single + { AgentID LLUUID } + { QueryID LLUUID } + } + { + TransactionData Single + { TransactionID LLUUID } + } + { + QueryData Variable + { OwnerID LLUUID } + { Name Variable 1 } + { Desc Variable 1 } + { ActualArea S32 } + { BillableArea S32 } + { Flags U8 } + { GlobalX F32 } // meters + { GlobalY F32 } // meters + { GlobalZ F32 } // meters + { SimName Variable 1 } + { SnapshotID LLUUID } + { Dwell F32 } + { Price S32 } + //{ ProductSKU Variable 1 } + } } // DirFindQuery viewer->sim -// Message to start asking questions for the directory -{ - DirFindQuery Low 31 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - QueryData Single - { QueryID LLUUID } - { QueryText Variable 1 } - { QueryFlags U32 } - { QueryStart S32 } // prev/next page support - } +// Message to start asking questions for the directory +{ + DirFindQuery Low 31 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + QueryData Single + { QueryID LLUUID } + { QueryText Variable 1 } + { QueryFlags U32 } + { QueryStart S32 } // prev/next page support + } } // DirFindQueryBackend sim->data // Trusted message generated by receipt of DirFindQuery to sim. { - DirFindQueryBackend Low 32 Trusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - } - { - QueryData Single - { QueryID LLUUID } - { QueryText Variable 1 } - { QueryFlags U32 } - { QueryStart S32 } // prev/next page support - { EstateID U32 } - { Godlike BOOL } - } + DirFindQueryBackend Low 32 Trusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + } + { + QueryData Single + { QueryID LLUUID } + { QueryText Variable 1 } + { QueryFlags U32 } + { QueryStart S32 } // prev/next page support + { EstateID U32 } + { Godlike BOOL } + } } // DirPlacesQuery viewer->sim // Used for the Find directory of places { - DirPlacesQuery Low 33 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - QueryData Single - { QueryID LLUUID } - { QueryText Variable 1 } - { QueryFlags U32 } - { Category S8 } - { SimName Variable 1 } - { QueryStart S32 } - } + DirPlacesQuery Low 33 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + QueryData Single + { QueryID LLUUID } + { QueryText Variable 1 } + { QueryFlags U32 } + { Category S8 } + { SimName Variable 1 } + { QueryStart S32 } + } } // DirPlacesQueryBackend sim->dataserver // Used for the Find directory of places. { - DirPlacesQueryBackend Low 34 Trusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - } - { - QueryData Single - { QueryID LLUUID } - { QueryText Variable 1 } - { QueryFlags U32 } - { Category S8 } - { SimName Variable 1 } - { EstateID U32 } - { Godlike BOOL } - { QueryStart S32 } - } + DirPlacesQueryBackend Low 34 Trusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + } + { + QueryData Single + { QueryID LLUUID } + { QueryText Variable 1 } + { QueryFlags U32 } + { Category S8 } + { SimName Variable 1 } + { EstateID U32 } + { Godlike BOOL } + { QueryStart S32 } + } } // DirPlacesReply dataserver->sim->viewer @@ -707,164 +707,164 @@ version 2.0 // global x,y,z. Otherwise, use center of the AABB. // reliable { - DirPlacesReply Low 35 Trusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - } - { - QueryData Variable - { QueryID LLUUID } - } - { - QueryReplies Variable - { ParcelID LLUUID } - { Name Variable 1 } - { ForSale BOOL } - { Auction BOOL } - { Dwell F32 } - } - { - StatusData Variable - { Status U32 } - } + DirPlacesReply Low 35 Trusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + } + { + QueryData Variable + { QueryID LLUUID } + } + { + QueryReplies Variable + { ParcelID LLUUID } + { Name Variable 1 } + { ForSale BOOL } + { Auction BOOL } + { Dwell F32 } + } + { + StatusData Variable + { Status U32 } + } } // DirPeopleReply { - DirPeopleReply Low 36 Trusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - } - { - QueryData Single - { QueryID LLUUID } - } - { - QueryReplies Variable - { AgentID LLUUID } - { FirstName Variable 1 } - { LastName Variable 1 } - { Group Variable 1 } - { Online BOOL } - { Reputation S32 } - } + DirPeopleReply Low 36 Trusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + } + { + QueryData Single + { QueryID LLUUID } + } + { + QueryReplies Variable + { AgentID LLUUID } + { FirstName Variable 1 } + { LastName Variable 1 } + { Group Variable 1 } + { Online BOOL } + { Reputation S32 } + } } // DirEventsReply { - DirEventsReply Low 37 Trusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - } - { - QueryData Single - { QueryID LLUUID } - } - { - QueryReplies Variable - { OwnerID LLUUID } - { Name Variable 1 } - { EventID U32 } - { Date Variable 1 } - { UnixTime U32 } - { EventFlags U32 } - } - { - StatusData Variable - { Status U32 } - } + DirEventsReply Low 37 Trusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + } + { + QueryData Single + { QueryID LLUUID } + } + { + QueryReplies Variable + { OwnerID LLUUID } + { Name Variable 1 } + { EventID U32 } + { Date Variable 1 } + { UnixTime U32 } + { EventFlags U32 } + } + { + StatusData Variable + { Status U32 } + } } // DirGroupsReply // dataserver -> userserver -> viewer // reliable { - DirGroupsReply Low 38 Trusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - } - { - QueryData Single - { QueryID LLUUID } - } - { - QueryReplies Variable - { GroupID LLUUID } - { GroupName Variable 1 } // string - { Members S32 } - { SearchOrder F32 } - } + DirGroupsReply Low 38 Trusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + } + { + QueryData Single + { QueryID LLUUID } + } + { + QueryReplies Variable + { GroupID LLUUID } + { GroupName Variable 1 } // string + { Members S32 } + { SearchOrder F32 } + } } // DirClassifiedQuery viewer->sim // reliable { - DirClassifiedQuery Low 39 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - QueryData Single - { QueryID LLUUID } - { QueryText Variable 1 } - { QueryFlags U32 } - { Category U32 } - { QueryStart S32 } - } + DirClassifiedQuery Low 39 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + QueryData Single + { QueryID LLUUID } + { QueryText Variable 1 } + { QueryFlags U32 } + { Category U32 } + { QueryStart S32 } + } } // DirClassifiedQueryBackend sim->dataserver // reliable { - DirClassifiedQueryBackend Low 40 Trusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - } - { - QueryData Single - { QueryID LLUUID } - { QueryText Variable 1 } - { QueryFlags U32 } - { Category U32 } - { EstateID U32 } - { Godlike BOOL } - { QueryStart S32 } - } + DirClassifiedQueryBackend Low 40 Trusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + } + { + QueryData Single + { QueryID LLUUID } + { QueryText Variable 1 } + { QueryFlags U32 } + { Category U32 } + { EstateID U32 } + { Godlike BOOL } + { QueryStart S32 } + } } // DirClassifiedReply dataserver->sim->viewer // reliable { - DirClassifiedReply Low 41 Trusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - } - { - QueryData Single - { QueryID LLUUID } - } - { - QueryReplies Variable - { ClassifiedID LLUUID } - { Name Variable 1 } - { ClassifiedFlags U8 } - { CreationDate U32 } - { ExpirationDate U32 } - { PriceForListing S32 } - } - { - StatusData Variable - { Status U32 } - } + DirClassifiedReply Low 41 Trusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + } + { + QueryData Single + { QueryID LLUUID } + } + { + QueryReplies Variable + { ClassifiedID LLUUID } + { Name Variable 1 } + { ClassifiedFlags U8 } + { CreationDate U32 } + { ExpirationDate U32 } + { PriceForListing S32 } + } + { + StatusData Variable + { Status U32 } + } } @@ -874,17 +874,17 @@ version 2.0 // This fills in the tabs of the Classifieds panel. // reliable { - AvatarClassifiedReply Low 42 Trusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { TargetID LLUUID } - } - { - Data Variable - { ClassifiedID LLUUID } - { Name Variable 1 } - } + AvatarClassifiedReply Low 42 Trusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { TargetID LLUUID } + } + { + Data Variable + { ClassifiedID LLUUID } + { Name Variable 1 } + } } @@ -893,16 +893,16 @@ version 2.0 // simulator -> dataserver // reliable { - ClassifiedInfoRequest Low 43 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Data Single - { ClassifiedID LLUUID } - } + ClassifiedInfoRequest Low 43 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Data Single + { ClassifiedID LLUUID } + } } @@ -911,28 +911,28 @@ version 2.0 // simulator -> viewer // reliable { - ClassifiedInfoReply Low 44 Trusted Unencoded + ClassifiedInfoReply Low 44 Trusted Unencoded { - AgentData Single - { AgentID LLUUID } + AgentData Single + { AgentID LLUUID } } { - Data Single - { ClassifiedID LLUUID } - { CreatorID LLUUID } - { CreationDate U32 } - { ExpirationDate U32 } - { Category U32 } - { Name Variable 1 } - { Desc Variable 2 } - { ParcelID LLUUID } - { ParentEstate U32 } - { SnapshotID LLUUID } - { SimName Variable 1 } - { PosGlobal LLVector3d } - { ParcelName Variable 1 } - { ClassifiedFlags U8 } - { PriceForListing S32 } + Data Single + { ClassifiedID LLUUID } + { CreatorID LLUUID } + { CreationDate U32 } + { ExpirationDate U32 } + { Category U32 } + { Name Variable 1 } + { Desc Variable 2 } + { ParcelID LLUUID } + { ParentEstate U32 } + { SnapshotID LLUUID } + { SimName Variable 1 } + { PosGlobal LLVector3d } + { ParcelName Variable 1 } + { ClassifiedFlags U8 } + { PriceForListing S32 } } } @@ -943,25 +943,25 @@ version 2.0 // viewer -> simulator -> dataserver // reliable { - ClassifiedInfoUpdate Low 45 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Data Single - { ClassifiedID LLUUID } - { Category U32 } - { Name Variable 1 } - { Desc Variable 2 } - { ParcelID LLUUID } - { ParentEstate U32 } - { SnapshotID LLUUID } - { PosGlobal LLVector3d } - { ClassifiedFlags U8 } - { PriceForListing S32 } - } + ClassifiedInfoUpdate Low 45 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Data Single + { ClassifiedID LLUUID } + { Category U32 } + { Name Variable 1 } + { Desc Variable 2 } + { ParcelID LLUUID } + { ParentEstate U32 } + { SnapshotID LLUUID } + { PosGlobal LLVector3d } + { ClassifiedFlags U8 } + { PriceForListing S32 } + } } @@ -970,36 +970,36 @@ version 2.0 // viewer -> simulator -> dataserver // reliable { - ClassifiedDelete Low 46 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Data Single - { ClassifiedID LLUUID } - } + ClassifiedDelete Low 46 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Data Single + { ClassifiedID LLUUID } + } } // ClassifiedGodDelete // Delete a classified from the database. -// QueryID is needed so database can send a repeat list of +// QueryID is needed so database can send a repeat list of // classified. // viewer -> simulator -> dataserver // reliable { - ClassifiedGodDelete Low 47 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Data Single - { ClassifiedID LLUUID } - { QueryID LLUUID } - } + ClassifiedGodDelete Low 47 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Data Single + { ClassifiedID LLUUID } + { QueryID LLUUID } + } } @@ -1007,168 +1007,168 @@ version 2.0 // Special query for the land for sale/auction panel. // reliable { - DirLandQuery Low 48 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - QueryData Single - { QueryID LLUUID } - { QueryFlags U32 } - { SearchType U32 } - { Price S32 } - { Area S32 } - { QueryStart S32 } - } + DirLandQuery Low 48 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + QueryData Single + { QueryID LLUUID } + { QueryFlags U32 } + { SearchType U32 } + { Price S32 } + { Area S32 } + { QueryStart S32 } + } } // DirLandQueryBackend sim->dataserver // Special query for the land for sale/auction panel. { - DirLandQueryBackend Low 49 Trusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - } - { - QueryData Single - { QueryID LLUUID } - { QueryFlags U32 } - { SearchType U32 } - { Price S32 } - { Area S32 } - { QueryStart S32 } - { EstateID U32 } - { Godlike BOOL } - } + DirLandQueryBackend Low 49 Trusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + } + { + QueryData Single + { QueryID LLUUID } + { QueryFlags U32 } + { SearchType U32 } + { Price S32 } + { Area S32 } + { QueryStart S32 } + { EstateID U32 } + { Godlike BOOL } + } } // DirLandReply // dataserver -> simulator -> viewer // reliable { - DirLandReply Low 50 Trusted Zerocoded UDPDeprecated - { - AgentData Single - { AgentID LLUUID } - } - { - QueryData Single - { QueryID LLUUID } - } - { - QueryReplies Variable - { ParcelID LLUUID } - { Name Variable 1 } - { Auction BOOL } - { ForSale BOOL } - { SalePrice S32 } - { ActualArea S32 } - //{ ProductSKU Variable 1 } - } + DirLandReply Low 50 Trusted Zerocoded UDPDeprecated + { + AgentData Single + { AgentID LLUUID } + } + { + QueryData Single + { QueryID LLUUID } + } + { + QueryReplies Variable + { ParcelID LLUUID } + { Name Variable 1 } + { Auction BOOL } + { ForSale BOOL } + { SalePrice S32 } + { ActualArea S32 } + //{ ProductSKU Variable 1 } + } } // DEPRECATED: DirPopularQuery viewer->sim // Special query for the land for sale/auction panel. // reliable { - DirPopularQuery Low 51 NotTrusted Zerocoded Deprecated - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - QueryData Single - { QueryID LLUUID } - { QueryFlags U32 } - } + DirPopularQuery Low 51 NotTrusted Zerocoded Deprecated + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + QueryData Single + { QueryID LLUUID } + { QueryFlags U32 } + } } // DEPRECATED: DirPopularQueryBackend sim->dataserver // Special query for the land for sale/auction panel. // reliable { - DirPopularQueryBackend Low 52 Trusted Zerocoded Deprecated - { - AgentData Single - { AgentID LLUUID } - } - { - QueryData Single - { QueryID LLUUID } - { QueryFlags U32 } - { EstateID U32 } - { Godlike BOOL } - } + DirPopularQueryBackend Low 52 Trusted Zerocoded Deprecated + { + AgentData Single + { AgentID LLUUID } + } + { + QueryData Single + { QueryID LLUUID } + { QueryFlags U32 } + { EstateID U32 } + { Godlike BOOL } + } } // DEPRECATED: DirPopularReply // dataserver -> simulator -> viewer // reliable { - DirPopularReply Low 53 Trusted Zerocoded Deprecated - { - AgentData Single - { AgentID LLUUID } - } - { - QueryData Single - { QueryID LLUUID } - } - { - QueryReplies Variable - { ParcelID LLUUID } - { Name Variable 1 } - { Dwell F32 } - } + DirPopularReply Low 53 Trusted Zerocoded Deprecated + { + AgentData Single + { AgentID LLUUID } + } + { + QueryData Single + { QueryID LLUUID } + } + { + QueryReplies Variable + { ParcelID LLUUID } + { Name Variable 1 } + { Dwell F32 } + } } // ParcelInfoRequest // viewer -> simulator -> dataserver // reliable { - ParcelInfoRequest Low 54 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Data Single - { ParcelID LLUUID } - } + ParcelInfoRequest Low 54 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Data Single + { ParcelID LLUUID } + } } // ParcelInfoReply // dataserver -> simulator -> viewer // reliable { - ParcelInfoReply Low 55 Trusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - } - { - Data Single - { ParcelID LLUUID } - { OwnerID LLUUID } - { Name Variable 1 } - { Desc Variable 1 } - { ActualArea S32 } - { BillableArea S32 } - { Flags U8 } - { GlobalX F32 } // meters - { GlobalY F32 } // meters - { GlobalZ F32 } // meters - { SimName Variable 1 } - { SnapshotID LLUUID } - { Dwell F32 } - { SalePrice S32 } - { AuctionID S32 } - } + ParcelInfoReply Low 55 Trusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + } + { + Data Single + { ParcelID LLUUID } + { OwnerID LLUUID } + { Name Variable 1 } + { Desc Variable 1 } + { ActualArea S32 } + { BillableArea S32 } + { Flags U8 } + { GlobalX F32 } // meters + { GlobalY F32 } // meters + { GlobalZ F32 } // meters + { SimName Variable 1 } + { SnapshotID LLUUID } + { Dwell F32 } + { SalePrice S32 } + { AuctionID S32 } + } } @@ -1176,16 +1176,16 @@ version 2.0 // viewer -> simulator // reliable { - ParcelObjectOwnersRequest Low 56 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ParcelData Single - { LocalID S32 } - } + ParcelObjectOwnersRequest Low 56 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ParcelData Single + { LocalID S32 } + } } @@ -1193,51 +1193,51 @@ version 2.0 // simulator -> viewer // reliable { - ParcelObjectOwnersReply Low 57 Trusted Zerocoded UDPDeprecated - { - Data Variable - { OwnerID LLUUID } - { IsGroupOwned BOOL } - { Count S32 } - { OnlineStatus BOOL } - } + ParcelObjectOwnersReply Low 57 Trusted Zerocoded UDPDeprecated + { + Data Variable + { OwnerID LLUUID } + { IsGroupOwned BOOL } + { Count S32 } + { OnlineStatus BOOL } + } } // GroupNoticeListRequest // viewer -> simulator -> dataserver // reliable { - GroupNoticesListRequest Low 58 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Data Single - { GroupID LLUUID } - } + GroupNoticesListRequest Low 58 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Data Single + { GroupID LLUUID } + } } // GroupNoticesListReply // dataserver -> simulator -> viewer // reliable { - GroupNoticesListReply Low 59 Trusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { GroupID LLUUID } - } - { - Data Variable - { NoticeID LLUUID } - { Timestamp U32 } - { FromName Variable 2 } - { Subject Variable 2 } - { HasAttachment BOOL } - { AssetType U8 } - } + GroupNoticesListReply Low 59 Trusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { GroupID LLUUID } + } + { + Data Variable + { NoticeID LLUUID } + { Timestamp U32 } + { FromName Variable 2 } + { Subject Variable 2 } + { HasAttachment BOOL } + { AssetType U8 } + } } // GroupNoticeRequest @@ -1245,48 +1245,48 @@ version 2.0 // simulator -> dataserver // reliable { - GroupNoticeRequest Low 60 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Data Single - { GroupNoticeID LLUUID } - } + GroupNoticeRequest Low 60 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Data Single + { GroupNoticeID LLUUID } + } } // GroupNoticeAdd -// Add a group notice. +// Add a group notice. // simulator -> dataserver // reliable { - GroupNoticeAdd Low 61 Trusted Unencoded - { - AgentData Single - { AgentID LLUUID } - } - { - MessageBlock Single - { ToGroupID LLUUID } - { ID LLUUID } - { Dialog U8 } - { FromAgentName Variable 1 } - { Message Variable 2 } - { BinaryBucket Variable 2 } - } + GroupNoticeAdd Low 61 Trusted Unencoded + { + AgentData Single + { AgentID LLUUID } + } + { + MessageBlock Single + { ToGroupID LLUUID } + { ID LLUUID } + { Dialog U8 } + { FromAgentName Variable 1 } + { Message Variable 2 } + { BinaryBucket Variable 2 } + } } // **************************************************************************** // Teleport messages // -// The teleport messages are numerous, so I have attempted to give them a +// The teleport messages are numerous, so I have attempted to give them a // consistent naming convention. Since there is a bit of glob pattern // aliasing, the rules are applied in order. // -// Teleport* - viewer->sim or sim->viewer message which announces a +// Teleport* - viewer->sim or sim->viewer message which announces a // teleportation request, progrees, start, or end. // Data* - sim->data or data->sim trusted message. // Space* - sim->space or space->sim trusted messaging @@ -1301,202 +1301,202 @@ version 2.0 // TeleportRequest // viewer -> sim specifying exact teleport destination { - TeleportRequest Low 62 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Info Single - { RegionID LLUUID } - { Position LLVector3 } - { LookAt LLVector3 } - } + TeleportRequest Low 62 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Info Single + { RegionID LLUUID } + { Position LLVector3 } + { LookAt LLVector3 } + } } // TeleportLocationRequest // viewer -> sim specifying exact teleport destination { - TeleportLocationRequest Low 63 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Info Single - { RegionHandle U64 } - { Position LLVector3 } - { LookAt LLVector3 } - } + TeleportLocationRequest Low 63 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Info Single + { RegionHandle U64 } + { Position LLVector3 } + { LookAt LLVector3 } + } } // TeleportLocal // sim -> viewer reply telling the viewer that we've successfully TP'd // to somewhere else within the sim { - TeleportLocal Low 64 Trusted Unencoded - { - Info Single - { AgentID LLUUID } - { LocationID U32 } - { Position LLVector3 } // region - { LookAt LLVector3 } - { TeleportFlags U32 } - } + TeleportLocal Low 64 Trusted Unencoded + { + Info Single + { AgentID LLUUID } + { LocationID U32 } + { Position LLVector3 } // region + { LookAt LLVector3 } + { TeleportFlags U32 } + } } // TeleportLandmarkRequest viewer->sim // teleport to landmark asset ID destination. use LLUUD::null for home. { - TeleportLandmarkRequest Low 65 NotTrusted Zerocoded - { - Info Single - { AgentID LLUUID } - { SessionID LLUUID } - { LandmarkID LLUUID } - } + TeleportLandmarkRequest Low 65 NotTrusted Zerocoded + { + Info Single + { AgentID LLUUID } + { SessionID LLUUID } + { LandmarkID LLUUID } + } } // TeleportProgress sim->viewer // Tell the agent how the teleport is going. { - TeleportProgress Low 66 Trusted Unencoded - { - AgentData Single - { AgentID LLUUID } - } - { - Info Single - { TeleportFlags U32 } - { Message Variable 1 } // string - } + TeleportProgress Low 66 Trusted Unencoded + { + AgentData Single + { AgentID LLUUID } + } + { + Info Single + { TeleportFlags U32 } + { Message Variable 1 } // string + } } // DataHomeLocationRequest sim->data -// Request +// Request { - DataHomeLocationRequest Low 67 Trusted Zerocoded - { - Info Single - { AgentID LLUUID } - { KickedFromEstateID U32 } - } - { - AgentInfo Single - { AgentEffectiveMaturity U32 } - } + DataHomeLocationRequest Low 67 Trusted Zerocoded + { + Info Single + { AgentID LLUUID } + { KickedFromEstateID U32 } + } + { + AgentInfo Single + { AgentEffectiveMaturity U32 } + } } // DataHomeLocationReply data->sim // response is the location of agent home. { - DataHomeLocationReply Low 68 Trusted Unencoded - { - Info Single - { AgentID LLUUID } - { RegionHandle U64 } - { Position LLVector3 } // region coords - { LookAt LLVector3 } - } + DataHomeLocationReply Low 68 Trusted Unencoded + { + Info Single + { AgentID LLUUID } + { RegionHandle U64 } + { Position LLVector3 } // region coords + { LookAt LLVector3 } + } } // TeleportFinish sim->viewer -// called when all of the information has been collected and readied for +// called when all of the information has been collected and readied for // the agent. { - TeleportFinish Low 69 Trusted Unencoded UDPBlackListed - { - Info Single - { AgentID LLUUID } - { LocationID U32 } - { SimIP IPADDR } - { SimPort IPPORT } - { RegionHandle U64 } - { SeedCapability Variable 2 } // URL - { SimAccess U8 } - { TeleportFlags U32 } - } + TeleportFinish Low 69 Trusted Unencoded UDPBlackListed + { + Info Single + { AgentID LLUUID } + { LocationID U32 } + { SimIP IPADDR } + { SimPort IPPORT } + { RegionHandle U64 } + { SeedCapability Variable 2 } // URL + { SimAccess U8 } + { TeleportFlags U32 } + } } // StartLure viewer->sim -// Sent from viewer to the local simulator to lure target id to near -// agent id. This will generate an instant message that will be routed -// through the space server and out to the userserver. When that IM -// goes through the userserver and the TargetID is online, the +// Sent from viewer to the local simulator to lure target id to near +// agent id. This will generate an instant message that will be routed +// through the space server and out to the userserver. When that IM +// goes through the userserver and the TargetID is online, the // userserver will send an InitializeLure to the spaceserver. When that -// packet is acked, the original instant message is finally forwarded to +// packet is acked, the original instant message is finally forwarded to // TargetID. { - StartLure Low 70 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Info Single - { LureType U8 } - { Message Variable 1 } - } - { - TargetData Variable - { TargetID LLUUID } - } + StartLure Low 70 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Info Single + { LureType U8 } + { Message Variable 1 } + } + { + TargetData Variable + { TargetID LLUUID } + } } // TeleportLureRequest viewer->sim -// Message from target of lure to begin the teleport process on the +// Message from target of lure to begin the teleport process on the // local simulator. { - TeleportLureRequest Low 71 NotTrusted Unencoded - { - Info Single - { AgentID LLUUID } - { SessionID LLUUID } - { LureID LLUUID } - { TeleportFlags U32 } - } + TeleportLureRequest Low 71 NotTrusted Unencoded + { + Info Single + { AgentID LLUUID } + { SessionID LLUUID } + { LureID LLUUID } + { TeleportFlags U32 } + } } // TeleportCancel viewer->sim // reliable { - TeleportCancel Low 72 NotTrusted Unencoded - { - Info Single - { AgentID LLUUID } - { SessionID LLUUID } - } + TeleportCancel Low 72 NotTrusted Unencoded + { + Info Single + { AgentID LLUUID } + { SessionID LLUUID } + } } // TeleportStart sim->viewer // announce a successful teleport request to the viewer. { - TeleportStart Low 73 Trusted Unencoded - { - Info Single - { TeleportFlags U32 } - } + TeleportStart Low 73 Trusted Unencoded + { + Info Single + { TeleportFlags U32 } + } } // TeleportFailed somewhere->sim->viewer // announce failure of teleport request { - TeleportFailed Low 74 Trusted Unencoded - { - Info Single - { AgentID LLUUID } - { Reason Variable 1 } // string - } - { - AlertInfo Variable - { Message Variable 1 } // string id - { ExtraParams Variable 1 } // llsd extra parameters - } + TeleportFailed Low 74 Trusted Unencoded + { + Info Single + { AgentID LLUUID } + { Reason Variable 1 } // string + } + { + AlertInfo Variable + { Message Variable 1 } // string id + { ExtraParams Variable 1 } // llsd extra parameters + } } @@ -1506,306 +1506,306 @@ version 2.0 // Undo { - Undo Low 75 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { GroupID LLUUID } - } - { - ObjectData Variable - { ObjectID LLUUID } - } + Undo Low 75 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { GroupID LLUUID } + } + { + ObjectData Variable + { ObjectID LLUUID } + } } // Redo { - Redo Low 76 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { GroupID LLUUID } - } - { - ObjectData Variable - { ObjectID LLUUID } - } + Redo Low 76 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { GroupID LLUUID } + } + { + ObjectData Variable + { ObjectID LLUUID } + } } // UndoLand { - UndoLand Low 77 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } + UndoLand Low 77 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } } // AgentPause - viewer occasionally will block, inform simulator of this fact { - AgentPause Low 78 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { SerialNum U32 } // U32, used by both pause and resume. Non-increasing numbers are ignored. - } + AgentPause Low 78 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { SerialNum U32 } // used by both pause and resume. Non-increasing numbers are ignored. + } } // AgentResume - unblock the agent { - AgentResume Low 79 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { SerialNum U32 } // U32, used by both pause and resume. Non-increasing numbers are ignored. - } + AgentResume Low 79 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { SerialNum U32 } // used by both pause and resume. Non-increasing numbers are ignored. + } } // AgentUpdate - Camera info sent from viewer to simulator // or, more simply, two axes and compute cross product // State data is temporary, indicates current behavior state: -// 0 = walking +// 0 = walking // 1 = mouselook -// 2 = typing -// +// 2 = typing +// // Center is region local (JNC 8.16.2001) // Camera center is region local (JNC 8.29.2001) { - AgentUpdate High 4 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { BodyRotation LLQuaternion } - { HeadRotation LLQuaternion } - { State U8 } - { CameraCenter LLVector3 } - { CameraAtAxis LLVector3 } - { CameraLeftAxis LLVector3 } - { CameraUpAxis LLVector3 } - { Far F32 } - { ControlFlags U32 } - { Flags U8 } - } + AgentUpdate High 4 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { BodyRotation LLQuaternion } + { HeadRotation LLQuaternion } + { State U8 } + { CameraCenter LLVector3 } + { CameraAtAxis LLVector3 } + { CameraLeftAxis LLVector3 } + { CameraUpAxis LLVector3 } + { Far F32 } + { ControlFlags U32 } + { Flags U8 } + } } // ChatFromViewer -// Specifies the text to be said and the "type", +// Specifies the text to be said and the "type", // normal speech, shout, whisper. // with the specified radius { - ChatFromViewer Low 80 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ChatData Single - { Message Variable 2 } - { Type U8 } - { Channel S32 } - } + ChatFromViewer Low 80 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ChatData Single + { Message Variable 2 } + { Type U8 } + { Channel S32 } + } } // AgentThrottle { - AgentThrottle Low 81 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { CircuitCode U32 } - } - { - Throttle Single - { GenCounter U32 } - { Throttles Variable 1 } - } + AgentThrottle Low 81 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { CircuitCode U32 } + } + { + Throttle Single + { GenCounter U32 } + { Throttles Variable 1 } + } } // AgentFOV - Update to agent's field of view, angle is vertical, single F32 float in radians { - AgentFOV Low 82 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { CircuitCode U32 } - } - { - FOVBlock Single - { GenCounter U32 } - { VerticalAngle F32 } - } + AgentFOV Low 82 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { CircuitCode U32 } + } + { + FOVBlock Single + { GenCounter U32 } + { VerticalAngle F32 } + } } // AgentHeightWidth - Update to height and aspect, sent as height/width to save space // Usually sent when window resized or created { - AgentHeightWidth Low 83 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { CircuitCode U32 } - } - { - HeightWidthBlock Single - { GenCounter U32 } - { Height U16 } - { Width U16 } - } + AgentHeightWidth Low 83 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { CircuitCode U32 } + } + { + HeightWidthBlock Single + { GenCounter U32 } + { Height U16 } + { Width U16 } + } } // AgentSetAppearance - Update to agent appearance { - AgentSetAppearance Low 84 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { SerialNum U32 } // U32, Increases every time the appearance changes. A value of 0 resets. - { Size LLVector3 } - } - { - WearableData Variable - { CacheID LLUUID } - { TextureIndex U8 } - } - { - ObjectData Single - { TextureEntry Variable 2 } - } - { - VisualParam Variable - { ParamValue U8 } - } + AgentSetAppearance Low 84 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { SerialNum U32 } // Increases every time the appearance changes. A value of 0 resets. + { Size LLVector3 } + } + { + WearableData Variable + { CacheID LLUUID } + { TextureIndex U8 } + } + { + ObjectData Single + { TextureEntry Variable 2 } + } + { + VisualParam Variable + { ParamValue U8 } + } } // AgentAnimation - Update animation state // viewer --> simulator { - AgentAnimation High 5 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - AnimationList Variable - { AnimID LLUUID } - { StartAnim BOOL } - } - { - PhysicalAvatarEventList Variable - { TypeData Variable 1 } - } + AgentAnimation High 5 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + AnimationList Variable + { AnimID LLUUID } + { StartAnim BOOL } + } + { + PhysicalAvatarEventList Variable + { TypeData Variable 1 } + } } // AgentRequestSit - Try to sit on an object { - AgentRequestSit High 6 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - TargetObject Single - { TargetID LLUUID } - { Offset LLVector3 } - } + AgentRequestSit High 6 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + TargetObject Single + { TargetID LLUUID } + { Offset LLVector3 } + } } // AgentSit - Actually sit on object { - AgentSit High 7 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } + AgentSit High 7 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } } // quit message sent between simulators { - AgentQuitCopy Low 85 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - FuseBlock Single - { ViewerCircuitCode U32 } - } + AgentQuitCopy Low 85 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + FuseBlock Single + { ViewerCircuitCode U32 } + } } // Request Image - Sent by the viewer to request a specified image at a specified resolution { - RequestImage High 8 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - RequestImage Variable - { Image LLUUID } - { DiscardLevel S8 } - { DownloadPriority F32 } - { Packet U32 } - { Type U8 } - } + RequestImage High 8 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + RequestImage Variable + { Image LLUUID } + { DiscardLevel S8 } + { DownloadPriority F32 } + { Packet U32 } + { Type U8 } + } } // ImageNotInDatabase // Simulator informs viewer that a requsted image definitely does not exist in the asset database { - ImageNotInDatabase Low 86 Trusted Unencoded - { - ImageID Single - { ID LLUUID } - } + ImageNotInDatabase Low 86 Trusted Unencoded + { + ImageID Single + { ID LLUUID } + } } // RebakeAvatarTextures // simulator -> viewer request when a temporary baked avatar texture is not found { - RebakeAvatarTextures Low 87 Trusted Unencoded - { - TextureData Single - { TextureID LLUUID } - } + RebakeAvatarTextures Low 87 Trusted Unencoded + { + TextureData Single + { TextureID LLUUID } + } } // SetAlwaysRun // Lets the viewer choose between running and walking { - SetAlwaysRun Low 88 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { AlwaysRun BOOL } - } + SetAlwaysRun Low 88 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { AlwaysRun BOOL } + } } // ObjectAdd - create new object in the world @@ -1818,69 +1818,69 @@ version 2.0 // // If only one ImageID is sent for an object type that has more than // one face, the same image is repeated on each subsequent face. -// +// // Data field is opaque type-specific data for this object { - ObjectAdd Medium 1 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { GroupID LLUUID } - } - { - ObjectData Single - { PCode U8 } - { Material U8 } - { AddFlags U32 } // see object_flags.h - - { PathCurve U8 } - { ProfileCurve U8 } - { PathBegin U16 } // 0 to 1, quanta = 0.01 - { PathEnd U16 } // 0 to 1, quanta = 0.01 - { PathScaleX U8 } // 0 to 1, quanta = 0.01 - { PathScaleY U8 } // 0 to 1, quanta = 0.01 - { PathShearX U8 } // -.5 to .5, quanta = 0.01 - { PathShearY U8 } // -.5 to .5, quanta = 0.01 - { PathTwist S8 } // -1 to 1, quanta = 0.01 - { PathTwistBegin S8 } // -1 to 1, quanta = 0.01 - { PathRadiusOffset S8 } // -1 to 1, quanta = 0.01 - { PathTaperX S8 } // -1 to 1, quanta = 0.01 - { PathTaperY S8 } // -1 to 1, quanta = 0.01 - { PathRevolutions U8 } // 0 to 3, quanta = 0.015 - { PathSkew S8 } // -1 to 1, quanta = 0.01 - { ProfileBegin U16 } // 0 to 1, quanta = 0.01 - { ProfileEnd U16 } // 0 to 1, quanta = 0.01 - { ProfileHollow U16 } // 0 to 1, quanta = 0.01 - - { BypassRaycast U8 } - { RayStart LLVector3 } - { RayEnd LLVector3 } - { RayTargetID LLUUID } - { RayEndIsIntersection U8 } - - { Scale LLVector3 } - { Rotation LLQuaternion } - - { State U8 } - } + ObjectAdd Medium 1 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { GroupID LLUUID } + } + { + ObjectData Single + { PCode U8 } + { Material U8 } + { AddFlags U32 } // see object_flags.h + + { PathCurve U8 } + { ProfileCurve U8 } + { PathBegin U16 } // 0 to 1, quanta = 0.01 + { PathEnd U16 } // 0 to 1, quanta = 0.01 + { PathScaleX U8 } // 0 to 1, quanta = 0.01 + { PathScaleY U8 } // 0 to 1, quanta = 0.01 + { PathShearX U8 } // -.5 to .5, quanta = 0.01 + { PathShearY U8 } // -.5 to .5, quanta = 0.01 + { PathTwist S8 } // -1 to 1, quanta = 0.01 + { PathTwistBegin S8 } // -1 to 1, quanta = 0.01 + { PathRadiusOffset S8 } // -1 to 1, quanta = 0.01 + { PathTaperX S8 } // -1 to 1, quanta = 0.01 + { PathTaperY S8 } // -1 to 1, quanta = 0.01 + { PathRevolutions U8 } // 0 to 3, quanta = 0.015 + { PathSkew S8 } // -1 to 1, quanta = 0.01 + { ProfileBegin U16 } // 0 to 1, quanta = 0.01 + { ProfileEnd U16 } // 0 to 1, quanta = 0.01 + { ProfileHollow U16 } // 0 to 1, quanta = 0.01 + + { BypassRaycast U8 } + { RayStart LLVector3 } + { RayEnd LLVector3 } + { RayTargetID LLUUID } + { RayEndIsIntersection U8 } + + { Scale LLVector3 } + { Rotation LLQuaternion } + + { State U8 } + } } // ObjectDelete // viewer -> simulator { - ObjectDelete Low 89 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { Force BOOL } // BOOL, god trying to force delete - } - { - ObjectData Variable - { ObjectLocalID U32 } - } + ObjectDelete Low 89 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { Force BOOL } // god trying to force delete + } + { + ObjectData Variable + { ObjectLocalID U32 } + } } @@ -1888,22 +1888,22 @@ version 2.0 // viewer -> simulator // Makes a copy of a set of objects, offset by a given amount { - ObjectDuplicate Low 90 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { GroupID LLUUID } - } - { - SharedData Single - { Offset LLVector3 } - { DuplicateFlags U32 } // see object_flags.h - } - { - ObjectData Variable - { ObjectLocalID U32 } - } + ObjectDuplicate Low 90 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { GroupID LLUUID } + } + { + SharedData Single + { Offset LLVector3 } + { DuplicateFlags U32 } // see object_flags.h + } + { + ObjectData Variable + { ObjectLocalID U32 } + } } @@ -1912,25 +1912,25 @@ version 2.0 // Makes a copy of an object, using the add object raycast // code to abut it to other objects. { - ObjectDuplicateOnRay Low 91 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { GroupID LLUUID } - { RayStart LLVector3 } // region local - { RayEnd LLVector3 } // region local - { BypassRaycast BOOL } - { RayEndIsIntersection BOOL } - { CopyCenters BOOL } - { CopyRotates BOOL } - { RayTargetID LLUUID } - { DuplicateFlags U32 } // see object_flags.h - } - { - ObjectData Variable - { ObjectLocalID U32 } - } + ObjectDuplicateOnRay Low 91 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { GroupID LLUUID } + { RayStart LLVector3 } // region local + { RayEnd LLVector3 } // region local + { BypassRaycast BOOL } + { RayEndIsIntersection BOOL } + { CopyCenters BOOL } + { CopyRotates BOOL } + { RayTargetID LLUUID } + { DuplicateFlags U32 } // see object_flags.h + } + { + ObjectData Variable + { ObjectLocalID U32 } + } } @@ -1939,18 +1939,18 @@ version 2.0 // updates position, rotation and scale in one message // positions sent as region-local floats { - MultipleObjectUpdate Medium 2 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ObjectData Variable - { ObjectLocalID U32 } - { Type U8 } - { Data Variable 1 } // custom type - } + MultipleObjectUpdate Medium 2 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ObjectData Variable + { ObjectLocalID U32 } + { Type U8 } + { Data Variable 1 } // custom type + } } // RequestMultipleObjects @@ -1964,17 +1964,17 @@ version 2.0 // CacheMissType 0 => full object (viewer doesn't have it) // CacheMissType 1 => CRC mismatch only { - RequestMultipleObjects Medium 3 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ObjectData Variable - { CacheMissType U8 } - { ID U32 } - } + RequestMultipleObjects Medium 3 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ObjectData Variable + { CacheMissType U8 } + { ID U32 } + } } @@ -1990,17 +1990,17 @@ version 2.0 // == New Location == // MultipleObjectUpdate can be used instead. { - ObjectPosition Medium 4 NotTrusted Zerocoded Deprecated - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ObjectData Variable - { ObjectLocalID U32 } - { Position LLVector3 } // region - } + ObjectPosition Medium 4 NotTrusted Zerocoded Deprecated + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ObjectData Variable + { ObjectLocalID U32 } + { Position LLVector3 } // region + } } @@ -2016,159 +2016,175 @@ version 2.0 // == New Location == // MultipleObjectUpdate can be used instead. { - ObjectScale Low 92 NotTrusted Zerocoded Deprecated - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ObjectData Variable - { ObjectLocalID U32 } - { Scale LLVector3 } - } + ObjectScale Low 92 NotTrusted Zerocoded Deprecated + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ObjectData Variable + { ObjectLocalID U32 } + { Scale LLVector3 } + } } // ObjectRotation // viewer -> simulator { - ObjectRotation Low 93 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ObjectData Variable - { ObjectLocalID U32 } - { Rotation LLQuaternion } - } + ObjectRotation Low 93 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ObjectData Variable + { ObjectLocalID U32 } + { Rotation LLQuaternion } + } } // ObjectFlagUpdate // viewer -> simulator { - ObjectFlagUpdate Low 94 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { ObjectLocalID U32 } - { UsePhysics BOOL } - { IsTemporary BOOL } - { IsPhantom BOOL } - { CastsShadows BOOL } - } + ObjectFlagUpdate Low 94 NotTrusted Zerocoded { - ExtraPhysics Variable - { PhysicsShapeType U8 } - { Density F32 } - { Friction F32 } - { Restitution F32 } - { GravityMultiplier F32 } - - } + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { ObjectLocalID U32 } + { UsePhysics BOOL } + { IsTemporary BOOL } + { IsPhantom BOOL } + { CastsShadows BOOL } + } + { + ExtraPhysics Variable + { PhysicsShapeType U8 } + { Density F32 } + { Friction F32 } + { Restitution F32 } + { GravityMultiplier F32 } + } } // ObjectClickAction // viewer -> simulator { - ObjectClickAction Low 95 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ObjectData Variable - { ObjectLocalID U32 } - { ClickAction U8 } - } + ObjectClickAction Low 95 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ObjectData Variable + { ObjectLocalID U32 } + { ClickAction U8 } + } } // ObjectImage // viewer -> simulator { - ObjectImage Low 96 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ObjectData Variable - { ObjectLocalID U32 } - { MediaURL Variable 1 } - { TextureEntry Variable 2 } - } -} - - -{ - ObjectMaterial Low 97 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ObjectData Variable - { ObjectLocalID U32 } - { Material U8 } - } -} - - -{ - ObjectShape Low 98 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ObjectData Variable - { ObjectLocalID U32 } - { PathCurve U8 } - { ProfileCurve U8 } - { PathBegin U16 } // 0 to 1, quanta = 0.01 - { PathEnd U16 } // 0 to 1, quanta = 0.01 - { PathScaleX U8 } // 0 to 1, quanta = 0.01 - { PathScaleY U8 } // 0 to 1, quanta = 0.01 - { PathShearX U8 } // -.5 to .5, quanta = 0.01 - { PathShearY U8 } // -.5 to .5, quanta = 0.01 - { PathTwist S8 } // -1 to 1, quanta = 0.01 - { PathTwistBegin S8 } // -1 to 1, quanta = 0.01 - { PathRadiusOffset S8 } // -1 to 1, quanta = 0.01 - { PathTaperX S8 } // -1 to 1, quanta = 0.01 - { PathTaperY S8 } // -1 to 1, quanta = 0.01 - { PathRevolutions U8 } // 0 to 3, quanta = 0.015 - { PathSkew S8 } // -1 to 1, quanta = 0.01 - { ProfileBegin U16 } // 0 to 1, quanta = 0.01 - { ProfileEnd U16 } // 0 to 1, quanta = 0.01 - { ProfileHollow U16 } // 0 to 1, quanta = 0.01 - } -} - -{ - ObjectExtraParams Low 99 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ObjectData Variable - { ObjectLocalID U32 } - { ParamType U16 } - { ParamInUse BOOL } - { ParamSize U32 } - { ParamData Variable 1 } - } + ObjectImage Low 96 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ObjectData Variable + { ObjectLocalID U32 } + { MediaURL Variable 1 } + { TextureEntry Variable 2 } + } +} + +// ObjectBypassModUpdate +// Viewer -> Simulator +// Allows the owner of an object to bypass mod protections for +// Predefined fields. +{ + ObjectBypassModUpdate Low 431 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ObjectData Variable + { ObjectLocalID U32 } + { PropertyID U8 } + { Value Variable 2 } + } +} + +{ + ObjectMaterial Low 97 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ObjectData Variable + { ObjectLocalID U32 } + { Material U8 } + } +} + +{ + ObjectShape Low 98 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ObjectData Variable + { ObjectLocalID U32 } + { PathCurve U8 } + { ProfileCurve U8 } + { PathBegin U16 } // 0 to 1, quanta = 0.01 + { PathEnd U16 } // 0 to 1, quanta = 0.01 + { PathScaleX U8 } // 0 to 1, quanta = 0.01 + { PathScaleY U8 } // 0 to 1, quanta = 0.01 + { PathShearX U8 } // -.5 to .5, quanta = 0.01 + { PathShearY U8 } // -.5 to .5, quanta = 0.01 + { PathTwist S8 } // -1 to 1, quanta = 0.01 + { PathTwistBegin S8 } // -1 to 1, quanta = 0.01 + { PathRadiusOffset S8 } // -1 to 1, quanta = 0.01 + { PathTaperX S8 } // -1 to 1, quanta = 0.01 + { PathTaperY S8 } // -1 to 1, quanta = 0.01 + { PathRevolutions U8 } // 0 to 3, quanta = 0.015 + { PathSkew S8 } // -1 to 1, quanta = 0.01 + { ProfileBegin U16 } // 0 to 1, quanta = 0.01 + { ProfileEnd U16 } // 0 to 1, quanta = 0.01 + { ProfileHollow U16 } // 0 to 1, quanta = 0.01 + } +} + +{ + ObjectExtraParams Low 99 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ObjectData Variable + { ObjectLocalID U32 } + { ParamType U16 } + { ParamInUse BOOL } + { ParamSize U32 } + { ParamData Variable 1 } + } } @@ -2177,57 +2193,57 @@ version 2.0 // TODO: Eliminate god-bit. Maybe not. God-bit is ok, because it's // known on the server. { - ObjectOwner Low 100 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - HeaderData Single - { Override BOOL } // BOOL, God-bit. - { OwnerID LLUUID } - { GroupID LLUUID } - } - { - ObjectData Variable - { ObjectLocalID U32 } - } + ObjectOwner Low 100 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + HeaderData Single + { Override BOOL } // God-bit. + { OwnerID LLUUID } + { GroupID LLUUID } + } + { + ObjectData Variable + { ObjectLocalID U32 } + } } // ObjectGroup // To make the object part of no group, set GroupID = LLUUID::null. // This call only works if objectid.ownerid == agentid. { - ObjectGroup Low 101 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { GroupID LLUUID } - } - { - ObjectData Variable - { ObjectLocalID U32 } - } + ObjectGroup Low 101 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { GroupID LLUUID } + } + { + ObjectData Variable + { ObjectLocalID U32 } + } } // Attempt to buy an object. This will only pack root objects. { - ObjectBuy Low 102 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { GroupID LLUUID } - { CategoryID LLUUID } // folder where it goes (if derezed) - } - { - ObjectData Variable - { ObjectLocalID U32 } - { SaleType U8 } // U8 -> EForSale - { SalePrice S32 } - } + ObjectBuy Low 102 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { GroupID LLUUID } + { CategoryID LLUUID } // folder where it goes (if derezed) + } + { + ObjectData Variable + { ObjectLocalID U32 } + { SaleType U8 } // U8 -> EForSale + { SalePrice S32 } + } } // viewer -> simulator @@ -2235,29 +2251,29 @@ version 2.0 // buy object inventory. If the transaction succeeds, it will add // inventory to the agent, and potentially remove the original. { - BuyObjectInventory Low 103 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Data Single - { ObjectID LLUUID } - { ItemID LLUUID } - { FolderID LLUUID } - } + BuyObjectInventory Low 103 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Data Single + { ObjectID LLUUID } + { ItemID LLUUID } + { FolderID LLUUID } + } } // sim -> viewer // Used to propperly handle buying asset containers { - DerezContainer Low 104 Trusted Zerocoded - { - Data Single - { ObjectID LLUUID } - { Delete BOOL } // BOOL - } + DerezContainer Low 104 Trusted Zerocoded + { + Data Single + { ObjectID LLUUID } + { Delete BOOL } + } } // ObjectPermissions @@ -2266,217 +2282,217 @@ version 2.0 // If set is false, tries to turn off bits in mask. // BUG: This just forces the permissions field. { - ObjectPermissions Low 105 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - HeaderData Single - { Override BOOL } // BOOL, God-bit. - } - { - ObjectData Variable - { ObjectLocalID U32 } - { Field U8 } - { Set U8 } - { Mask U32 } - } + ObjectPermissions Low 105 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + HeaderData Single + { Override BOOL } // God-bit. + } + { + ObjectData Variable + { ObjectLocalID U32 } + { Field U8 } + { Set U8 } + { Mask U32 } + } } // set object sale information { - ObjectSaleInfo Low 106 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ObjectData Variable - { LocalID U32 } - { SaleType U8 } // U8 -> EForSale - { SalePrice S32 } - } + ObjectSaleInfo Low 106 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ObjectData Variable + { LocalID U32 } + { SaleType U8 } // U8 -> EForSale + { SalePrice S32 } + } } // set object names { - ObjectName Low 107 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ObjectData Variable - { LocalID U32 } - { Name Variable 1 } - } + ObjectName Low 107 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ObjectData Variable + { LocalID U32 } + { Name Variable 1 } + } } // set object descriptions { - ObjectDescription Low 108 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ObjectData Variable - { LocalID U32 } - { Description Variable 1 } - } + ObjectDescription Low 108 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ObjectData Variable + { LocalID U32 } + { Description Variable 1 } + } } // set object category { - ObjectCategory Low 109 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ObjectData Variable - { LocalID U32 } - { Category U32 } - } + ObjectCategory Low 109 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ObjectData Variable + { LocalID U32 } + { Category U32 } + } } // ObjectSelect // Variable object data because rectangular selection can // generate a large list very quickly. { - ObjectSelect Low 110 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ObjectData Variable - { ObjectLocalID U32 } - } + ObjectSelect Low 110 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ObjectData Variable + { ObjectLocalID U32 } + } } // ObjectDeselect { - ObjectDeselect Low 111 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ObjectData Variable - { ObjectLocalID U32 } - } + ObjectDeselect Low 111 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ObjectData Variable + { ObjectLocalID U32 } + } } // ObjectAttach { - ObjectAttach Low 112 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { AttachmentPoint U8 } - } - { - ObjectData Variable - { ObjectLocalID U32 } - { Rotation LLQuaternion } - } + ObjectAttach Low 112 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { AttachmentPoint U8 } + } + { + ObjectData Variable + { ObjectLocalID U32 } + { Rotation LLQuaternion } + } } // ObjectDetach -- derezzes an attachment, marking its item in your inventory as not "(worn)" { - ObjectDetach Low 113 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ObjectData Variable - { ObjectLocalID U32 } - } + ObjectDetach Low 113 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ObjectData Variable + { ObjectLocalID U32 } + } } // ObjectDrop -- drops an attachment from your avatar onto the ground { - ObjectDrop Low 114 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ObjectData Variable - { ObjectLocalID U32 } - } + ObjectDrop Low 114 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ObjectData Variable + { ObjectLocalID U32 } + } } // ObjectLink { - ObjectLink Low 115 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ObjectData Variable - { ObjectLocalID U32 } - } + ObjectLink Low 115 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ObjectData Variable + { ObjectLocalID U32 } + } } // ObjectDelink { - ObjectDelink Low 116 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ObjectData Variable - { ObjectLocalID U32 } - } + ObjectDelink Low 116 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ObjectData Variable + { ObjectLocalID U32 } + } } // ObjectGrab { - ObjectGrab Low 117 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ObjectData Single - { LocalID U32 } - { GrabOffset LLVector3 } - } - { - SurfaceInfo Variable - { UVCoord LLVector3 } - { STCoord LLVector3 } - { FaceIndex S32 } - { Position LLVector3 } - { Normal LLVector3 } - { Binormal LLVector3 } - } + ObjectGrab Low 117 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ObjectData Single + { LocalID U32 } + { GrabOffset LLVector3 } + } + { + SurfaceInfo Variable + { UVCoord LLVector3 } + { STCoord LLVector3 } + { FaceIndex S32 } + { Position LLVector3 } + { Normal LLVector3 } + { Binormal LLVector3 } + } } @@ -2485,146 +2501,146 @@ version 2.0 // TimeSinceLast could go to 1 byte, since capped // at 100 on sim. { - ObjectGrabUpdate Low 118 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ObjectData Single - { ObjectID LLUUID } - { GrabOffsetInitial LLVector3 } // LLVector3 - { GrabPosition LLVector3 } // LLVector3, region local - { TimeSinceLast U32 } - } - { - SurfaceInfo Variable - { UVCoord LLVector3 } - { STCoord LLVector3 } - { FaceIndex S32 } - { Position LLVector3 } - { Normal LLVector3 } - { Binormal LLVector3 } - } - -} - - -// ObjectDeGrab -{ - ObjectDeGrab Low 119 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ObjectData Single - { LocalID U32 } - } - { - SurfaceInfo Variable - { UVCoord LLVector3 } - { STCoord LLVector3 } - { FaceIndex S32 } - { Position LLVector3 } - { Normal LLVector3 } - { Binormal LLVector3 } - } + ObjectGrabUpdate Low 118 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ObjectData Single + { ObjectID LLUUID } + { GrabOffsetInitial LLVector3 } // LLVector3 + { GrabPosition LLVector3 } // LLVector3, region local + { TimeSinceLast U32 } + } + { + SurfaceInfo Variable + { UVCoord LLVector3 } + { STCoord LLVector3 } + { FaceIndex S32 } + { Position LLVector3 } + { Normal LLVector3 } + { Binormal LLVector3 } + } + } -// ObjectSpinStart +// ObjectDeGrab { - ObjectSpinStart Low 120 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ObjectData Single - { ObjectID LLUUID } - } + ObjectDeGrab Low 119 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ObjectData Single + { LocalID U32 } + } + { + SurfaceInfo Variable + { UVCoord LLVector3 } + { STCoord LLVector3 } + { FaceIndex S32 } + { Position LLVector3 } + { Normal LLVector3 } + { Binormal LLVector3 } + } } -// ObjectSpinUpdate +// ObjectSpinStart { - ObjectSpinUpdate Low 121 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ObjectData Single - { ObjectID LLUUID } - { Rotation LLQuaternion } - } + ObjectSpinStart Low 120 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ObjectData Single + { ObjectID LLUUID } + } +} + + +// ObjectSpinUpdate +{ + ObjectSpinUpdate Low 121 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ObjectData Single + { ObjectID LLUUID } + { Rotation LLQuaternion } + } } // ObjectSpinStop { - ObjectSpinStop Low 122 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ObjectData Single - { ObjectID LLUUID } - } + ObjectSpinStop Low 122 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ObjectData Single + { ObjectID LLUUID } + } } // Export selected objects // viewer->sim { - ObjectExportSelected Low 123 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { RequestID LLUUID } - { VolumeDetail S16 } - } - { - ObjectData Variable - { ObjectID LLUUID } - } + ObjectExportSelected Low 123 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { RequestID LLUUID } + { VolumeDetail S16 } + } + { + ObjectData Variable + { ObjectID LLUUID } + } } // ModifyLand - sent to modify a piece of land on a simulator. // viewer -> sim { - ModifyLand Low 124 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ModifyBlock Single - { Action U8 } - { BrushSize U8 } - { Seconds F32 } - { Height F32 } - } - { - ParcelData Variable - { LocalID S32 } - { West F32 } - { South F32 } - { East F32 } - { North F32 } - } - { - ModifyBlockExtended Variable - { BrushSize F32 } - } + ModifyLand Low 124 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ModifyBlock Single + { Action U8 } + { BrushSize U8 } + { Seconds F32 } + { Height F32 } + } + { + ParcelData Variable + { LocalID S32 } + { West F32 } + { South F32 } + { East F32 } + { North F32 } + } + { + ModifyBlockExtended Variable + { BrushSize F32 } + } } @@ -2632,12 +2648,12 @@ version 2.0 // viewer->sim // requires administrative access { - VelocityInterpolateOn Low 125 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } + VelocityInterpolateOn Low 125 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } } @@ -2645,54 +2661,54 @@ version 2.0 // viewer->sim // requires administrative access { - VelocityInterpolateOff Low 126 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } + VelocityInterpolateOff Low 126 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } } // Save State // viewer->sim // requires administrative access { - StateSave Low 127 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - DataBlock Single - { Filename Variable 1 } - } + StateSave Low 127 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + DataBlock Single + { Filename Variable 1 } + } } // ReportAutosaveCrash // sim->launcher { - ReportAutosaveCrash Low 128 NotTrusted Unencoded - { - AutosaveData Single - { PID S32 } - { Status S32 } - } + ReportAutosaveCrash Low 128 NotTrusted Unencoded + { + AutosaveData Single + { PID S32 } + { Status S32 } + } } // SimWideDeletes { - SimWideDeletes Low 129 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - DataBlock Single - { TargetID LLUUID } - { Flags U32 } - } + SimWideDeletes Low 129 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + DataBlock Single + { TargetID LLUUID } + { Flags U32 } + } } // RequestObjectPropertiesFamily @@ -2700,133 +2716,133 @@ version 2.0 // Medium frequency because it is driven by mouse hovering over objects, which // occurs at high rates. { - RequestObjectPropertiesFamily Medium 5 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ObjectData Single - { RequestFlags U32 } - { ObjectID LLUUID } - } + RequestObjectPropertiesFamily Medium 5 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ObjectData Single + { RequestFlags U32 } + { ObjectID LLUUID } + } } // Track agent - this information is used when sending out the -// coarse location update so that we know who you are tracking. +// coarse location update so that we know who you are tracking. // To stop tracking - send a null uuid as the prey. { - TrackAgent Low 130 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - TargetData Single - { PreyID LLUUID } - } + TrackAgent Low 130 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + TargetData Single + { PreyID LLUUID } + } } // end viewer to simulator section { - ViewerStats Low 131 NotTrusted Zerocoded UDPDeprecated - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { IP IPADDR } - { StartTime U32 } - { RunTime F32 } // F32 - { SimFPS F32 } // F32 - { FPS F32 } // F32 - { AgentsInView U8 } // - { Ping F32 } // F32 - { MetersTraveled F64 } - { RegionsVisited S32 } - { SysRAM U32 } - { SysOS Variable 1 } // String - { SysCPU Variable 1 } // String - { SysGPU Variable 1 } // String - } - - { - DownloadTotals Single - { World U32 } - { Objects U32 } - { Textures U32 } - } - - { - NetStats Multiple 2 - { Bytes U32 } - { Packets U32 } - { Compressed U32 } - { Savings U32 } - } - - { - FailStats Single - { SendPacket U32 } - { Dropped U32 } - { Resent U32 } - { FailedResends U32 } - { OffCircuit U32 } - { Invalid U32 } - } - - { - MiscStats Variable - { Type U32 } - { Value F64 } - } -} - + ViewerStats Low 131 NotTrusted Zerocoded UDPDeprecated + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { IP IPADDR } + { StartTime U32 } + { RunTime F32 } // F32 + { SimFPS F32 } // F32 + { FPS F32 } // F32 + { AgentsInView U8 } + { Ping F32 } // F32 + { MetersTraveled F64 } + { RegionsVisited S32 } + { SysRAM U32 } + { SysOS Variable 1 } // String + { SysCPU Variable 1 } // String + { SysGPU Variable 1 } // String + } + + { + DownloadTotals Single + { World U32 } + { Objects U32 } + { Textures U32 } + } + + { + NetStats Multiple 2 + { Bytes U32 } + { Packets U32 } + { Compressed U32 } + { Savings U32 } + } + + { + FailStats Single + { SendPacket U32 } + { Dropped U32 } + { Resent U32 } + { FailedResends U32 } + { OffCircuit U32 } + { Invalid U32 } + } + + { + MiscStats Variable + { Type U32 } + { Value F64 } + } +} + // ScriptAnswerYes // reliable { - ScriptAnswerYes Low 132 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Data Single - { TaskID LLUUID } - { ItemID LLUUID } - { Questions S32 } - } + ScriptAnswerYes Low 132 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Data Single + { TaskID LLUUID } + { ItemID LLUUID } + { Questions S32 } + } } // complaint/bug-report // reliable { - UserReport Low 133 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ReportData Single - { ReportType U8 } // BUG=1, COMPLAINT=2 - { Category U8 } // see sequence.user_report_category - { Position LLVector3 } // screenshot position, region-local - { CheckFlags U8 } // checkboxflags - { ScreenshotID LLUUID } - { ObjectID LLUUID } - { AbuserID LLUUID } - { AbuseRegionName Variable 1 } - { AbuseRegionID LLUUID } - { Summary Variable 1 } - { Details Variable 2 } - { VersionString Variable 1 } - } + UserReport Low 133 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ReportData Single + { ReportType U8 } // BUG=1, COMPLAINT=2 + { Category U8 } // see sequence.user_report_category + { Position LLVector3 } // screenshot position, region-local + { CheckFlags U8 } // checkboxflags + { ScreenshotID LLUUID } + { ObjectID LLUUID } + { AbuserID LLUUID } + { AbuseRegionName Variable 1 } + { AbuseRegionID LLUUID } + { Summary Variable 1 } + { Details Variable 2 } + { VersionString Variable 1 } + } } @@ -2836,67 +2852,73 @@ version 2.0 // AlertMessage // Specifies the text to be posted in an alert dialog +// Also sent from dataserver to simulator with AgentInfo block +// Simulator doesn't include AgentInfo block to viewer { - AlertMessage Low 134 Trusted Unencoded - { - AlertData Single - { Message Variable 1 } - } - { - AlertInfo Variable - { Message Variable 1 } - { ExtraParams Variable 1 } - } + AlertMessage Low 134 Trusted Unencoded + { + AlertData Single + { Message Variable 1 } + } + { + AlertInfo Variable + { Message Variable 1 } + { ExtraParams Variable 1 } + } + { + AgentInfo Variable + { AgentID LLUUID } + } } // Send an AlertMessage to the named agent. // usually dataserver->simulator { - AgentAlertMessage Low 135 Trusted Unencoded - { - AgentData Single - { AgentID LLUUID } - } - { - AlertData Single - { Modal BOOL } - { Message Variable 1 } - } + AgentAlertMessage Low 135 Trusted Unencoded + { + AgentData Single + { AgentID LLUUID } + } + { + AlertData Single + { Modal BOOL } + { Message Variable 1 } + } } // MeanCollisionAlert // Specifies the text to be posted in an alert dialog { - MeanCollisionAlert Low 136 Trusted Zerocoded - { - MeanCollision Variable - { Victim LLUUID } - { Perp LLUUID } - { Time U32 } - { Mag F32 } - { Type U8 } - } + MeanCollisionAlert Low 136 Trusted Zerocoded + { + MeanCollision Variable + { Victim LLUUID } + { Perp LLUUID } + { Time U32 } + { Mag F32 } + { Type U8 } + } } // ViewerFrozenMessage // Specifies the text to be posted in an alert dialog { - ViewerFrozenMessage Low 137 Trusted Unencoded - { - FrozenData Single - { Data BOOL } - } + ViewerFrozenMessage Low 137 Trusted Unencoded + { + FrozenData Single + { Data BOOL } + } } // Health Message // Tells viewer what agent health is { - HealthMessage Low 138 Trusted Zerocoded - { - HealthData Single - { Health F32 } - } + HealthMessage Low 138 Trusted Zerocoded + { + HealthData Single + { Health F32 } + } } // ChatFromSimulator @@ -2905,55 +2927,55 @@ version 2.0 // Viewer can optionally use position to animate // If audible is CHAT_NOT_AUDIBLE, message will not be valid { - ChatFromSimulator Low 139 Trusted Unencoded - { - ChatData Single - { FromName Variable 1 } - { SourceID LLUUID } // agent id or object id - { OwnerID LLUUID } // object's owner - { SourceType U8 } - { ChatType U8 } - { Audible U8 } - { Position LLVector3 } - { Message Variable 2 } // UTF-8 text - } + ChatFromSimulator Low 139 Trusted Unencoded + { + ChatData Single + { FromName Variable 1 } + { SourceID LLUUID } // agent id or object id + { OwnerID LLUUID } // object's owner + { SourceType U8 } + { ChatType U8 } + { Audible U8 } + { Position LLVector3 } + { Message Variable 2 } // UTF-8 text + } } // Simulator statistics packet (goes out to viewer and dataserver/spaceserver) { - SimStats Low 140 Trusted Unencoded - { - Region Single - { RegionX U32 } - { RegionY U32 } - { RegionFlags U32 } - { ObjectCapacity U32 } - } - { - Stat Variable - { StatID U32 } - { StatValue F32 } - } - { - PidStat Single - { PID S32 } - } - { - RegionInfo Variable - { RegionFlagsExtended U64 } - } + SimStats Low 140 Trusted Unencoded + { + Region Single + { RegionX U32 } + { RegionY U32 } + { RegionFlags U32 } + { ObjectCapacity U32 } + } + { + Stat Variable + { StatID U32 } + { StatValue F32 } + } + { + PidStat Single + { PID S32 } + } + { + RegionInfo Variable + { RegionFlagsExtended U64 } + } } // viewer -> sim // reliable { - RequestRegionInfo Low 141 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } + RequestRegionInfo Low 141 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } } // RegionInfo @@ -2962,53 +2984,63 @@ version 2.0 // sim -> viewer // reliable { - RegionInfo Low 142 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - RegionInfo Single - { SimName Variable 1 } // string - { EstateID U32 } - { ParentEstateID U32 } - { RegionFlags U32 } - { SimAccess U8 } - { MaxAgents U8 } - { BillableFactor F32 } - { ObjectBonusFactor F32 } - { WaterHeight F32 } - { TerrainRaiseLimit F32 } - { TerrainLowerLimit F32 } - { PricePerMeter S32 } - { RedirectGridX S32 } - { RedirectGridY S32 } - { UseEstateSun BOOL } - { SunHour F32 } // last value set by estate or region controls JC - } - { - RegionInfo2 Single - { ProductSKU Variable 1 } // string - { ProductName Variable 1 } // string - { MaxAgents32 U32 } // Identical to RegionInfo.MaxAgents but allows greater range - { HardMaxAgents U32 } - { HardMaxObjects U32 } - } - { - RegionInfo3 Variable - { RegionFlagsExtended U64 } - } - { - RegionInfo5 Variable - { ChatWhisperRange F32 } - { ChatNormalRange F32 } - { ChatShoutRange F32 } - { ChatWhisperOffset F32 } - { ChatNormalOffset F32 } - { ChatShoutOffset F32 } - { ChatFlags U32 } - } + RegionInfo Low 142 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + RegionInfo Single + { SimName Variable 1 } // string + { EstateID U32 } + { ParentEstateID U32 } + { RegionFlags U32 } + { SimAccess U8 } + { MaxAgents U8 } + { BillableFactor F32 } + { ObjectBonusFactor F32 } + { WaterHeight F32 } + { TerrainRaiseLimit F32 } + { TerrainLowerLimit F32 } + { PricePerMeter S32 } + { RedirectGridX S32 } + { RedirectGridY S32 } + { UseEstateSun BOOL } + { SunHour F32 } // last value set by estate or region controls JC + } + { + RegionInfo2 Single + { ProductSKU Variable 1 } // string + { ProductName Variable 1 } // string + { MaxAgents32 U32 } // Identical to RegionInfo.MaxAgents but allows greater range + { HardMaxAgents U32 } + { HardMaxObjects U32 } + } + { + RegionInfo3 Variable + { RegionFlagsExtended U64 } + } + { + RegionInfo5 Variable + { ChatWhisperRange F32 } + { ChatNormalRange F32 } + { ChatShoutRange F32 } + { ChatWhisperOffset F32 } + { ChatNormalOffset F32 } + { ChatShoutOffset F32 } + { ChatFlags U32 } + } + { + CombatSettings Variable + { CombatFlags U32 } + { OnDeath U8 } + { DamageThrottle F32 } + { RegenerationRate F32 } + { InvulnerabilyTime F32 } + { DamageLimit F32 } + } + } // GodUpdateRegionInfo @@ -3017,27 +3049,27 @@ version 2.0 // viewer -> sim // reliable { - GodUpdateRegionInfo Low 143 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - RegionInfo Single - { SimName Variable 1 } // string - { EstateID U32 } - { ParentEstateID U32 } - { RegionFlags U32 } - { BillableFactor F32 } - { PricePerMeter S32 } - { RedirectGridX S32 } - { RedirectGridY S32 } - } - { - RegionInfo2 Variable - { RegionFlagsExtended U64 } - } + GodUpdateRegionInfo Low 143 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + RegionInfo Single + { SimName Variable 1 } // string + { EstateID U32 } + { ParentEstateID U32 } + { RegionFlags U32 } + { BillableFactor F32 } + { PricePerMeter S32 } + { RedirectGridX S32 } + { RedirectGridY S32 } + } + { + RegionInfo2 Variable + { RegionFlagsExtended U64 } + } } //NearestLandingRegionRequest @@ -3046,11 +3078,11 @@ version 2.0 //to request the most up to date region for the requesting //region to redirect teleports to { - NearestLandingRegionRequest Low 144 Trusted Unencoded - { - RequestingRegionData Single - { RegionHandle U64 } - } + NearestLandingRegionRequest Low 144 Trusted Unencoded + { + RequestingRegionData Single + { RegionHandle U64 } + } } //NearestLandingPointReply @@ -3059,11 +3091,11 @@ version 2.0 //to the redirectregion request stating which region //the requesting region should redirect teleports to if necessary { - NearestLandingRegionReply Low 145 Trusted Unencoded - { - LandingRegionData Single - { RegionHandle U64 } - } + NearestLandingRegionReply Low 145 Trusted Unencoded + { + LandingRegionData Single + { RegionHandle U64 } + } } //NearestLandingPointUpdated @@ -3072,11 +3104,11 @@ version 2.0 //to have the dataserver note/clear in the db //that the region has updated it's nearest landing point { - NearestLandingRegionUpdated Low 146 Trusted Unencoded - { - RegionData Single - { RegionHandle U64 } - } + NearestLandingRegionUpdated Low 146 Trusted Unencoded + { + RegionData Single + { RegionHandle U64 } + } } @@ -3085,11 +3117,11 @@ version 2.0 //Sent from the region to the data server //to note that the region's teleportation landing status has changed { - TeleportLandingStatusChanged Low 147 Trusted Unencoded - { - RegionData Single - { RegionHandle U64 } - } + TeleportLandingStatusChanged Low 147 Trusted Unencoded + { + RegionData Single + { RegionHandle U64 } + } } // RegionHandshake @@ -3098,51 +3130,51 @@ version 2.0 // sim -> viewer // reliable { - RegionHandshake Low 148 Trusted Zerocoded - { - RegionInfo Single - { RegionFlags U32 } - { SimAccess U8 } - { SimName Variable 1 } // string - { SimOwner LLUUID } - { IsEstateManager BOOL } // this agent, for this sim - { WaterHeight F32 } - { BillableFactor F32 } - { CacheID LLUUID } - { TerrainBase0 LLUUID } - { TerrainBase1 LLUUID } - { TerrainBase2 LLUUID } - { TerrainBase3 LLUUID } - { TerrainDetail0 LLUUID } - { TerrainDetail1 LLUUID } - { TerrainDetail2 LLUUID } - { TerrainDetail3 LLUUID } - { TerrainStartHeight00 F32 } - { TerrainStartHeight01 F32 } - { TerrainStartHeight10 F32 } - { TerrainStartHeight11 F32 } - { TerrainHeightRange00 F32 } - { TerrainHeightRange01 F32 } - { TerrainHeightRange10 F32 } - { TerrainHeightRange11 F32 } - } - { - RegionInfo2 Single - { RegionID LLUUID } - } - { - RegionInfo3 Single - { CPUClassID S32 } - { CPURatio S32 } - { ColoName Variable 1 } // string - { ProductSKU Variable 1 } // string - { ProductName Variable 1 } // string - } - { - RegionInfo4 Variable - { RegionFlagsExtended U64 } - { RegionProtocols U64 } - } + RegionHandshake Low 148 Trusted Zerocoded + { + RegionInfo Single + { RegionFlags U32 } + { SimAccess U8 } + { SimName Variable 1 } // string + { SimOwner LLUUID } + { IsEstateManager BOOL } // this agent, for this sim + { WaterHeight F32 } + { BillableFactor F32 } + { CacheID LLUUID } + { TerrainBase0 LLUUID } + { TerrainBase1 LLUUID } + { TerrainBase2 LLUUID } + { TerrainBase3 LLUUID } + { TerrainDetail0 LLUUID } + { TerrainDetail1 LLUUID } + { TerrainDetail2 LLUUID } + { TerrainDetail3 LLUUID } + { TerrainStartHeight00 F32 } + { TerrainStartHeight01 F32 } + { TerrainStartHeight10 F32 } + { TerrainStartHeight11 F32 } + { TerrainHeightRange00 F32 } + { TerrainHeightRange01 F32 } + { TerrainHeightRange10 F32 } + { TerrainHeightRange11 F32 } + } + { + RegionInfo2 Single + { RegionID LLUUID } + } + { + RegionInfo3 Single + { CPUClassID S32 } + { CPURatio S32 } + { ColoName Variable 1 } // string + { ProductSKU Variable 1 } // string + { ProductName Variable 1 } // string + } + { + RegionInfo4 Variable + { RegionFlagsExtended U64 } + { RegionProtocols U64 } + } } // RegionHandshakeReply @@ -3154,295 +3186,295 @@ version 2.0 // After the simulator receives this, it will start sending // data about objects. { - RegionHandshakeReply Low 149 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - RegionInfo Single - { Flags U32 } - } + RegionHandshakeReply Low 149 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + RegionInfo Single + { Flags U32 } + } } -// The CoarseLocationUpdate message is sent to notify the viewer of +// The CoarseLocationUpdate message is sent to notify the viewer of // the location of mappable objects in the region. 1 meter resolution is -// sufficient for this. The index block is used to show where you are, +// sufficient for this. The index block is used to show where you are, // and where someone you are tracking is located. They are -1 if not // applicable. { - CoarseLocationUpdate Medium 6 Trusted Unencoded - { - Location Variable - { X U8 } - { Y U8 } - { Z U8 } // Z in meters / 4 - } - { - Index Single - { You S16 } - { Prey S16 } - } - { - AgentData Variable - { AgentID LLUUID } - } -} - -// ImageData - sent to viewer to transmit information about an image -{ - ImageData High 9 Trusted Unencoded - { - ImageID Single - { ID LLUUID } - { Codec U8 } - { Size U32 } - { Packets U16 } - } - { - ImageData Single - { Data Variable 2 } - } -} - -// ImagePacket - follow on image data for images having > 1 packet of data -{ - ImagePacket High 10 Trusted Unencoded - { - ImageID Single - { ID LLUUID } - { Packet U16 } - } - { - ImageData Single - { Data Variable 2 } - } + CoarseLocationUpdate Medium 6 Trusted Unencoded + { + Location Variable + { X U8 } + { Y U8 } + { Z U8 } // Z in meters / 4 + } + { + Index Single + { You S16 } + { Prey S16 } + } + { + AgentData Variable + { AgentID LLUUID } + } +} + +// ImageData - sent to viewer to transmit information about an image +{ + ImageData High 9 Trusted Unencoded + { + ImageID Single + { ID LLUUID } + { Codec U8 } + { Size U32 } + { Packets U16 } + } + { + ImageData Single + { Data Variable 2 } + } +} + +// ImagePacket - follow on image data for images having > 1 packet of data +{ + ImagePacket High 10 Trusted Unencoded + { + ImageID Single + { ID LLUUID } + { Packet U16 } + } + { + ImageData Single + { Data Variable 2 } + } } // LayerData - Sent to viewer - encodes layer data { - LayerData High 11 Trusted Unencoded - { - LayerID Single - { Type U8 } + LayerData High 11 Trusted Unencoded + { + LayerID Single + { Type U8 } - } - { - LayerData Single - { Data Variable 2 } - } + } + { + LayerData Single + { Data Variable 2 } + } } // ObjectUpdate - Sent by objects from the simulator to the viewer // // If only one ImageID is sent for an object type that has more than // one face, the same image is repeated on each subsequent face. -// +// // NameValue is a list of name-value strings, separated by \n characters, // terminated by \0 // // Data is type-specific opaque data for this object { - ObjectUpdate High 12 Trusted Zerocoded - { - RegionData Single - { RegionHandle U64 } - { TimeDilation U16 } - } - { - ObjectData Variable - { ID U32 } - { State U8 } - - { FullID LLUUID } - { CRC U32 } // TEMPORARY HACK FOR JAMES - { PCode U8 } - { Material U8 } - { ClickAction U8 } - { Scale LLVector3 } - { ObjectData Variable 1 } - - { ParentID U32 } - { UpdateFlags U32 } // U32, see object_flags.h - - { PathCurve U8 } - { ProfileCurve U8 } - { PathBegin U16 } // 0 to 1, quanta = 0.01 - { PathEnd U16 } // 0 to 1, quanta = 0.01 - { PathScaleX U8 } // 0 to 1, quanta = 0.01 - { PathScaleY U8 } // 0 to 1, quanta = 0.01 - { PathShearX U8 } // -.5 to .5, quanta = 0.01 - { PathShearY U8 } // -.5 to .5, quanta = 0.01 - { PathTwist S8 } // -1 to 1, quanta = 0.01 - { PathTwistBegin S8 } // -1 to 1, quanta = 0.01 - { PathRadiusOffset S8 } // -1 to 1, quanta = 0.01 - { PathTaperX S8 } // -1 to 1, quanta = 0.01 - { PathTaperY S8 } // -1 to 1, quanta = 0.01 - { PathRevolutions U8 } // 0 to 3, quanta = 0.015 - { PathSkew S8 } // -1 to 1, quanta = 0.01 - { ProfileBegin U16 } // 0 to 1, quanta = 0.01 - { ProfileEnd U16 } // 0 to 1, quanta = 0.01 - { ProfileHollow U16 } // 0 to 1, quanta = 0.01 - - { TextureEntry Variable 2 } - { TextureAnim Variable 1 } - - { NameValue Variable 2 } - { Data Variable 2 } - { Text Variable 1 } // llSetText() hovering text - { TextColor Fixed 4 } // actually, a LLColor4U - { MediaURL Variable 1 } // URL for web page, movie, etc. - - // Info for particle systems - { PSBlock Variable 1 } - - // Extra parameters - { ExtraParams Variable 1 } - - // info for looped attached sounds + ObjectUpdate High 12 Trusted Zerocoded + { + RegionData Single + { RegionHandle U64 } + { TimeDilation U16 } + } + { + ObjectData Variable + { ID U32 } + { State U8 } + + { FullID LLUUID } + { CRC U32 } // TEMPORARY HACK FOR JAMES + { PCode U8 } + { Material U8 } + { ClickAction U8 } + { Scale LLVector3 } + { ObjectData Variable 1 } + + { ParentID U32 } + { UpdateFlags U32 } // see object_flags.h + + { PathCurve U8 } + { ProfileCurve U8 } + { PathBegin U16 } // 0 to 1, quanta = 0.01 + { PathEnd U16 } // 0 to 1, quanta = 0.01 + { PathScaleX U8 } // 0 to 1, quanta = 0.01 + { PathScaleY U8 } // 0 to 1, quanta = 0.01 + { PathShearX U8 } // -.5 to .5, quanta = 0.01 + { PathShearY U8 } // -.5 to .5, quanta = 0.01 + { PathTwist S8 } // -1 to 1, quanta = 0.01 + { PathTwistBegin S8 } // -1 to 1, quanta = 0.01 + { PathRadiusOffset S8 } // -1 to 1, quanta = 0.01 + { PathTaperX S8 } // -1 to 1, quanta = 0.01 + { PathTaperY S8 } // -1 to 1, quanta = 0.01 + { PathRevolutions U8 } // 0 to 3, quanta = 0.015 + { PathSkew S8 } // -1 to 1, quanta = 0.01 + { ProfileBegin U16 } // 0 to 1, quanta = 0.01 + { ProfileEnd U16 } // 0 to 1, quanta = 0.01 + { ProfileHollow U16 } // 0 to 1, quanta = 0.01 + + { TextureEntry Variable 2 } + { TextureAnim Variable 1 } + + { NameValue Variable 2 } + { Data Variable 2 } + { Text Variable 1 } // llSetText() hovering text + { TextColor Fixed 4 } // actually, a LLColor4U + { MediaURL Variable 1 } // URL for web page, movie, etc. + + // Info for particle systems + { PSBlock Variable 1 } + + // Extra parameters + { ExtraParams Variable 1 } + + // info for looped attached sounds // because these are almost always all zero - // the hit after zero-coding is only 2 bytes - // not the 42 you see here - { Sound LLUUID } - { OwnerID LLUUID } // HACK object's owner id, only set if non-null sound, for muting - { Gain F32 } - { Flags U8 } - { Radius F32 } // cutoff radius - - // joint info -- is sent in the update of each joint-child-root - { JointType U8 } - { JointPivot LLVector3 } - { JointAxisOrAnchor LLVector3 } - } + // the hit after zero-coding is only 2 bytes + // not the 42 you see here + { Sound LLUUID } + { OwnerID LLUUID } // HACK object's owner id, only set if non-null sound, for muting + { Gain F32 } + { Flags U8 } + { Radius F32 } // cutoff radius + + // joint info -- is sent in the update of each joint-child-root + { JointType U8 } + { JointPivot LLVector3 } + { JointAxisOrAnchor LLVector3 } + } } // ObjectUpdateCompressed { - ObjectUpdateCompressed High 13 Trusted Unencoded - { - RegionData Single - { RegionHandle U64 } - { TimeDilation U16 } - } - { - ObjectData Variable - { UpdateFlags U32 } - { Data Variable 2 } - } + ObjectUpdateCompressed High 13 Trusted Unencoded + { + RegionData Single + { RegionHandle U64 } + { TimeDilation U16 } + } + { + ObjectData Variable + { UpdateFlags U32 } + { Data Variable 2 } + } } // ObjectUpdateCached // reliable { - ObjectUpdateCached High 14 Trusted Unencoded - { - RegionData Single - { RegionHandle U64 } - { TimeDilation U16 } - } - { - ObjectData Variable - { ID U32 } - { CRC U32 } - { UpdateFlags U32 } - } + ObjectUpdateCached High 14 Trusted Unencoded + { + RegionData Single + { RegionHandle U64 } + { TimeDilation U16 } + } + { + ObjectData Variable + { ID U32 } + { CRC U32 } + { UpdateFlags U32 } + } } // packed terse object update format { - ImprovedTerseObjectUpdate High 15 Trusted Unencoded - { - RegionData Single - { RegionHandle U64 } - { TimeDilation U16 } - } - { - ObjectData Variable - { Data Variable 1 } - { TextureEntry Variable 2 } - } + ImprovedTerseObjectUpdate High 15 Trusted Unencoded + { + RegionData Single + { RegionHandle U64 } + { TimeDilation U16 } + } + { + ObjectData Variable + { Data Variable 1 } + { TextureEntry Variable 2 } + } } // KillObject - Sent by objects to the viewer to tell them to kill themselves { - KillObject High 16 Trusted Unencoded - { - ObjectData Variable - { ID U32 } - } + KillObject High 16 Trusted Unencoded + { + ObjectData Variable + { ID U32 } + } } -// CrossedRegion - new way to tell a viewer it has gone across a region +// CrossedRegion - new way to tell a viewer it has gone across a region // boundary { - CrossedRegion Medium 7 Trusted Unencoded UDPBlackListed - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - RegionData Single - { SimIP IPADDR } - { SimPort IPPORT } - { RegionHandle U64 } - { SeedCapability Variable 2 } // URL - } - { - Info Single - { Position LLVector3 } - { LookAt LLVector3 } - } + CrossedRegion Medium 7 Trusted Unencoded UDPBlackListed + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + RegionData Single + { SimIP IPADDR } + { SimPort IPPORT } + { RegionHandle U64 } + { SeedCapability Variable 2 } // URL + } + { + Info Single + { Position LLVector3 } + { LookAt LLVector3 } + } } // SimulatorViewerTimeMessage - Allows viewer to resynch to world time { - SimulatorViewerTimeMessage Low 150 Trusted Unencoded - { - TimeInfo Single - { UsecSinceStart U64 } - { SecPerDay U32 } - { SecPerYear U32 } - { SunDirection LLVector3 } - { SunPhase F32 } - { SunAngVelocity LLVector3 } - } + SimulatorViewerTimeMessage Low 150 Trusted Unencoded + { + TimeInfo Single + { UsecSinceStart U64 } + { SecPerDay U32 } + { SecPerYear U32 } + { SunDirection LLVector3 } + { SunPhase F32 } + { SunAngVelocity LLVector3 } + } } // EnableSimulator - Preps a viewer to receive data from a simulator { - EnableSimulator Low 151 Trusted Unencoded UDPBlackListed - { - SimulatorInfo Single - { Handle U64 } - { IP IPADDR } - { Port IPPORT } - } + EnableSimulator Low 151 Trusted Unencoded UDPBlackListed + { + SimulatorInfo Single + { Handle U64 } + { IP IPADDR } + { Port IPPORT } + } } // DisableThisSimulator - Tells a viewer not to expect data from this simulator anymore { - DisableSimulator Low 152 Trusted Unencoded + DisableSimulator Low 152 Trusted Unencoded } // ConfirmEnableSimulator - A confirmation message sent from simulator to neighbors that the simulator // has successfully been enabled by the viewer { - ConfirmEnableSimulator Medium 8 Trusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } + ConfirmEnableSimulator Medium 8 Trusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } } //----------------------------------------------------------------------------- @@ -3451,52 +3483,52 @@ version 2.0 // Request a new transfer (target->source) { - TransferRequest Low 153 NotTrusted Zerocoded - { - TransferInfo Single - { TransferID LLUUID } - { ChannelType S32 } - { SourceType S32 } - { Priority F32 } - { Params Variable 2 } - } + TransferRequest Low 153 NotTrusted Zerocoded + { + TransferInfo Single + { TransferID LLUUID } + { ChannelType S32 } + { SourceType S32 } + { Priority F32 } + { Params Variable 2 } + } } // Return info about a transfer/initiate transfer (source->target) // Possibly should have a Params field like above { - TransferInfo Low 154 NotTrusted Zerocoded - { - TransferInfo Single - { TransferID LLUUID } - { ChannelType S32 } - { TargetType S32 } - { Status S32 } - { Size S32 } - { Params Variable 2 } - } + TransferInfo Low 154 NotTrusted Zerocoded + { + TransferInfo Single + { TransferID LLUUID } + { ChannelType S32 } + { TargetType S32 } + { Status S32 } + { Size S32 } + { Params Variable 2 } + } } { - TransferPacket High 17 NotTrusted Unencoded - { - TransferData Single - { TransferID LLUUID } - { ChannelType S32 } - { Packet S32 } - { Status S32 } - { Data Variable 2 } - } + TransferPacket High 17 NotTrusted Unencoded + { + TransferData Single + { TransferID LLUUID } + { ChannelType S32 } + { Packet S32 } + { Status S32 } + { Data Variable 2 } + } } // Abort a transfer in progress (either from target->source or source->target) { - TransferAbort Low 155 NotTrusted Zerocoded - { - TransferInfo Single - { TransferID LLUUID } - { ChannelType S32 } - } + TransferAbort Low 155 NotTrusted Zerocoded + { + TransferInfo Single + { TransferID LLUUID } + { ChannelType S32 } + } } @@ -3506,51 +3538,51 @@ version 2.0 // RequestXfer - request an arbitrary xfer { - RequestXfer Low 156 NotTrusted Zerocoded - { - XferID Single - { ID U64 } - { Filename Variable 1 } - { FilePath U8 } // ELLPath - { DeleteOnCompletion BOOL } // BOOL - { UseBigPackets BOOL } // BOOL - { VFileID LLUUID } - { VFileType S16 } - } -} - -// SendXferPacket - send an additional packet of an arbitrary xfer from sim -> viewer -{ - SendXferPacket High 18 NotTrusted Unencoded - { - XferID Single - { ID U64 } - { Packet U32 } - } - { - DataPacket Single - { Data Variable 2 } - } + RequestXfer Low 156 NotTrusted Zerocoded + { + XferID Single + { ID U64 } + { Filename Variable 1 } + { FilePath U8 } // ELLPath + { DeleteOnCompletion BOOL } + { UseBigPackets BOOL } + { VFileID LLUUID } + { VFileType S16 } + } +} + +// SendXferPacket - send an additional packet of an arbitrary xfer from sim -> viewer +{ + SendXferPacket High 18 NotTrusted Unencoded + { + XferID Single + { ID U64 } + { Packet U32 } + } + { + DataPacket Single + { Data Variable 2 } + } } // ConfirmXferPacket { - ConfirmXferPacket High 19 NotTrusted Unencoded - { - XferID Single - { ID U64 } - { Packet U32 } - } + ConfirmXferPacket High 19 NotTrusted Unencoded + { + XferID Single + { ID U64 } + { Packet U32 } + } } // AbortXfer { - AbortXfer Low 157 NotTrusted Unencoded - { - XferID Single - { ID U64 } - { Result S32 } - } + AbortXfer Low 157 NotTrusted Unencoded + { + XferID Single + { ID U64 } + { Result S32 } + } } //----------------------------------------------------------------------------- @@ -3559,198 +3591,198 @@ version 2.0 // AvatarAnimation - Update animation state -// simulator --> viewer -{ - AvatarAnimation High 20 Trusted Unencoded - { - Sender Single - { ID LLUUID } - } - { - AnimationList Variable - { AnimID LLUUID } - { AnimSequenceID S32 } - } - { - AnimationSourceList Variable - { ObjectID LLUUID } - } - { - PhysicalAvatarEventList Variable - { TypeData Variable 1 } - } +// simulator --> viewer +{ + AvatarAnimation High 20 Trusted Unencoded + { + Sender Single + { ID LLUUID } + } + { + AnimationList Variable + { AnimID LLUUID } + { AnimSequenceID S32 } + } + { + AnimationSourceList Variable + { ObjectID LLUUID } + } + { + PhysicalAvatarEventList Variable + { TypeData Variable 1 } + } } + // AvatarAppearance - Update visual params { - AvatarAppearance Low 158 Trusted Zerocoded - { - Sender Single - { ID LLUUID } - { IsTrial BOOL } - } - { - ObjectData Single - { TextureEntry Variable 2 } - } - { - VisualParam Variable - { ParamValue U8 } - } - { - AppearanceData Variable - { AppearanceVersion U8 } - { CofVersion S32 } - { Flags U32 } - } - { - AppearanceHover Variable - { HoverHeight LLVector3 } - } - { - AttachmentBlock Variable - { ID LLUUID } - { AttachmentPoint U8 } - } + AvatarAppearance Low 158 Trusted Zerocoded + { + Sender Single + { ID LLUUID } + { IsTrial BOOL } + } + { + ObjectData Single + { TextureEntry Variable 2 } + } + { + VisualParam Variable + { ParamValue U8 } + } + { + AppearanceData Variable + { AppearanceVersion U8 } + { CofVersion S32 } + { Flags U32 } + } + { + AppearanceHover Variable + { HoverHeight LLVector3 } + } + { + AttachmentBlock Variable + { ID LLUUID } + { AttachmentPoint U8 } + } } // AvatarSitResponse - response to a request to sit on an object { - AvatarSitResponse High 21 Trusted Zerocoded - { - SitObject Single - { ID LLUUID } - } - { - SitTransform Single - { AutoPilot BOOL } - { SitPosition LLVector3 } - { SitRotation LLQuaternion } - { CameraEyeOffset LLVector3 } - { CameraAtOffset LLVector3 } - { ForceMouselook BOOL } - } + AvatarSitResponse High 21 Trusted Zerocoded + { + SitObject Single + { ID LLUUID } + } + { + SitTransform Single + { AutoPilot BOOL } + { SitPosition LLVector3 } + { SitRotation LLQuaternion } + { CameraEyeOffset LLVector3 } + { CameraAtOffset LLVector3 } + { ForceMouselook BOOL } + } } // SetFollowCamProperties -{ - SetFollowCamProperties Low 159 Trusted Unencoded - { - ObjectData Single - { ObjectID LLUUID } - } - { - CameraProperty Variable - { Type S32 } - { Value F32 } - } +{ + SetFollowCamProperties Low 159 Trusted Unencoded + { + ObjectData Single + { ObjectID LLUUID } + } + { + CameraProperty Variable + { Type S32 } + { Value F32 } + } } // ClearFollowCamProperties { - ClearFollowCamProperties Low 160 Trusted Unencoded - { - ObjectData Single - { ObjectID LLUUID } - } + ClearFollowCamProperties Low 160 Trusted Unencoded + { + ObjectData Single + { ObjectID LLUUID } + } } // CameraConstraint - new camera distance limit (based on collision with objects) { - CameraConstraint High 22 Trusted Zerocoded - { - CameraCollidePlane Single - { Plane LLVector4 } - } -} + CameraConstraint High 22 Trusted Zerocoded + { + CameraCollidePlane Single + { Plane LLVector4 } + } +} // ObjectProperties // Extended information such as creator, permissions, etc. // Medium because potentially driven by mouse hover events. { - ObjectProperties Medium 9 Trusted Zerocoded - { - ObjectData Variable - { ObjectID LLUUID } - { CreatorID LLUUID } - { OwnerID LLUUID } - { GroupID LLUUID } - { CreationDate U64 } - { BaseMask U32 } - { OwnerMask U32 } - { GroupMask U32 } - { EveryoneMask U32 } - { NextOwnerMask U32 } - { OwnershipCost S32 } -// { TaxRate F32 } // F32 - { SaleType U8 } // U8 -> EForSale - { SalePrice S32 } - { AggregatePerms U8 } - { AggregatePermTextures U8 } - { AggregatePermTexturesOwner U8 } - { Category U32 } // LLCategory - { InventorySerial S16 } // S16 - { ItemID LLUUID } - { FolderID LLUUID } - { FromTaskID LLUUID } - { LastOwnerID LLUUID } - { Name Variable 1 } - { Description Variable 1 } - { TouchName Variable 1 } - { SitName Variable 1 } - { TextureID Variable 1 } - } + ObjectProperties Medium 9 Trusted Zerocoded + { + ObjectData Variable + { ObjectID LLUUID } + { CreatorID LLUUID } + { OwnerID LLUUID } + { GroupID LLUUID } + { CreationDate U64 } + { BaseMask U32 } + { OwnerMask U32 } + { GroupMask U32 } + { EveryoneMask U32 } + { NextOwnerMask U32 } + { OwnershipCost S32 } +// { TaxRate F32 } // F32 + { SaleType U8 } // U8 -> EForSale + { SalePrice S32 } + { AggregatePerms U8 } + { AggregatePermTextures U8 } + { AggregatePermTexturesOwner U8 } + { Category U32 } // LLCategory + { InventorySerial S16 } // S16 + { ItemID LLUUID } + { FolderID LLUUID } + { FromTaskID LLUUID } + { LastOwnerID LLUUID } + { Name Variable 1 } + { Description Variable 1 } + { TouchName Variable 1 } + { SitName Variable 1 } + { TextureID Variable 1 } + } } // ObjectPropertiesFamily // Medium because potentially driven by mouse hover events. { - ObjectPropertiesFamily Medium 10 Trusted Zerocoded - { - ObjectData Single - { RequestFlags U32 } - { ObjectID LLUUID } - { OwnerID LLUUID } - { GroupID LLUUID } - { BaseMask U32 } - { OwnerMask U32 } - { GroupMask U32 } - { EveryoneMask U32 } - { NextOwnerMask U32 } - { OwnershipCost S32 } - { SaleType U8 } // U8 -> EForSale - { SalePrice S32 } - { Category U32 } // LLCategory - { LastOwnerID LLUUID } - { Name Variable 1 } - { Description Variable 1 } - } + ObjectPropertiesFamily Medium 10 Trusted Zerocoded + { + ObjectData Single + { RequestFlags U32 } + { ObjectID LLUUID } + { OwnerID LLUUID } + { GroupID LLUUID } + { BaseMask U32 } + { OwnerMask U32 } + { GroupMask U32 } + { EveryoneMask U32 } + { NextOwnerMask U32 } + { OwnershipCost S32 } + { SaleType U8 } // U8 -> EForSale + { SalePrice S32 } + { Category U32 } // LLCategory + { LastOwnerID LLUUID } + { Name Variable 1 } + { Description Variable 1 } + } } // RequestPayPrice // viewer -> sim { - RequestPayPrice Low 161 NotTrusted Unencoded - { - ObjectData Single - { ObjectID LLUUID } - } + RequestPayPrice Low 161 NotTrusted Unencoded + { + ObjectData Single + { ObjectID LLUUID } + } } // PayPriceReply // sim -> viewer { - PayPriceReply Low 162 Trusted Unencoded - { - ObjectData Single - { ObjectID LLUUID } - { DefaultPayPrice S32 } - } - { - ButtonData Variable - - { PayButton S32 } - } + PayPriceReply Low 162 Trusted Unencoded + { + ObjectData Single + { ObjectID LLUUID } + { DefaultPayPrice S32 } + } + { + ButtonData Variable + { PayButton S32 } + } } // KickUser @@ -3760,29 +3792,29 @@ version 2.0 // ROUTED dataserver -> userserver -> spaceserver -> simulator -> viewer // reliable, but that may not matter if a system component is quitting { - KickUser Low 163 Trusted Unencoded - { - TargetBlock Single - { TargetIP IPADDR } // U32 encoded IP - { TargetPort IPPORT } - } - { - UserInfo Single - { AgentID LLUUID } - { SessionID LLUUID } - { Reason Variable 2 } // string - } + KickUser Low 163 Trusted Unencoded + { + TargetBlock Single + { TargetIP IPADDR } // U32 encoded IP + { TargetPort IPPORT } + } + { + UserInfo Single + { AgentID LLUUID } + { SessionID LLUUID } + { Reason Variable 2 } // string + } } // ack sent from the simulator up to the main database so that login // can continue. { - KickUserAck Low 164 Trusted Unencoded - { - UserInfo Single - { SessionID LLUUID } - { Flags U32 } - } + KickUserAck Low 164 Trusted Unencoded + { + UserInfo Single + { SessionID LLUUID } + { Flags U32 } + } } // GodKickUser @@ -3790,42 +3822,42 @@ version 2.0 // viewer -> sim // reliable { - GodKickUser Low 165 NotTrusted Unencoded - { - UserInfo Single - { GodID LLUUID } - { GodSessionID LLUUID } - { AgentID LLUUID } - { KickFlags U32 } - { Reason Variable 2 } // string - } + GodKickUser Low 165 NotTrusted Unencoded + { + UserInfo Single + { GodID LLUUID } + { GodSessionID LLUUID } + { AgentID LLUUID } + { KickFlags U32 } + { Reason Variable 2 } // string + } } // SystemKickUser // user->space, reliable { - SystemKickUser Low 166 Trusted Unencoded - { - AgentInfo Variable - { AgentID LLUUID } - } + SystemKickUser Low 166 Trusted Unencoded + { + AgentInfo Variable + { AgentID LLUUID } + } } // EjectUser // viewer -> sim // reliable { - EjectUser Low 167 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Data Single - { TargetID LLUUID } - { Flags U32 } - } + EjectUser Low 167 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Data Single + { TargetID LLUUID } + { Flags U32 } + } } // FreezeUser @@ -3833,17 +3865,17 @@ version 2.0 // viewer -> sim // reliable { - FreezeUser Low 168 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Data Single - { TargetID LLUUID } - { Flags U32 } - } + FreezeUser Low 168 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Data Single + { TargetID LLUUID } + { Flags U32 } + } } @@ -3851,68 +3883,68 @@ version 2.0 // viewer -> simulator // reliable { - AvatarPropertiesRequest Low 169 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { AvatarID LLUUID } - } + AvatarPropertiesRequest Low 169 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { AvatarID LLUUID } + } } // AvatarPropertiesRequestBackend // simulator -> dataserver // reliable { - AvatarPropertiesRequestBackend Low 170 Trusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { AvatarID LLUUID } - { GodLevel U8 } - { WebProfilesDisabled BOOL } - } + AvatarPropertiesRequestBackend Low 170 Trusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { AvatarID LLUUID } + { GodLevel U8 } + { WebProfilesDisabled BOOL } + } } // AvatarPropertiesReply // dataserver -> simulator // simulator -> viewer // reliable { - AvatarPropertiesReply Low 171 Trusted Zerocoded - { - AgentData Single - { AgentID LLUUID } // your id - { AvatarID LLUUID } // avatar you're asking about - } - { - PropertiesData Single - { ImageID LLUUID } - { FLImageID LLUUID } - { PartnerID LLUUID } - { AboutText Variable 2 } // string, up to 512 - { FLAboutText Variable 1 } // string - { BornOn Variable 1 } // string - { ProfileURL Variable 1 } // string - { CharterMember Variable 1 } // special - usually U8 - { Flags U32 } - } -} - -{ - AvatarInterestsReply Low 172 Trusted Zerocoded - { - AgentData Single - { AgentID LLUUID } // your id - { AvatarID LLUUID } // avatar you're asking about - } - { - PropertiesData Single - { WantToMask U32 } - { WantToText Variable 1 } // string - { SkillsMask U32 } - { SkillsText Variable 1 } // string - { LanguagesText Variable 1 } // string - } + AvatarPropertiesReply Low 171 Trusted Zerocoded + { + AgentData Single + { AgentID LLUUID } // your id + { AvatarID LLUUID } // avatar you're asking about + } + { + PropertiesData Single + { ImageID LLUUID } + { FLImageID LLUUID } + { PartnerID LLUUID } + { AboutText Variable 2 } // string, up to 512 + { FLAboutText Variable 1 } // string + { BornOn Variable 1 } // string + { ProfileURL Variable 1 } // string + { CharterMember Variable 1 } // special - usually U8 + { Flags U32 } + } +} + +{ + AvatarInterestsReply Low 172 Trusted Zerocoded + { + AgentData Single + { AgentID LLUUID } // your id + { AvatarID LLUUID } // avatar you're asking about + } + { + PropertiesData Single + { WantToMask U32 } + { WantToText Variable 1 } // string + { SkillsMask U32 } + { SkillsText Variable 1 } // string + { LanguagesText Variable 1 } // string + } } // AvatarGroupsReply @@ -3920,25 +3952,25 @@ version 2.0 // simulator -> viewer // reliable { - AvatarGroupsReply Low 173 Trusted Zerocoded - { - AgentData Single - { AgentID LLUUID } // your id - { AvatarID LLUUID } // avatar you're asking about - } - { - GroupData Variable - { GroupPowers U64 } - { AcceptNotices BOOL } - { GroupTitle Variable 1 } - { GroupID LLUUID } - { GroupName Variable 1 } - { GroupInsigniaID LLUUID } - } - { - NewGroupData Single - { ListInProfile BOOL } // whether group displays in profile - } + AvatarGroupsReply Low 173 Trusted Zerocoded + { + AgentData Single + { AgentID LLUUID } // your id + { AvatarID LLUUID } // avatar you're asking about + } + { + GroupData Variable + { GroupPowers U64 } + { AcceptNotices BOOL } + { GroupTitle Variable 1 } + { GroupID LLUUID } + { GroupName Variable 1 } + { GroupInsigniaID LLUUID } + } + { + NewGroupData Single + { ListInProfile BOOL } // whether group displays in profile + } } @@ -3946,42 +3978,42 @@ version 2.0 // viewer -> simulator // reliable { - AvatarPropertiesUpdate Low 174 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - PropertiesData Single - { ImageID LLUUID } - { FLImageID LLUUID } - { AboutText Variable 2 } // string, up to 512 - { FLAboutText Variable 1 } - { AllowPublish BOOL } // whether profile is externally visible or not - { MaturePublish BOOL } // profile is "mature" - { ProfileURL Variable 1 } // string - } + AvatarPropertiesUpdate Low 174 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + PropertiesData Single + { ImageID LLUUID } + { FLImageID LLUUID } + { AboutText Variable 2 } // string, up to 512 + { FLAboutText Variable 1 } + { AllowPublish BOOL } // whether profile is externally visible or not + { MaturePublish BOOL } // profile is "mature" + { ProfileURL Variable 1 } // string + } } // AvatarInterestsUpdate // viewer -> simulator // reliable { - AvatarInterestsUpdate Low 175 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - PropertiesData Single - { WantToMask U32 } - { WantToText Variable 1 } // string - { SkillsMask U32 } - { SkillsText Variable 1 } // string - { LanguagesText Variable 1 } // string - } + AvatarInterestsUpdate Low 175 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + PropertiesData Single + { WantToMask U32 } + { WantToText Variable 1 } // string + { SkillsMask U32 } + { SkillsText Variable 1 } // string + { LanguagesText Variable 1 } // string + } } @@ -3991,16 +4023,16 @@ version 2.0 // simulator -> viewer // reliable { - AvatarNotesReply Low 176 Trusted Unencoded - { - AgentData Single - { AgentID LLUUID } - } - { - Data Single - { TargetID LLUUID } - { Notes Variable 2 } // string - } + AvatarNotesReply Low 176 Trusted Unencoded + { + AgentData Single + { AgentID LLUUID } + } + { + Data Single + { TargetID LLUUID } + { Notes Variable 2 } // string + } } @@ -4008,17 +4040,17 @@ version 2.0 // viewer -> simulator -> dataserver // reliable { - AvatarNotesUpdate Low 177 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Data Single - { TargetID LLUUID } - { Notes Variable 2 } // string - } + AvatarNotesUpdate Low 177 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Data Single + { TargetID LLUUID } + { Notes Variable 2 } // string + } } @@ -4028,17 +4060,17 @@ version 2.0 // This fills in the tabs of the Picks panel. // reliable { - AvatarPicksReply Low 178 Trusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { TargetID LLUUID } - } - { - Data Variable - { PickID LLUUID } - { PickName Variable 1 } // string - } + AvatarPicksReply Low 178 Trusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { TargetID LLUUID } + } + { + Data Variable + { PickID LLUUID } + { PickName Variable 1 } // string + } } @@ -4047,16 +4079,16 @@ version 2.0 // simulator -> dataserver // reliable { - EventInfoRequest Low 179 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - EventData Single - { EventID U32 } - } + EventInfoRequest Low 179 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + EventData Single + { EventID U32 } + } } @@ -4065,27 +4097,27 @@ version 2.0 // simulator -> viewer // reliable { - EventInfoReply Low 180 Trusted Unencoded - { - AgentData Single - { AgentID LLUUID } - } - { - EventData Single - { EventID U32 } - { Creator Variable 1 } - { Name Variable 1 } - { Category Variable 1 } - { Desc Variable 2 } - { Date Variable 1 } - { DateUTC U32 } - { Duration U32 } - { Cover U32 } - { Amount U32 } - { SimName Variable 1 } - { GlobalPos LLVector3d } - { EventFlags U32 } - } + EventInfoReply Low 180 Trusted Unencoded + { + AgentData Single + { AgentID LLUUID } + } + { + EventData Single + { EventID U32 } + { Creator Variable 1 } + { Name Variable 1 } + { Category Variable 1 } + { Desc Variable 2 } + { Date Variable 1 } + { DateUTC U32 } + { Duration U32 } + { Cover U32 } + { Amount U32 } + { SimName Variable 1 } + { GlobalPos LLVector3d } + { EventFlags U32 } + } } @@ -4094,16 +4126,16 @@ version 2.0 // simulator -> dataserver // reliable { - EventNotificationAddRequest Low 181 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - EventData Single - { EventID U32 } - } + EventNotificationAddRequest Low 181 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + EventData Single + { EventID U32 } + } } @@ -4112,16 +4144,16 @@ version 2.0 // simulator -> dataserver // reliable { - EventNotificationRemoveRequest Low 182 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - EventData Single - { EventID U32 } - } + EventNotificationRemoveRequest Low 182 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + EventData Single + { EventID U32 } + } } // EventGodDelete @@ -4130,23 +4162,23 @@ version 2.0 // QueryData is used to resend a search result after the deletion // reliable { - EventGodDelete Low 183 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - EventData Single - { EventID U32 } - } - { - QueryData Single - { QueryID LLUUID } - { QueryText Variable 1 } - { QueryFlags U32 } - { QueryStart S32 } // prev/next page support - } + EventGodDelete Low 183 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + EventData Single + { EventID U32 } + } + { + QueryData Single + { QueryID LLUUID } + { QueryText Variable 1 } + { QueryFlags U32 } + { QueryStart S32 } // prev/next page support + } } @@ -4155,26 +4187,26 @@ version 2.0 // simulator -> viewer // reliable { - PickInfoReply Low 184 Trusted Unencoded + PickInfoReply Low 184 Trusted Unencoded { - AgentData Single - { AgentID LLUUID } + AgentData Single + { AgentID LLUUID } } { - Data Single - { PickID LLUUID } - { CreatorID LLUUID } - { TopPick BOOL } - { ParcelID LLUUID } - { Name Variable 1 } - { Desc Variable 2 } - { SnapshotID LLUUID } - { User Variable 1 } - { OriginalName Variable 1 } - { SimName Variable 1 } - { PosGlobal LLVector3d } - { SortOrder S32 } - { Enabled BOOL } + Data Single + { PickID LLUUID } + { CreatorID LLUUID } + { TopPick BOOL } + { ParcelID LLUUID } + { Name Variable 1 } + { Desc Variable 2 } + { SnapshotID LLUUID } + { User Variable 1 } + { OriginalName Variable 1 } + { SimName Variable 1 } + { PosGlobal LLVector3d } + { SortOrder S32 } + { Enabled BOOL } } } @@ -4187,25 +4219,25 @@ version 2.0 // viewer -> simulator -> dataserver // reliable { - PickInfoUpdate Low 185 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Data Single - { PickID LLUUID } - { CreatorID LLUUID } - { TopPick BOOL } - { ParcelID LLUUID } - { Name Variable 1 } - { Desc Variable 2 } - { SnapshotID LLUUID } - { PosGlobal LLVector3d } - { SortOrder S32 } - { Enabled BOOL } - } + PickInfoUpdate Low 185 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Data Single + { PickID LLUUID } + { CreatorID LLUUID } + { TopPick BOOL } + { ParcelID LLUUID } + { Name Variable 1 } + { Desc Variable 2 } + { SnapshotID LLUUID } + { PosGlobal LLVector3d } + { SortOrder S32 } + { Enabled BOOL } + } } @@ -4214,92 +4246,92 @@ version 2.0 // viewer -> simulator -> dataserver // reliable { - PickDelete Low 186 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Data Single - { PickID LLUUID } - } + PickDelete Low 186 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Data Single + { PickID LLUUID } + } } // PickGodDelete // Delete a pick from the database. -// QueryID is needed so database can send a repeat list of +// QueryID is needed so database can send a repeat list of // picks. // viewer -> simulator -> dataserver // reliable { - PickGodDelete Low 187 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Data Single - { PickID LLUUID } - { QueryID LLUUID } - } + PickGodDelete Low 187 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Data Single + { PickID LLUUID } + { QueryID LLUUID } + } } // ScriptQuestion // reliable { - ScriptQuestion Low 188 Trusted Unencoded - { - Data Single - { TaskID LLUUID } - { ItemID LLUUID } - { ObjectName Variable 1 } - { ObjectOwner Variable 1 } - { Questions S32 } - } - { - Experience Single - { ExperienceID LLUUID } - } + ScriptQuestion Low 188 Trusted Unencoded + { + Data Single + { TaskID LLUUID } + { ItemID LLUUID } + { ObjectName Variable 1 } + { ObjectOwner Variable 1 } + { Questions S32 } + } + { + Experience Single + { ExperienceID LLUUID } + } } // ScriptControlChange // reliable { - ScriptControlChange Low 189 Trusted Unencoded - { - Data Variable - { TakeControls BOOL } - { Controls U32 } - { PassToAgent BOOL } - } + ScriptControlChange Low 189 Trusted Unencoded + { + Data Variable + { TakeControls BOOL } + { Controls U32 } + { PassToAgent BOOL } + } } // ScriptDialog // sim -> viewer // reliable { - ScriptDialog Low 190 Trusted Zerocoded - { - Data Single - { ObjectID LLUUID } - { FirstName Variable 1 } - { LastName Variable 1 } - { ObjectName Variable 1 } - { Message Variable 2 } - { ChatChannel S32 } - { ImageID LLUUID } - } - { - Buttons Variable - { ButtonLabel Variable 1 } - } - { - OwnerData Variable - { OwnerID LLUUID } - } + ScriptDialog Low 190 Trusted Zerocoded + { + Data Single + { ObjectID LLUUID } + { FirstName Variable 1 } + { LastName Variable 1 } + { ObjectName Variable 1 } + { Message Variable 2 } + { ChatChannel S32 } + { ImageID LLUUID } + } + { + Buttons Variable + { ButtonLabel Variable 1 } + } + { + OwnerData Variable + { OwnerID LLUUID } + } } @@ -4307,47 +4339,47 @@ version 2.0 // viewer -> sim // reliable { - ScriptDialogReply Low 191 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Data Single - { ObjectID LLUUID } - { ChatChannel S32 } - { ButtonIndex S32 } - { ButtonLabel Variable 1 } - } + ScriptDialogReply Low 191 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Data Single + { ObjectID LLUUID } + { ChatChannel S32 } + { ButtonIndex S32 } + { ButtonLabel Variable 1 } + } } // ForceScriptControlRelease // reliable { - ForceScriptControlRelease Low 192 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } + ForceScriptControlRelease Low 192 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } } // RevokePermissions // reliable { - RevokePermissions Low 193 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Data Single - { ObjectID LLUUID } - { ObjectPermissions U32 } - } + RevokePermissions Low 193 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Data Single + { ObjectID LLUUID } + { ObjectPermissions U32 } + } } // LoadURL @@ -4355,28 +4387,31 @@ version 2.0 // Ask the user if they would like to load a URL // reliable { - LoadURL Low 194 Trusted Unencoded - { - Data Single - { ObjectName Variable 1 } - { ObjectID LLUUID } - { OwnerID LLUUID } - { OwnerIsGroup BOOL } - { Message Variable 1 } - { URL Variable 1 } - } + LoadURL Low 194 Trusted Unencoded + { + Data Single + { ObjectName Variable 1 } + { ObjectID LLUUID } + { OwnerID LLUUID } + { OwnerIsGroup BOOL } + { Message Variable 1 } + { URL Variable 1 } + } } // ScriptTeleportRequest +// Interestingly, this message does not actually "Request a Teleport" +// on the viewer. Instead it opens the world map and places a beacon +// at the indicated location. // reliable { ScriptTeleportRequest Low 195 Trusted Unencoded { - Data Single - { ObjectName Variable 1 } - { SimName Variable 1 } - { SimPosition LLVector3 } - { LookAt LLVector3 } + Data Single + { ObjectName Variable 1 } + { SimName Variable 1 } + { SimPosition LLVector3 } + { LookAt LLVector3 } } { Options Variable @@ -4399,12 +4434,12 @@ version 2.0 // sim -> viewer // reliable { - ParcelOverlay Low 196 Trusted Zerocoded - { - ParcelData Single - { SequenceID S32 } // 0...3, which piece of region - { Data Variable 2 } // packed bit-field, (grids*grids)/N - } + ParcelOverlay Low 196 Trusted Zerocoded + { + ParcelData Single + { SequenceID S32 } // 0...3, which piece of region + { Data Variable 2 } // packed bit-field, (grids*grids)/N + } } @@ -4414,38 +4449,38 @@ version 2.0 // viewer -> sim // reliable { - ParcelPropertiesRequest Medium 11 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ParcelData Single - { SequenceID S32 } - { West F32 } - { South F32 } - { East F32 } - { North F32 } - { SnapSelection BOOL } - } + ParcelPropertiesRequest Medium 11 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ParcelData Single + { SequenceID S32 } + { West F32 } + { South F32 } + { East F32 } + { North F32 } + { SnapSelection BOOL } + } } // ParcelPropertiesRequestByID // viewer -> sim // reliable { - ParcelPropertiesRequestByID Low 197 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ParcelData Single - { SequenceID S32 } - { LocalID S32 } - } + ParcelPropertiesRequestByID Low 197 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ParcelData Single + { SequenceID S32 } + { LocalID S32 } + } } // ParcelProperties @@ -4458,68 +4493,69 @@ version 2.0 // WARNING: This packet is potentially large. With max length name, // description, music URL and media URL, it is 1526 + sizeof ( LLUUID ) bytes. { - ParcelProperties High 23 Trusted Zerocoded - { - ParcelData Single - { RequestResult S32 } - { SequenceID S32 } - { SnapSelection BOOL } - { SelfCount S32 } - { OtherCount S32 } - { PublicCount S32 } - { LocalID S32 } - { OwnerID LLUUID } - { IsGroupOwned BOOL } - { AuctionID U32 } - { ClaimDate S32 } // time_t - { ClaimPrice S32 } - { RentPrice S32 } - { AABBMin LLVector3 } - { AABBMax LLVector3 } - { Bitmap Variable 2 } // packed bit-field - { Area S32 } - { Status U8 } // owned vs. pending - { SimWideMaxPrims S32 } - { SimWideTotalPrims S32 } - { MaxPrims S32 } - { TotalPrims S32 } - { OwnerPrims S32 } - { GroupPrims S32 } - { OtherPrims S32 } - { SelectedPrims S32 } - { ParcelPrimBonus F32 } - - { OtherCleanTime S32 } - - { ParcelFlags U32 } - { SalePrice S32 } - { Name Variable 1 } // string - { Desc Variable 1 } // string - { MusicURL Variable 1 } // string - { MediaURL Variable 1 } // string - { MediaID LLUUID } - { MediaAutoScale U8 } - { GroupID LLUUID } - { PassPrice S32 } - { PassHours F32 } - { Category U8 } - { AuthBuyerID LLUUID } - { SnapshotID LLUUID } - { UserLocation LLVector3 } - { UserLookAt LLVector3 } - { LandingType U8 } - { RegionPushOverride BOOL } - { RegionDenyAnonymous BOOL } - { RegionDenyIdentified BOOL } - { RegionDenyTransacted BOOL } - } - { - AgeVerificationBlock Single - { RegionDenyAgeUnverified BOOL } - } + ParcelProperties High 23 Trusted Zerocoded UDPDeprecated + { + ParcelData Single + { RequestResult S32 } + { SequenceID S32 } + { SnapSelection BOOL } + { SelfCount S32 } + { OtherCount S32 } + { PublicCount S32 } + { LocalID S32 } + { OwnerID LLUUID } + { IsGroupOwned BOOL } + { AuctionID U32 } + { ClaimDate S32 } // time_t + { ClaimPrice S32 } + { RentPrice S32 } + { AABBMin LLVector3 } + { AABBMax LLVector3 } + { Bitmap Variable 2 } // packed bit-field + { Area S32 } + { Status U8 } // owned vs. pending + { SimWideMaxPrims S32 } + { SimWideTotalPrims S32 } + { MaxPrims S32 } + { TotalPrims S32 } + { OwnerPrims S32 } + { GroupPrims S32 } + { OtherPrims S32 } + { SelectedPrims S32 } + { ParcelPrimBonus F32 } + + { OtherCleanTime S32 } + + { ParcelFlags U32 } + { SalePrice S32 } + { Name Variable 1 } // string + { Desc Variable 1 } // string + { MusicURL Variable 1 } // string + { MediaURL Variable 1 } // string + { MediaID LLUUID } + { MediaAutoScale U8 } + { GroupID LLUUID } + { PassPrice S32 } + { PassHours F32 } + { Category U8 } + { AuthBuyerID LLUUID } + { SnapshotID LLUUID } + { UserLocation LLVector3 } + { UserLookAt LLVector3 } + { LandingType U8 } + { RegionPushOverride BOOL } + { RegionDenyAnonymous BOOL } + { RegionDenyIdentified BOOL } + { RegionDenyTransacted BOOL } + // in llsd message, SeeAVs, GroupAVSounds and AnyAVSounds BOOLs are also sent + } + { + AgeVerificationBlock Single + { RegionDenyAgeUnverified BOOL } + } { RegionAllowAccessBlock Single - { RegionAllowAccessOverride BOOL } + { RegionAllowAccessOverride BOOL } } { ParcelEnvironmentBlock Single @@ -4532,77 +4568,77 @@ version 2.0 // viewer -> sim // reliable { - ParcelPropertiesUpdate Low 198 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ParcelData Single - { LocalID S32 } - { Flags U32 } - - { ParcelFlags U32 } - { SalePrice S32 } - { Name Variable 1 } // string - { Desc Variable 1 } // string - { MusicURL Variable 1 } // string - { MediaURL Variable 1 } // string - { MediaID LLUUID } - { MediaAutoScale U8 } - { GroupID LLUUID } - { PassPrice S32 } - { PassHours F32 } - { Category U8 } - { AuthBuyerID LLUUID } - { SnapshotID LLUUID } - { UserLocation LLVector3 } - { UserLookAt LLVector3 } - { LandingType U8 } - } + ParcelPropertiesUpdate Low 198 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ParcelData Single + { LocalID S32 } + { Flags U32 } + + { ParcelFlags U32 } + { SalePrice S32 } + { Name Variable 1 } // string + { Desc Variable 1 } // string + { MusicURL Variable 1 } // string + { MediaURL Variable 1 } // string + { MediaID LLUUID } + { MediaAutoScale U8 } + { GroupID LLUUID } + { PassPrice S32 } + { PassHours F32 } + { Category U8 } + { AuthBuyerID LLUUID } + { SnapshotID LLUUID } + { UserLocation LLVector3 } + { UserLookAt LLVector3 } + { LandingType U8 } + } } // ParcelReturnObjects // viewer -> sim // reliable { - ParcelReturnObjects Low 199 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ParcelData Single - { LocalID S32 } - { ReturnType U32 } - } - { - TaskIDs Variable - { TaskID LLUUID } - } - { - OwnerIDs Variable - { OwnerID LLUUID } - } + ParcelReturnObjects Low 199 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ParcelData Single + { LocalID S32 } + { ReturnType U32 } + } + { + TaskIDs Variable + { TaskID LLUUID } + } + { + OwnerIDs Variable + { OwnerID LLUUID } + } } // ParcelSetOtherCleanTime // viewer -> sim // reliable { - ParcelSetOtherCleanTime Low 200 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ParcelData Single - { LocalID S32 } - { OtherCleanTime S32 } - } + ParcelSetOtherCleanTime Low 200 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ParcelData Single + { LocalID S32 } + { OtherCleanTime S32 } + } } @@ -4611,25 +4647,25 @@ version 2.0 // viewer -> sim // reliable { - ParcelDisableObjects Low 201 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ParcelData Single - { LocalID S32 } - { ReturnType U32 } - } - { - TaskIDs Variable - { TaskID LLUUID } - } - { - OwnerIDs Variable - { OwnerID LLUUID } - } + ParcelDisableObjects Low 201 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ParcelData Single + { LocalID S32 } + { ReturnType U32 } + } + { + TaskIDs Variable + { TaskID LLUUID } + } + { + OwnerIDs Variable + { OwnerID LLUUID } + } } @@ -4637,21 +4673,21 @@ version 2.0 // viewer -> sim // reliable { - ParcelSelectObjects Low 202 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ParcelData Single - { LocalID S32 } - { ReturnType U32 } - } - { - ReturnIDs Variable - { ReturnID LLUUID } - } + ParcelSelectObjects Low 202 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ParcelData Single + { LocalID S32 } + { ReturnType U32 } + } + { + ReturnIDs Variable + { ReturnID LLUUID } + } } @@ -4660,11 +4696,11 @@ version 2.0 // reliable { EstateCovenantRequest Low 203 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } } // EstateCovenantReply @@ -4672,12 +4708,12 @@ version 2.0 // reliable { EstateCovenantReply Low 204 Trusted Unencoded - { - Data Single - { CovenantID LLUUID } - { CovenantTimestamp U32 } - { EstateName Variable 1 } // string - { EstateOwnerID LLUUID } + { + Data Single + { CovenantID LLUUID } + { CovenantTimestamp U32 } + { EstateName Variable 1 } // string + { EstateOwnerID LLUUID } } } @@ -4686,15 +4722,15 @@ version 2.0 // sim -> viewer // reliable { - ForceObjectSelect Low 205 Trusted Unencoded - { - Header Single - { ResetList BOOL } - } - { - Data Variable - { LocalID U32 } - } + ForceObjectSelect Low 205 Trusted Unencoded + { + Header Single + { ResetList BOOL } + } + { + Data Variable + { LocalID U32 } + } } @@ -4702,72 +4738,72 @@ version 2.0 // viewer -> sim // reliable { - ParcelBuyPass Low 206 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ParcelData Single - { LocalID S32 } - } + ParcelBuyPass Low 206 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ParcelData Single + { LocalID S32 } + } } // ParcelDeedToGroup - deed a patch of land to a group // viewer -> sim // reliable { - ParcelDeedToGroup Low 207 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Data Single - { GroupID LLUUID } - { LocalID S32 } // parcel id - } + ParcelDeedToGroup Low 207 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Data Single + { GroupID LLUUID } + { LocalID S32 } // parcel id + } } // reserved for when island owners force re-claim parcel { - ParcelReclaim Low 208 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Data Single - { LocalID S32 } // parcel id - } + ParcelReclaim Low 208 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Data Single + { LocalID S32 } // parcel id + } } // ParcelClaim - change the owner of a patch of land // viewer -> sim // reliable { - ParcelClaim Low 209 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Data Single - { GroupID LLUUID } - { IsGroupOwned BOOL } - { Final BOOL } // true if buyer is in tier - } - { - ParcelData Variable - { West F32 } - { South F32 } - { East F32 } - { North F32 } - } + ParcelClaim Low 209 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Data Single + { GroupID LLUUID } + { IsGroupOwned BOOL } + { Final BOOL } // true if buyer is in tier + } + { + ParcelData Variable + { West F32 } + { South F32 } + { East F32 } + { North F32 } + } } // ParcelJoin - Take all parcels which are owned by agent and inside @@ -4775,19 +4811,19 @@ version 2.0 // viewer -> sim // reliable { - ParcelJoin Low 210 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ParcelData Single - { West F32 } - { South F32 } - { East F32 } - { North F32 } - } + ParcelJoin Low 210 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ParcelData Single + { West F32 } + { South F32 } + { East F32 } + { North F32 } + } } // ParcelDivide @@ -4796,19 +4832,19 @@ version 2.0 // viewer -> sim // reliable { - ParcelDivide Low 211 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ParcelData Single - { West F32 } - { South F32 } - { East F32 } - { North F32 } - } + ParcelDivide Low 211 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ParcelData Single + { West F32 } + { South F32 } + { East F32 } + { North F32 } + } } // ParcelRelease @@ -4816,178 +4852,178 @@ version 2.0 // viewer -> sim // reliable { - ParcelRelease Low 212 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Data Single - { LocalID S32 } // parcel ID - } + ParcelRelease Low 212 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Data Single + { LocalID S32 } // parcel ID + } } // ParcelBuy - change the owner of a patch of land. // viewer -> sim // reliable { - ParcelBuy Low 213 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Data Single - { GroupID LLUUID } - { IsGroupOwned BOOL } - { RemoveContribution BOOL } - { LocalID S32 } - { Final BOOL } // true if buyer is in tier - } - { - ParcelData Single - { Price S32 } - { Area S32 } - } + ParcelBuy Low 213 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Data Single + { GroupID LLUUID } + { IsGroupOwned BOOL } + { RemoveContribution BOOL } + { LocalID S32 } + { Final BOOL } // true if buyer is in tier + } + { + ParcelData Single + { Price S32 } + { Area S32 } + } } // ParcelGodForceOwner Unencoded { - ParcelGodForceOwner Low 214 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Data Single - { OwnerID LLUUID } - { LocalID S32 } // parcel ID - } + ParcelGodForceOwner Low 214 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Data Single + { OwnerID LLUUID } + { LocalID S32 } // parcel ID + } } // viewer -> sim // ParcelAccessListRequest { - ParcelAccessListRequest Low 215 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Data Single - { SequenceID S32 } - { Flags U32 } - { LocalID S32 } - } + ParcelAccessListRequest Low 215 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Data Single + { SequenceID S32 } + { Flags U32 } + { LocalID S32 } + } } // sim -> viewer // ParcelAccessListReply { - ParcelAccessListReply Low 216 Trusted Zerocoded - { - Data Single - { AgentID LLUUID } - { SequenceID S32 } - { Flags U32 } - { LocalID S32 } - } - { - List Variable - { ID LLUUID } - { Time S32 } // time_t - { Flags U32 } - } + ParcelAccessListReply Low 216 Trusted Zerocoded + { + Data Single + { AgentID LLUUID } + { SequenceID S32 } + { Flags U32 } + { LocalID S32 } + } + { + List Variable + { ID LLUUID } + { Time S32 } // time_t + { Flags U32 } + } } // viewer -> sim // ParcelAccessListUpdate { - ParcelAccessListUpdate Low 217 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Data Single - { Flags U32 } - { LocalID S32 } - { TransactionID LLUUID } - { SequenceID S32 } - { Sections S32 } - } - { - List Variable - { ID LLUUID } - { Time S32 } // time_t - { Flags U32 } - } + ParcelAccessListUpdate Low 217 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Data Single + { Flags U32 } + { LocalID S32 } + { TransactionID LLUUID } + { SequenceID S32 } + { Sections S32 } + } + { + List Variable + { ID LLUUID } + { Time S32 } // time_t + { Flags U32 } + } } // viewer -> sim -> dataserver // reliable { - ParcelDwellRequest Low 218 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Data Single - { LocalID S32 } - { ParcelID LLUUID } // filled in on sim - } + ParcelDwellRequest Low 218 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Data Single + { LocalID S32 } + { ParcelID LLUUID } // filled in on sim + } } // dataserver -> sim -> viewer // reliable { - ParcelDwellReply Low 219 Trusted Unencoded - { - AgentData Single - { AgentID LLUUID } - } - { - Data Single - { LocalID S32 } - { ParcelID LLUUID } - { Dwell F32 } - } + ParcelDwellReply Low 219 Trusted Unencoded + { + AgentData Single + { AgentID LLUUID } + } + { + Data Single + { LocalID S32 } + { ParcelID LLUUID } + { Dwell F32 } + } } // sim -> dataserver // This message is used to check if a user can buy a parcel. If // successful, the transaction is approved through a money balance reply -// with the same transaction id. -{ - RequestParcelTransfer Low 220 Trusted Zerocoded - { - Data Single - { TransactionID LLUUID } - { TransactionTime U32 } // utc seconds since epoch - { SourceID LLUUID } - { DestID LLUUID } - { OwnerID LLUUID } - { Flags U8 } // see lltransactiontypes.h - { TransactionType S32 } // see lltransactiontypes.h - { Amount S32 } - { BillableArea S32 } - { ActualArea S32 } - { Final BOOL } // true if buyer should be in tier - } - { - RegionData Single // included so region name shows up in transaction logs +// with the same transaction id. +{ + RequestParcelTransfer Low 220 Trusted Zerocoded + { + Data Single + { TransactionID LLUUID } + { TransactionTime U32 } // utc seconds since epoch + { SourceID LLUUID } + { DestID LLUUID } + { OwnerID LLUUID } + { Flags U8 } // see lltransactiontypes.h + { TransactionType S32 } // see lltransactiontypes.h + { Amount S32 } + { BillableArea S32 } + { ActualArea S32 } + { Final BOOL } // true if buyer should be in tier + } + { + RegionData Single // included so region name shows up in transaction logs { RegionID LLUUID } { GridX U32 } { GridY U32 } @@ -5000,114 +5036,114 @@ version 2.0 // If you add something here, you should probably also change the // simulator's database update query on startup. { - UpdateParcel Low 221 Trusted Zerocoded - { - ParcelData Single - { ParcelID LLUUID } - { RegionHandle U64 } - { OwnerID LLUUID } - { GroupOwned BOOL } - { Status U8 } - { Name Variable 1 } - { Description Variable 1 } - { MusicURL Variable 1 } - { RegionX F32 } - { RegionY F32 } - { ActualArea S32 } - { BillableArea S32 } - { ShowDir BOOL } - { IsForSale BOOL } - { Category U8 } - { SnapshotID LLUUID } - { UserLocation LLVector3 } - { SalePrice S32 } - { AuthorizedBuyerID LLUUID } - { AllowPublish BOOL } - { MaturePublish BOOL } - } + UpdateParcel Low 221 Trusted Zerocoded + { + ParcelData Single + { ParcelID LLUUID } + { RegionHandle U64 } + { OwnerID LLUUID } + { GroupOwned BOOL } + { Status U8 } + { Name Variable 1 } + { Description Variable 1 } + { MusicURL Variable 1 } + { RegionX F32 } + { RegionY F32 } + { ActualArea S32 } + { BillableArea S32 } + { ShowDir BOOL } + { IsForSale BOOL } + { Category U8 } + { SnapshotID LLUUID } + { UserLocation LLVector3 } + { SalePrice S32 } + { AuthorizedBuyerID LLUUID } + { AllowPublish BOOL } + { MaturePublish BOOL } + } } // sim -> dataserver or space ->sim // This message is used to tell the dataserver that a parcel has been // removed. { - RemoveParcel Low 222 Trusted Unencoded - { - ParcelData Variable - { ParcelID LLUUID } - } + RemoveParcel Low 222 Trusted Unencoded + { + ParcelData Variable + { ParcelID LLUUID } + } } // sim -> dataserver // Merges some of the database information for parcels (dwell). { - MergeParcel Low 223 Trusted Unencoded - { - MasterParcelData Single - { MasterID LLUUID } - } - { - SlaveParcelData Variable - { SlaveID LLUUID } - } + MergeParcel Low 223 Trusted Unencoded + { + MasterParcelData Single + { MasterID LLUUID } + } + { + SlaveParcelData Variable + { SlaveID LLUUID } + } } // sim -> dataserver { - LogParcelChanges Low 224 Trusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - } - { - RegionData Single - { RegionHandle U64 } - } - { - ParcelData Variable - { ParcelID LLUUID } - { OwnerID LLUUID } - { IsOwnerGroup BOOL } - { ActualArea S32 } - { Action S8 } - { TransactionID LLUUID } - } -} + LogParcelChanges Low 224 Trusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + } + { + RegionData Single + { RegionHandle U64 } + } + { + ParcelData Variable + { ParcelID LLUUID } + { OwnerID LLUUID } + { IsOwnerGroup BOOL } + { ActualArea S32 } + { Action S8 } + { TransactionID LLUUID } + } +} // sim -> dataserver { - CheckParcelSales Low 225 Trusted Unencoded - { - RegionData Variable - { RegionHandle U64 } - } + CheckParcelSales Low 225 Trusted Unencoded + { + RegionData Variable + { RegionHandle U64 } + } } // dataserver -> simulator // tell a particular simulator to finish parcel sale. { - ParcelSales Low 226 Trusted Unencoded - { - ParcelData Variable - { ParcelID LLUUID } - { BuyerID LLUUID } - } + ParcelSales Low 226 Trusted Unencoded + { + ParcelData Variable + { ParcelID LLUUID } + { BuyerID LLUUID } + } } // viewer -> sim // mark parcel and double secret agent content on parcel as owned by // governor/maint and adjusts permissions approriately. Godlike request. { - ParcelGodMarkAsContent Low 227 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ParcelData Single - { LocalID S32 } - } + ParcelGodMarkAsContent Low 227 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ParcelData Single + { LocalID S32 } + } } @@ -5116,82 +5152,82 @@ version 2.0 // validates and fills in the rest of the information to start an auction // on a parcel. Processing currently requires that AgentID is a god. { - ViewerStartAuction Low 228 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ParcelData Single - { LocalID S32 } - { SnapshotID LLUUID } - } + ViewerStartAuction Low 228 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ParcelData Single + { LocalID S32 } + { SnapshotID LLUUID } + } } // sim -> dataserver -// Once all of the data has been gathered, +// Once all of the data has been gathered, { - StartAuction Low 229 Trusted Unencoded - { - AgentData Single - { AgentID LLUUID } - } - { - ParcelData Single - { ParcelID LLUUID } - { SnapshotID LLUUID } - { Name Variable 1 } // string - } + StartAuction Low 229 Trusted Unencoded + { + AgentData Single + { AgentID LLUUID } + } + { + ParcelData Single + { ParcelID LLUUID } + { SnapshotID LLUUID } + { Name Variable 1 } // string + } } // dataserver -> sim { - ConfirmAuctionStart Low 230 Trusted Unencoded - { - AuctionData Single - { ParcelID LLUUID } - { AuctionID U32 } - } + ConfirmAuctionStart Low 230 Trusted Unencoded + { + AuctionData Single + { ParcelID LLUUID } + { AuctionID U32 } + } } // sim -> dataserver // Tell the dataserver that an auction has completed. { - CompleteAuction Low 231 Trusted Unencoded - { - ParcelData Variable - { ParcelID LLUUID } - } + CompleteAuction Low 231 Trusted Unencoded + { + ParcelData Variable + { ParcelID LLUUID } + } } // Tell the dataserver that an auction has been canceled. { - CancelAuction Low 232 Trusted Unencoded - { - ParcelData Variable - { ParcelID LLUUID } - } + CancelAuction Low 232 Trusted Unencoded + { + ParcelData Variable + { ParcelID LLUUID } + } } // sim -> dataserver { - CheckParcelAuctions Low 233 Trusted Unencoded - { - RegionData Variable - { RegionHandle U64 } - } + CheckParcelAuctions Low 233 Trusted Unencoded + { + RegionData Variable + { RegionHandle U64 } + } } // dataserver -> sim // tell a particular simulator to finish parcel sale. { - ParcelAuctions Low 234 Trusted Unencoded - { - ParcelData Variable - { ParcelID LLUUID } - { WinnerID LLUUID } - } + ParcelAuctions Low 234 Trusted Unencoded + { + ParcelData Variable + { ParcelID LLUUID } + { WinnerID LLUUID } + } } // *************************************************************************** @@ -5201,44 +5237,44 @@ version 2.0 // UUIDNameRequest // Translate a UUID into first and last names { - UUIDNameRequest Low 235 NotTrusted Unencoded - { - UUIDNameBlock Variable - { ID LLUUID } - } + UUIDNameRequest Low 235 NotTrusted Unencoded + { + UUIDNameBlock Variable + { ID LLUUID } + } } // UUIDNameReply // Translate a UUID into first and last names { - UUIDNameReply Low 236 Trusted Unencoded - { - UUIDNameBlock Variable - { ID LLUUID } - { FirstName Variable 1 } - { LastName Variable 1 } - } + UUIDNameReply Low 236 Trusted Unencoded + { + UUIDNameBlock Variable + { ID LLUUID } + { FirstName Variable 1 } + { LastName Variable 1 } + } } // UUIDGroupNameRequest // Translate a UUID into a group name { - UUIDGroupNameRequest Low 237 NotTrusted Unencoded - { - UUIDNameBlock Variable - { ID LLUUID } - } + UUIDGroupNameRequest Low 237 NotTrusted Unencoded + { + UUIDNameBlock Variable + { ID LLUUID } + } } // UUIDGroupNameReply // Translate a UUID into a group name { - UUIDGroupNameReply Low 238 Trusted Unencoded - { - UUIDNameBlock Variable - { ID LLUUID } - { GroupName Variable 1 } - } + UUIDGroupNameReply Low 238 Trusted Unencoded + { + UUIDNameBlock Variable + { ID LLUUID } + { GroupName Variable 1 } + } } // end uuid to name lookup @@ -5252,43 +5288,47 @@ version 2.0 // Chat is region local to receiving simulator. // Type is one of CHAT_TYPE_NORMAL, _WHISPER, _SHOUT { - ChatPass Low 239 Trusted Zerocoded - { - ChatData Single - { Channel S32 } - { Position LLVector3 } - { ID LLUUID } - { OwnerID LLUUID } - { Name Variable 1 } - { SourceType U8 } - { Type U8 } - { Radius F32 } - { SimAccess U8 } - { Message Variable 2 } - } + ChatPass Low 239 Trusted Zerocoded + { + ChatData Single + { Channel S32 } + { Position LLVector3 } + { ID LLUUID } + { OwnerID LLUUID } + { Name Variable 1 } + { SourceType U8 } + { Type U8 } + { Radius F32 } + { SimAccess U8 } + { Message Variable 2 } + } } // Edge data - compressed edge data { - EdgeDataPacket High 24 Trusted Zerocoded - { - EdgeData Single - { LayerType U8 } - { Direction U8 } - { LayerData Variable 2 } - } + EdgeDataPacket High 24 Trusted Zerocoded + { + EdgeData Single + { LayerType U8 } + { Direction U8 } + { LayerData Variable 2 } + } } // Sim status, condition of this sim // sent reliably, when dirty { - SimStatus Medium 12 Trusted Unencoded - { - SimStatus Single - { CanAcceptAgents BOOL } - { CanAcceptTasks BOOL } - } + SimStatus Medium 12 Trusted Unencoded + { + SimStatus Single + { CanAcceptAgents BOOL } + { CanAcceptTasks BOOL } + } + { + SimFlags Single + { Flags U64 } + } } // Child Agent Update - agents send child agents to neighboring simulators. @@ -5296,136 +5336,140 @@ version 2.0 // Can't send viewer IP and port between simulators -- the port may get remapped // if the viewer is behind a Network Address Translation (NAT) box. // -// Note: some of the fields of this message really only need to be sent when an +// Note: some of the fields of this message really only need to be sent when an // agent crosses a region boundary and changes from a child to a main agent // (such as Head/BodyRotation, ControlFlags, Animations etc) // simulator -> simulator // reliable { - ChildAgentUpdate High 25 Trusted Zerocoded - { - AgentData Single - - { RegionHandle U64 } - { ViewerCircuitCode U32 } - { AgentID LLUUID } - { SessionID LLUUID } - - { AgentPos LLVector3 } - { AgentVel LLVector3 } - { Center LLVector3 } - { Size LLVector3 } - { AtAxis LLVector3 } - { LeftAxis LLVector3 } - { UpAxis LLVector3 } - { ChangedGrid BOOL } // BOOL - - { Far F32 } - { Aspect F32 } - { Throttles Variable 1 } - { LocomotionState U32 } - { HeadRotation LLQuaternion } - { BodyRotation LLQuaternion } - { ControlFlags U32 } - { EnergyLevel F32 } - { GodLevel U8 } // Changed from BOOL to U8, and renamed GodLevel (from Godlike) - { AlwaysRun BOOL } - { PreyAgent LLUUID } - { AgentAccess U8 } - { AgentTextures Variable 2 } - { ActiveGroupID LLUUID } - } - { - GroupData Variable - { GroupID LLUUID } - { GroupPowers U64 } - { AcceptNotices BOOL } - } - { - AnimationData Variable - { Animation LLUUID } - { ObjectID LLUUID } - } - { - GranterBlock Variable - { GranterID LLUUID } - } - { - NVPairData Variable - { NVPairs Variable 2 } - } - { - VisualParam Variable - { ParamValue U8 } - } - { - AgentAccess Variable - { AgentLegacyAccess U8 } - { AgentMaxAccess U8 } - } - { - AgentInfo Variable - { Flags U32 } - } + ChildAgentUpdate High 25 Trusted Zerocoded + { + AgentData Single + + { RegionHandle U64 } + { ViewerCircuitCode U32 } + { AgentID LLUUID } + { SessionID LLUUID } + + { AgentPos LLVector3 } + { AgentVel LLVector3 } + { Center LLVector3 } + { Size LLVector3 } + { AtAxis LLVector3 } + { LeftAxis LLVector3 } + { UpAxis LLVector3 } + { ChangedGrid BOOL } + + { Far F32 } + { Aspect F32 } + { Throttles Variable 1 } + { LocomotionState U32 } + { HeadRotation LLQuaternion } + { BodyRotation LLQuaternion } + { ControlFlags U32 } + { EnergyLevel F32 } + { GodLevel U8 } // Changed from BOOL to U8, and renamed GodLevel (from Godlike) + { AlwaysRun BOOL } + { PreyAgent LLUUID } + { AgentAccess U8 } + { AgentTextures Variable 2 } + { ActiveGroupID LLUUID } + } + { + GroupData Variable + { GroupID LLUUID } + { GroupPowers U64 } + { AcceptNotices BOOL } + } + { + AnimationData Variable + { Animation LLUUID } + { ObjectID LLUUID } + } + { + GranterBlock Variable + { GranterID LLUUID } + } + { + NVPairData Variable + { NVPairs Variable 2 } + } + { + VisualParam Variable + { ParamValue U8 } + } + { + AgentAccess Variable + { AgentLegacyAccess U8 } + { AgentMaxAccess U8 } + } + { + AgentInfo Variable + { Flags U32 } + } + { + AgentInventoryHost Variable + { InventoryHost Variable 1 } //String + } } // ChildAgentAlive // sent to child agents just to keep them alive { - ChildAgentAlive High 26 Trusted Unencoded - { - AgentData Single - { RegionHandle U64 } - { ViewerCircuitCode U32 } - { AgentID LLUUID } - { SessionID LLUUID } - } + ChildAgentAlive High 26 Trusted Unencoded + { + AgentData Single + { RegionHandle U64 } + { ViewerCircuitCode U32 } + { AgentID LLUUID } + { SessionID LLUUID } + } } // ChildAgentPositionUpdate // sent to child agents just to keep them alive { - ChildAgentPositionUpdate High 27 Trusted Unencoded - { - AgentData Single - - { RegionHandle U64 } - { ViewerCircuitCode U32 } - { AgentID LLUUID } - { SessionID LLUUID } - - { AgentPos LLVector3 } - { AgentVel LLVector3 } - { Center LLVector3 } - { Size LLVector3 } - { AtAxis LLVector3 } - { LeftAxis LLVector3 } - { UpAxis LLVector3 } - { ChangedGrid BOOL } - } + ChildAgentPositionUpdate High 27 Trusted Unencoded + { + AgentData Single + + { RegionHandle U64 } + { ViewerCircuitCode U32 } + { AgentID LLUUID } + { SessionID LLUUID } + + { AgentPos LLVector3 } + { AgentVel LLVector3 } + { Center LLVector3 } + { Size LLVector3 } + { AtAxis LLVector3 } + { LeftAxis LLVector3 } + { UpAxis LLVector3 } + { ChangedGrid BOOL } + } } // Obituary for child agents - make sure the parent know the child is dead // This way, children can be reliably restarted { - ChildAgentDying Low 240 Trusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } + ChildAgentDying Low 240 Trusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } } // This is sent if a full child agent hasn't been accepted yet { - ChildAgentUnknown Low 241 Trusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } + ChildAgentUnknown Low 241 Trusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } } @@ -5433,117 +5477,117 @@ version 2.0 { AtomicPassObject High 28 Trusted Unencoded { - TaskData Single - { TaskID LLUUID } - { AttachmentNeedsSave BOOL } // true iff is attachment and needs asset saved - } + TaskData Single + { TaskID LLUUID } + { AttachmentNeedsSave BOOL } // true iff is attachment and needs asset saved + } } // KillChildAgents - A new agent has connected to the simulator . . . make sure that any old child cameras are blitzed { - KillChildAgents Low 242 Trusted Unencoded - { - IDBlock Single - { AgentID LLUUID } - } + KillChildAgents Low 242 Trusted Unencoded + { + IDBlock Single + { AgentID LLUUID } + } } // GetScriptRunning - asks if a script is running or not. the simulator // responds with ScriptRunningReply { - GetScriptRunning Low 243 NotTrusted Unencoded - { - Script Single - { ObjectID LLUUID } - { ItemID LLUUID } - } + GetScriptRunning Low 243 NotTrusted Unencoded + { + Script Single + { ObjectID LLUUID } + { ItemID LLUUID } + } } // ScriptRunningReply - response from simulator to message above { - ScriptRunningReply Low 244 NotTrusted Unencoded UDPDeprecated - { - Script Single - { ObjectID LLUUID } - { ItemID LLUUID } - { Running BOOL } -// { Mono BOOL } Added to LLSD message - } + ScriptRunningReply Low 244 NotTrusted Unencoded UDPDeprecated + { + Script Single + { ObjectID LLUUID } + { ItemID LLUUID } + { Running BOOL } +// { Mono BOOL } Added to LLSD message + } } // SetScriptRunning - makes a script active or inactive (Enable may be // true or false) { - SetScriptRunning Low 245 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Script Single - { ObjectID LLUUID } - { ItemID LLUUID } - { Running BOOL } - } + SetScriptRunning Low 245 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Script Single + { ObjectID LLUUID } + { ItemID LLUUID } + { Running BOOL } + } } // ScriptReset - causes a script to reset { - ScriptReset Low 246 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Script Single - { ObjectID LLUUID } - { ItemID LLUUID } - } + ScriptReset Low 246 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Script Single + { ObjectID LLUUID } + { ItemID LLUUID } + } } // ScriptSensorRequest - causes the receiving sim to run a script sensor and return the results { - ScriptSensorRequest Low 247 Trusted Zerocoded - { - Requester Single - { SourceID LLUUID } - { RequestID LLUUID } - { SearchID LLUUID } - { SearchPos LLVector3 } - { SearchDir LLQuaternion } - { SearchName Variable 1 } - { Type S32 } - { Range F32 } - { Arc F32 } - { RegionHandle U64 } - { SearchRegions U8 } - } + ScriptSensorRequest Low 247 Trusted Zerocoded + { + Requester Single + { SourceID LLUUID } + { RequestID LLUUID } + { SearchID LLUUID } + { SearchPos LLVector3 } + { SearchDir LLQuaternion } + { SearchName Variable 1 } + { Type S32 } + { Range F32 } + { Arc F32 } + { RegionHandle U64 } + { SearchRegions U8 } + } } // ScriptSensorReply - returns the request script search information back to the requester { - ScriptSensorReply Low 248 Trusted Zerocoded - { - Requester Single - { SourceID LLUUID } - } - { - SensedData Variable - { ObjectID LLUUID } - { OwnerID LLUUID } - { GroupID LLUUID } - { Position LLVector3 } - { Velocity LLVector3 } - { Rotation LLQuaternion } - { Name Variable 1 } - { Type S32 } - { Range F32 } - } + ScriptSensorReply Low 248 Trusted Zerocoded + { + Requester Single + { SourceID LLUUID } + } + { + SensedData Variable + { ObjectID LLUUID } + { OwnerID LLUUID } + { GroupID LLUUID } + { Position LLVector3 } + { Velocity LLVector3 } + { Rotation LLQuaternion } + { Name Variable 1 } + { Type S32 } + { Range F32 } + } } //----------------------------------------------------------------------------- @@ -5554,34 +5598,34 @@ version 2.0 // agent is coming into the region. The region should be expecting the // agent. { - CompleteAgentMovement Low 249 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { CircuitCode U32 } - } + CompleteAgentMovement Low 249 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { CircuitCode U32 } + } } // sim -> viewer { - AgentMovementComplete Low 250 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Data Single - { Position LLVector3 } - { LookAt LLVector3 } - { RegionHandle U64 } - { Timestamp U32 } - } - { - SimData Single - { ChannelVersion Variable 2 } - } + AgentMovementComplete Low 250 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Data Single + { Position LLVector3 } + { LookAt LLVector3 } + { RegionHandle U64 } + { Timestamp U32 } + } + { + SimData Single + { ChannelVersion Variable 2 } + } } @@ -5591,26 +5635,26 @@ version 2.0 // userserver -> dataserver { - DataServerLogout Low 251 Trusted Unencoded - { - UserData Single - { AgentID LLUUID } - { ViewerIP IPADDR } - { Disconnect BOOL } - { SessionID LLUUID } - } + DataServerLogout Low 251 Trusted Unencoded + { + UserData Single + { AgentID LLUUID } + { ViewerIP IPADDR } + { Disconnect BOOL } + { SessionID LLUUID } + } } // LogoutRequest // viewer -> sim // reliable { - LogoutRequest Low 252 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } + LogoutRequest Low 252 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } } @@ -5620,16 +5664,16 @@ version 2.0 // reliable // Includes inventory items to update with new asset ids { - LogoutReply Low 253 Trusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - InventoryData Variable - { ItemID LLUUID } // null if list is actually empty (but has one entry 'cause it can't have none) - } + LogoutReply Low 253 Trusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + InventoryData Variable + { ItemID LLUUID } // null if list is actually empty (but has one entry 'cause it can't have none) + } } @@ -5642,61 +5686,70 @@ version 2.0 // ParentEstateID: parent estate id of the source estate // RegionID: region id of the source of the IM. // Position: position of the sender in region local coordinates -// Dialog see llinstantmessage.h for values -// ID May be used by dialog. Interpretation depends on context. +// Dialog see llinstantmessage.h for values +// ID May be used by dialog. Interpretation depends on context. // BinaryBucket May be used by some dialog types // reliable { - ImprovedInstantMessage Low 254 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - MessageBlock Single - { FromGroup BOOL } - { ToAgentID LLUUID } - { ParentEstateID U32 } - { RegionID LLUUID } - { Position LLVector3 } - { Offline U8 } - { Dialog U8 } // U8 - IM type - { ID LLUUID } - { Timestamp U32 } - { FromAgentName Variable 1 } - { Message Variable 2 } - { BinaryBucket Variable 2 } - } + ImprovedInstantMessage Low 254 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + MessageBlock Single + { FromGroup BOOL } + { ToAgentID LLUUID } + { ParentEstateID U32 } + { RegionID LLUUID } + { Position LLVector3 } + { Offline U8 } + { Dialog U8 } // U8 - IM type + { ID LLUUID } + { Timestamp U32 } + { FromAgentName Variable 1 } + { Message Variable 2 } + { BinaryBucket Variable 2 } + } + { + EstateBlock Single + { EstateID U32 } + } + { + MetaData Variable + { Data Variable 2 } + } } // RetrieveInstantMessages - used to get instant messages that // were persisted out to the database while the user was offline +// Sent from viewer->simulator. Also see RetrieveIMsExtended (back-end only) { - RetrieveInstantMessages Low 255 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } + RetrieveInstantMessages Low 255 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } } // FindAgent - used to find an agent's global position. I used a // variable sized LocationBlock so that the message can be recycled with // minimum new messages and handlers. { - FindAgent Low 256 NotTrusted Unencoded - { - AgentBlock Single - { Hunter LLUUID } - { Prey LLUUID } - { SpaceIP IPADDR } - } - { - LocationBlock Variable - { GlobalX F64 } - { GlobalY F64 } - } + FindAgent Low 256 NotTrusted Unencoded + { + AgentBlock Single + { Hunter LLUUID } + { Prey LLUUID } + { SpaceIP IPADDR } + } + { + LocationBlock Variable + { GlobalX F64 } + { GlobalY F64 } + } } // Set godlike to 1 if you want to become godlike. @@ -5704,17 +5757,17 @@ version 2.0 // viewer -> simulator -> dataserver // reliable { - RequestGodlikePowers Low 257 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - RequestBlock Single - { Godlike BOOL } - { Token LLUUID } // viewer packs a null, sim packs token - } + RequestGodlikePowers Low 257 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + RequestBlock Single + { Godlike BOOL } + { Token LLUUID } // viewer packs a null, sim packs token + } } // At the simulator, turn the godlike bit on. @@ -5722,81 +5775,81 @@ version 2.0 // dataserver -> simulator -> viewer // reliable { - GrantGodlikePowers Low 258 Trusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - GrantData Single - { GodLevel U8 } - { Token LLUUID } // checked on sim, ignored on viewer - } + GrantGodlikePowers Low 258 Trusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + GrantData Single + { GodLevel U8 } + { Token LLUUID } // checked on sim, ignored on viewer + } } // GodlikeMessage - generalized construct for Gods to send messages // around the system. Each Request has it's own internal protocol. { GodlikeMessage Low 259 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { TransactionID LLUUID } - } - { - MethodData Single - { Method Variable 1 } - { Invoice LLUUID } - } - { - ParamList Variable - { Parameter Variable 1 } - } + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { TransactionID LLUUID } + } + { + MethodData Single + { Method Variable 1 } + { Invoice LLUUID } + } + { + ParamList Variable + { Parameter Variable 1 } + } } // EstateOwnerMessage // format must be identical to above { - EstateOwnerMessage Low 260 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { TransactionID LLUUID } - } - { - MethodData Single - { Method Variable 1 } - { Invoice LLUUID } - } - { - ParamList Variable - { Parameter Variable 1 } - } + EstateOwnerMessage Low 260 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { TransactionID LLUUID } + } + { + MethodData Single + { Method Variable 1 } + { Invoice LLUUID } + } + { + ParamList Variable + { Parameter Variable 1 } + } } // GenericMessage // format must be identical to above // As above, but don't have to be god or estate owner to send. { - GenericMessage Low 261 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { TransactionID LLUUID } - } - { - MethodData Single - { Method Variable 1 } - { Invoice LLUUID } - } - { - ParamList Variable - { Parameter Variable 1 } - } + GenericMessage Low 261 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { TransactionID LLUUID } + } + { + MethodData Single + { Method Variable 1 } + { Invoice LLUUID } + } + { + ParamList Variable + { Parameter Variable 1 } + } } // GenericStreamingMessage @@ -5814,29 +5867,29 @@ version 2.0 { DataBlock Single - { Data Variable 2 } + { Data Variable 2 } } } // LargeGenericMessage -// Similar to the above messages, but can handle larger payloads and serialized -// LLSD. Uses HTTP transport +// Similar to the above messages, but can handle larger payloads and serialized +// LLSD. Uses HTTP transport { LargeGenericMessage Low 430 NotTrusted Unencoded UDPDeprecated { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { TransactionID LLUUID } + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { TransactionID LLUUID } } { MethodData Single - { Method Variable 1 } - { Invoice LLUUID } + { Method Variable 1 } + { Invoice LLUUID } } { - ParamList Variable - { Parameter Variable 2 } + ParamList Variable + { Parameter Variable 2 } } } @@ -5846,72 +5899,72 @@ version 2.0 // request for mute list { - MuteListRequest Low 262 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - MuteData Single - { MuteCRC U32 } - } + MuteListRequest Low 262 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + MuteData Single + { MuteCRC U32 } + } } // update/add someone in the mute list { - UpdateMuteListEntry Low 263 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - MuteData Single - { MuteID LLUUID } - { MuteName Variable 1 } - { MuteType S32 } - { MuteFlags U32 } - } + UpdateMuteListEntry Low 263 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + MuteData Single + { MuteID LLUUID } + { MuteName Variable 1 } + { MuteType S32 } + { MuteFlags U32 } + } } // Remove a mute list entry. { - RemoveMuteListEntry Low 264 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - MuteData Single - { MuteID LLUUID } - { MuteName Variable 1 } - } + RemoveMuteListEntry Low 264 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + MuteData Single + { MuteID LLUUID } + { MuteName Variable 1 } + } } -// -// Inventory update messages +// +// Inventory update messages // UDP DEPRECATED - Now a viewer capability. { - CopyInventoryFromNotecard Low 265 NotTrusted Zerocoded UDPDeprecated - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - NotecardData Single - { NotecardItemID LLUUID } - { ObjectID LLUUID } - } - { - InventoryData Variable - { ItemID LLUUID } - { FolderID LLUUID } - } + CopyInventoryFromNotecard Low 265 NotTrusted Zerocoded UDPDeprecated + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + NotecardData Single + { NotecardItemID LLUUID } + { ObjectID LLUUID } + } + { + InventoryData Variable + { ItemID LLUUID } + { FolderID LLUUID } + } } // @@ -5919,40 +5972,40 @@ version 2.0 // THIS MESSAGE CAN NOT CREATE NEW INVENTORY ITEMS. // { - UpdateInventoryItem Low 266 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { TransactionID LLUUID } - } - { - InventoryData Variable - { ItemID LLUUID } - { FolderID LLUUID } - { CallbackID U32 } // Async Response - - { CreatorID LLUUID } // permissions - { OwnerID LLUUID } // permissions - { GroupID LLUUID } // permissions - { BaseMask U32 } // permissions - { OwnerMask U32 } // permissions - { GroupMask U32 } // permissions - { EveryoneMask U32 } // permissions - { NextOwnerMask U32 } // permissions - { GroupOwned BOOL } // permissions - - { TransactionID LLUUID } // TransactionID: new assets only - { Type S8 } - { InvType S8 } - { Flags U32 } - { SaleType U8 } - { SalePrice S32 } - { Name Variable 1 } - { Description Variable 1 } - { CreationDate S32 } - { CRC U32 } - } + UpdateInventoryItem Low 266 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { TransactionID LLUUID } + } + { + InventoryData Variable + { ItemID LLUUID } + { FolderID LLUUID } + { CallbackID U32 } // Async Response + + { CreatorID LLUUID } // permissions + { OwnerID LLUUID } // permissions + { GroupID LLUUID } // permissions + { BaseMask U32 } // permissions + { OwnerMask U32 } // permissions + { GroupMask U32 } // permissions + { EveryoneMask U32 } // permissions + { NextOwnerMask U32 } // permissions + { GroupOwned BOOL } // permissions + + { TransactionID LLUUID } // TransactionID: new assets only + { Type S8 } + { InvType S8 } + { Flags U32 } + { SaleType U8 } + { SalePrice S32 } + { Name Variable 1 } + { Description Variable 1 } + { CreationDate S32 } + { CRC U32 } + } } // @@ -5960,106 +6013,106 @@ version 2.0 // DO NOT ALLOW THIS FROM THE VIEWER. // { - UpdateCreateInventoryItem Low 267 Trusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SimApproved BOOL } - { TransactionID LLUUID } - } - { - InventoryData Variable - { ItemID LLUUID } - { FolderID LLUUID } - { CallbackID U32 } // Async Response - - { CreatorID LLUUID } // permissions - { OwnerID LLUUID } // permissions - { GroupID LLUUID } // permissions - { BaseMask U32 } // permissions - { OwnerMask U32 } // permissions - { GroupMask U32 } // permissions - { EveryoneMask U32 } // permissions - { NextOwnerMask U32 } // permissions - { GroupOwned BOOL } // permissions - - { AssetID LLUUID } - { Type S8 } - { InvType S8 } - { Flags U32 } - { SaleType U8 } - { SalePrice S32 } - { Name Variable 1 } - { Description Variable 1 } - { CreationDate S32 } - { CRC U32 } - } -} - -{ - MoveInventoryItem Low 268 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { Stamp BOOL } // should the server re-timestamp? - } - { - InventoryData Variable - { ItemID LLUUID } - { FolderID LLUUID } - { NewName Variable 1 } - } -} - -// copy inventory item by item id to specified destination folder, + UpdateCreateInventoryItem Low 267 Trusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SimApproved BOOL } + { TransactionID LLUUID } + } + { + InventoryData Variable + { ItemID LLUUID } + { FolderID LLUUID } + { CallbackID U32 } // Async Response + + { CreatorID LLUUID } // permissions + { OwnerID LLUUID } // permissions + { GroupID LLUUID } // permissions + { BaseMask U32 } // permissions + { OwnerMask U32 } // permissions + { GroupMask U32 } // permissions + { EveryoneMask U32 } // permissions + { NextOwnerMask U32 } // permissions + { GroupOwned BOOL } // permissions + + { AssetID LLUUID } + { Type S8 } + { InvType S8 } + { Flags U32 } + { SaleType U8 } + { SalePrice S32 } + { Name Variable 1 } + { Description Variable 1 } + { CreationDate S32 } + { CRC U32 } + } +} + +{ + MoveInventoryItem Low 268 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { Stamp BOOL } // should the server re-timestamp? + } + { + InventoryData Variable + { ItemID LLUUID } + { FolderID LLUUID } + { NewName Variable 1 } + } +} + +// copy inventory item by item id to specified destination folder, // send out bulk inventory update when done. // // Inventory items are only unique for {agent, inv_id} pairs; // the OldItemID needs to be paired with the OldAgentID to // produce a unique inventory item. { - CopyInventoryItem Low 269 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - InventoryData Variable - { CallbackID U32 } // Async response - { OldAgentID LLUUID } - { OldItemID LLUUID } - { NewFolderID LLUUID } - { NewName Variable 1 } - } -} - -{ - RemoveInventoryItem Low 270 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - InventoryData Variable - { ItemID LLUUID } - } -} - -{ - ChangeInventoryItemFlags Low 271 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - InventoryData Variable - { ItemID LLUUID } - { Flags U32 } - } + CopyInventoryItem Low 269 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + InventoryData Variable + { CallbackID U32 } // Async response + { OldAgentID LLUUID } + { OldItemID LLUUID } + { NewFolderID LLUUID } + { NewName Variable 1 } + } +} + +{ + RemoveInventoryItem Low 270 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + InventoryData Variable + { ItemID LLUUID } + } +} + +{ + ChangeInventoryItemFlags Low 271 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + InventoryData Variable + { ItemID LLUUID } + { Flags U32 } + } } // @@ -6068,235 +6121,235 @@ version 2.0 // This message is currently only uses objects, so the viewer ignores // the asset id. { - SaveAssetIntoInventory Low 272 Trusted Unencoded - { - AgentData Single - { AgentID LLUUID } - } - { - InventoryData Single - { ItemID LLUUID } - { NewAssetID LLUUID } - } -} - -{ - CreateInventoryFolder Low 273 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - FolderData Single - { FolderID LLUUID } - { ParentID LLUUID } - { Type S8 } - { Name Variable 1 } - } -} - -{ - UpdateInventoryFolder Low 274 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - FolderData Variable - { FolderID LLUUID } - { ParentID LLUUID } - { Type S8 } - { Name Variable 1 } - } -} - -{ - MoveInventoryFolder Low 275 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { Stamp BOOL } // should the server re-timestamp children - } - { - InventoryData Variable - { FolderID LLUUID } - { ParentID LLUUID } - } -} - -{ - RemoveInventoryFolder Low 276 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - FolderData Variable - { FolderID LLUUID } - } + SaveAssetIntoInventory Low 272 Trusted Unencoded + { + AgentData Single + { AgentID LLUUID } + } + { + InventoryData Single + { ItemID LLUUID } + { NewAssetID LLUUID } + } +} + +{ + CreateInventoryFolder Low 273 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + FolderData Single + { FolderID LLUUID } + { ParentID LLUUID } + { Type S8 } + { Name Variable 1 } + } +} + +{ + UpdateInventoryFolder Low 274 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + FolderData Variable + { FolderID LLUUID } + { ParentID LLUUID } + { Type S8 } + { Name Variable 1 } + } +} + +{ + MoveInventoryFolder Low 275 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { Stamp BOOL } // should the server re-timestamp children + } + { + InventoryData Variable + { FolderID LLUUID } + { ParentID LLUUID } + } +} + +{ + RemoveInventoryFolder Low 276 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + FolderData Variable + { FolderID LLUUID } + } } // Get inventory segment. { - FetchInventoryDescendents Low 277 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - InventoryData Single - { FolderID LLUUID } - { OwnerID LLUUID } - { SortOrder S32 } // 0 = name, 1 = time - { FetchFolders BOOL } // false will omit folders in query - { FetchItems BOOL } // false will omit items in query - } -} - -// return inventory segment. + FetchInventoryDescendents Low 277 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + InventoryData Single + { FolderID LLUUID } + { OwnerID LLUUID } + { SortOrder S32 } // 0 = name, 1 = time + { FetchFolders BOOL } // false will omit folders in query + { FetchItems BOOL } // false will omit items in query + } +} + +// return inventory segment. // *NOTE: This could be compressed more since we already know the // parent_id for folders and the folder_id for items, but this is // reasonable until we heve server side inventory. { - InventoryDescendents Low 278 Trusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { FolderID LLUUID } - { OwnerID LLUUID } // owner of the folders creatd. - { Version S32 } // version of the folder for caching - { Descendents S32 } // count to help with caching - } - { - FolderData Variable - { FolderID LLUUID } - { ParentID LLUUID } - { Type S8 } - { Name Variable 1 } - } - { - ItemData Variable - { ItemID LLUUID } - { FolderID LLUUID } - { CreatorID LLUUID } // permissions - { OwnerID LLUUID } // permissions - { GroupID LLUUID } // permissions - { BaseMask U32 } // permissions - { OwnerMask U32 } // permissions - { GroupMask U32 } // permissions - { EveryoneMask U32 } // permissions - { NextOwnerMask U32 } // permissions - { GroupOwned BOOL } // permissions - { AssetID LLUUID } - { Type S8 } - { InvType S8 } - { Flags U32 } - { SaleType U8 } - { SalePrice S32 } - { Name Variable 1 } - { Description Variable 1 } - { CreationDate S32 } - { CRC U32 } - } + InventoryDescendents Low 278 Trusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { FolderID LLUUID } + { OwnerID LLUUID } // owner of the folders creatd. + { Version S32 } // version of the folder for caching + { Descendents S32 } // count to help with caching + } + { + FolderData Variable + { FolderID LLUUID } + { ParentID LLUUID } + { Type S8 } + { Name Variable 1 } + } + { + ItemData Variable + { ItemID LLUUID } + { FolderID LLUUID } + { CreatorID LLUUID } // permissions + { OwnerID LLUUID } // permissions + { GroupID LLUUID } // permissions + { BaseMask U32 } // permissions + { OwnerMask U32 } // permissions + { GroupMask U32 } // permissions + { EveryoneMask U32 } // permissions + { NextOwnerMask U32 } // permissions + { GroupOwned BOOL } // permissions + { AssetID LLUUID } + { Type S8 } + { InvType S8 } + { Flags U32 } + { SaleType U8 } + { SalePrice S32 } + { Name Variable 1 } + { Description Variable 1 } + { CreationDate S32 } + { CRC U32 } + } } // Get inventory item(s) - response comes through FetchInventoryReply { - FetchInventory Low 279 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - InventoryData Variable - { OwnerID LLUUID } - { ItemID LLUUID } - } + FetchInventory Low 279 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + InventoryData Variable + { OwnerID LLUUID } + { ItemID LLUUID } + } } // response to fetch inventory { - FetchInventoryReply Low 280 Trusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - } - { - InventoryData Variable - { ItemID LLUUID } - { FolderID LLUUID } - - { CreatorID LLUUID } // permissions - { OwnerID LLUUID } // permissions - { GroupID LLUUID } // permissions - { BaseMask U32 } // permissions - { OwnerMask U32 } // permissions - { GroupMask U32 } // permissions - { EveryoneMask U32 } // permissions - { NextOwnerMask U32 } // permissions - { GroupOwned BOOL } // permissions - - { AssetID LLUUID } - { Type S8 } - { InvType S8 } - { Flags U32 } - { SaleType U8 } - { SalePrice S32 } - { Name Variable 1 } - { Description Variable 1 } - { CreationDate S32 } - { CRC U32 } - } + FetchInventoryReply Low 280 Trusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + } + { + InventoryData Variable + { ItemID LLUUID } + { FolderID LLUUID } + + { CreatorID LLUUID } // permissions + { OwnerID LLUUID } // permissions + { GroupID LLUUID } // permissions + { BaseMask U32 } // permissions + { OwnerMask U32 } // permissions + { GroupMask U32 } // permissions + { EveryoneMask U32 } // permissions + { NextOwnerMask U32 } // permissions + { GroupOwned BOOL } // permissions + + { AssetID LLUUID } + { Type S8 } + { InvType S8 } + { Flags U32 } + { SaleType U8 } + { SalePrice S32 } + { Name Variable 1 } + { Description Variable 1 } + { CreationDate S32 } + { CRC U32 } + } } // Can only fit around 7 items per packet - that's the way it goes. At // least many bulk updates can be packed. // Only from dataserver->sim->viewer { - BulkUpdateInventory Low 281 Trusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { TransactionID LLUUID } - } - { - FolderData Variable - { FolderID LLUUID } - { ParentID LLUUID } - { Type S8 } - { Name Variable 1 } - } - { - ItemData Variable - { ItemID LLUUID } - { CallbackID U32 } // Async Response - { FolderID LLUUID } - { CreatorID LLUUID } // permissions - { OwnerID LLUUID } // permissions - { GroupID LLUUID } // permissions - { BaseMask U32 } // permissions - { OwnerMask U32 } // permissions - { GroupMask U32 } // permissions - { EveryoneMask U32 } // permissions - { NextOwnerMask U32 } // permissions - { GroupOwned BOOL } // permissions - { AssetID LLUUID } - { Type S8 } - { InvType S8 } - { Flags U32 } - { SaleType U8 } - { SalePrice S32 } - { Name Variable 1 } - { Description Variable 1 } - { CreationDate S32 } - { CRC U32 } - } + BulkUpdateInventory Low 281 Trusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { TransactionID LLUUID } + } + { + FolderData Variable + { FolderID LLUUID } + { ParentID LLUUID } + { Type S8 } + { Name Variable 1 } + } + { + ItemData Variable + { ItemID LLUUID } + { CallbackID U32 } // Async Response + { FolderID LLUUID } + { CreatorID LLUUID } // permissions + { OwnerID LLUUID } // permissions + { GroupID LLUUID } // permissions + { BaseMask U32 } // permissions + { OwnerMask U32 } // permissions + { GroupMask U32 } // permissions + { EveryoneMask U32 } // permissions + { NextOwnerMask U32 } // permissions + { GroupOwned BOOL } // permissions + { AssetID LLUUID } + { Type S8 } + { InvType S8 } + { Flags U32 } + { SaleType U8 } + { SalePrice S32 } + { Name Variable 1 } + { Description Variable 1 } + { CreationDate S32 } + { CRC U32 } + } } @@ -6304,162 +6357,162 @@ version 2.0 // request permissions for agent id to get the asset for owner_id's // item_id. { - RequestInventoryAsset Low 282 Trusted Unencoded - { - QueryData Single - { QueryID LLUUID } - { AgentID LLUUID } - { OwnerID LLUUID } - { ItemID LLUUID } - } + RequestInventoryAsset Low 282 Trusted Unencoded + { + QueryData Single + { QueryID LLUUID } + { AgentID LLUUID } + { OwnerID LLUUID } + { ItemID LLUUID } + } } // response to RequestInventoryAsset // lluuid will be null if agentid in the request above cannot read asset { - InventoryAssetResponse Low 283 Trusted Unencoded - { - QueryData Single - { QueryID LLUUID } - { AssetID LLUUID } - { IsReadable BOOL } - } + InventoryAssetResponse Low 283 Trusted Unencoded + { + QueryData Single + { QueryID LLUUID } + { AssetID LLUUID } + { IsReadable BOOL } + } } // This is the new improved way to remove inventory items. It is // currently only supported in viewer->userserver->dataserver // messages typically initiated by an empty trash method. { - RemoveInventoryObjects Low 284 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - FolderData Variable - { FolderID LLUUID } - } - { - ItemData Variable - { ItemID LLUUID } - } + RemoveInventoryObjects Low 284 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + FolderData Variable + { FolderID LLUUID } + } + { + ItemData Variable + { ItemID LLUUID } + } } // This is how you remove inventory when you're not even sure what it // is - only it's parenting. { - PurgeInventoryDescendents Low 285 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - InventoryData Single - { FolderID LLUUID } - } + PurgeInventoryDescendents Low 285 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + InventoryData Single + { FolderID LLUUID } + } } // These messages are viewer->simulator requests to update a task's // inventory. // if Key == 0, itemid is the key. if Key == 1, assetid is the key. { - UpdateTaskInventory Low 286 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - UpdateData Single - { LocalID U32 } - { Key U8 } - } - { - InventoryData Single - { ItemID LLUUID } - { FolderID LLUUID } - { CreatorID LLUUID } // permissions - { OwnerID LLUUID } // permissions - { GroupID LLUUID } // permissions - { BaseMask U32 } // permissions - { OwnerMask U32 } // permissions - { GroupMask U32 } // permissions - { EveryoneMask U32 } // permissions - { NextOwnerMask U32 } // permissions - { GroupOwned BOOL } // permissions - { TransactionID LLUUID } - { Type S8 } - { InvType S8 } - { Flags U32 } - { SaleType U8 } - { SalePrice S32 } - { Name Variable 1 } - { Description Variable 1 } - { CreationDate S32 } - { CRC U32 } - } -} - -{ - RemoveTaskInventory Low 287 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - InventoryData Single - { LocalID U32 } - { ItemID LLUUID } - } -} - -{ - MoveTaskInventory Low 288 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { FolderID LLUUID } - } - { - InventoryData Single - { LocalID U32 } - { ItemID LLUUID } - } -} - -{ - RequestTaskInventory Low 289 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - InventoryData Single - { LocalID U32 } - } -} - -{ - ReplyTaskInventory Low 290 Trusted Zerocoded - { - InventoryData Single - { TaskID LLUUID } - { Serial S16 } // S16 - { Filename Variable 1 } - } + UpdateTaskInventory Low 286 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + UpdateData Single + { LocalID U32 } + { Key U8 } + } + { + InventoryData Single + { ItemID LLUUID } + { FolderID LLUUID } + { CreatorID LLUUID } // permissions + { OwnerID LLUUID } // permissions + { GroupID LLUUID } // permissions + { BaseMask U32 } // permissions + { OwnerMask U32 } // permissions + { GroupMask U32 } // permissions + { EveryoneMask U32 } // permissions + { NextOwnerMask U32 } // permissions + { GroupOwned BOOL } // permissions + { TransactionID LLUUID } + { Type S8 } + { InvType S8 } + { Flags U32 } + { SaleType U8 } + { SalePrice S32 } + { Name Variable 1 } + { Description Variable 1 } + { CreationDate S32 } + { CRC U32 } + } +} + +{ + RemoveTaskInventory Low 287 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + InventoryData Single + { LocalID U32 } + { ItemID LLUUID } + } +} + +{ + MoveTaskInventory Low 288 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { FolderID LLUUID } + } + { + InventoryData Single + { LocalID U32 } + { ItemID LLUUID } + } +} + +{ + RequestTaskInventory Low 289 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + InventoryData Single + { LocalID U32 } + } +} + +{ + ReplyTaskInventory Low 290 Trusted Zerocoded + { + InventoryData Single + { TaskID LLUUID } + { Serial S16 } // S16 + { Filename Variable 1 } + } } // These messages are viewer->simulator requests regarding objects -// which are currently being simulated. The viewer will get an +// which are currently being simulated. The viewer will get an // UpdateInventoryItem response if a DeRez succeeds, and the object // will appear if a RezObject succeeds. // The Destination field tells where the derez should wind up, and the -// meaning of DestinationID depends on it. For example, if the +// meaning of DestinationID depends on it. For example, if the // destination is a category, then the destination is the category id. If // the destination is a task inventory, then the destination id is the // task id. @@ -6468,194 +6521,199 @@ version 2.0 // just duplicated (it's not that much, and derezzes that span multiple // packets will be rare.) { - DeRezObject Low 291 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - AgentBlock Single - { GroupID LLUUID } - { Destination U8 } - { DestinationID LLUUID } // see above - { TransactionID LLUUID } - { PacketCount U8 } - { PacketNumber U8 } - } - { - ObjectData Variable - { ObjectLocalID U32 } // object id in world - } + DeRezObject Low 291 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + AgentBlock Single + { GroupID LLUUID } + { Destination U8 } + { DestinationID LLUUID } // see above + { TransactionID LLUUID } + { PacketCount U8 } + { PacketNumber U8 } + } + { + ObjectData Variable + { ObjectLocalID U32 } // object id in world + } } // This message is sent when a derez succeeds, but there's no way to // know, since no inventory is created on the viewer. For example, when // saving into task inventory. { - DeRezAck Low 292 Trusted Unencoded - { - TransactionData Single - { TransactionID LLUUID } - { Success BOOL } - } + DeRezAck Low 292 Trusted Unencoded + { + TransactionData Single + { TransactionID LLUUID } + { Success BOOL } + } } // This message is sent from viewer -> simulator when the viewer wants // to rez an object out of inventory. { - RezObject Low 293 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { GroupID LLUUID } - } - { - RezData Single - { FromTaskID LLUUID } - { BypassRaycast U8 } - { RayStart LLVector3 } - { RayEnd LLVector3 } - { RayTargetID LLUUID } - { RayEndIsIntersection BOOL } - { RezSelected BOOL } - { RemoveItem BOOL } - { ItemFlags U32 } - { GroupMask U32 } - { EveryoneMask U32 } - { NextOwnerMask U32 } - } - { - InventoryData Single - { ItemID LLUUID } - { FolderID LLUUID } - { CreatorID LLUUID } // permissions - { OwnerID LLUUID } // permissions - { GroupID LLUUID } // permissions - { BaseMask U32 } // permissions - { OwnerMask U32 } // permissions - { GroupMask U32 } // permissions - { EveryoneMask U32 } // permissions - { NextOwnerMask U32 } // permissions - { GroupOwned BOOL } // permissions - { TransactionID LLUUID } - { Type S8 } - { InvType S8 } - { Flags U32 } - { SaleType U8 } - { SalePrice S32 } - { Name Variable 1 } - { Description Variable 1 } - { CreationDate S32 } - { CRC U32 } - } + RezObject Low 293 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { GroupID LLUUID } + } + { + RezData Single + { FromTaskID LLUUID } + { BypassRaycast U8 } + { RayStart LLVector3 } + { RayEnd LLVector3 } + { RayTargetID LLUUID } + { RayEndIsIntersection BOOL } + { RezSelected BOOL } + { RemoveItem BOOL } + { ItemFlags U32 } + { GroupMask U32 } + { EveryoneMask U32 } + { NextOwnerMask U32 } + } + { + InventoryData Single + { ItemID LLUUID } + { FolderID LLUUID } + { CreatorID LLUUID } // permissions + { OwnerID LLUUID } // permissions + { GroupID LLUUID } // permissions + { BaseMask U32 } // permissions + { OwnerMask U32 } // permissions + { GroupMask U32 } // permissions + { EveryoneMask U32 } // permissions + { NextOwnerMask U32 } // permissions + { GroupOwned BOOL } // permissions + { TransactionID LLUUID } + { Type S8 } + { InvType S8 } + { Flags U32 } + { SaleType U8 } + { SalePrice S32 } + { Name Variable 1 } + { Description Variable 1 } + { CreationDate S32 } + { CRC U32 } + } } // This message is sent from viewer -> simulator when the viewer wants // to rez an object from a notecard. { - RezObjectFromNotecard Low 294 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { GroupID LLUUID } - } - { - RezData Single - { FromTaskID LLUUID } - { BypassRaycast U8 } - { RayStart LLVector3 } - { RayEnd LLVector3 } - { RayTargetID LLUUID } - { RayEndIsIntersection BOOL } - { RezSelected BOOL } - { RemoveItem BOOL } - { ItemFlags U32 } - { GroupMask U32 } - { EveryoneMask U32 } - { NextOwnerMask U32 } - } - { - NotecardData Single - { NotecardItemID LLUUID } - { ObjectID LLUUID } - } - { - InventoryData Variable - { ItemID LLUUID } - } + RezObjectFromNotecard Low 294 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { GroupID LLUUID } + } + { + RezData Single + { FromTaskID LLUUID } + { BypassRaycast U8 } + { RayStart LLVector3 } + { RayEnd LLVector3 } + { RayTargetID LLUUID } + { RayEndIsIntersection BOOL } + { RezSelected BOOL } + { RemoveItem BOOL } + { ItemFlags U32 } + { GroupMask U32 } + { EveryoneMask U32 } + { NextOwnerMask U32 } + } + { + NotecardData Single + { NotecardItemID LLUUID } + { ObjectID LLUUID } + } + { + InventoryData Variable + { ItemID LLUUID } + } } // sim -> dataserver // sent during agent to agent inventory transfers { - TransferInventory Low 295 Trusted Zerocoded - { - InfoBlock Single - { SourceID LLUUID } - { DestID LLUUID } - { TransactionID LLUUID } - } - { - InventoryBlock Variable - { InventoryID LLUUID } - { Type S8 } - } + TransferInventory Low 295 Trusted Zerocoded + { + InfoBlock Single + { SourceID LLUUID } + { DestID LLUUID } + { TransactionID LLUUID } + } + { + InventoryBlock Variable + { InventoryID LLUUID } + { Type S8 } + } + { + ValidationBlock Single + { NeedsValidation BOOL } + { EstateID U32 } + } } // dataserver -> sim // InventoryID is the id of the inventory object that the end user // should discard if they deny the transfer. { - TransferInventoryAck Low 296 Trusted Zerocoded - { - InfoBlock Single - { TransactionID LLUUID } - { InventoryID LLUUID } - } + TransferInventoryAck Low 296 Trusted Zerocoded + { + InfoBlock Single + { TransactionID LLUUID } + { InventoryID LLUUID } + } } { - AcceptFriendship Low 297 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - TransactionBlock Single - { TransactionID LLUUID } - } - { - FolderData Variable - { FolderID LLUUID } // place to put calling card. - } + AcceptFriendship Low 297 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + TransactionBlock Single + { TransactionID LLUUID } + } + { + FolderData Variable + { FolderID LLUUID } // place to put calling card. + } } { - DeclineFriendship Low 298 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - TransactionBlock Single - { TransactionID LLUUID } - } + DeclineFriendship Low 298 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + TransactionBlock Single + { TransactionID LLUUID } + } } { - FormFriendship Low 299 Trusted Unencoded - { - AgentBlock Single - { SourceID LLUUID } - { DestID LLUUID } - } + FormFriendship Low 299 Trusted Unencoded + { + AgentBlock Single + { SourceID LLUUID } + { DestID LLUUID } + } } // Cancels user relationship @@ -6664,281 +6722,281 @@ version 2.0 // viewer -> userserver -> dataserver // reliable { - TerminateFriendship Low 300 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ExBlock Single - { OtherID LLUUID } - } + TerminateFriendship Low 300 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ExBlock Single + { OtherID LLUUID } + } } // used to give someone a calling card. { - OfferCallingCard Low 301 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - AgentBlock Single - { DestID LLUUID } - { TransactionID LLUUID } - } -} - -{ - AcceptCallingCard Low 302 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - TransactionBlock Single - { TransactionID LLUUID } - } - { - FolderData Variable - { FolderID LLUUID } // place to put calling card. - } -} - -{ - DeclineCallingCard Low 303 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - TransactionBlock Single - { TransactionID LLUUID } - } + OfferCallingCard Low 301 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + AgentBlock Single + { DestID LLUUID } + { TransactionID LLUUID } + } +} + +{ + AcceptCallingCard Low 302 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + TransactionBlock Single + { TransactionID LLUUID } + } + { + FolderData Variable + { FolderID LLUUID } // place to put calling card. + } +} + +{ + DeclineCallingCard Low 303 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + TransactionBlock Single + { TransactionID LLUUID } + } } // Rez a script onto an object { - RezScript Low 304 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { GroupID LLUUID } - } - { - UpdateBlock Single - { ObjectLocalID U32 } // object id in world - { Enabled BOOL } // is script rezzed in enabled? - } - { - InventoryBlock Single - { ItemID LLUUID } - { FolderID LLUUID } - { CreatorID LLUUID } // permissions - { OwnerID LLUUID } // permissions - { GroupID LLUUID } // permissions - { BaseMask U32 } // permissions - { OwnerMask U32 } // permissions - { GroupMask U32 } // permissions - { EveryoneMask U32 } // permissions - { NextOwnerMask U32 } // permissions - { GroupOwned BOOL } // permissions - { TransactionID LLUUID } - { Type S8 } - { InvType S8 } - { Flags U32 } - { SaleType U8 } - { SalePrice S32 } - { Name Variable 1 } - { Description Variable 1 } - { CreationDate S32 } - { CRC U32 } - } + RezScript Low 304 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { GroupID LLUUID } + } + { + UpdateBlock Single + { ObjectLocalID U32 } // object id in world + { Enabled BOOL } // is script rezzed in enabled? + } + { + InventoryBlock Single + { ItemID LLUUID } + { FolderID LLUUID } + { CreatorID LLUUID } // permissions + { OwnerID LLUUID } // permissions + { GroupID LLUUID } // permissions + { BaseMask U32 } // permissions + { OwnerMask U32 } // permissions + { GroupMask U32 } // permissions + { EveryoneMask U32 } // permissions + { NextOwnerMask U32 } // permissions + { GroupOwned BOOL } // permissions + { TransactionID LLUUID } + { Type S8 } + { InvType S8 } + { Flags U32 } + { SaleType U8 } + { SalePrice S32 } + { Name Variable 1 } + { Description Variable 1 } + { CreationDate S32 } + { CRC U32 } + } } // Create inventory { - CreateInventoryItem Low 305 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - InventoryBlock Single - { CallbackID U32 } // Async Response - { FolderID LLUUID } - { TransactionID LLUUID } // Going to become TransactionID - { NextOwnerMask U32 } - { Type S8 } - { InvType S8 } - { WearableType U8 } - { Name Variable 1 } - { Description Variable 1 } - } + CreateInventoryItem Low 305 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + InventoryBlock Single + { CallbackID U32 } // Async Response + { FolderID LLUUID } + { TransactionID LLUUID } // Going to become TransactionID + { NextOwnerMask U32 } + { Type S8 } + { InvType S8 } + { WearableType U8 } + { Name Variable 1 } + { Description Variable 1 } + } } // give agent a landmark for an event. { - CreateLandmarkForEvent Low 306 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - EventData Single - { EventID U32 } - } - { - InventoryBlock Single - { FolderID LLUUID } - { Name Variable 1 } - } -} - -{ - EventLocationRequest Low 307 Trusted Zerocoded - { - QueryData Single - { QueryID LLUUID } - } - { - EventData Single - { EventID U32 } - } -} - -{ - EventLocationReply Low 308 Trusted Zerocoded - { - QueryData Single - { QueryID LLUUID } - } - { - EventData Single - { Success BOOL } - { RegionID LLUUID } - { RegionPos LLVector3 } - } + CreateLandmarkForEvent Low 306 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + EventData Single + { EventID U32 } + } + { + InventoryBlock Single + { FolderID LLUUID } + { Name Variable 1 } + } +} + +{ + EventLocationRequest Low 307 Trusted Zerocoded + { + QueryData Single + { QueryID LLUUID } + } + { + EventData Single + { EventID U32 } + } +} + +{ + EventLocationReply Low 308 Trusted Zerocoded + { + QueryData Single + { QueryID LLUUID } + } + { + EventData Single + { Success BOOL } + { RegionID LLUUID } + { RegionPos LLVector3 } + } } // get information about landmarks. Used by viewers for determining // the location of a landmark, and by simulators for teleport { - RegionHandleRequest Low 309 NotTrusted Unencoded - { - RequestBlock Single - { RegionID LLUUID } - } + RegionHandleRequest Low 309 NotTrusted Unencoded + { + RequestBlock Single + { RegionID LLUUID } + } } { - RegionIDAndHandleReply Low 310 Trusted Unencoded - { - ReplyBlock Single - { RegionID LLUUID } - { RegionHandle U64 } - } + RegionIDAndHandleReply Low 310 Trusted Unencoded + { + ReplyBlock Single + { RegionID LLUUID } + { RegionHandle U64 } + } } // Move money from one agent to another. Validation will happen at the // simulator, the dataserver will actually do the work. Dataserver // generates a MoneyBalance message in reply. The simulator // will generate a MoneyTransferBackend in response to this. -// viewer -> simulator -> dataserver -{ - MoneyTransferRequest Low 311 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - MoneyData Single - { SourceID LLUUID } - { DestID LLUUID } // destination of the transfer - { Flags U8 } - { Amount S32 } - { AggregatePermNextOwner U8 } - { AggregatePermInventory U8 } - { TransactionType S32 } // see lltransactiontypes.h - { Description Variable 1 } // string, name of item for purchases - } +// viewer -> simulator -> dataserver +{ + MoneyTransferRequest Low 311 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + MoneyData Single + { SourceID LLUUID } + { DestID LLUUID } // destination of the transfer + { Flags U8 } + { Amount S32 } + { AggregatePermNextOwner U8 } + { AggregatePermInventory U8 } + { TransactionType S32 } // see lltransactiontypes.h + { Description Variable 1 } // string, name of item for purchases + } } // And, the money transfer // *NOTE: Unused as of 2010-04-06, because all back-end money transactions // are done with web services via L$ API. JC { - MoneyTransferBackend Low 312 Trusted Zerocoded - { - MoneyData Single - { TransactionID LLUUID } - { TransactionTime U32 } // utc seconds since epoch - { SourceID LLUUID } - { DestID LLUUID } // destination of the transfer - { Flags U8 } - { Amount S32 } - { AggregatePermNextOwner U8 } - { AggregatePermInventory U8 } - { TransactionType S32 } // see lltransactiontypes.h - { RegionID LLUUID } // region sending the request, for logging - { GridX U32 } // *HACK: database doesn't have region_id in schema - { GridY U32 } // *HACK: database doesn't have region_id in schema - { Description Variable 1 } // string, name of item for purchases - } + MoneyTransferBackend Low 312 Trusted Zerocoded + { + MoneyData Single + { TransactionID LLUUID } + { TransactionTime U32 } // utc seconds since epoch + { SourceID LLUUID } + { DestID LLUUID } // destination of the transfer + { Flags U8 } + { Amount S32 } + { AggregatePermNextOwner U8 } + { AggregatePermInventory U8 } + { TransactionType S32 } // see lltransactiontypes.h + { RegionID LLUUID } // region sending the request, for logging + { GridX U32 } // *HACK: database doesn't have region_id in schema + { GridY U32 } // *HACK: database doesn't have region_id in schema + { Description Variable 1 } // string, name of item for purchases + } } // viewer -> userserver -> dataserver // Reliable { - MoneyBalanceRequest Low 313 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - MoneyData Single - { TransactionID LLUUID } - } + MoneyBalanceRequest Low 313 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + MoneyData Single + { TransactionID LLUUID } + } } // dataserver -> simulator -> viewer { - MoneyBalanceReply Low 314 Trusted Zerocoded - { - MoneyData Single - { AgentID LLUUID } - { TransactionID LLUUID } - { TransactionSuccess BOOL } // BOOL - { MoneyBalance S32 } - { SquareMetersCredit S32 } - { SquareMetersCommitted S32 } - { Description Variable 1 } // string - } - // For replies that are part of a transaction (buying something) provide - // metadata for localization. If TransactionType is 0, the message is - // purely a balance update. Added for server 1.40 and viewer 2.1. JC - { - TransactionInfo Single - { TransactionType S32 } // lltransactiontype.h - { SourceID LLUUID } - { IsSourceGroup BOOL } - { DestID LLUUID } - { IsDestGroup BOOL } - { Amount S32 } - { ItemDescription Variable 1 } // string - } + MoneyBalanceReply Low 314 Trusted Zerocoded + { + MoneyData Single + { AgentID LLUUID } + { TransactionID LLUUID } + { TransactionSuccess BOOL } + { MoneyBalance S32 } + { SquareMetersCredit S32 } + { SquareMetersCommitted S32 } + { Description Variable 1 } // string + } + // For replies that are part of a transaction (buying something) provide + // metadata for localization. If TransactionType is 0, the message is + // purely a balance update. Added for server 1.40 and viewer 2.1. JC + { + TransactionInfo Single + { TransactionType S32 } // lltransactiontype.h + { SourceID LLUUID } + { IsSourceGroup BOOL } + { DestID LLUUID } + { IsDestGroup BOOL } + { Amount S32 } + { ItemDescription Variable 1 } // string + } } @@ -6949,33 +7007,33 @@ version 2.0 // dataserver -> simulator -> spaceserver -> simulator -> viewer // reliable { - RoutedMoneyBalanceReply Low 315 Trusted Zerocoded - { - TargetBlock Single - { TargetIP IPADDR } // U32 encoded IP - { TargetPort IPPORT } - } - { - MoneyData Single - { AgentID LLUUID } - { TransactionID LLUUID } - { TransactionSuccess BOOL } // BOOL - { MoneyBalance S32 } - { SquareMetersCredit S32 } - { SquareMetersCommitted S32 } - { Description Variable 1 } // string - } - // See MoneyBalanceReply above. - { - TransactionInfo Single - { TransactionType S32 } // lltransactiontype.h - { SourceID LLUUID } - { IsSourceGroup BOOL } - { DestID LLUUID } - { IsDestGroup BOOL } - { Amount S32 } - { ItemDescription Variable 1 } // string - } + RoutedMoneyBalanceReply Low 315 Trusted Zerocoded UDPDeprecated + { + TargetBlock Single + { TargetIP IPADDR } // U32 encoded IP + { TargetPort IPPORT } + } + { + MoneyData Single + { AgentID LLUUID } + { TransactionID LLUUID } + { TransactionSuccess BOOL } + { MoneyBalance S32 } + { SquareMetersCredit S32 } + { SquareMetersCommitted S32 } + { Description Variable 1 } // string + } + // See MoneyBalanceReply above. + { + TransactionInfo Single + { TransactionType S32 } // lltransactiontype.h + { SourceID LLUUID } + { IsSourceGroup BOOL } + { DestID LLUUID } + { IsDestGroup BOOL } + { Amount S32 } + { ItemDescription Variable 1 } // string + } } @@ -6988,36 +7046,36 @@ version 2.0 // Tell the database that some gestures are now active // viewer -> sim -> data { - ActivateGestures Low 316 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { Flags U32 } - } - { - Data Variable - { ItemID LLUUID } - { AssetID LLUUID } - { GestureFlags U32 } - } + ActivateGestures Low 316 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { Flags U32 } + } + { + Data Variable + { ItemID LLUUID } + { AssetID LLUUID } + { GestureFlags U32 } + } } // Tell the database some gestures are no longer active // viewer -> sim -> data { - DeactivateGestures Low 317 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { Flags U32 } - } - { - Data Variable - { ItemID LLUUID } - { GestureFlags U32 } - } + DeactivateGestures Low 317 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { Flags U32 } + } + { + Data Variable + { ItemID LLUUID } + { GestureFlags U32 } + } } //--------------------------------------------------------------------------- @@ -7028,35 +7086,35 @@ version 2.0 // could be sent as a result of spam // as well as in response to InventoryRequest //{ -// InventoryUpdate Low Trusted Unencoded -// { -// AgentData Single -// { AgentID LLUUID } -// } -// { -// InventoryData Single -// { IsComplete U8 } -// { Filename Variable 1 } -// } +// InventoryUpdate Low Trusted Unencoded +// { +// AgentData Single +// { AgentID LLUUID } +// } +// { +// InventoryData Single +// { IsComplete U8 } +// { Filename Variable 1 } +// } //} // dataserver-> userserver -> viewer to move around the mute list { - MuteListUpdate Low 318 Trusted Unencoded - { - MuteData Single - { AgentID LLUUID } - { Filename Variable 1 } - } + MuteListUpdate Low 318 Trusted Unencoded + { + MuteData Single + { AgentID LLUUID } + { Filename Variable 1 } + } } // tell viewer to use the local mute cache { - UseCachedMuteList Low 319 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - } + UseCachedMuteList Low 319 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + } } // Sent from viewer to simulator to set user rights. This message will be @@ -7066,17 +7124,17 @@ version 2.0 // agent-related and the same PUT will be issued to the sim host if // they are online. { - GrantUserRights Low 320 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Rights Variable - { AgentRelated LLUUID } - { RelatedRights S32 } - } + GrantUserRights Low 320 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Rights Variable + { AgentRelated LLUUID } + { RelatedRights S32 } + } } // This message is sent from the simulator to the viewer to indicate a @@ -7085,69 +7143,69 @@ version 2.0 // right. Adding/removing online status rights will show up as an // online/offline notification. { - ChangeUserRights Low 321 Trusted Unencoded - { - AgentData Single - { AgentID LLUUID } - } - { - Rights Variable - { AgentRelated LLUUID } - { RelatedRights S32 } - } + ChangeUserRights Low 321 Trusted Unencoded + { + AgentData Single + { AgentID LLUUID } + } + { + Rights Variable + { AgentRelated LLUUID } + { RelatedRights S32 } + } } -// notification for login and logout. +// notification for login and logout. // source_sim -> dest_viewer { - OnlineNotification Low 322 Trusted Unencoded - { - AgentBlock Variable - { AgentID LLUUID } - } + OnlineNotification Low 322 Trusted Unencoded + { + AgentBlock Variable + { AgentID LLUUID } + } } { - OfflineNotification Low 323 Trusted Unencoded - { - AgentBlock Variable - { AgentID LLUUID } - } + OfflineNotification Low 323 Trusted Unencoded + { + AgentBlock Variable + { AgentID LLUUID } + } } // SetStartLocationRequest -// viewer -> sim -// failure checked at sim and triggers ImprovedInstantMessage -// success triggers SetStartLocation -{ - SetStartLocationRequest Low 324 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - StartLocationData Single - { SimName Variable 1 } // string - { LocationID U32 } - { LocationPos LLVector3 } // region coords - { LocationLookAt LLVector3 } - } +// viewer -> sim +// failure checked at sim and triggers ImprovedInstantMessage +// success triggers SetStartLocation +{ + SetStartLocationRequest Low 324 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + StartLocationData Single + { SimName Variable 1 } // string + { LocationID U32 } + { LocationPos LLVector3 } // region coords + { LocationLookAt LLVector3 } + } } // SetStartLocation // sim -> dataserver { - SetStartLocation Low 325 Trusted Zerocoded - { - StartLocationData Single - { AgentID LLUUID } - { RegionID LLUUID } - { LocationID U32 } - { RegionHandle U64 } - { LocationPos LLVector3 } // region coords - { LocationLookAt LLVector3 } - } + SetStartLocation Low 325 Trusted Zerocoded + { + StartLocationData Single + { AgentID LLUUID } + { RegionID LLUUID } + { LocationID U32 } + { RegionHandle U64 } + { LocationPos LLVector3 } // region coords + { LocationLookAt LLVector3 } + } } @@ -7159,21 +7217,21 @@ version 2.0 // NetTest - This goes back and forth to the space server because of // problems determining the port { - NetTest Low 326 NotTrusted Unencoded - { - NetBlock Single - { Port IPPORT } - } + NetTest Low 326 NotTrusted Unencoded + { + NetBlock Single + { Port IPPORT } + } } // SetChildCount - Sent to launcher to adjust nominal child count // Simulator sends this increase the sim/cpu ratio on startup { - SetCPURatio Low 327 NotTrusted Unencoded - { - Data Single - { Ratio U8 } - } + SetCPURatio Low 327 NotTrusted Unencoded + { + Data Single + { Ratio U8 } + } } @@ -7181,16 +7239,16 @@ version 2.0 // SimCrashed - Sent to dataserver when the sim goes down. // Maybe we should notify the spaceserver as well? { - SimCrashed Low 328 NotTrusted Unencoded - { - Data Single - { RegionX U32 } - { RegionY U32 } - } - { - Users Variable - { AgentID LLUUID } - } + SimCrashed Low 328 NotTrusted Unencoded + { + Data Single + { RegionX U32 } + { RegionY U32 } + } + { + Users Variable + { AgentID LLUUID } + } } // *************************************************************************** @@ -7199,28 +7257,28 @@ version 2.0 // NameValuePair - if the specific task exists on simulator, add or replace this name value pair { - NameValuePair Low 329 Trusted Unencoded - { - TaskData Single - { ID LLUUID } - } - { - NameValueData Variable - { NVPair Variable 2 } - } + NameValuePair Low 329 Trusted Unencoded + { + TaskData Single + { ID LLUUID } + } + { + NameValueData Variable + { NVPair Variable 2 } + } } // NameValuePair - if the specific task exists on simulator or dataserver, remove the name value pair (value is ignored) { - RemoveNameValuePair Low 330 Trusted Unencoded - { - TaskData Single - { ID LLUUID } - } - { - NameValueData Variable - { NVPair Variable 2 } - } + RemoveNameValuePair Low 330 Trusted Unencoded + { + TaskData Single + { ID LLUUID } + } + { + NameValueData Variable + { NVPair Variable 2 } + } } @@ -7229,66 +7287,66 @@ version 2.0 // *************************************************************************** // -// Simulator informs Dataserver of new attachment or attachment asset update +// Simulator informs Dataserver of new attachment or attachment asset update // DO NOT ALLOW THIS FROM THE VIEWER // { - UpdateAttachment Low 331 Trusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - AttachmentBlock Single - { AttachmentPoint U8 } - } - { - OperationData Single - { AddItem BOOL } - { UseExistingAsset BOOL } - } - { - InventoryData Single // Standard inventory item block - { ItemID LLUUID } - { FolderID LLUUID } - - { CreatorID LLUUID } // permissions - { OwnerID LLUUID } // permissions - { GroupID LLUUID } // permissions - { BaseMask U32 } // permissions - { OwnerMask U32 } // permissions - { GroupMask U32 } // permissions - { EveryoneMask U32 } // permissions - { NextOwnerMask U32 } // permissions - { GroupOwned BOOL } // permissions - - { AssetID LLUUID } - { Type S8 } - { InvType S8 } - { Flags U32 } - { SaleType U8 } - { SalePrice S32 } - { Name Variable 1 } - { Description Variable 1 } - { CreationDate S32 } - { CRC U32 } - } + UpdateAttachment Low 331 Trusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + AttachmentBlock Single + { AttachmentPoint U8 } + } + { + OperationData Single + { AddItem BOOL } + { UseExistingAsset BOOL } + } + { + InventoryData Single // Standard inventory item block + { ItemID LLUUID } + { FolderID LLUUID } + + { CreatorID LLUUID } // permissions + { OwnerID LLUUID } // permissions + { GroupID LLUUID } // permissions + { BaseMask U32 } // permissions + { OwnerMask U32 } // permissions + { GroupMask U32 } // permissions + { EveryoneMask U32 } // permissions + { NextOwnerMask U32 } // permissions + { GroupOwned BOOL } // permissions + + { AssetID LLUUID } + { Type S8 } + { InvType S8 } + { Flags U32 } + { SaleType U8 } + { SalePrice S32 } + { Name Variable 1 } + { Description Variable 1 } + { CreationDate S32 } + { CRC U32 } + } } // Simulator informs Dataserver that attachment has been taken off { - RemoveAttachment Low 332 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - AttachmentBlock Single - { AttachmentPoint U8 } - { ItemID LLUUID } - } + RemoveAttachment Low 332 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + AttachmentBlock Single + { AttachmentPoint U8 } + { ItemID LLUUID } + } } @@ -7298,57 +7356,56 @@ version 2.0 // SoundTrigger - Sent by simulator to viewer to trigger sound outside current region { - SoundTrigger High 29 NotTrusted Unencoded - { - SoundData Single - { SoundID LLUUID } - { OwnerID LLUUID } - { ObjectID LLUUID } - { ParentID LLUUID } // null if this object is the parent - { Handle U64 } // region handle - { Position LLVector3 } // region local - { Gain F32 } - } + SoundTrigger High 29 NotTrusted Unencoded + { + SoundData Single + { SoundID LLUUID } + { OwnerID LLUUID } + { ObjectID LLUUID } + { ParentID LLUUID } // null if this object is the parent + { Handle U64 } // region handle + { Position LLVector3 } // region local + { Gain F32 } + } } // AttachedSound - Sent by simulator to viewer to play sound attached with an object { - AttachedSound Medium 13 Trusted Unencoded - { - DataBlock Single - { SoundID LLUUID } - { ObjectID LLUUID } - { OwnerID LLUUID } - { Gain F32 } - { Flags U8 } - } + AttachedSound Medium 13 Trusted Unencoded + { + DataBlock Single + { SoundID LLUUID } + { ObjectID LLUUID } + { OwnerID LLUUID } + { Gain F32 } + { Flags U8 } + } } // AttachedSoundGainChange - Sent by simulator to viewer to change an attached sounds' volume { - AttachedSoundGainChange Medium 14 Trusted Unencoded - { - DataBlock Single - { ObjectID LLUUID } - { Gain F32 } - } + AttachedSoundGainChange Medium 14 Trusted Unencoded + { + DataBlock Single + { ObjectID LLUUID } + { Gain F32 } + } } // PreloadSound - Sent by simulator to viewer to preload sound for an object { - PreloadSound Medium 15 Trusted Unencoded - { - DataBlock Variable - { ObjectID LLUUID } - { OwnerID LLUUID } - { SoundID LLUUID } - } + PreloadSound Medium 15 Trusted Unencoded + { + DataBlock Variable + { ObjectID LLUUID } + { OwnerID LLUUID } + { SoundID LLUUID } + } } - // ************************************************************************* // Object animation messages // ************************************************************************* @@ -7360,16 +7417,16 @@ version 2.0 // ObjectAnimation - Update animation state // simulator --> viewer { - ObjectAnimation High 30 Trusted Unencoded - { - Sender Single - { ID LLUUID } - } - { - AnimationList Variable - { AnimID LLUUID } - { AnimSequenceID S32 } - } + ObjectAnimation High 30 Trusted Unencoded + { + Sender Single + { ID LLUUID } + } + { + AnimationList Variable + { AnimID LLUUID } + { AnimSequenceID S32 } + } } // ************************************************************************* @@ -7378,87 +7435,87 @@ version 2.0 // current assumes an existing UUID, need to enhance for new assets { - AssetUploadRequest Low 333 NotTrusted Unencoded - { - AssetBlock Single - { TransactionID LLUUID } - { Type S8 } - { Tempfile BOOL } - { StoreLocal BOOL } - { AssetData Variable 2 } // Optional: the actual asset data if the whole thing will fit it this packet - } + AssetUploadRequest Low 333 NotTrusted Unencoded + { + AssetBlock Single + { TransactionID LLUUID } + { Type S8 } + { Tempfile BOOL } + { StoreLocal BOOL } + { AssetData Variable 2 } // Optional: the actual asset data if the whole thing will fit it this packet + } } { - AssetUploadComplete Low 334 NotTrusted Unencoded - { - AssetBlock Single - { UUID LLUUID } - { Type S8 } - { Success BOOL } - } + AssetUploadComplete Low 334 NotTrusted Unencoded + { + AssetBlock Single + { UUID LLUUID } + { Type S8 } + { Success BOOL } + } } // Script on simulator asks dataserver if there are any email messages // waiting. { - EmailMessageRequest Low 335 Trusted Unencoded - { - DataBlock Single - { ObjectID LLUUID } - { FromAddress Variable 1 } - { Subject Variable 1 } - } + EmailMessageRequest Low 335 Trusted Unencoded + { + DataBlock Single + { ObjectID LLUUID } + { FromAddress Variable 1 } + { Subject Variable 1 } + } } // Dataserver gives simulator the oldest email message in the queue, along with // how many messages are left in the queue. And passes back the filter used to request emails. { - EmailMessageReply Low 336 Trusted Unencoded - { - DataBlock Single - { ObjectID LLUUID } - { More U32 } //U32 - { Time U32 } //U32 - { FromAddress Variable 1 } - { Subject Variable 1 } - { Data Variable 2 } - { MailFilter Variable 1 } - } + EmailMessageReply Low 336 Trusted Unencoded + { + DataBlock Single + { ObjectID LLUUID } + { More U32 } + { Time U32 } + { FromAddress Variable 1 } + { Subject Variable 1 } + { Data Variable 2 } + { MailFilter Variable 1 } + } } // Script on simulator sends mail to another script { - InternalScriptMail Medium 16 Trusted Unencoded - { - DataBlock Single - { From Variable 1 } - { To LLUUID } - { Subject Variable 1 } - { Body Variable 2 } - } + InternalScriptMail Medium 16 Trusted Unencoded + { + DataBlock Single + { From Variable 1 } + { To LLUUID } + { Subject Variable 1 } + { Body Variable 2 } + } } -// Script on simulator asks dataserver for information +// Script on simulator asks dataserver for information { - ScriptDataRequest Low 337 Trusted Unencoded - { - DataBlock Variable - { Hash U64 } - { RequestType S8 } - { Request Variable 2 } - } + ScriptDataRequest Low 337 Trusted Unencoded + { + DataBlock Variable + { Hash U64 } + { RequestType S8 } + { Request Variable 2 } + } } // Data server responds with data { - ScriptDataReply Low 338 Trusted Unencoded - { - DataBlock Variable - { Hash U64 } - { Reply Variable 2 } - } + ScriptDataReply Low 338 Trusted Unencoded + { + DataBlock Variable + { Hash U64 } + { Reply Variable 2 } + } } @@ -7468,26 +7525,25 @@ version 2.0 // CreateGroupRequest // viewer -> simulator -// simulator -> dataserver // reliable { - CreateGroupRequest Low 339 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - GroupData Single - { Name Variable 1 } // string - { Charter Variable 2 } // string - { ShowInList BOOL } - { InsigniaID LLUUID } - { MembershipFee S32 } // S32 - { OpenEnrollment BOOL } // BOOL (U8) - { AllowPublish BOOL } // whether profile is externally visible or not - { MaturePublish BOOL } // profile is "mature" - } + CreateGroupRequest Low 339 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + GroupData Single + { Name Variable 1 } // string + { Charter Variable 2 } // string + { ShowInList BOOL } + { InsigniaID LLUUID } + { MembershipFee S32 } + { OpenEnrollment BOOL } + { AllowPublish BOOL } // whether profile is externally visible or not + { MaturePublish BOOL } // profile is "mature" + } } // CreateGroupReply @@ -7495,17 +7551,17 @@ version 2.0 // simulator -> viewer // reliable { - CreateGroupReply Low 340 Trusted Unencoded - { - AgentData Single - { AgentID LLUUID } - } - { - ReplyData Single - { GroupID LLUUID } - { Success BOOL } - { Message Variable 1 } // string - } + CreateGroupReply Low 340 Trusted Unencoded + { + AgentData Single + { AgentID LLUUID } + } + { + ReplyData Single + { GroupID LLUUID } + { Success BOOL } + { Message Variable 1 } // string + } } // UpdateGroupInfo @@ -7513,73 +7569,73 @@ version 2.0 // simulator -> dataserver // reliable { - UpdateGroupInfo Low 341 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - GroupData Single - { GroupID LLUUID } - { Charter Variable 2 } // string - { ShowInList BOOL } - { InsigniaID LLUUID } - { MembershipFee S32 } - { OpenEnrollment BOOL } - { AllowPublish BOOL } - { MaturePublish BOOL } - } + UpdateGroupInfo Low 341 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + GroupData Single + { GroupID LLUUID } + { Charter Variable 2 } // string + { ShowInList BOOL } + { InsigniaID LLUUID } + { MembershipFee S32 } + { OpenEnrollment BOOL } + { AllowPublish BOOL } + { MaturePublish BOOL } + } } // GroupRoleChanges // viewer -> simulator -> dataserver // reliable { - GroupRoleChanges Low 342 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { GroupID LLUUID } - } - { - RoleChange Variable - { RoleID LLUUID } - { MemberID LLUUID } - { Change U32 } - } + GroupRoleChanges Low 342 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { GroupID LLUUID } + } + { + RoleChange Variable + { RoleID LLUUID } + { MemberID LLUUID } + { Change U32 } + } } // JoinGroupRequest // viewer -> simulator -> dataserver // reliable { - JoinGroupRequest Low 343 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - GroupData Single - { GroupID LLUUID } - } + JoinGroupRequest Low 343 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + GroupData Single + { GroupID LLUUID } + } } // JoinGroupReply // dataserver -> simulator -> viewer { - JoinGroupReply Low 344 Trusted Unencoded - { - AgentData Single - { AgentID LLUUID } - } - { - GroupData Single - { GroupID LLUUID } - { Success BOOL } - } + JoinGroupReply Low 344 Trusted Unencoded + { + AgentData Single + { AgentID LLUUID } + } + { + GroupData Single + { GroupID LLUUID } + { Success BOOL } + } } @@ -7587,152 +7643,156 @@ version 2.0 // viewer -> simulator -> dataserver // reliable { - EjectGroupMemberRequest Low 345 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - GroupData Single - { GroupID LLUUID } - } - { - EjectData Variable - { EjecteeID LLUUID } - } + EjectGroupMemberRequest Low 345 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + GroupData Single + { GroupID LLUUID } + } + { + EjectData Variable + { EjecteeID LLUUID } + } } // EjectGroupMemberReply // dataserver -> simulator -> viewer // reliable { - EjectGroupMemberReply Low 346 Trusted Unencoded - { - AgentData Single - { AgentID LLUUID } - } - { - GroupData Single - { GroupID LLUUID } - } - { - EjectData Single - { Success BOOL } - } + EjectGroupMemberReply Low 346 Trusted Unencoded + { + AgentData Single + { AgentID LLUUID } + } + { + GroupData Single + { GroupID LLUUID } + } + { + EjectData Single + { Success BOOL } + } } // LeaveGroupRequest // viewer -> simulator -> dataserver // reliable { - LeaveGroupRequest Low 347 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - GroupData Single - { GroupID LLUUID } - } + LeaveGroupRequest Low 347 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + GroupData Single + { GroupID LLUUID } + } } // LeaveGroupReply // dataserver -> simulator -> viewer { - LeaveGroupReply Low 348 Trusted Unencoded - { - AgentData Single - { AgentID LLUUID } - } - { - GroupData Single - { GroupID LLUUID } - { Success BOOL } - } + LeaveGroupReply Low 348 Trusted Unencoded + { + AgentData Single + { AgentID LLUUID } + } + { + GroupData Single + { GroupID LLUUID } + { Success BOOL } + } } // InviteGroupRequest // viewer -> simulator -> dataserver // reliable { - InviteGroupRequest Low 349 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } // UUID of inviting agent - { SessionID LLUUID } - } - { - GroupData Single - { GroupID LLUUID } - } - { - InviteData Variable - { InviteeID LLUUID } - { RoleID LLUUID } - } + InviteGroupRequest Low 349 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } // UUID of inviting agent + { SessionID LLUUID } + } + { + GroupData Single + { GroupID LLUUID } + } + { + InviteData Variable + { InviteeID LLUUID } + { RoleID LLUUID } + } } // InviteGroupResponse // simulator -> dataserver // reliable { - InviteGroupResponse Low 350 Trusted Unencoded - { - InviteData Single - { AgentID LLUUID } - { InviteeID LLUUID } - { GroupID LLUUID } - { RoleID LLUUID } - { MembershipFee S32 } - } + InviteGroupResponse Low 350 Trusted Unencoded + { + InviteData Single + { AgentID LLUUID } + { InviteeID LLUUID } + { GroupID LLUUID } + { RoleID LLUUID } + { MembershipFee S32 } + } + { + GroupData Single + { GroupLimit S32 } // Extra block for the agent's group limit + } } // GroupProfileRequest // viewer-> simulator -> dataserver // reliable { - GroupProfileRequest Low 351 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - GroupData Single - { GroupID LLUUID } - } + GroupProfileRequest Low 351 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + GroupData Single + { GroupID LLUUID } + } } // GroupProfileReply // dataserver -> simulator -> viewer // reliable { - GroupProfileReply Low 352 Trusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - } - { - GroupData Single - { GroupID LLUUID } - { Name Variable 1 } // string - { Charter Variable 2 } // string - { ShowInList BOOL } - { MemberTitle Variable 1 } // string - { PowersMask U64 } // U32 mask - { InsigniaID LLUUID } - { FounderID LLUUID } - { MembershipFee S32 } - { OpenEnrollment BOOL } // BOOL (U8) - { Money S32 } - { GroupMembershipCount S32 } - { GroupRolesCount S32 } - { AllowPublish BOOL } - { MaturePublish BOOL } - { OwnerRole LLUUID } - } + GroupProfileReply Low 352 Trusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + } + { + GroupData Single + { GroupID LLUUID } + { Name Variable 1 } // string + { Charter Variable 2 } // string + { ShowInList BOOL } + { MemberTitle Variable 1 } // string + { PowersMask U64 } + { InsigniaID LLUUID } + { FounderID LLUUID } + { MembershipFee S32 } + { OpenEnrollment BOOL } + { Money S32 } + { GroupMembershipCount S32 } + { GroupRolesCount S32 } + { AllowPublish BOOL } + { MaturePublish BOOL } + { OwnerRole LLUUID } + } } // CurrentInterval = 0 => this period (week, day, etc.) @@ -7740,287 +7800,287 @@ version 2.0 // viewer -> simulator -> dataserver // reliable { - GroupAccountSummaryRequest Low 353 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { GroupID LLUUID } - } - { - MoneyData Single - { RequestID LLUUID } - { IntervalDays S32 } - { CurrentInterval S32 } - } + GroupAccountSummaryRequest Low 353 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { GroupID LLUUID } + } + { + MoneyData Single + { RequestID LLUUID } + { IntervalDays S32 } + { CurrentInterval S32 } + } } // dataserver -> simulator -> viewer // Reliable { - GroupAccountSummaryReply Low 354 Trusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { GroupID LLUUID } - } - { - MoneyData Single - { RequestID LLUUID } - { IntervalDays S32 } - { CurrentInterval S32 } - { StartDate Variable 1 } // string - { Balance S32 } - { TotalCredits S32 } - { TotalDebits S32 } - { ObjectTaxCurrent S32 } - { LightTaxCurrent S32 } - { LandTaxCurrent S32 } - { GroupTaxCurrent S32 } - { ParcelDirFeeCurrent S32 } - { ObjectTaxEstimate S32 } - { LightTaxEstimate S32 } - { LandTaxEstimate S32 } - { GroupTaxEstimate S32 } - { ParcelDirFeeEstimate S32 } - { NonExemptMembers S32 } - { LastTaxDate Variable 1 } // string - { TaxDate Variable 1 } // string - } + GroupAccountSummaryReply Low 354 Trusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { GroupID LLUUID } + } + { + MoneyData Single + { RequestID LLUUID } + { IntervalDays S32 } + { CurrentInterval S32 } + { StartDate Variable 1 } // string + { Balance S32 } + { TotalCredits S32 } + { TotalDebits S32 } + { ObjectTaxCurrent S32 } + { LightTaxCurrent S32 } + { LandTaxCurrent S32 } + { GroupTaxCurrent S32 } + { ParcelDirFeeCurrent S32 } + { ObjectTaxEstimate S32 } + { LightTaxEstimate S32 } + { LandTaxEstimate S32 } + { GroupTaxEstimate S32 } + { ParcelDirFeeEstimate S32 } + { NonExemptMembers S32 } + { LastTaxDate Variable 1 } // string + { TaxDate Variable 1 } // string + } } // Reliable { - GroupAccountDetailsRequest Low 355 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { GroupID LLUUID } - } - { - MoneyData Single - { RequestID LLUUID } - { IntervalDays S32 } - { CurrentInterval S32 } - } + GroupAccountDetailsRequest Low 355 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { GroupID LLUUID } + } + { + MoneyData Single + { RequestID LLUUID } + { IntervalDays S32 } + { CurrentInterval S32 } + } } // Reliable { - GroupAccountDetailsReply Low 356 Trusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { GroupID LLUUID } - } - { - MoneyData Single - { RequestID LLUUID } - { IntervalDays S32 } - { CurrentInterval S32 } - { StartDate Variable 1 } // string - } - { - HistoryData Variable - { Description Variable 1 } // string - { Amount S32 } - } + GroupAccountDetailsReply Low 356 Trusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { GroupID LLUUID } + } + { + MoneyData Single + { RequestID LLUUID } + { IntervalDays S32 } + { CurrentInterval S32 } + { StartDate Variable 1 } // string + } + { + HistoryData Variable + { Description Variable 1 } // string + { Amount S32 } + } } // Reliable { - GroupAccountTransactionsRequest Low 357 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { GroupID LLUUID } - } - { - MoneyData Single - { RequestID LLUUID } - { IntervalDays S32 } - { CurrentInterval S32 } - } + GroupAccountTransactionsRequest Low 357 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { GroupID LLUUID } + } + { + MoneyData Single + { RequestID LLUUID } + { IntervalDays S32 } + { CurrentInterval S32 } + } } // Reliable { - GroupAccountTransactionsReply Low 358 Trusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { GroupID LLUUID } - } - { - MoneyData Single - { RequestID LLUUID } - { IntervalDays S32 } - { CurrentInterval S32 } - { StartDate Variable 1 } // string - } - { - HistoryData Variable - { Time Variable 1 } // string - { User Variable 1 } // string - { Type S32 } - { Item Variable 1 } // string - { Amount S32 } - } + GroupAccountTransactionsReply Low 358 Trusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { GroupID LLUUID } + } + { + MoneyData Single + { RequestID LLUUID } + { IntervalDays S32 } + { CurrentInterval S32 } + { StartDate Variable 1 } // string + } + { + HistoryData Variable + { Time Variable 1 } // string + { User Variable 1 } // string + { Type S32 } + { Item Variable 1 } // string + { Amount S32 } + } } // GroupActiveProposalsRequest // viewer -> simulator -> dataserver //reliable { - GroupActiveProposalsRequest Low 359 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - GroupData Single - { GroupID LLUUID } - } - { - TransactionData Single - { TransactionID LLUUID } - } + GroupActiveProposalsRequest Low 359 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + GroupData Single + { GroupID LLUUID } + } + { + TransactionData Single + { TransactionID LLUUID } + } } // GroupActiveProposalItemReply // dataserver -> simulator -> viewer // reliable { - GroupActiveProposalItemReply Low 360 Trusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { GroupID LLUUID } - } - { - TransactionData Single - { TransactionID LLUUID } - { TotalNumItems U32 } - } - { - ProposalData Variable - { VoteID LLUUID } - { VoteInitiator LLUUID } - { TerseDateID Variable 1 } // string - { StartDateTime Variable 1 } // string - { EndDateTime Variable 1 } // string - { AlreadyVoted BOOL } - { VoteCast Variable 1 } // string - { Majority F32 } - { Quorum S32 } - { ProposalText Variable 1 } // string - } + GroupActiveProposalItemReply Low 360 Trusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { GroupID LLUUID } + } + { + TransactionData Single + { TransactionID LLUUID } + { TotalNumItems U32 } + } + { + ProposalData Variable + { VoteID LLUUID } + { VoteInitiator LLUUID } + { TerseDateID Variable 1 } // string + { StartDateTime Variable 1 } // string + { EndDateTime Variable 1 } // string + { AlreadyVoted BOOL } + { VoteCast Variable 1 } // string + { Majority F32 } + { Quorum S32 } + { ProposalText Variable 1 } // string + } } // GroupVoteHistoryRequest // viewer -> simulator -> dataserver //reliable { - GroupVoteHistoryRequest Low 361 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - GroupData Single - { GroupID LLUUID } - } - { - TransactionData Single - { TransactionID LLUUID } - } + GroupVoteHistoryRequest Low 361 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + GroupData Single + { GroupID LLUUID } + } + { + TransactionData Single + { TransactionID LLUUID } + } } // GroupVoteHistoryItemReply // dataserver -> simulator -> viewer // reliable { - GroupVoteHistoryItemReply Low 362 Trusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { GroupID LLUUID } - } - { - TransactionData Single - { TransactionID LLUUID } - { TotalNumItems U32 } - } - { - HistoryItemData Single - { VoteID LLUUID } - { TerseDateID Variable 1 } // string - { StartDateTime Variable 1 } // string - { EndDateTime Variable 1 } // string - { VoteInitiator LLUUID } - { VoteType Variable 1 } // string - { VoteResult Variable 1 } // string - { Majority F32 } - { Quorum S32 } - { ProposalText Variable 2 } // string - } - { - VoteItem Variable - { CandidateID LLUUID } - { VoteCast Variable 1 } // string - { NumVotes S32 } - } + GroupVoteHistoryItemReply Low 362 Trusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { GroupID LLUUID } + } + { + TransactionData Single + { TransactionID LLUUID } + { TotalNumItems U32 } + } + { + HistoryItemData Single + { VoteID LLUUID } + { TerseDateID Variable 1 } // string + { StartDateTime Variable 1 } // string + { EndDateTime Variable 1 } // string + { VoteInitiator LLUUID } + { VoteType Variable 1 } // string + { VoteResult Variable 1 } // string + { Majority F32 } + { Quorum S32 } + { ProposalText Variable 2 } // string + } + { + VoteItem Variable + { CandidateID LLUUID } + { VoteCast Variable 1 } // string + { NumVotes S32 } + } } // StartGroupProposal // viewer -> simulator -> dataserver // reliable { - StartGroupProposal Low 363 NotTrusted Zerocoded UDPDeprecated - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ProposalData Single - { GroupID LLUUID } - { Quorum S32 } - { Majority F32 } // F32 - { Duration S32 } // S32, seconds - { ProposalText Variable 1 } // string - } + StartGroupProposal Low 363 NotTrusted Zerocoded UDPDeprecated + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ProposalData Single + { GroupID LLUUID } + { Quorum S32 } + { Majority F32 } + { Duration S32 } // seconds + { ProposalText Variable 1 } // string + } } // GroupProposalBallot // viewer -> simulator -> dataserver // reliable { - GroupProposalBallot Low 364 NotTrusted Unencoded UDPDeprecated - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ProposalData Single - { ProposalID LLUUID } - { GroupID LLUUID } - { VoteCast Variable 1 } // string - } + GroupProposalBallot Low 364 NotTrusted Unencoded UDPDeprecated + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ProposalData Single + { ProposalID LLUUID } + { GroupID LLUUID } + { VoteCast Variable 1 } // string + } } // TallyVotes userserver -> dataserver // reliable { - TallyVotes Low 365 Trusted Unencoded + TallyVotes Low 365 Trusted Unencoded } @@ -8030,17 +8090,17 @@ version 2.0 // simulator -> dataserver // reliable { - GroupMembersRequest Low 366 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - GroupData Single - { GroupID LLUUID } - { RequestID LLUUID } - } + GroupMembersRequest Low 366 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + GroupData Single + { GroupID LLUUID } + { RequestID LLUUID } + } } // GroupMembersReply @@ -8048,88 +8108,88 @@ version 2.0 // dataserver -> simulator // reliable { - GroupMembersReply Low 367 Trusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - } - { - GroupData Single - { GroupID LLUUID } - { RequestID LLUUID } - { MemberCount S32 } - } - { - MemberData Variable - { AgentID LLUUID } - { Contribution S32 } - { OnlineStatus Variable 1 } // string - { AgentPowers U64 } - { Title Variable 1 } // string - { IsOwner BOOL } - } + GroupMembersReply Low 367 Trusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + } + { + GroupData Single + { GroupID LLUUID } + { RequestID LLUUID } + { MemberCount S32 } + } + { + MemberData Variable + { AgentID LLUUID } + { Contribution S32 } + { OnlineStatus Variable 1 } // string + { AgentPowers U64 } + { Title Variable 1 } // string + { IsOwner BOOL } + } } // used to switch an agent's currently active group. // viewer -> simulator -> dataserver -> AgentDataUpdate... { - ActivateGroup Low 368 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { GroupID LLUUID } - } + ActivateGroup Low 368 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { GroupID LLUUID } + } } // viewer -> simulator -> dataserver { - SetGroupContribution Low 369 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Data Single - { GroupID LLUUID } - { Contribution S32 } - } + SetGroupContribution Low 369 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Data Single + { GroupID LLUUID } + { Contribution S32 } + } } // viewer -> simulator -> dataserver { - SetGroupAcceptNotices Low 370 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Data Single - { GroupID LLUUID } - { AcceptNotices BOOL } - } - { - NewData Single - { ListInProfile BOOL } - } + SetGroupAcceptNotices Low 370 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Data Single + { GroupID LLUUID } + { AcceptNotices BOOL } + } + { + NewData Single + { ListInProfile BOOL } + } } // GroupRoleDataRequest // viewer -> simulator -> dataserver { - GroupRoleDataRequest Low 371 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - GroupData Single - { GroupID LLUUID } - { RequestID LLUUID } - } + GroupRoleDataRequest Low 371 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + GroupData Single + { GroupID LLUUID } + { RequestID LLUUID } + } } @@ -8137,152 +8197,152 @@ version 2.0 // All role data for this group // dataserver -> simulator -> agent { - GroupRoleDataReply Low 372 Trusted Unencoded - { - AgentData Single - { AgentID LLUUID } - } - { - GroupData Single - { GroupID LLUUID } - { RequestID LLUUID } - { RoleCount S32 } - } - { - RoleData Variable - { RoleID LLUUID } - { Name Variable 1 } - { Title Variable 1 } - { Description Variable 1 } - { Powers U64 } - { Members U32 } - } + GroupRoleDataReply Low 372 Trusted Unencoded + { + AgentData Single + { AgentID LLUUID } + } + { + GroupData Single + { GroupID LLUUID } + { RequestID LLUUID } + { RoleCount S32 } + } + { + RoleData Variable + { RoleID LLUUID } + { Name Variable 1 } + { Title Variable 1 } + { Description Variable 1 } + { Powers U64 } + { Members U32 } + } } // GroupRoleMembersRequest // viewer -> simulator -> dataserver { - GroupRoleMembersRequest Low 373 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - GroupData Single - { GroupID LLUUID } - { RequestID LLUUID } - } + GroupRoleMembersRequest Low 373 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + GroupData Single + { GroupID LLUUID } + { RequestID LLUUID } + } } // GroupRoleMembersReply // All role::member pairs for this group. // dataserver -> simulator -> agent { - GroupRoleMembersReply Low 374 Trusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { GroupID LLUUID } - { RequestID LLUUID } - { TotalPairs U32 } - } - { - MemberData Variable - { RoleID LLUUID } - { MemberID LLUUID } - } + GroupRoleMembersReply Low 374 Trusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { GroupID LLUUID } + { RequestID LLUUID } + { TotalPairs U32 } + } + { + MemberData Variable + { RoleID LLUUID } + { MemberID LLUUID } + } } // GroupTitlesRequest // viewer -> simulator -> dataserver { - GroupTitlesRequest Low 375 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { GroupID LLUUID } - { RequestID LLUUID } - } + GroupTitlesRequest Low 375 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { GroupID LLUUID } + { RequestID LLUUID } + } } // GroupTitlesReply // dataserver -> simulator -> viewer { - GroupTitlesReply Low 376 Trusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { GroupID LLUUID } - { RequestID LLUUID } - } - { - GroupData Variable - { Title Variable 1 } // string - { RoleID LLUUID } - { Selected BOOL } - } + GroupTitlesReply Low 376 Trusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { GroupID LLUUID } + { RequestID LLUUID } + } + { + GroupData Variable + { Title Variable 1 } // string + { RoleID LLUUID } + { Selected BOOL } + } } // GroupTitleUpdate // viewer -> simulator -> dataserver { - GroupTitleUpdate Low 377 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { GroupID LLUUID } - { TitleRoleID LLUUID } - } + GroupTitleUpdate Low 377 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { GroupID LLUUID } + { TitleRoleID LLUUID } + } } // GroupRoleUpdate // viewer -> simulator -> dataserver { - GroupRoleUpdate Low 378 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { GroupID LLUUID } - } - { - RoleData Variable - { RoleID LLUUID } - { Name Variable 1 } - { Description Variable 1 } - { Title Variable 1 } - { Powers U64 } - { UpdateType U8 } - } -} - + GroupRoleUpdate Low 378 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { GroupID LLUUID } + } + { + RoleData Variable + { RoleID LLUUID } + { Name Variable 1 } + { Description Variable 1 } + { Title Variable 1 } + { Powers U64 } + { UpdateType U8 } + } +} + // Request the members of the live help group needed for requesting agent. // userserver -> dataserver { - LiveHelpGroupRequest Low 379 Trusted Unencoded - { - RequestData Single - { RequestID LLUUID } - { AgentID LLUUID } - } + LiveHelpGroupRequest Low 379 Trusted Unencoded + { + RequestData Single + { RequestID LLUUID } + { AgentID LLUUID } + } } // Send down the group // dataserver -> userserver { - LiveHelpGroupReply Low 380 Trusted Unencoded - { - ReplyData Single - { RequestID LLUUID } - { GroupID LLUUID } - { Selection Variable 1 } // selection criteria all or active - } + LiveHelpGroupReply Low 380 Trusted Unencoded + { + ReplyData Single + { RequestID LLUUID } + { GroupID LLUUID } + { Selection Variable 1 } // selection criteria all or active + } } //----------------------------------------------------------------------------- @@ -8294,12 +8354,12 @@ version 2.0 // viewer -> simulator -> dataserver // reliable { - AgentWearablesRequest Low 381 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } + AgentWearablesRequest Low 381 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } } // AgentWearablesUpdate @@ -8308,19 +8368,19 @@ version 2.0 // reliable // NEVER from viewer to sim { - AgentWearablesUpdate Low 382 Trusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { SerialNum U32 } // U32, Increases every time the wearables change for a given agent. Used to avoid processing out of order packets. - } - { - WearableData Variable - { ItemID LLUUID } - { AssetID LLUUID } - { WearableType U8 } // U8, LLWearable::EWearType - } + AgentWearablesUpdate Low 382 Trusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { SerialNum U32 } // Increases every time the wearables change for a given agent. Used to avoid processing out of order packets. + } + { + WearableData Variable + { ItemID LLUUID } + { AssetID LLUUID } + { WearableType U8 } // LLWearable::EWearType + } } // @@ -8329,37 +8389,37 @@ version 2.0 // viewer->sim->dataserver // reliable { - AgentIsNowWearing Low 383 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - WearableData Variable - { ItemID LLUUID } - { WearableType U8 } - } + AgentIsNowWearing Low 383 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + WearableData Variable + { ItemID LLUUID } + { WearableType U8 } + } } - + // AgentCachedTexture // viewer queries for cached textures on dataserver (via simulator) // viewer -> simulator -> dataserver // reliable { - AgentCachedTexture Low 384 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { SerialNum S32 } - } - { - WearableData Variable - { ID LLUUID } - { TextureIndex U8 } - } + AgentCachedTexture Low 384 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { SerialNum S32 } + } + { + WearableData Variable + { ID LLUUID } + { TextureIndex U8 } + } } // AgentCachedTextureResponse @@ -8367,29 +8427,29 @@ version 2.0 // dataserver -> simulator -> viewer // reliable { - AgentCachedTextureResponse Low 385 Trusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { SerialNum S32 } - } - { - WearableData Variable - { TextureID LLUUID } - { TextureIndex U8 } - { HostName Variable 1 } - } + AgentCachedTextureResponse Low 385 Trusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { SerialNum S32 } + } + { + WearableData Variable + { TextureID LLUUID } + { TextureIndex U8 } + { HostName Variable 1 } + } } // Request an AgentDataUpdate without changing any agent data. { - AgentDataUpdateRequest Low 386 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } + AgentDataUpdateRequest Low 386 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } } // AgentDataUpdate @@ -8398,17 +8458,17 @@ version 2.0 // dataserver -> simulator -> viewer // reliable { - AgentDataUpdate Low 387 Trusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { FirstName Variable 1 } // string - { LastName Variable 1 } // string - { GroupTitle Variable 1 } // string - { ActiveGroupID LLUUID } // active group - { GroupPowers U64 } - { GroupName Variable 1 } // string - } + AgentDataUpdate Low 387 Trusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { FirstName Variable 1 } // string + { LastName Variable 1 } // string + { GroupTitle Variable 1 } // string + { ActiveGroupID LLUUID } // active group + { GroupPowers U64 } + { GroupName Variable 1 } // string + } } @@ -8416,35 +8476,35 @@ version 2.0 // This is a bunch of group data that needs to be appropriatly routed based on presence info. // dataserver -> simulator { - GroupDataUpdate Low 388 Trusted Zerocoded - { - AgentGroupData Variable - { AgentID LLUUID } - { GroupID LLUUID } - { AgentPowers U64 } - { GroupTitle Variable 1 } - } + GroupDataUpdate Low 388 Trusted Zerocoded + { + AgentGroupData Variable + { AgentID LLUUID } + { GroupID LLUUID } + { AgentPowers U64 } + { GroupTitle Variable 1 } + } } // AgentGroupDataUpdate -// Updates a viewer or simulator's impression of the groups an agent is in. +// Updates a viewer or simulator's impression of the groups an agent is in. // dataserver -> simulator -> viewer // reliable { - AgentGroupDataUpdate Low 389 Trusted Zerocoded UDPDeprecated - { - AgentData Single - { AgentID LLUUID } - } - { - GroupData Variable - { GroupID LLUUID } - { GroupPowers U64 } - { AcceptNotices BOOL } - { GroupInsigniaID LLUUID } - { Contribution S32 } - { GroupName Variable 1 } // string - } + AgentGroupDataUpdate Low 389 Trusted Zerocoded UDPDeprecated + { + AgentData Single + { AgentID LLUUID } + } + { + GroupData Variable + { GroupID LLUUID } + { GroupPowers U64 } + { AcceptNotices BOOL } + { GroupInsigniaID LLUUID } + { Contribution S32 } + { GroupName Variable 1 } // string + } } // AgentDropGroup @@ -8453,12 +8513,12 @@ version 2.0 // dataserver -> userserver // reliable { - AgentDropGroup Low 390 Trusted Zerocoded UDPDeprecated - { - AgentData Single - { AgentID LLUUID } - { GroupID LLUUID } - } + AgentDropGroup Low 390 Trusted Zerocoded UDPDeprecated + { + AgentData Single + { AgentID LLUUID } + { GroupID LLUUID } + } } // LogTextMessage @@ -8466,16 +8526,16 @@ version 2.0 // chat and IM log table. // Sent from userserver (IM logging) and simulator (chat logging). { - LogTextMessage Low 391 Trusted Zerocoded - { - DataBlock Variable - { FromAgentId LLUUID } - { ToAgentId LLUUID } - { GlobalX F64 } - { GlobalY F64 } - { Time U32 } // utc seconds since epoch - { Message Variable 2 } // string - } + LogTextMessage Low 391 Trusted Zerocoded + { + DataBlock Variable + { FromAgentId LLUUID } + { ToAgentId LLUUID } + { GlobalX F64 } + { GlobalY F64 } + { Time U32 } // utc seconds since epoch + { Message Variable 2 } // string + } } // ViewerEffect @@ -8484,21 +8544,21 @@ version 2.0 // sim-->viewer (multiple effects that can be seen by viewer) // the AgentData block used for authentication for viewer-->sim messages { - ViewerEffect Medium 17 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - Effect Variable - { ID LLUUID } // unique UUID of the effect - { AgentID LLUUID } // yes, pack AgentID again (note this block is variable) - { Type U8 } // Type of the effect - { Duration F32 } // F32 time (seconds) - { Color Fixed 4 } // Color4U - { TypeData Variable 1 } // Type specific data - } + ViewerEffect Medium 17 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + Effect Variable + { ID LLUUID } // unique UUID of the effect + { AgentID LLUUID } // yes, pack AgentID again (note this block is variable) + { Type U8 } // Type of the effect + { Duration F32 } // F32 time (seconds) + { Color Fixed 4 } // Color4U + { TypeData Variable 1 } // Type specific data + } } @@ -8506,12 +8566,12 @@ version 2.0 // Sent to establish a trust relationship between two components. // Only sent in response to a DenyTrustedCircuit message. { - CreateTrustedCircuit Low 392 NotTrusted Unencoded - { - DataBlock Single - { EndPointID LLUUID } - { Digest Fixed 32 } // 32 hex digits == 1 MD5 Digest - } + CreateTrustedCircuit Low 392 NotTrusted Unencoded + { + DataBlock Single + { EndPointID LLUUID } + { Digest Fixed 32 } // 32 hex digits == 1 MD5 Digest + } } // DenyTrustedCircuit @@ -8521,97 +8581,97 @@ version 2.0 // - the reception of a trusted message on a non-trusted circuit // This allows us to re-auth a circuit if it gets closed due to timeouts or network failures. { - DenyTrustedCircuit Low 393 NotTrusted Unencoded - { - DataBlock Single - { EndPointID LLUUID } - } + DenyTrustedCircuit Low 393 NotTrusted Unencoded + { + DataBlock Single + { EndPointID LLUUID } + } } // RequestTrustedCircuit // If the destination does not trust the sender, a Deny is sent back. { - RequestTrustedCircuit Low 394 Trusted Unencoded -} - - -{ - RezSingleAttachmentFromInv Low 395 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ObjectData Single - { ItemID LLUUID } - { OwnerID LLUUID } - { AttachmentPt U8 } // 0 for default - { ItemFlags U32 } - { GroupMask U32 } - { EveryoneMask U32 } - { NextOwnerMask U32 } - { Name Variable 1 } - { Description Variable 1 } - } -} - -{ - RezMultipleAttachmentsFromInv Low 396 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - HeaderData Single - { CompoundMsgID LLUUID } // All messages a single "compound msg" must have the same id - { TotalObjects U8 } - { FirstDetachAll BOOL } - } - { - ObjectData Variable // 1 to 4 of these per packet - { ItemID LLUUID } - { OwnerID LLUUID } - { AttachmentPt U8 } // 0 for default - { ItemFlags U32 } - { GroupMask U32 } - { EveryoneMask U32 } - { NextOwnerMask U32 } - { Name Variable 1 } - { Description Variable 1 } - } -} - - -{ - DetachAttachmentIntoInv Low 397 NotTrusted Unencoded - { - ObjectData Single - { AgentID LLUUID } - { ItemID LLUUID } - } + RequestTrustedCircuit Low 394 Trusted Unencoded +} + + +{ + RezSingleAttachmentFromInv Low 395 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ObjectData Single + { ItemID LLUUID } + { OwnerID LLUUID } + { AttachmentPt U8 } // 0 for default + { ItemFlags U32 } + { GroupMask U32 } + { EveryoneMask U32 } + { NextOwnerMask U32 } + { Name Variable 1 } + { Description Variable 1 } + } +} + +{ + RezMultipleAttachmentsFromInv Low 396 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + HeaderData Single + { CompoundMsgID LLUUID } // All messages a single "compound msg" must have the same id + { TotalObjects U8 } + { FirstDetachAll BOOL } + } + { + ObjectData Variable // 1 to 4 of these per packet + { ItemID LLUUID } + { OwnerID LLUUID } + { AttachmentPt U8 } // 0 for default + { ItemFlags U32 } + { GroupMask U32 } + { EveryoneMask U32 } + { NextOwnerMask U32 } + { Name Variable 1 } + { Description Variable 1 } + } +} + + +{ + DetachAttachmentIntoInv Low 397 NotTrusted Unencoded + { + ObjectData Single + { AgentID LLUUID } + { ItemID LLUUID } + } } // Viewer -> Sim // Used in "Make New Outfit" { - CreateNewOutfitAttachments Low 398 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - HeaderData Single - { NewFolderID LLUUID } - } - { - ObjectData Variable - { OldItemID LLUUID } - { OldFolderID LLUUID } - } + CreateNewOutfitAttachments Low 398 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + HeaderData Single + { NewFolderID LLUUID } + } + { + ObjectData Variable + { OldItemID LLUUID } + { OldFolderID LLUUID } + } } //----------------------------------------------------------------------------- @@ -8619,40 +8679,40 @@ version 2.0 //----------------------------------------------------------------------------- { - UserInfoRequest Low 399 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } + UserInfoRequest Low 399 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } } { - UserInfoReply Low 400 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - } - { - UserData Single - { IMViaEMail BOOL } - { DirectoryVisibility Variable 1 } - { EMail Variable 2 } - } + UserInfoReply Low 400 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + } + { + UserData Single + { IMViaEMail BOOL } + { DirectoryVisibility Variable 1 } + { EMail Variable 2 } + } } { - UpdateUserInfo Low 401 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - UserData Single - { IMViaEMail BOOL } - { DirectoryVisibility Variable 1 } - } + UpdateUserInfo Low 401 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + UserData Single + { IMViaEMail BOOL } + { DirectoryVisibility Variable 1 } + } } @@ -8664,44 +8724,44 @@ version 2.0 // spaceserver -> sim // tell a particular simulator to rename a parcel { - ParcelRename Low 402 Trusted Unencoded - { - ParcelData Variable - { ParcelID LLUUID } - { NewName Variable 1 } // string - } + ParcelRename Low 402 Trusted Unencoded + { + ParcelData Variable + { ParcelID LLUUID } + { NewName Variable 1 } // string + } } // sim -> viewer // initiate upload. primarily used for uploading raw files. { - InitiateDownload Low 403 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - } - { - FileData Single - { SimFilename Variable 1 } // string - { ViewerFilename Variable 1 } // string - } + InitiateDownload Low 403 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + } + { + FileData Single + { SimFilename Variable 1 } // string + { ViewerFilename Variable 1 } // string + } } // Generalized system message. Each Requst has its own protocol for // the StringData block format and contents. { SystemMessage Low 404 Trusted Zerocoded - { - MethodData Single - { Method Variable 1 } - { Invoice LLUUID } - { Digest Fixed 32 } // 32 hex digits == 1 MD5 Digest - } - { - ParamList Variable - { Parameter Variable 1 } - } + { + MethodData Single + { Method Variable 1 } + { Invoice LLUUID } + { Digest Fixed 32 } // 32 hex digits == 1 MD5 Digest + } + { + ParamList Variable + { Parameter Variable 1 } + } } @@ -8715,33 +8775,33 @@ version 2.0 // of all map layers and NULL-layer sims. // Returns: MapLayerReply and MapBlockReply { - MapLayerRequest Low 405 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { Flags U32 } - { EstateID U32 } // filled in on sim - { Godlike BOOL } // filled in on sim - } + MapLayerRequest Low 405 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { Flags U32 } + { EstateID U32 } // filled in on sim + { Godlike BOOL } // filled in on sim + } } // sim -> viewer { - MapLayerReply Low 406 Trusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { Flags U32 } - } - { - LayerData Variable - { Left U32 } - { Right U32 } - { Top U32 } - { Bottom U32 } - { ImageID LLUUID } - } + MapLayerReply Low 406 Trusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { Flags U32 } + } + { + LayerData Variable + { Left U32 } + { Right U32 } + { Top U32 } + { Bottom U32 } + { ImageID LLUUID } + } } // viewer -> sim @@ -8749,22 +8809,22 @@ version 2.0 // of the sims in a specified region. // Returns: MapBlockReply { - MapBlockRequest Low 407 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { Flags U32 } - { EstateID U32 } // filled in on sim - { Godlike BOOL } // filled in on sim - } - { - PositionData Single - { MinX U16 } // in region-widths - { MaxX U16 } // in region-widths - { MinY U16 } // in region-widths - { MaxY U16 } // in region-widths - } + MapBlockRequest Low 407 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { Flags U32 } + { EstateID U32 } // filled in on sim + { Godlike BOOL } // filled in on sim + } + { + PositionData Single + { MinX U16 } // in region-widths + { MaxX U16 } // in region-widths + { MinY U16 } // in region-widths + { MaxY U16 } // in region-widths + } } // viewer -> sim @@ -8772,40 +8832,40 @@ version 2.0 // of the sims with a given name. // Returns: MapBlockReply { - MapNameRequest Low 408 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { Flags U32 } - { EstateID U32 } // filled in on sim - { Godlike BOOL } // filled in on sim - } - { - NameData Single - { Name Variable 1 } // string - } + MapNameRequest Low 408 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { Flags U32 } + { EstateID U32 } // filled in on sim + { Godlike BOOL } // filled in on sim + } + { + NameData Single + { Name Variable 1 } // string + } } // sim -> viewer { - MapBlockReply Low 409 Trusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { Flags U32 } - } - { - Data Variable - { X U16 } // in region-widths - { Y U16 } // in region-widths - { Name Variable 1 } // string - { Access U8 } // PG, mature, etc. - { RegionFlags U32 } - { WaterHeight U8 } // meters - { Agents U8 } - { MapImageID LLUUID } - } + MapBlockReply Low 409 Trusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { Flags U32 } + } + { + Data Variable + { X U16 } // in region-widths + { Y U16 } // in region-widths + { Name Variable 1 } // string + { Access U8 } // PG, mature, etc. + { RegionFlags U32 } + { WaterHeight U8 } // meters + { Agents U8 } + { MapImageID LLUUID } + } } // viewer -> sim @@ -8814,43 +8874,43 @@ version 2.0 // Used for Telehubs, Agents, Events, Popular Places, etc. // Returns: MapBlockReply { - MapItemRequest Low 410 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { Flags U32 } - { EstateID U32 } // filled in on sim - { Godlike BOOL } // filled in on sim - } - { - RequestData Single - { ItemType U32 } - { RegionHandle U64 } // filled in on sim - } + MapItemRequest Low 410 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { Flags U32 } + { EstateID U32 } // filled in on sim + { Godlike BOOL } // filled in on sim + } + { + RequestData Single + { ItemType U32 } + { RegionHandle U64 } // filled in on sim + } } // sim -> viewer { - MapItemReply Low 411 Trusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { Flags U32 } - } - { - RequestData Single - { ItemType U32 } - } - { - Data Variable - { X U32 } // global position - { Y U32 } // global position - { ID LLUUID } // identifier id - { Extra S32 } // extra information - { Extra2 S32 } // extra information - { Name Variable 1 } // identifier string - } + MapItemReply Low 411 Trusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { Flags U32 } + } + { + RequestData Single + { ItemType U32 } + } + { + Data Variable + { X U32 } // global position + { Y U32 } // global position + { ID LLUUID } // identifier id + { Extra S32 } // extra information + { Extra2 S32 } // extra information + { Name Variable 1 } // identifier string + } } //----------------------------------------------------------------------------- @@ -8858,21 +8918,21 @@ version 2.0 //----------------------------------------------------------------------------- // reliable { - SendPostcard Low 412 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - { AssetID LLUUID } - { PosGlobal LLVector3d } // Where snapshot was taken - { To Variable 1 } // dest email address(es) - { From Variable 1 } // src email address(es) - { Name Variable 1 } // src name - { Subject Variable 1 } // mail subject - { Msg Variable 2 } // message text - { AllowPublish BOOL } // Allow publishing on the web. - { MaturePublish BOOL } // profile is "mature" - } + SendPostcard Low 412 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { AssetID LLUUID } + { PosGlobal LLVector3d } // Where snapshot was taken + { To Variable 1 } // dest email address(es) + { From Variable 1 } // src email address(es) + { Name Variable 1 } // src name + { Subject Variable 1 } // mail subject + { Msg Variable 2 } // message text + { AllowPublish BOOL } // Allow publishing on the web. + { MaturePublish BOOL } // profile is "mature" + } } // RPC messages @@ -8881,11 +8941,11 @@ version 2.0 { RpcChannelRequest Low 413 Trusted Unencoded { - DataBlock Single - { GridX U32 } - { GridY U32 } - { TaskID LLUUID } - { ItemID LLUUID } + DataBlock Single + { GridX U32 } + { GridY U32 } + { TaskID LLUUID } + { ItemID LLUUID } } } @@ -8895,9 +8955,9 @@ version 2.0 { RpcChannelReply Low 414 Trusted Unencoded { - DataBlock Single + DataBlock Single { TaskID LLUUID } - { ItemID LLUUID } + { ItemID LLUUID } { ChannelID LLUUID } } } @@ -8907,175 +8967,175 @@ version 2.0 // RpcScriptRequestInboundForward: spaceserver -> simulator // reply: simulator -> rpcserver { - RpcScriptRequestInbound Low 415 NotTrusted Unencoded - { - TargetBlock Single - { GridX U32 } - { GridY U32 } - } - { - DataBlock Single - { TaskID LLUUID } - { ItemID LLUUID } - { ChannelID LLUUID } - { IntValue U32 } - { StringValue Variable 2 } // string - } + RpcScriptRequestInbound Low 415 NotTrusted Unencoded + { + TargetBlock Single + { GridX U32 } + { GridY U32 } + } + { + DataBlock Single + { TaskID LLUUID } + { ItemID LLUUID } + { ChannelID LLUUID } + { IntValue U32 } + { StringValue Variable 2 } // string + } } // spaceserver -> simulator { - RpcScriptRequestInboundForward Low 416 Trusted Unencoded UDPDeprecated - { - DataBlock Single - { RPCServerIP IPADDR } - { RPCServerPort IPPORT } - { TaskID LLUUID } - { ItemID LLUUID } - { ChannelID LLUUID } - { IntValue U32 } - { StringValue Variable 2 } // string - } + RpcScriptRequestInboundForward Low 416 Trusted Unencoded UDPDeprecated + { + DataBlock Single + { RPCServerIP IPADDR } + { RPCServerPort IPPORT } + { TaskID LLUUID } + { ItemID LLUUID } + { ChannelID LLUUID } + { IntValue U32 } + { StringValue Variable 2 } // string + } } // simulator -> rpcserver // Not trusted because trust establishment doesn't work here. { - RpcScriptReplyInbound Low 417 NotTrusted Unencoded - { - DataBlock Single - { TaskID LLUUID } - { ItemID LLUUID } - { ChannelID LLUUID } - { IntValue U32 } - { StringValue Variable 2 } // string - } + RpcScriptReplyInbound Low 417 NotTrusted Unencoded + { + DataBlock Single + { TaskID LLUUID } + { ItemID LLUUID } + { ChannelID LLUUID } + { IntValue U32 } + { StringValue Variable 2 } // string + } } // ScriptMailRegistration // Simulator -> dataserver { - ScriptMailRegistration Low 418 Trusted Unencoded - { - DataBlock Single - { TargetIP Variable 1 } // String IP - { TargetPort IPPORT } - { TaskID LLUUID } - { Flags U32 } - } + ScriptMailRegistration Low 418 Trusted Unencoded + { + DataBlock Single + { TargetIP Variable 1 } // String IP + { TargetPort IPPORT } + { TaskID LLUUID } + { Flags U32 } + } } // ParcelMediaCommandMessage // Sends a parcel media command { - ParcelMediaCommandMessage Low 419 Trusted Unencoded - { - CommandBlock Single - { Flags U32 } - { Command U32 } - { Time F32 } - } + ParcelMediaCommandMessage Low 419 Trusted Unencoded + { + CommandBlock Single + { Flags U32 } + { Command U32 } + { Time F32 } + } } // ParcelMediaUpdate // Sends a parcel media update to a single user // For global updates use the parcel manager. { - ParcelMediaUpdate Low 420 Trusted Unencoded - { - DataBlock Single - { MediaURL Variable 1 } // string - { MediaID LLUUID } - { MediaAutoScale U8 } - } - { - DataBlockExtended Single - { MediaType Variable 1 } - { MediaDesc Variable 1 } - { MediaWidth S32 } - { MediaHeight S32 } - { MediaLoop U8 } - } + ParcelMediaUpdate Low 420 Trusted Unencoded + { + DataBlock Single + { MediaURL Variable 1 } // string + { MediaID LLUUID } + { MediaAutoScale U8 } + } + { + DataBlockExtended Single + { MediaType Variable 1 } + { MediaDesc Variable 1 } + { MediaWidth S32 } + { MediaHeight S32 } + { MediaLoop U8 } + } } // LandStatRequest // Sent by the viewer to request collider/script information for a parcel { - LandStatRequest Low 421 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - RequestData Single - { ReportType U32 } - { RequestFlags U32 } - { Filter Variable 1 } - { ParcelLocalID S32 } - } + LandStatRequest Low 421 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + RequestData Single + { ReportType U32 } + { RequestFlags U32 } + { Filter Variable 1 } + { ParcelLocalID S32 } + } } // LandStatReply // Sent by the simulator in response to LandStatRequest { - LandStatReply Low 422 Trusted Unencoded UDPDeprecated - { - RequestData Single - { ReportType U32 } - { RequestFlags U32 } - { TotalObjectCount U32 } - } - { - ReportData Variable - { TaskLocalID U32 } - { TaskID LLUUID } - { LocationX F32 } - { LocationY F32 } - { LocationZ F32 } - { Score F32 } - { TaskName Variable 1 } - { OwnerName Variable 1 } - } + LandStatReply Low 422 Trusted Unencoded UDPDeprecated + { + RequestData Single + { ReportType U32 } + { RequestFlags U32 } + { TotalObjectCount U32 } + } + { + ReportData Variable + { TaskLocalID U32 } + { TaskID LLUUID } + { LocationX F32 } + { LocationY F32 } + { LocationZ F32 } + { Score F32 } + { TaskName Variable 1 } + { OwnerName Variable 1 } + } } // Generic Error -- this is used for sending an error message // to a UDP recipient. The lowest common denominator is to at least // log the message. More sophisticated receivers can do something -// smarter, for example, a money transaction failure can put up a +// smarter, for example, a money transaction failure can put up a // more user visible UI widget. { - Error Low 423 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } // will forward to agentid if coming from trusted circuit - } - { - Data Single - { Code S32 } // matches http status codes - { Token Variable 1 } // some specific short string based message - { ID LLUUID } // the transactionid/uniqueid/sessionid whatever. - { System Variable 1 } // The hierarchical path to the system, eg, "message/handler" - { Message Variable 2 } // Human readable message - { Data Variable 2 } // Binary serialized LLSD for extra info. - } + Error Low 423 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } // will forward to agentid if coming from trusted circuit + } + { + Data Single + { Code S32 } // matches http status codes + { Token Variable 1 } // some specific short string based message + { ID LLUUID } // the transactionid/uniqueid/sessionid whatever. + { System Variable 1 } // The hierarchical path to the system, eg, "message/handler" + { Message Variable 2 } // Human readable message + { Data Variable 2 } // Binary serialized LLSD for extra info. + } } // ObjectIncludeInSearch // viewer -> simulator { - ObjectIncludeInSearch Low 424 NotTrusted Unencoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - ObjectData Variable - { ObjectLocalID U32 } - { IncludeInSearch BOOL } - } + ObjectIncludeInSearch Low 424 NotTrusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + ObjectData Variable + { ObjectLocalID U32 } + { IncludeInSearch BOOL } + } } @@ -9083,57 +9143,145 @@ version 2.0 // to rez an object out of inventory back to its position before it // last moved into the inventory { - RezRestoreToWorld Low 425 NotTrusted Unencoded UDPDeprecated - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - InventoryData Single - { ItemID LLUUID } - { FolderID LLUUID } - { CreatorID LLUUID } // permissions - { OwnerID LLUUID } // permissions - { GroupID LLUUID } // permissions - { BaseMask U32 } // permissions - { OwnerMask U32 } // permissions - { GroupMask U32 } // permissions - { EveryoneMask U32 } // permissions - { NextOwnerMask U32 } // permissions - { GroupOwned BOOL } // permissions - { TransactionID LLUUID } - { Type S8 } - { InvType S8 } - { Flags U32 } - { SaleType U8 } - { SalePrice S32 } - { Name Variable 1 } - { Description Variable 1 } - { CreationDate S32 } - { CRC U32 } - } + RezRestoreToWorld Low 425 NotTrusted Unencoded UDPDeprecated + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + InventoryData Single + { ItemID LLUUID } + { FolderID LLUUID } + { CreatorID LLUUID } // permissions + { OwnerID LLUUID } // permissions + { GroupID LLUUID } // permissions + { BaseMask U32 } // permissions + { OwnerMask U32 } // permissions + { GroupMask U32 } // permissions + { EveryoneMask U32 } // permissions + { NextOwnerMask U32 } // permissions + { GroupOwned BOOL } // permissions + { TransactionID LLUUID } + { Type S8 } + { InvType S8 } + { Flags U32 } + { SaleType U8 } + { SalePrice S32 } + { Name Variable 1 } + { Description Variable 1 } + { CreationDate S32 } + { CRC U32 } + } } // Link inventory { - LinkInventoryItem Low 426 NotTrusted Zerocoded - { - AgentData Single - { AgentID LLUUID } - { SessionID LLUUID } - } - { - InventoryBlock Single - { CallbackID U32 } // Async Response - { FolderID LLUUID } - { TransactionID LLUUID } // Going to become TransactionID - { OldItemID LLUUID } - { Type S8 } - { InvType S8 } - { Name Variable 1 } - { Description Variable 1 } - - } + LinkInventoryItem Low 426 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + InventoryBlock Single + { CallbackID U32 } // Async Response + { FolderID LLUUID } + { TransactionID LLUUID } // Going to become TransactionID + { OldItemID LLUUID } + { Type S8 } + { InvType S8 } + { Name Variable 1 } + { Description Variable 1 } + + } +} + +// RetrieveIMsExtended - extended version of RetrieveInstantMessages, +// used to get instant messages that were persisted out to the database while the user was offline +// sent between the simulator and dataserver +{ + RetrieveIMsExtended Low 427 Trusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { IsPremium BOOL } + } +} + +// JoinGroupRequestExtended +// Extends JoinGroupRequest from viewer and passed to dataserver +// simulator -> dataserver +// reliable +{ + JoinGroupRequestExtended Low 428 Trusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { GroupLimit S32 } + } + { + GroupData Single + { GroupID LLUUID } + } +} + +// CreateGroupRequestExtended +// simulator -> dataserver, extends data from CreateGroupRequest +// reliable +{ + CreateGroupRequestExtended Low 429 Trusted Unencoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + { GroupLimit S32 } + } + { + GroupData Single + { Name Variable 1 } // string + { Charter Variable 2 } // string + { ShowInList BOOL } + { InsigniaID LLUUID } + { MembershipFee S32 } + { OpenEnrollment BOOL } + { AllowPublish BOOL } // whether profile is externally visible or not + { MaturePublish BOOL } // profile is "mature" + } +} + +// viewer -> simulator +// GameControlInput - input from game controller +// The main payload of this message is split into two Variable chunks: +// +// AxisData = list of {Index:Value} pairs. Value is an S16 that maps to range [-1, 1] +// ButtonData = list of indices of pressed buttons +// +// Any Axis ommitted from the message is assumed by the receiving Simulator to be unchanged +// from its previously received value. +// +// Any Button omitted from the message is assumed by the receiving Simulator to be unpressed. +// +// GameControlInput messages are sent unreliably, but when input changes stop the last +// message will be resent at a ever increasing period to make sure the server receives it. +// +{ + GameControlInput High 32 NotTrusted Zerocoded + { + AgentData Single + { AgentID LLUUID } + { SessionID LLUUID } + } + { + AxisData Variable + { Index U8 } + { Value S16 } + } + { + ButtonData Variable + { Data Variable 1 } + } } diff --git a/scripts/messages/message_template.msg.sha1 b/scripts/messages/message_template.msg.sha1 index eb436d0627..baa4f3f12b 100755 --- a/scripts/messages/message_template.msg.sha1 +++ b/scripts/messages/message_template.msg.sha1 @@ -1 +1 @@ -b98fc0af5fa88601f5afa4f3c83f08188316e9a8 \ No newline at end of file +aaecaf01b6954c156662f572dc3ecaf26de0ca67 \ No newline at end of file -- cgit v1.2.3 From 423df2ba4b731417796478c449e3e8f3d166ef21 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Fri, 21 Mar 2025 07:18:13 -0700 Subject: prevent erroneous edit of wrong parcel (#3759) * prevent erroneous edit of wrong parcel Fixes jira-archive-internal/issues/70771 [SL-20409] Erroneous Local Parcel Twins - Parcel Updates Across Region Borders - unrequested updateDatabaseParcel changes * remove unused argument in sendParcelPropertiesUpdate() --- indra/llinventory/llparcel.h | 3 +++ indra/newview/llviewerparcelmgr.cpp | 12 +++++++++--- indra/newview/llviewerparcelmgr.h | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/indra/llinventory/llparcel.h b/indra/llinventory/llparcel.h index 67d713db1f..759638b956 100644 --- a/indra/llinventory/llparcel.h +++ b/indra/llinventory/llparcel.h @@ -262,6 +262,8 @@ public: void setMediaURLResetTimer(F32 time); virtual void setLocalID(S32 local_id); + void setRegionID(const LLUUID& id) { mRegionID = id; } + const LLUUID& getRegionID() const { return mRegionID; } // blow away all the extra stuff lurking in parcels, including urls, access lists, etc void clearParcel(); @@ -651,6 +653,7 @@ public: S32 mLocalID; LLUUID mBanListTransactionID; LLUUID mAccessListTransactionID; + LLUUID mRegionID; std::map mAccessList; std::map mBanList; std::map mTempBanList; diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 8e6657b4b9..1a5c40064a 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -1327,12 +1327,12 @@ const S32 LLViewerParcelMgr::getAgentParcelId() const return INVALID_PARCEL_ID; } -void LLViewerParcelMgr::sendParcelPropertiesUpdate(LLParcel* parcel, bool use_agent_region) +void LLViewerParcelMgr::sendParcelPropertiesUpdate(LLParcel* parcel) { if(!parcel) return; - LLViewerRegion *region = use_agent_region ? gAgent.getRegion() : LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth ); + LLViewerRegion *region = LLWorld::getInstance()->getRegionFromID(parcel->getRegionID()); if (!region) return; @@ -1676,10 +1676,16 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use // Actually extract the data. if (parcel) { + // store region_id in the parcel so we can find it again later + LLViewerRegion* parcel_region = LLWorld::getInstance()->getRegion(msg->getSender()); + if (parcel_region) + { + parcel->setRegionID(parcel_region->getRegionID()); + } + if (local_id == parcel_mgr.mAgentParcel->getLocalID()) { // Parcels in different regions can have same ids. - LLViewerRegion* parcel_region = LLWorld::getInstance()->getRegion(msg->getSender()); LLViewerRegion* agent_region = gAgent.getRegion(); if (parcel_region && agent_region && parcel_region->getRegionID() == agent_region->getRegionID()) { diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h index 974ea39359..086bca4878 100644 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -219,7 +219,7 @@ public: // containing the southwest corner of the selection. // If want_reply_to_update, simulator will send back a ParcelProperties // message. - void sendParcelPropertiesUpdate(LLParcel* parcel, bool use_agent_region = false); + void sendParcelPropertiesUpdate(LLParcel* parcel); // Takes an Access List flag, like AL_ACCESS or AL_BAN void sendParcelAccessListUpdate(U32 which); -- cgit v1.2.3 From 1e2d4d3018f0e0c46e4f22943ae51badd9aaaaf8 Mon Sep 17 00:00:00 2001 From: AtlasLinden <114031241+AtlasLinden@users.noreply.github.com> Date: Wed, 26 Mar 2025 14:41:44 -0700 Subject: Added QA workflow file Previously in the develop archive. Recent change is to only run the workflow for tagged builds. The code to running other builds has been commented out. --- .github/workflows/qatest.yaml | 172 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 .github/workflows/qatest.yaml diff --git a/.github/workflows/qatest.yaml b/.github/workflows/qatest.yaml new file mode 100644 index 0000000000..8709ca0cd4 --- /dev/null +++ b/.github/workflows/qatest.yaml @@ -0,0 +1,172 @@ +name: Run QA Test # Runs automated tests on a self-hosted QA machine + +on: + workflow_run: + workflows: ["Build"] + types: + - completed + +concurrency: + group: qa-test-run + cancel-in-progress: true # Cancels any queued job when a new one starts + +jobs: + debug-workflow: + runs-on: ubuntu-latest + steps: + - name: Debug Workflow Variables + run: | + echo "Workflow Conclusion: ${{ github.event.workflow_run.conclusion }}" + echo "Workflow Head Branch: ${{ github.event.workflow_run.head_branch }}" + echo "Workflow Run ID: ${{ github.event.workflow_run.id }}" + echo "Head Commit Message: ${{ github.event.workflow_run.head_commit.message }}" + echo "GitHub Ref: ${{ github.ref }}" + echo "GitHub Ref Name: ${{ github.ref_name }}" + echo "GitHub Event Name: ${{ github.event_name }}" + echo "GitHub Workflow Name: ${{ github.workflow }}" + + install-viewer-and-run-tests: + runs-on: [self-hosted, qa-machine] + # Run test only on successful builds of develop or Second_Life_X branches + if: > + github.event.workflow_run.conclusion == 'success' && + ( + startsWith(github.ref, 'refs/tags/Second_Life') + + # For now this will only run on Second_Life_X tagged builds + # || startsWith(github.event.workflow_run.head_branch, 'release') + # || github.event.workflow_run.head_branch == 'develop' + ) + + steps: + - name: Temporarily Allow PowerShell Scripts (Process Scope) + run: | + Set-ExecutionPolicy RemoteSigned -Scope Process -Force + + - name: Verify viewer-sikulix-main Exists + run: | + if (-Not (Test-Path -Path 'C:\viewer-sikulix-main')) { + Write-Host '❌ Error: viewer-sikulix not found on runner!' + exit 1 + } + Write-Host '✅ viewer-sikulix is already available.' + + - name: Fetch & Download Windows Installer Artifact + shell: pwsh + run: | + $BUILD_ID = "${{ github.event.workflow_run.id }}" + $ARTIFACTS_URL = "https://api.github.com/repos/secondlife/viewer/actions/runs/$BUILD_ID/artifacts" + + # Fetch the correct artifact URL + $response = Invoke-RestMethod -Headers @{Authorization="token ${{ secrets.GITHUB_TOKEN }}" } -Uri $ARTIFACTS_URL + $ARTIFACT_NAME = ($response.artifacts | Where-Object { $_.name -eq "Windows-installer" }).archive_download_url + + if (-Not $ARTIFACT_NAME) { + Write-Host "❌ Error: Windows-installer artifact not found!" + exit 1 + } + + Write-Host "✅ Artifact found: $ARTIFACT_NAME" + + # Secure download path + $DownloadPath = "$env:TEMP\secondlife-build-$BUILD_ID" + New-Item -ItemType Directory -Path $DownloadPath -Force | Out-Null + $InstallerPath = "$DownloadPath\installer.zip" + + # Download the ZIP + Invoke-WebRequest -Uri $ARTIFACT_NAME -Headers @{Authorization="token ${{ secrets.GITHUB_TOKEN }}"} -OutFile $InstallerPath + + # Ensure download succeeded + if (-Not (Test-Path $InstallerPath)) { + Write-Host "❌ Error: Failed to download Windows-installer.zip" + exit 1 + } + + - name: Extract Installer & Locate Executable + shell: pwsh + run: | + # Explicitly set BUILD_ID again (since it does not appear to persist across steps) + $BUILD_ID = "${{ github.event.workflow_run.id }}" + $ExtractPath = "$env:TEMP\secondlife-build-$BUILD_ID" + $InstallerZip = "$ExtractPath\installer.zip" + + # Print paths for debugging + Write-Host "Extract Path: $ExtractPath" + Write-Host "Installer ZIP Path: $InstallerZip" + + # Verify ZIP exists before extracting + if (-Not (Test-Path $InstallerZip)) { + Write-Host "❌ Error: ZIP file not found at $InstallerZip!" + exit 1 + } + + Write-Host "✅ ZIP file exists and is valid. Extracting..." + + Expand-Archive -Path $InstallerZip -DestinationPath $ExtractPath -Force + + # Find installer executable + $INSTALLER_PATH = (Get-ChildItem -Path $ExtractPath -Filter '*.exe' -Recurse | Select-Object -First 1).FullName + + if (-Not $INSTALLER_PATH -or $INSTALLER_PATH -eq "") { + Write-Host "❌ Error: No installer executable found in the extracted files!" + Write-Host "📂 Extracted Files:" + Get-ChildItem -Path $ExtractPath -Recurse | Format-Table -AutoSize + exit 1 + } + + Write-Host "✅ Installer found: $INSTALLER_PATH" + echo "INSTALLER_PATH=$INSTALLER_PATH" | Out-File -FilePath $env:GITHUB_ENV -Append + + - name: Install Second Life Using Task Scheduler (Bypass UAC) + shell: pwsh + run: | + $action = New-ScheduledTaskAction -Execute "${{ env.INSTALLER_PATH }}" -Argument "/S" + $principal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -LogonType ServiceAccount -RunLevel Highest + $task = New-ScheduledTask -Action $action -Principal $principal + Register-ScheduledTask -TaskName "SilentSLInstaller" -InputObject $task -Force + Start-ScheduledTask -TaskName "SilentSLInstaller" + + - name: Wait for Installation to Complete + shell: pwsh + run: | + Write-Host "Waiting for the Second Life installer to finish..." + do { + Start-Sleep -Seconds 5 + $installerProcess = Get-Process | Where-Object { $_.Path -eq "${{ env.INSTALLER_PATH }}" } + } while ($installerProcess) + + Write-Host "✅ Installation completed!" + + - name: Cleanup Task Scheduler Entry + shell: pwsh + run: | + Unregister-ScheduledTask -TaskName "SilentSLInstaller" -Confirm:$false + Write-Host "✅ Task Scheduler entry removed." + + - name: Delete Installer ZIP + shell: pwsh + run: | + # Explicitly set BUILD_ID again + $BUILD_ID = "${{ github.event.workflow_run.id }}" + $DeletePath = "$env:TEMP\secondlife-build-$BUILD_ID\installer.zip" + + Write-Host "Checking if installer ZIP exists: $DeletePath" + + # Ensure the ZIP file exists before trying to delete it + if (Test-Path $DeletePath) { + Remove-Item -Path $DeletePath -Force + Write-Host "✅ Successfully deleted: $DeletePath" + } else { + Write-Host "⚠️ Warning: ZIP file does not exist, skipping deletion." + } + + - name: Run QA Test Script + run: | + Write-Host "Running QA Test script..." + python C:\viewer-sikulix-main\runTests.py + + # - name: Upload Test Results + # uses: actions/upload-artifact@v3 + # with: + # name: test-results + # path: C:\viewer-sikulix-main\regressionTest\test_results.html \ No newline at end of file -- cgit v1.2.3 From 51f5b853608a756ef9eb39f5bafd963d28e752d7 Mon Sep 17 00:00:00 2001 From: AtlasLinden <114031241+AtlasLinden@users.noreply.github.com> Date: Thu, 27 Mar 2025 06:58:07 -0700 Subject: Removed unnecessary comments in QA workflow file GHA does not like comments inside an if statement. These have been removed. --- .github/workflows/qatest.yaml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/qatest.yaml b/.github/workflows/qatest.yaml index 8709ca0cd4..533635c3f7 100644 --- a/.github/workflows/qatest.yaml +++ b/.github/workflows/qatest.yaml @@ -27,15 +27,11 @@ jobs: install-viewer-and-run-tests: runs-on: [self-hosted, qa-machine] - # Run test only on successful builds of develop or Second_Life_X branches + # Run test only on successful builds of Second_Life_X branches if: > github.event.workflow_run.conclusion == 'success' && ( startsWith(github.ref, 'refs/tags/Second_Life') - - # For now this will only run on Second_Life_X tagged builds - # || startsWith(github.event.workflow_run.head_branch, 'release') - # || github.event.workflow_run.head_branch == 'develop' ) steps: @@ -169,4 +165,4 @@ jobs: # uses: actions/upload-artifact@v3 # with: # name: test-results - # path: C:\viewer-sikulix-main\regressionTest\test_results.html \ No newline at end of file + # path: C:\viewer-sikulix-main\regressionTest\test_results.html -- cgit v1.2.3 From 0a39fe8dc9c5f3c24392f3f5cfb385379f70da03 Mon Sep 17 00:00:00 2001 From: AtlasLinden <114031241+AtlasLinden@users.noreply.github.com> Date: Thu, 27 Mar 2025 15:28:15 -0700 Subject: Allow QA workflow to run on Second_Life_X branches Using the echos from the last run, it appears that the tagged builds have Workflow Head Branch = Second_Life_X. Edit made so the file looks for this rather than what was there previously. --- .github/workflows/qatest.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/qatest.yaml b/.github/workflows/qatest.yaml index 533635c3f7..7f3a5242e9 100644 --- a/.github/workflows/qatest.yaml +++ b/.github/workflows/qatest.yaml @@ -31,7 +31,7 @@ jobs: if: > github.event.workflow_run.conclusion == 'success' && ( - startsWith(github.ref, 'refs/tags/Second_Life') + startsWith(github.event.workflow_run.head_branch, 'Second_Life') ) steps: -- cgit v1.2.3 From e1ebb33ab2966a20b63741dd84a0826e82b6a807 Mon Sep 17 00:00:00 2001 From: William Weaver Date: Fri, 28 Mar 2025 04:28:36 +0300 Subject: fix(pipeline): Remove incorrect zeroing of mRT dimensions in createGLBuffers Resolves the root cause of shadow rendering failures when changing RenderShadowResolutionScale immediately after modifying other graphics settings (e.g., SSAO, HDR). Investigation revealed that LLPipeline::createGLBuffers, which is called during certain graphics setting changes that require full buffer recreation, contained lines that incorrectly set mRT->width and mRT->height to zero *after* the call to allocateScreenBuffer had already established the correct dimensions. This created a state inconsistency. If RenderShadowResolutionScale was changed immediately following the graphics setting change, the subsequent call to LLPipeline::resizeShadowTexture (triggered via handleShadowsResized) would read these incorrect zero dimensions from mRT. This led to failed shadow buffer allocation (allocateShadowBuffer(0, 0)) and resulted in corrupted or missing shadows. This commit removes the erroneous mRT->width = 0 and mRT->height = 0 lines from the end of createGLBuffers. This ensures that the render target dimensions remain valid after buffer recreation. With this fix, resizeShadowTexture now correctly reads the valid screen dimensions immediately following a graphics setting change and successfully resizes the shadow buffers without delay or error. This eliminates the need for previous workarounds like guard conditions or forced shader recompiles. Ref: #3719 --- indra/newview/pipeline.cpp | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 691d155a3c..6adf203ea1 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -727,29 +727,6 @@ void LLPipeline::requestResizeShadowTexture() void LLPipeline::resizeShadowTexture() { - // A static counter to keep track of skipped frames - static int sSkippedFrameCount = 0; - - if (!mRT || mRT->width == 0 || mRT->height == 0) - { - sSkippedFrameCount++; - LL_WARNS("Render") << "Shadow texture resizing aborted: render target dimensions invalid. Skipped " - << sSkippedFrameCount << " frame(s) so far." << LL_ENDL; - return; - } - - // If there were skipped frames before mRT became valid, log that information. - if (sSkippedFrameCount > 0) - { - LL_INFOS("Render") << "Render target now valid after " - << sSkippedFrameCount << " skipped frame(s)." << LL_ENDL; - sSkippedFrameCount = 0; - } - - LL_WARNS() << "LLPipeline::resizeShadowTexture() called." << LL_ENDL; - LL_INFOS() << "Resizing shadow texture. mRT->width = " - << mRT->width << " mRT->height = " << mRT->height << LL_ENDL; - releaseSunShadowTargets(); releaseSpotShadowTargets(); allocateShadowBuffer(mRT->width, mRT->height); @@ -1309,8 +1286,11 @@ void LLPipeline::createGLBuffers() } allocateScreenBuffer(resX, resY); - mRT->width = 0; - mRT->height = 0; + // Do not zero out mRT dimensions here. allocateScreenBuffer() above + // already sets the correct dimensions. Zeroing them caused resizeShadowTexture() + // to fail if called immediately after createGLBuffers (e.g., post graphics change). + // mRT->width = 0; + // mRT->height = 0; if (!mNoiseMap) -- cgit v1.2.3 From 04af0424359d55ddb8056dc1693c078eadaee239 Mon Sep 17 00:00:00 2001 From: William Weaver Date: Wed, 2 Apr 2025 02:13:01 +0300 Subject: Fix(EnvAdjust): Ensure cloud texture selection updates the sky Problem: When selecting a new cloud texture in the Personal Lighting floater (LLFloaterEnvironmentAdjust) using the cloud map texture picker, the sky rendering did not update to reflect the selected texture. The callback only updated the internal mLiveSky object and its subsequent call to mLiveSky->update() was insufficient to trigger a live render update. Cause: The onCloudMapChanged callback modified the mLiveSky settings object directly and called its update() method. However, in the context of live environment adjustments, changes require propagation through the central LLEnvironment singleton to correctly update the active environment layer (ENV_LOCAL) and signal the renderer. Relying solely on the settings object's update() method bypassed this necessary mechanism. Solution: This commit refactors onCloudMapChanged to correctly handle the update: 1. Uses the LLEnvironment singleton to manage the state change: - Explicitly targets the local environment layer (ENV_LOCAL) via setSelectedEnvironment(). - Clones the mLiveSky settings object. - Uses LLEnvironment::setEnvironment() to apply the modified clone to the ENV_LOCAL layer. - Uses LLEnvironment::updateEnvironment() to trigger the render update. 2. Synchronizes the UI preview: - Calls picker_ctrl->setValue() on the LLTextureCtrl widget after the environment update to ensure the UI preview matches the applied texture. Result: Selecting a cloud texture in the Environment Settings floater now correctly updates both the sky rendering and the UI preview widget simultaneously. Testing: - Open World -> Environment Editor -> Environment Settings. - Go to the Clouds tab. - Click the cloud texture preview to open the texture picker. - Select a new cloud texture and click OK. - Verify the sky updates immediately to use the selected texture. - Verify the texture preview in the floater also updates immediately. - Repeat with several different textures to confirm consistent behavior. --- indra/newview/llfloaterenvironmentadjust.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfloaterenvironmentadjust.cpp b/indra/newview/llfloaterenvironmentadjust.cpp index 35f8340997..b137d71c22 100644 --- a/indra/newview/llfloaterenvironmentadjust.cpp +++ b/indra/newview/llfloaterenvironmentadjust.cpp @@ -456,8 +456,26 @@ void LLFloaterEnvironmentAdjust::onCloudMapChanged() { if (!mLiveSky) return; - mLiveSky->setCloudNoiseTextureId(getChild(FIELD_SKY_CLOUD_MAP)->getValue().asUUID()); + + // Get the texture picker control + LLTextureCtrl* picker_ctrl = getChild(FIELD_SKY_CLOUD_MAP); + if (!picker_ctrl) + { + // Optional: Log an error if the control isn't found, though unlikely + return; + } + + // Get the new texture ID selected by the user + LLUUID new_texture_id = picker_ctrl->getValue().asUUID(); + + // Update the internal sky settings object + mLiveSky->setCloudNoiseTextureId(new_texture_id); + + // Trigger the update for the sky rendering mLiveSky->update(); + + // Explicitly refresh the UI picker control to match the applied change + picker_ctrl->setValue(new_texture_id); } void LLFloaterEnvironmentAdjust::onWaterMapChanged() -- cgit v1.2.3 From 61ba4b0d7705ca12b606d238d48a0b1bc370bf31 Mon Sep 17 00:00:00 2001 From: William Weaver Date: Wed, 2 Apr 2025 03:45:54 +0300 Subject: Fix(XUI): Remove unrecognized user_resize attribute from sun_moon_trackball Problem: A warning "Failed to parse parameter 'user_resize.'" appeared in the logs during UI loading, originating from sun_moon_trackball.xml. Cause: The 'user_resize' attribute is not a recognized or utilized parameter for the 'sun_moon_trackball' widget type, as defined in the corresponding C++ (LLVirtualTrackball). Solution: Removed the extraneous 'user_resize="false"' line from the sun_moon_trackball.xml widget definition. Result: Eliminates the parsing warning from the logs upon viewer startup or UI reload. Testing: - Launch viewer. - Check logs for the absence of the "Failed to parse parameter 'user_resize.'" warning. --- indra/newview/skins/default/xui/en/widgets/sun_moon_trackball.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/widgets/sun_moon_trackball.xml b/indra/newview/skins/default/xui/en/widgets/sun_moon_trackball.xml index cdeff6ab05..f246ff764a 100644 --- a/indra/newview/skins/default/xui/en/widgets/sun_moon_trackball.xml +++ b/indra/newview/skins/default/xui/en/widgets/sun_moon_trackball.xml @@ -3,7 +3,6 @@ name="virtualtrackball" width="150" height="150" - user_resize="false" increment_angle_mouse="1.5f" increment_angle_btn="1.0f" image_sphere="VirtualTrackball_Sphere" -- cgit v1.2.3 From be595b440321dcad842be5d982d20fd601bb8b4c Mon Sep 17 00:00:00 2001 From: William Weaver Date: Wed, 2 Apr 2025 04:09:00 +0300 Subject: Fix(XUI): Resolve parsing warnings for Fixed Environment editor widgets Problem: Opening the Fixed Environment floater generated three distinct XUI parsing warnings in the logs: - Failed to parse parameter "decimal_digits." in xy_vector.xml - Failed to parse parameter "user_resize." in xy_vector.xml - Failed to parse parameter "logarithmic." in panel_settings_sky_clouds.xml Cause: These attributes were either not recognized/utilized by the underlying C++ widget implementations ('decimal_digits', 'user_resize' in LLXYVector) or were using an incorrect value ('logarithmic="1"' instead of a boolean 'true'/'false' in LLSliderCtrl). Solution: This commit addresses these three warnings: - Removed the extraneous 'decimal_digits' and 'user_resize' attributes from the definition of the 'xyvector' widget in xy_vector.xml. - Corrected the 'logarithmic' attribute value from "1" to "true" for the 'cloud_scroll_xy' slider in panel_settings_sky_clouds.xml. Result: Eliminates these specific parsing warnings from the logs when the Fixed Environment floater is opened. Testing: - Launch viewer. - Open World -> Environment Editor -> My Environments. - Select a sky setting and click Edit (or create a New one). - Observe the logs upon the Fixed Environment floater opening. - Verify the absence of the 'decimal_digits', 'user_resize' (from xy_vector.xml), and 'logarithmic' (from panel_settings_sky_clouds.xml) parsing warnings. --- indra/newview/skins/default/xui/en/panel_settings_sky_clouds.xml | 2 +- indra/newview/skins/default/xui/en/widgets/xy_vector.xml | 4 +--- scripts/messages/message_template.msg.sha1 | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/indra/newview/skins/default/xui/en/panel_settings_sky_clouds.xml b/indra/newview/skins/default/xui/en/panel_settings_sky_clouds.xml index 7687f7cd96..23bbf45e88 100644 --- a/indra/newview/skins/default/xui/en/panel_settings_sky_clouds.xml +++ b/indra/newview/skins/default/xui/en/panel_settings_sky_clouds.xml @@ -139,7 +139,7 @@ max_val_x="30" min_val_y="-30" max_val_y="30" - logarithmic="1"/> + logarithmic="true"/> + edit_bar_height="18"> diff --git a/scripts/messages/message_template.msg.sha1 b/scripts/messages/message_template.msg.sha1 index eb436d0627..b5692f48c9 100755 --- a/scripts/messages/message_template.msg.sha1 +++ b/scripts/messages/message_template.msg.sha1 @@ -1 +1 @@ -b98fc0af5fa88601f5afa4f3c83f08188316e9a8 \ No newline at end of file +dcd067e0627d9a7169c4449a3d2782c446fe0354 \ No newline at end of file -- cgit v1.2.3 From 2bb4de97e43a32589434a35b617a36c2dfda22ee Mon Sep 17 00:00:00 2001 From: Hecklezz Date: Wed, 2 Apr 2025 18:18:17 +1000 Subject: Fix normal and specular repeats per meter scaling --- indra/newview/llpanelface.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index c080d72580..5a2a8ce128 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -3592,7 +3592,7 @@ void LLPanelFace::onCommitRepeatsPerMeter() bool identical_scale_t = false; LLSelectedTE::getObjectScaleS(obj_scale_s, identical_scale_s); - LLSelectedTE::getObjectScaleS(obj_scale_t, identical_scale_t); + LLSelectedTE::getObjectScaleT(obj_scale_t, identical_scale_t); if (gSavedSettings.getBOOL("SyncMaterialSettings")) { @@ -5086,6 +5086,7 @@ void LLPanelFace::LLSelectedTEMaterial::getMaxSpecularRepeats(F32& repeats, bool LLMaterial* mat = object->getTE(face)->getMaterialParams().get(); U32 s_axis = VX; U32 t_axis = VY; + LLPrimitive::getTESTAxes(face, &s_axis, &t_axis); F32 repeats_s = 1.0f; F32 repeats_t = 1.0f; if (mat) @@ -5110,6 +5111,7 @@ void LLPanelFace::LLSelectedTEMaterial::getMaxNormalRepeats(F32& repeats, bool& LLMaterial* mat = object->getTE(face)->getMaterialParams().get(); U32 s_axis = VX; U32 t_axis = VY; + LLPrimitive::getTESTAxes(face, &s_axis, &t_axis); F32 repeats_s = 1.0f; F32 repeats_t = 1.0f; if (mat) -- cgit v1.2.3 From 1fcabcdd324305ccfafb59b9c9ef5e04ef859a4d Mon Sep 17 00:00:00 2001 From: William Weaver Date: Fri, 4 Apr 2025 16:02:08 +0300 Subject: Fix(EnvAdjust): Properly update sky after cloud texture selection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: When selecting a new cloud texture in the Personal Lighting floater (LLFloaterEnvironmentAdjust), the sky did not visually update. The code previously only updated LiveSky->setCloudNoiseTextureId() and called mLiveSky->update(), which failed to notify the global LLEnvironment mechanism or the renderer about the new texture. Cause: Relying solely on mLiveSky for environment changes is insufficient. To update the live environment layer (ENV_LOCAL) and trigger a render refresh, calls to LLEnvironment::setEnvironment() and LLEnvironment::updateEnvironment() are required. Solution: 1. Remove an unnecessary null-check for getChild, as getChild() never returns null. 2. Clone the current sky settings (mLiveSky->buildClone()) to avoid modifying a shared environment object directly. 3. Apply the new cloud texture ID to the clone. 4. Use LLEnvironment::setEnvironment(ENV_LOCAL, sky_to_set) to apply the updated settings to the user's local environment override. 5. Call LLEnvironment::updateEnvironment(LLEnvironment::TRANSITION_INSTANT, true) to ensure the renderer recognizes and displays the updated texture immediately. 6. Reset the picker control’s value to match the newly applied texture for UI consistency. Additional Note: A partial implementation was inadvertently committed earlier (commit`04af042`) due to a local staging error. This commit supersedes that incomplete change by correctly implementing the intended fix. Result: Selecting a new cloud texture from LLFloaterEnvironmentAdjust now immediately updates both the in-world sky rendering and the texture preview UI, ensuring consistency and clarity for users. Testing: - Open the Personal Lighting floater and select various cloud textures. - Verify that the sky updates immediately for each new selection. - Confirm that the texture picker also updates to reflect the selected texture. --- indra/newview/llfloaterenvironmentadjust.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/indra/newview/llfloaterenvironmentadjust.cpp b/indra/newview/llfloaterenvironmentadjust.cpp index b137d71c22..58616995d3 100644 --- a/indra/newview/llfloaterenvironmentadjust.cpp +++ b/indra/newview/llfloaterenvironmentadjust.cpp @@ -455,26 +455,28 @@ void LLFloaterEnvironmentAdjust::onMoonAzimElevChanged() void LLFloaterEnvironmentAdjust::onCloudMapChanged() { if (!mLiveSky) + { return; + } - // Get the texture picker control LLTextureCtrl* picker_ctrl = getChild(FIELD_SKY_CLOUD_MAP); - if (!picker_ctrl) + + LLUUID new_texture_id = picker_ctrl->getValue().asUUID(); + + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); + + LLSettingsSky::ptr_t sky_to_set = mLiveSky->buildClone(); + if (!sky_to_set) { - // Optional: Log an error if the control isn't found, though unlikely - return; + return; } - // Get the new texture ID selected by the user - LLUUID new_texture_id = picker_ctrl->getValue().asUUID(); + sky_to_set->setCloudNoiseTextureId(new_texture_id); - // Update the internal sky settings object - mLiveSky->setCloudNoiseTextureId(new_texture_id); + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, sky_to_set); - // Trigger the update for the sky rendering - mLiveSky->update(); + LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_INSTANT, true); - // Explicitly refresh the UI picker control to match the applied change picker_ctrl->setValue(new_texture_id); } -- cgit v1.2.3 From cfbcdd713baf1a1027281832f5f41ce5b99fafd7 Mon Sep 17 00:00:00 2001 From: William Weaver Date: Mon, 7 Apr 2025 16:57:12 +0300 Subject: Fix: Remove potentially redundant RenderAutoHideSurfaceAreaLimit setting registration This commit removes a seemingly duplicated `connectRefreshCachedSettingsSafe` call in `LLPipeline::init()` for the `RenderAutoHideSurfaceAreaLimit` setting. A duplicated registration for this setting was identified during a review of `LLPipeline::init()`. Double registration can lead to unexpected behavior, including potential CPU overhead. The duplication *may* have been introduced with commit 440c7b2 (Added CollectFontVertexBuffers feature), though this requires further confirmation. Testing Performed: After removing the duplicate registration, the `RenderAutoHideSurfaceAreaLimit` functionality was validated by ensuring the following behavior (consistent with the existing code): * A value of 0 (zero) causes all objects to appear regardless of size. * Values slightly above zero result in only small objects appearing, with all others hidden. * Increasing the value causes objects of increasing size to appear, while smaller objects remain visible. This change merits careful review to ensure it has no unintended side effects, and to confirm the accuracy of these observations from other developers. --- indra/newview/pipeline.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 6adf203ea1..aa82b28bf7 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -599,7 +599,6 @@ void LLPipeline::init() connectRefreshCachedSettingsSafe("RenderMirrors"); connectRefreshCachedSettingsSafe("RenderHeroProbeUpdateRate"); connectRefreshCachedSettingsSafe("RenderHeroProbeConservativeUpdateMultiplier"); - connectRefreshCachedSettingsSafe("RenderAutoHideSurfaceAreaLimit"); LLPointer cntrl_ptr = gSavedSettings.getControl("CollectFontVertexBuffers"); if (cntrl_ptr.notNull()) -- cgit v1.2.3 From c07817c3d26095de569e9193ade2b9040b7be8c0 Mon Sep 17 00:00:00 2001 From: William Weaver Date: Fri, 11 Apr 2025 02:23:52 +0300 Subject: Fix(Tonemap): Correct blend logic to preserve HDR detail The blending operation for the `tonemap_mix` uniform in `postDeferredTonemap.glsl` incorrectly used a prematurely clamped color value as the source for the linear mix target. Specifically, the exposed HDR input color was clamped to the [0, 1] LDR range before being used in the `mix()` function when `tonemap_mix < 1.0`. This premature clamping resulted in the loss of High Dynamic Range (HDR) detail in highlights during the blend operation. As `tonemap_mix` was reduced, instead of smoothly blending towards the linear scene representation, clipped highlights were incorrectly reintroduced. This commit modifies the `toneMap` and `toneMapNoExposure` functions to correct this logic: 1. The original linear input color is preserved before exposure/processing. 2. The appropriate exposure factor is calculated and applied separately. 3. The chosen tone mapping operator is applied to the exposed color, storing the result. 4. The `mix()` function now correctly blends between the appropriately scaled, *unclamped* linear input color and the fully tone-mapped result. 5. The final clamp to the [0, 1] LDR range is applied *after* the blend operation. This change ensures that HDR information is preserved throughout the blending process, resulting in a smoother, more perceptually correct visual transition as `tonemap_mix` is adjusted. While the effect is nuanced, it is noticeable in bright highlights; with the legacy code, these highlights appeared visibly clipped and less intense during the blend, whereas the corrected code allows them to retain their peak brightness and detail more accurately. This makes the `tonemap_mix` control more intuitive, behaving as a true intensity blend for the tone mapping effect without introducing clipping artifacts. The computational cost is negligible. --- .../shaders/class1/deferred/tonemapUtilF.glsl | 37 ++++++++++++++-------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/tonemapUtilF.glsl b/indra/newview/app_settings/shaders/class1/deferred/tonemapUtilF.glsl index a63b8d7c2b..774ccb6baf 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/tonemapUtilF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/tonemapUtilF.glsl @@ -117,27 +117,34 @@ uniform float exposure; uniform float tonemap_mix; uniform int tonemap_type; + vec3 toneMap(vec3 color) { #ifndef NO_POST - float exp_scale = texture(exposureMap, vec2(0.5,0.5)).r; - - color *= exposure * exp_scale; + vec3 linear_input_color = color; - vec3 clamped_color = clamp(color.rgb, vec3(0.0), vec3(1.0)); + float exp_scale = texture(exposureMap, vec2(0.5,0.5)).r; + float final_exposure = exposure * exp_scale; + vec3 exposed_color = color * final_exposure; + vec3 tonemapped_color = exposed_color; switch(tonemap_type) { case 0: - color = PBRNeutralToneMapping(color); + tonemapped_color = PBRNeutralToneMapping(exposed_color); break; case 1: - color = toneMapACES_Hill(color); + tonemapped_color = toneMapACES_Hill(exposed_color); break; } - // mix tonemapped and linear here to provide adjustment - color = mix(clamped_color, color, tonemap_mix); + vec3 exposed_linear_input = linear_input_color * final_exposure; + color = mix(exposed_linear_input, tonemapped_color, tonemap_mix); + + color = clamp(color, 0.0, 1.0); +#else + color *= exposure * texture(exposureMap, vec2(0.5,0.5)).r; + color = clamp(color, 0.0, 1.0); #endif return color; @@ -147,20 +154,24 @@ vec3 toneMap(vec3 color) vec3 toneMapNoExposure(vec3 color) { #ifndef NO_POST - vec3 clamped_color = clamp(color.rgb, vec3(0.0), vec3(1.0)); + vec3 linear_input_color = color; + vec3 tonemapped_color = color; switch(tonemap_type) { case 0: - color = PBRNeutralToneMapping(color); + tonemapped_color = PBRNeutralToneMapping(color); break; case 1: - color = toneMapACES_Hill(color); + tonemapped_color = toneMapACES_Hill(color); break; } - // mix tonemapped and linear here to provide adjustment - color = mix(clamped_color, color, tonemap_mix); + color = mix(linear_input_color, tonemapped_color, tonemap_mix); + + color = clamp(color, 0.0, 1.0); +#else + color = clamp(color, 0.0, 1.0); #endif return color; -- cgit v1.2.3 From d65de99052d5ff08c7c4290a1f1b8e396105b8af Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 17 Apr 2025 18:44:09 +0200 Subject: Use standard library functions for llisnan and replace obvious NaN checks that don't work using /fp:fast floating point behavior under MSVC --- indra/llappearance/llpolymorph.cpp | 8 ++++---- indra/llmath/llmath.h | 14 ++------------ indra/newview/llphysicsmotion.cpp | 21 ++++++++++----------- 3 files changed, 16 insertions(+), 27 deletions(-) diff --git a/indra/llappearance/llpolymorph.cpp b/indra/llappearance/llpolymorph.cpp index 8df8a9726f..5ee6649164 100644 --- a/indra/llappearance/llpolymorph.cpp +++ b/indra/llappearance/llpolymorph.cpp @@ -550,12 +550,12 @@ void LLPolyMorphTarget::apply( ESex avatar_sex ) mLastSex = avatar_sex; - // Check for NaN condition (NaN is detected if a variable doesn't equal itself. - if (mCurWeight != mCurWeight) + // Check for NaN condition + if (llisnan(mCurWeight)) { - mCurWeight = 0.0; + mCurWeight = 0.f; } - if (mLastWeight != mLastWeight) + if (llisnan(mLastWeight)) { mLastWeight = mCurWeight+.001f; } diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h index fa315291a3..c0f5b3dbf3 100644 --- a/indra/llmath/llmath.h +++ b/indra/llmath/llmath.h @@ -39,18 +39,8 @@ // llcommon depend on llmath. #include "is_approx_equal_fraction.h" -// work around for Windows & older gcc non-standard function names. -#if LL_WINDOWS -#include -#define llisnan(val) _isnan(val) -#define llfinite(val) _finite(val) -#elif (LL_LINUX && __GNUC__ <= 2) -#define llisnan(val) isnan(val) -#define llfinite(val) isfinite(val) -#else -#define llisnan(val) std::isnan(val) -#define llfinite(val) std::isfinite(val) -#endif +#define llisnan(val) std::isnan(val) +#define llfinite(val) std::isfinite(val) // Single Precision Floating Point Routines // (There used to be more defined here, but they appeared to be redundant and diff --git a/indra/newview/llphysicsmotion.cpp b/indra/newview/llphysicsmotion.cpp index 86291708b0..e5c84728fe 100644 --- a/indra/newview/llphysicsmotion.cpp +++ b/indra/newview/llphysicsmotion.cpp @@ -646,18 +646,17 @@ bool LLPhysicsMotion::onUpdate(F32 time) velocity_new_local = 0; } - // Check for NaN values. A NaN value is detected if the variables doesn't equal itself. - // If NaN, then reset everything. - if ((mPosition_local != mPosition_local) || - (mVelocity_local != mVelocity_local) || - (position_new_local != position_new_local)) + // Check for NaN values. If NaN, then reset everything. + if (llisnan(mPosition_local) || + llisnan(mVelocity_local) || + llisnan(position_new_local)) { - position_new_local = 0; - mVelocity_local = 0; - mVelocityJoint_local = 0; - mAccelerationJoint_local = 0; - mPosition_local = 0; - mPosition_world = LLVector3(0,0,0); + position_new_local = 0.f; + mVelocity_local = 0.f; + mVelocityJoint_local = 0.f; + mAccelerationJoint_local = 0.f; + mPosition_local = 0.f; + mPosition_world = LLVector3(0.f,0.f,0.f); } const F32 position_new_local_clamped = llclamp(position_new_local, -- cgit v1.2.3 From 441c844ec8319f4c15d59de5a5a8ae46be7912f1 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 17 Apr 2025 18:55:08 +0200 Subject: Fix lerp issues on newer GCC versions --- indra/llmath/llmath.h | 5 +---- indra/llmath/llvolume.cpp | 25 +++++++++++++------------ indra/newview/llpanelprimmediacontrols.cpp | 2 +- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h index c0f5b3dbf3..fe9a22983d 100644 --- a/indra/llmath/llmath.h +++ b/indra/llmath/llmath.h @@ -348,10 +348,7 @@ inline F32 snap_to_sig_figs(F32 foo, S32 sig_figs) return new_foo; } -inline F32 lerp(F32 a, F32 b, F32 u) -{ - return a + ((b - a) * u); -} +using std::lerp; inline F32 lerp2d(F32 x00, F32 x01, F32 x10, F32 x11, F32 u, F32 v) { diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 76e5e3aae9..1e7dfd18f2 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -1294,10 +1294,11 @@ void LLPath::genNGon(const LLPathParams& params, S32 sides, F32 startOff, F32 en c = cos(ang)*lerp(radius_start, radius_end, t); - pt->mPos.set(0 + lerp(0,params.getShear().mV[0],s) + pt->mPos.set(0 + lerp(0.f, params.getShear().mV[VX], s) + lerp(-skew ,skew, t) * 0.5f, - c + lerp(0,params.getShear().mV[1],s), + c + lerp(0.f, params.getShear().mV[VY], s), s); + pt->mScale.set(hole_x * lerp(taper_x_begin, taper_x_end, t), hole_y * lerp(taper_y_begin, taper_y_end, t), 0,1); @@ -1327,9 +1328,9 @@ void LLPath::genNGon(const LLPathParams& params, S32 sides, F32 startOff, F32 en c = cos(ang)*lerp(radius_start, radius_end, t); s = sin(ang)*lerp(radius_start, radius_end, t); - pt->mPos.set(0 + lerp(0,params.getShear().mV[0],s) + pt->mPos.set(0 + lerp(0.f, params.getShear().mV[VX], s) + lerp(-skew ,skew, t) * 0.5f, - c + lerp(0,params.getShear().mV[1],s), + c + lerp(0.f, params.getShear().mV[VY], s), s); pt->mScale.set(hole_x * lerp(taper_x_begin, taper_x_end, t), @@ -1354,9 +1355,9 @@ void LLPath::genNGon(const LLPathParams& params, S32 sides, F32 startOff, F32 en c = cos(ang)*lerp(radius_start, radius_end, t); s = sin(ang)*lerp(radius_start, radius_end, t); - pt->mPos.set(0 + lerp(0,params.getShear().mV[0],s) + pt->mPos.set(0 + lerp(0.f, params.getShear().mV[VX], s) + lerp(-skew ,skew, t) * 0.5f, - c + lerp(0,params.getShear().mV[1],s), + c + lerp(0.f, params.getShear().mV[VY], s), s); pt->mScale.set(hole_x * lerp(taper_x_begin, taper_x_end, t), hole_y * lerp(taper_y_begin, taper_y_end, t), @@ -1494,8 +1495,8 @@ bool LLPath::generate(const LLPathParams& params, F32 detail, S32 split, for (S32 i=0;i= mControlFadeTime) { -- cgit v1.2.3 From 4c6afbbb75076e9fd34ee5707a02195c4e2f7223 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 17 Apr 2025 19:50:30 +0200 Subject: Restore llmath improvements from archived develop branch: * Make eligible functions constexpr * Use constants for vector indices where applicable * Reformat to match actual coding conventions --- indra/llcommon/indra_constants.h | 408 +++++++++++----------- indra/llcommon/lldefs.h | 14 +- indra/llcommon/stdtypes.h | 6 +- indra/llmath/llcamera.h | 26 +- indra/llmath/llcoordframe.cpp | 1 - indra/llmath/llcoordframe.h | 2 +- indra/llmath/llline.h | 2 +- indra/llmath/llmath.h | 60 ++-- indra/llmath/llquaternion.cpp | 1 - indra/llmath/llvolume.h | 1 - indra/llmath/m3math.cpp | 1 - indra/llmath/m4math.cpp | 1 - indra/llmath/v2math.cpp | 37 +- indra/llmath/v2math.h | 144 ++++---- indra/llmath/v3color.cpp | 122 +++---- indra/llmath/v3color.h | 425 +++++++++++------------ indra/llmath/v3colorutil.h | 68 ++-- indra/llmath/v3dmath.cpp | 45 ++- indra/llmath/v3dmath.h | 373 +++++++++++---------- indra/llmath/v3math.cpp | 137 ++++---- indra/llmath/v3math.h | 263 ++++++++------- indra/llmath/v4color.cpp | 391 +++++++++++----------- indra/llmath/v4color.h | 706 ++++++++++++++++++--------------------- indra/llmath/v4coloru.cpp | 65 +--- indra/llmath/v4coloru.h | 371 ++++++++------------ indra/llmath/v4math.cpp | 19 +- indra/llmath/v4math.h | 299 ++++++++--------- indra/llmath/xform.h | 2 +- 28 files changed, 1879 insertions(+), 2111 deletions(-) diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h index c6bdab007f..a0394da281 100644 --- a/indra/llcommon/indra_constants.h +++ b/indra/llcommon/indra_constants.h @@ -31,15 +31,15 @@ class LLUUID; -static const F32 REGION_WIDTH_METERS = 256.f; -static const S32 REGION_WIDTH_UNITS = 256; -static const U32 REGION_WIDTH_U32 = 256; +static constexpr F32 REGION_WIDTH_METERS = 256.f; +static constexpr S32 REGION_WIDTH_UNITS = 256; +static constexpr U32 REGION_WIDTH_U32 = 256; -const F32 REGION_HEIGHT_METERS = 4096.f; +constexpr F32 REGION_HEIGHT_METERS = 4096.f; -const F32 DEFAULT_AGENT_DEPTH = 0.45f; -const F32 DEFAULT_AGENT_WIDTH = 0.60f; -const F32 DEFAULT_AGENT_HEIGHT = 1.9f; +constexpr F32 DEFAULT_AGENT_DEPTH = 0.45f; +constexpr F32 DEFAULT_AGENT_WIDTH = 0.60f; +constexpr F32 DEFAULT_AGENT_HEIGHT = 1.9f; enum ETerrainBrushType { @@ -67,112 +67,112 @@ enum EMouseClickType{ // keys // Bit masks for various keyboard modifier keys. -const MASK MASK_NONE = 0x0000; -const MASK MASK_CONTROL = 0x0001; // Mapped to cmd on Macs -const MASK MASK_ALT = 0x0002; -const MASK MASK_SHIFT = 0x0004; -const MASK MASK_NORMALKEYS = 0x0007; // A real mask - only get the bits for normal modifier keys -const MASK MASK_MAC_CONTROL = 0x0008; // Un-mapped Ctrl key on Macs, not used on Windows -const MASK MASK_MODIFIERS = MASK_CONTROL|MASK_ALT|MASK_SHIFT|MASK_MAC_CONTROL; +constexpr MASK MASK_NONE = 0x0000; +constexpr MASK MASK_CONTROL = 0x0001; // Mapped to cmd on Macs +constexpr MASK MASK_ALT = 0x0002; +constexpr MASK MASK_SHIFT = 0x0004; +constexpr MASK MASK_NORMALKEYS = 0x0007; // A real mask - only get the bits for normal modifier keys +constexpr MASK MASK_MAC_CONTROL = 0x0008; // Un-mapped Ctrl key on Macs, not used on Windows +constexpr MASK MASK_MODIFIERS = MASK_CONTROL|MASK_ALT|MASK_SHIFT|MASK_MAC_CONTROL; // Special keys go into >128 -const KEY KEY_SPECIAL = 0x80; // special keys start here -const KEY KEY_RETURN = 0x81; -const KEY KEY_LEFT = 0x82; -const KEY KEY_RIGHT = 0x83; -const KEY KEY_UP = 0x84; -const KEY KEY_DOWN = 0x85; -const KEY KEY_ESCAPE = 0x86; -const KEY KEY_BACKSPACE =0x87; -const KEY KEY_DELETE = 0x88; -const KEY KEY_SHIFT = 0x89; -const KEY KEY_CONTROL = 0x8A; -const KEY KEY_ALT = 0x8B; -const KEY KEY_HOME = 0x8C; -const KEY KEY_END = 0x8D; -const KEY KEY_PAGE_UP = 0x8E; -const KEY KEY_PAGE_DOWN = 0x8F; -const KEY KEY_HYPHEN = 0x90; -const KEY KEY_EQUALS = 0x91; -const KEY KEY_INSERT = 0x92; -const KEY KEY_CAPSLOCK = 0x93; -const KEY KEY_TAB = 0x94; -const KEY KEY_ADD = 0x95; -const KEY KEY_SUBTRACT =0x96; -const KEY KEY_MULTIPLY =0x97; -const KEY KEY_DIVIDE = 0x98; -const KEY KEY_F1 = 0xA1; -const KEY KEY_F2 = 0xA2; -const KEY KEY_F3 = 0xA3; -const KEY KEY_F4 = 0xA4; -const KEY KEY_F5 = 0xA5; -const KEY KEY_F6 = 0xA6; -const KEY KEY_F7 = 0xA7; -const KEY KEY_F8 = 0xA8; -const KEY KEY_F9 = 0xA9; -const KEY KEY_F10 = 0xAA; -const KEY KEY_F11 = 0xAB; -const KEY KEY_F12 = 0xAC; - -const KEY KEY_PAD_UP = 0xC0; -const KEY KEY_PAD_DOWN = 0xC1; -const KEY KEY_PAD_LEFT = 0xC2; -const KEY KEY_PAD_RIGHT = 0xC3; -const KEY KEY_PAD_HOME = 0xC4; -const KEY KEY_PAD_END = 0xC5; -const KEY KEY_PAD_PGUP = 0xC6; -const KEY KEY_PAD_PGDN = 0xC7; -const KEY KEY_PAD_CENTER = 0xC8; // the 5 in the middle -const KEY KEY_PAD_INS = 0xC9; -const KEY KEY_PAD_DEL = 0xCA; -const KEY KEY_PAD_RETURN = 0xCB; -const KEY KEY_PAD_ADD = 0xCC; // not used -const KEY KEY_PAD_SUBTRACT = 0xCD; // not used -const KEY KEY_PAD_MULTIPLY = 0xCE; // not used -const KEY KEY_PAD_DIVIDE = 0xCF; // not used - -const KEY KEY_BUTTON0 = 0xD0; -const KEY KEY_BUTTON1 = 0xD1; -const KEY KEY_BUTTON2 = 0xD2; -const KEY KEY_BUTTON3 = 0xD3; -const KEY KEY_BUTTON4 = 0xD4; -const KEY KEY_BUTTON5 = 0xD5; -const KEY KEY_BUTTON6 = 0xD6; -const KEY KEY_BUTTON7 = 0xD7; -const KEY KEY_BUTTON8 = 0xD8; -const KEY KEY_BUTTON9 = 0xD9; -const KEY KEY_BUTTON10 = 0xDA; -const KEY KEY_BUTTON11 = 0xDB; -const KEY KEY_BUTTON12 = 0xDC; -const KEY KEY_BUTTON13 = 0xDD; -const KEY KEY_BUTTON14 = 0xDE; -const KEY KEY_BUTTON15 = 0xDF; - -const KEY KEY_NONE = 0xFF; // not sent from keyboard. For internal use only. - -const S32 KEY_COUNT = 256; - - -const F32 DEFAULT_WATER_HEIGHT = 20.0f; +constexpr KEY KEY_SPECIAL = 0x80; // special keys start here +constexpr KEY KEY_RETURN = 0x81; +constexpr KEY KEY_LEFT = 0x82; +constexpr KEY KEY_RIGHT = 0x83; +constexpr KEY KEY_UP = 0x84; +constexpr KEY KEY_DOWN = 0x85; +constexpr KEY KEY_ESCAPE = 0x86; +constexpr KEY KEY_BACKSPACE =0x87; +constexpr KEY KEY_DELETE = 0x88; +constexpr KEY KEY_SHIFT = 0x89; +constexpr KEY KEY_CONTROL = 0x8A; +constexpr KEY KEY_ALT = 0x8B; +constexpr KEY KEY_HOME = 0x8C; +constexpr KEY KEY_END = 0x8D; +constexpr KEY KEY_PAGE_UP = 0x8E; +constexpr KEY KEY_PAGE_DOWN = 0x8F; +constexpr KEY KEY_HYPHEN = 0x90; +constexpr KEY KEY_EQUALS = 0x91; +constexpr KEY KEY_INSERT = 0x92; +constexpr KEY KEY_CAPSLOCK = 0x93; +constexpr KEY KEY_TAB = 0x94; +constexpr KEY KEY_ADD = 0x95; +constexpr KEY KEY_SUBTRACT =0x96; +constexpr KEY KEY_MULTIPLY =0x97; +constexpr KEY KEY_DIVIDE = 0x98; +constexpr KEY KEY_F1 = 0xA1; +constexpr KEY KEY_F2 = 0xA2; +constexpr KEY KEY_F3 = 0xA3; +constexpr KEY KEY_F4 = 0xA4; +constexpr KEY KEY_F5 = 0xA5; +constexpr KEY KEY_F6 = 0xA6; +constexpr KEY KEY_F7 = 0xA7; +constexpr KEY KEY_F8 = 0xA8; +constexpr KEY KEY_F9 = 0xA9; +constexpr KEY KEY_F10 = 0xAA; +constexpr KEY KEY_F11 = 0xAB; +constexpr KEY KEY_F12 = 0xAC; + +constexpr KEY KEY_PAD_UP = 0xC0; +constexpr KEY KEY_PAD_DOWN = 0xC1; +constexpr KEY KEY_PAD_LEFT = 0xC2; +constexpr KEY KEY_PAD_RIGHT = 0xC3; +constexpr KEY KEY_PAD_HOME = 0xC4; +constexpr KEY KEY_PAD_END = 0xC5; +constexpr KEY KEY_PAD_PGUP = 0xC6; +constexpr KEY KEY_PAD_PGDN = 0xC7; +constexpr KEY KEY_PAD_CENTER = 0xC8; // the 5 in the middle +constexpr KEY KEY_PAD_INS = 0xC9; +constexpr KEY KEY_PAD_DEL = 0xCA; +constexpr KEY KEY_PAD_RETURN = 0xCB; +constexpr KEY KEY_PAD_ADD = 0xCC; // not used +constexpr KEY KEY_PAD_SUBTRACT = 0xCD; // not used +constexpr KEY KEY_PAD_MULTIPLY = 0xCE; // not used +constexpr KEY KEY_PAD_DIVIDE = 0xCF; // not used + +constexpr KEY KEY_BUTTON0 = 0xD0; +constexpr KEY KEY_BUTTON1 = 0xD1; +constexpr KEY KEY_BUTTON2 = 0xD2; +constexpr KEY KEY_BUTTON3 = 0xD3; +constexpr KEY KEY_BUTTON4 = 0xD4; +constexpr KEY KEY_BUTTON5 = 0xD5; +constexpr KEY KEY_BUTTON6 = 0xD6; +constexpr KEY KEY_BUTTON7 = 0xD7; +constexpr KEY KEY_BUTTON8 = 0xD8; +constexpr KEY KEY_BUTTON9 = 0xD9; +constexpr KEY KEY_BUTTON10 = 0xDA; +constexpr KEY KEY_BUTTON11 = 0xDB; +constexpr KEY KEY_BUTTON12 = 0xDC; +constexpr KEY KEY_BUTTON13 = 0xDD; +constexpr KEY KEY_BUTTON14 = 0xDE; +constexpr KEY KEY_BUTTON15 = 0xDF; + +constexpr KEY KEY_NONE = 0xFF; // not sent from keyboard. For internal use only. + +constexpr S32 KEY_COUNT = 256; + + +constexpr F32 DEFAULT_WATER_HEIGHT = 20.0f; // Maturity ratings for simulators -const U8 SIM_ACCESS_MIN = 0; // Treated as 'unknown', usually ends up being SIM_ACCESS_PG -const U8 SIM_ACCESS_PG = 13; -const U8 SIM_ACCESS_MATURE = 21; -const U8 SIM_ACCESS_ADULT = 42; // Seriously Adult Only -const U8 SIM_ACCESS_DOWN = 254; -const U8 SIM_ACCESS_MAX = SIM_ACCESS_ADULT; +constexpr U8 SIM_ACCESS_MIN = 0; // Treated as 'unknown', usually ends up being SIM_ACCESS_PG +constexpr U8 SIM_ACCESS_PG = 13; +constexpr U8 SIM_ACCESS_MATURE = 21; +constexpr U8 SIM_ACCESS_ADULT = 42; // Seriously Adult Only +constexpr U8 SIM_ACCESS_DOWN = 254; +constexpr U8 SIM_ACCESS_MAX = SIM_ACCESS_ADULT; // attachment constants -const U8 ATTACHMENT_ADD = 0x80; +constexpr U8 ATTACHMENT_ADD = 0x80; // god levels -const U8 GOD_MAINTENANCE = 250; -const U8 GOD_FULL = 200; -const U8 GOD_LIAISON = 150; -const U8 GOD_CUSTOMER_SERVICE = 100; -const U8 GOD_LIKE = 1; -const U8 GOD_NOT = 0; +constexpr U8 GOD_MAINTENANCE = 250; +constexpr U8 GOD_FULL = 200; +constexpr U8 GOD_LIAISON = 150; +constexpr U8 GOD_CUSTOMER_SERVICE = 100; +constexpr U8 GOD_LIKE = 1; +constexpr U8 GOD_NOT = 0; // "agent id" for things that should be done to ALL agents LL_COMMON_API extern const LLUUID LL_UUID_ALL_AGENTS; @@ -239,120 +239,120 @@ LL_COMMON_API extern const LLUUID BLANK_OBJECT_NORMAL; LL_COMMON_API extern const LLUUID BLANK_MATERIAL_ASSET_ID; // radius within which a chat message is fully audible -const F32 CHAT_NORMAL_RADIUS = 20.f; +constexpr F32 CHAT_NORMAL_RADIUS = 20.f; // media commands -const U32 PARCEL_MEDIA_COMMAND_STOP = 0; -const U32 PARCEL_MEDIA_COMMAND_PAUSE = 1; -const U32 PARCEL_MEDIA_COMMAND_PLAY = 2; -const U32 PARCEL_MEDIA_COMMAND_LOOP = 3; -const U32 PARCEL_MEDIA_COMMAND_TEXTURE = 4; -const U32 PARCEL_MEDIA_COMMAND_URL = 5; -const U32 PARCEL_MEDIA_COMMAND_TIME = 6; -const U32 PARCEL_MEDIA_COMMAND_AGENT = 7; -const U32 PARCEL_MEDIA_COMMAND_UNLOAD = 8; -const U32 PARCEL_MEDIA_COMMAND_AUTO_ALIGN = 9; -const U32 PARCEL_MEDIA_COMMAND_TYPE = 10; -const U32 PARCEL_MEDIA_COMMAND_SIZE = 11; -const U32 PARCEL_MEDIA_COMMAND_DESC = 12; -const U32 PARCEL_MEDIA_COMMAND_LOOP_SET = 13; +constexpr U32 PARCEL_MEDIA_COMMAND_STOP = 0; +constexpr U32 PARCEL_MEDIA_COMMAND_PAUSE = 1; +constexpr U32 PARCEL_MEDIA_COMMAND_PLAY = 2; +constexpr U32 PARCEL_MEDIA_COMMAND_LOOP = 3; +constexpr U32 PARCEL_MEDIA_COMMAND_TEXTURE = 4; +constexpr U32 PARCEL_MEDIA_COMMAND_URL = 5; +constexpr U32 PARCEL_MEDIA_COMMAND_TIME = 6; +constexpr U32 PARCEL_MEDIA_COMMAND_AGENT = 7; +constexpr U32 PARCEL_MEDIA_COMMAND_UNLOAD = 8; +constexpr U32 PARCEL_MEDIA_COMMAND_AUTO_ALIGN = 9; +constexpr U32 PARCEL_MEDIA_COMMAND_TYPE = 10; +constexpr U32 PARCEL_MEDIA_COMMAND_SIZE = 11; +constexpr U32 PARCEL_MEDIA_COMMAND_DESC = 12; +constexpr U32 PARCEL_MEDIA_COMMAND_LOOP_SET = 13; const S32 CHAT_CHANNEL_DEBUG = S32_MAX; // agent constants -const U32 CONTROL_AT_POS_INDEX = 0; -const U32 CONTROL_AT_NEG_INDEX = 1; -const U32 CONTROL_LEFT_POS_INDEX = 2; -const U32 CONTROL_LEFT_NEG_INDEX = 3; -const U32 CONTROL_UP_POS_INDEX = 4; -const U32 CONTROL_UP_NEG_INDEX = 5; -const U32 CONTROL_PITCH_POS_INDEX = 6; -const U32 CONTROL_PITCH_NEG_INDEX = 7; -const U32 CONTROL_YAW_POS_INDEX = 8; -const U32 CONTROL_YAW_NEG_INDEX = 9; -const U32 CONTROL_FAST_AT_INDEX = 10; -const U32 CONTROL_FAST_LEFT_INDEX = 11; -const U32 CONTROL_FAST_UP_INDEX = 12; -const U32 CONTROL_FLY_INDEX = 13; -const U32 CONTROL_STOP_INDEX = 14; -const U32 CONTROL_FINISH_ANIM_INDEX = 15; -const U32 CONTROL_STAND_UP_INDEX = 16; -const U32 CONTROL_SIT_ON_GROUND_INDEX = 17; -const U32 CONTROL_MOUSELOOK_INDEX = 18; -const U32 CONTROL_NUDGE_AT_POS_INDEX = 19; -const U32 CONTROL_NUDGE_AT_NEG_INDEX = 20; -const U32 CONTROL_NUDGE_LEFT_POS_INDEX = 21; -const U32 CONTROL_NUDGE_LEFT_NEG_INDEX = 22; -const U32 CONTROL_NUDGE_UP_POS_INDEX = 23; -const U32 CONTROL_NUDGE_UP_NEG_INDEX = 24; -const U32 CONTROL_TURN_LEFT_INDEX = 25; -const U32 CONTROL_TURN_RIGHT_INDEX = 26; -const U32 CONTROL_AWAY_INDEX = 27; -const U32 CONTROL_LBUTTON_DOWN_INDEX = 28; -const U32 CONTROL_LBUTTON_UP_INDEX = 29; -const U32 CONTROL_ML_LBUTTON_DOWN_INDEX = 30; -const U32 CONTROL_ML_LBUTTON_UP_INDEX = 31; -const U32 TOTAL_CONTROLS = 32; - -const U32 AGENT_CONTROL_AT_POS = 0x1 << CONTROL_AT_POS_INDEX; // 0x00000001 -const U32 AGENT_CONTROL_AT_NEG = 0x1 << CONTROL_AT_NEG_INDEX; // 0x00000002 -const U32 AGENT_CONTROL_LEFT_POS = 0x1 << CONTROL_LEFT_POS_INDEX; // 0x00000004 -const U32 AGENT_CONTROL_LEFT_NEG = 0x1 << CONTROL_LEFT_NEG_INDEX; // 0x00000008 -const U32 AGENT_CONTROL_UP_POS = 0x1 << CONTROL_UP_POS_INDEX; // 0x00000010 -const U32 AGENT_CONTROL_UP_NEG = 0x1 << CONTROL_UP_NEG_INDEX; // 0x00000020 -const U32 AGENT_CONTROL_PITCH_POS = 0x1 << CONTROL_PITCH_POS_INDEX; // 0x00000040 -const U32 AGENT_CONTROL_PITCH_NEG = 0x1 << CONTROL_PITCH_NEG_INDEX; // 0x00000080 -const U32 AGENT_CONTROL_YAW_POS = 0x1 << CONTROL_YAW_POS_INDEX; // 0x00000100 -const U32 AGENT_CONTROL_YAW_NEG = 0x1 << CONTROL_YAW_NEG_INDEX; // 0x00000200 - -const U32 AGENT_CONTROL_FAST_AT = 0x1 << CONTROL_FAST_AT_INDEX; // 0x00000400 -const U32 AGENT_CONTROL_FAST_LEFT = 0x1 << CONTROL_FAST_LEFT_INDEX; // 0x00000800 -const U32 AGENT_CONTROL_FAST_UP = 0x1 << CONTROL_FAST_UP_INDEX; // 0x00001000 - -const U32 AGENT_CONTROL_FLY = 0x1 << CONTROL_FLY_INDEX; // 0x00002000 -const U32 AGENT_CONTROL_STOP = 0x1 << CONTROL_STOP_INDEX; // 0x00004000 -const U32 AGENT_CONTROL_FINISH_ANIM = 0x1 << CONTROL_FINISH_ANIM_INDEX; // 0x00008000 -const U32 AGENT_CONTROL_STAND_UP = 0x1 << CONTROL_STAND_UP_INDEX; // 0x00010000 -const U32 AGENT_CONTROL_SIT_ON_GROUND = 0x1 << CONTROL_SIT_ON_GROUND_INDEX; // 0x00020000 -const U32 AGENT_CONTROL_MOUSELOOK = 0x1 << CONTROL_MOUSELOOK_INDEX; // 0x00040000 - -const U32 AGENT_CONTROL_NUDGE_AT_POS = 0x1 << CONTROL_NUDGE_AT_POS_INDEX; // 0x00080000 -const U32 AGENT_CONTROL_NUDGE_AT_NEG = 0x1 << CONTROL_NUDGE_AT_NEG_INDEX; // 0x00100000 -const U32 AGENT_CONTROL_NUDGE_LEFT_POS = 0x1 << CONTROL_NUDGE_LEFT_POS_INDEX; // 0x00200000 -const U32 AGENT_CONTROL_NUDGE_LEFT_NEG = 0x1 << CONTROL_NUDGE_LEFT_NEG_INDEX; // 0x00400000 -const U32 AGENT_CONTROL_NUDGE_UP_POS = 0x1 << CONTROL_NUDGE_UP_POS_INDEX; // 0x00800000 -const U32 AGENT_CONTROL_NUDGE_UP_NEG = 0x1 << CONTROL_NUDGE_UP_NEG_INDEX; // 0x01000000 -const U32 AGENT_CONTROL_TURN_LEFT = 0x1 << CONTROL_TURN_LEFT_INDEX; // 0x02000000 -const U32 AGENT_CONTROL_TURN_RIGHT = 0x1 << CONTROL_TURN_RIGHT_INDEX; // 0x04000000 - -const U32 AGENT_CONTROL_AWAY = 0x1 << CONTROL_AWAY_INDEX; // 0x08000000 - -const U32 AGENT_CONTROL_LBUTTON_DOWN = 0x1 << CONTROL_LBUTTON_DOWN_INDEX; // 0x10000000 -const U32 AGENT_CONTROL_LBUTTON_UP = 0x1 << CONTROL_LBUTTON_UP_INDEX; // 0x20000000 -const U32 AGENT_CONTROL_ML_LBUTTON_DOWN = 0x1 << CONTROL_ML_LBUTTON_DOWN_INDEX; // 0x40000000 -const U32 AGENT_CONTROL_ML_LBUTTON_UP = ((U32)0x1) << CONTROL_ML_LBUTTON_UP_INDEX; // 0x80000000 +constexpr U32 CONTROL_AT_POS_INDEX = 0; +constexpr U32 CONTROL_AT_NEG_INDEX = 1; +constexpr U32 CONTROL_LEFT_POS_INDEX = 2; +constexpr U32 CONTROL_LEFT_NEG_INDEX = 3; +constexpr U32 CONTROL_UP_POS_INDEX = 4; +constexpr U32 CONTROL_UP_NEG_INDEX = 5; +constexpr U32 CONTROL_PITCH_POS_INDEX = 6; +constexpr U32 CONTROL_PITCH_NEG_INDEX = 7; +constexpr U32 CONTROL_YAW_POS_INDEX = 8; +constexpr U32 CONTROL_YAW_NEG_INDEX = 9; +constexpr U32 CONTROL_FAST_AT_INDEX = 10; +constexpr U32 CONTROL_FAST_LEFT_INDEX = 11; +constexpr U32 CONTROL_FAST_UP_INDEX = 12; +constexpr U32 CONTROL_FLY_INDEX = 13; +constexpr U32 CONTROL_STOP_INDEX = 14; +constexpr U32 CONTROL_FINISH_ANIM_INDEX = 15; +constexpr U32 CONTROL_STAND_UP_INDEX = 16; +constexpr U32 CONTROL_SIT_ON_GROUND_INDEX = 17; +constexpr U32 CONTROL_MOUSELOOK_INDEX = 18; +constexpr U32 CONTROL_NUDGE_AT_POS_INDEX = 19; +constexpr U32 CONTROL_NUDGE_AT_NEG_INDEX = 20; +constexpr U32 CONTROL_NUDGE_LEFT_POS_INDEX = 21; +constexpr U32 CONTROL_NUDGE_LEFT_NEG_INDEX = 22; +constexpr U32 CONTROL_NUDGE_UP_POS_INDEX = 23; +constexpr U32 CONTROL_NUDGE_UP_NEG_INDEX = 24; +constexpr U32 CONTROL_TURN_LEFT_INDEX = 25; +constexpr U32 CONTROL_TURN_RIGHT_INDEX = 26; +constexpr U32 CONTROL_AWAY_INDEX = 27; +constexpr U32 CONTROL_LBUTTON_DOWN_INDEX = 28; +constexpr U32 CONTROL_LBUTTON_UP_INDEX = 29; +constexpr U32 CONTROL_ML_LBUTTON_DOWN_INDEX = 30; +constexpr U32 CONTROL_ML_LBUTTON_UP_INDEX = 31; +constexpr U32 TOTAL_CONTROLS = 32; + +constexpr U32 AGENT_CONTROL_AT_POS = 0x1 << CONTROL_AT_POS_INDEX; // 0x00000001 +constexpr U32 AGENT_CONTROL_AT_NEG = 0x1 << CONTROL_AT_NEG_INDEX; // 0x00000002 +constexpr U32 AGENT_CONTROL_LEFT_POS = 0x1 << CONTROL_LEFT_POS_INDEX; // 0x00000004 +constexpr U32 AGENT_CONTROL_LEFT_NEG = 0x1 << CONTROL_LEFT_NEG_INDEX; // 0x00000008 +constexpr U32 AGENT_CONTROL_UP_POS = 0x1 << CONTROL_UP_POS_INDEX; // 0x00000010 +constexpr U32 AGENT_CONTROL_UP_NEG = 0x1 << CONTROL_UP_NEG_INDEX; // 0x00000020 +constexpr U32 AGENT_CONTROL_PITCH_POS = 0x1 << CONTROL_PITCH_POS_INDEX; // 0x00000040 +constexpr U32 AGENT_CONTROL_PITCH_NEG = 0x1 << CONTROL_PITCH_NEG_INDEX; // 0x00000080 +constexpr U32 AGENT_CONTROL_YAW_POS = 0x1 << CONTROL_YAW_POS_INDEX; // 0x00000100 +constexpr U32 AGENT_CONTROL_YAW_NEG = 0x1 << CONTROL_YAW_NEG_INDEX; // 0x00000200 + +constexpr U32 AGENT_CONTROL_FAST_AT = 0x1 << CONTROL_FAST_AT_INDEX; // 0x00000400 +constexpr U32 AGENT_CONTROL_FAST_LEFT = 0x1 << CONTROL_FAST_LEFT_INDEX; // 0x00000800 +constexpr U32 AGENT_CONTROL_FAST_UP = 0x1 << CONTROL_FAST_UP_INDEX; // 0x00001000 + +constexpr U32 AGENT_CONTROL_FLY = 0x1 << CONTROL_FLY_INDEX; // 0x00002000 +constexpr U32 AGENT_CONTROL_STOP = 0x1 << CONTROL_STOP_INDEX; // 0x00004000 +constexpr U32 AGENT_CONTROL_FINISH_ANIM = 0x1 << CONTROL_FINISH_ANIM_INDEX; // 0x00008000 +constexpr U32 AGENT_CONTROL_STAND_UP = 0x1 << CONTROL_STAND_UP_INDEX; // 0x00010000 +constexpr U32 AGENT_CONTROL_SIT_ON_GROUND = 0x1 << CONTROL_SIT_ON_GROUND_INDEX; // 0x00020000 +constexpr U32 AGENT_CONTROL_MOUSELOOK = 0x1 << CONTROL_MOUSELOOK_INDEX; // 0x00040000 + +constexpr U32 AGENT_CONTROL_NUDGE_AT_POS = 0x1 << CONTROL_NUDGE_AT_POS_INDEX; // 0x00080000 +constexpr U32 AGENT_CONTROL_NUDGE_AT_NEG = 0x1 << CONTROL_NUDGE_AT_NEG_INDEX; // 0x00100000 +constexpr U32 AGENT_CONTROL_NUDGE_LEFT_POS = 0x1 << CONTROL_NUDGE_LEFT_POS_INDEX; // 0x00200000 +constexpr U32 AGENT_CONTROL_NUDGE_LEFT_NEG = 0x1 << CONTROL_NUDGE_LEFT_NEG_INDEX; // 0x00400000 +constexpr U32 AGENT_CONTROL_NUDGE_UP_POS = 0x1 << CONTROL_NUDGE_UP_POS_INDEX; // 0x00800000 +constexpr U32 AGENT_CONTROL_NUDGE_UP_NEG = 0x1 << CONTROL_NUDGE_UP_NEG_INDEX; // 0x01000000 +constexpr U32 AGENT_CONTROL_TURN_LEFT = 0x1 << CONTROL_TURN_LEFT_INDEX; // 0x02000000 +constexpr U32 AGENT_CONTROL_TURN_RIGHT = 0x1 << CONTROL_TURN_RIGHT_INDEX; // 0x04000000 + +constexpr U32 AGENT_CONTROL_AWAY = 0x1 << CONTROL_AWAY_INDEX; // 0x08000000 + +constexpr U32 AGENT_CONTROL_LBUTTON_DOWN = 0x1 << CONTROL_LBUTTON_DOWN_INDEX; // 0x10000000 +constexpr U32 AGENT_CONTROL_LBUTTON_UP = 0x1 << CONTROL_LBUTTON_UP_INDEX; // 0x20000000 +constexpr U32 AGENT_CONTROL_ML_LBUTTON_DOWN = 0x1 << CONTROL_ML_LBUTTON_DOWN_INDEX; // 0x40000000 +constexpr U32 AGENT_CONTROL_ML_LBUTTON_UP = ((U32)0x1) << CONTROL_ML_LBUTTON_UP_INDEX; // 0x80000000 // move these up so that we can hide them in "State" for object updates // (for now) -const U32 AGENT_ATTACH_OFFSET = 4; -const U32 AGENT_ATTACH_MASK = 0xf << AGENT_ATTACH_OFFSET; +constexpr U32 AGENT_ATTACH_OFFSET = 4; +constexpr U32 AGENT_ATTACH_MASK = 0xf << AGENT_ATTACH_OFFSET; // RN: this method swaps the upper and lower nibbles to maintain backward // compatibility with old objects that only used the upper nibble #define ATTACHMENT_ID_FROM_STATE(state) ((S32)((((U8)state & AGENT_ATTACH_MASK) >> 4) | (((U8)state & ~AGENT_ATTACH_MASK) << 4))) // DO NOT CHANGE THE SEQUENCE OF THIS LIST!! -const U8 CLICK_ACTION_NONE = 0; -const U8 CLICK_ACTION_TOUCH = 0; -const U8 CLICK_ACTION_SIT = 1; -const U8 CLICK_ACTION_BUY = 2; -const U8 CLICK_ACTION_PAY = 3; -const U8 CLICK_ACTION_OPEN = 4; -const U8 CLICK_ACTION_PLAY = 5; -const U8 CLICK_ACTION_OPEN_MEDIA = 6; -const U8 CLICK_ACTION_ZOOM = 7; -const U8 CLICK_ACTION_DISABLED = 8; -const U8 CLICK_ACTION_IGNORE = 9; +constexpr U8 CLICK_ACTION_NONE = 0; +constexpr U8 CLICK_ACTION_TOUCH = 0; +constexpr U8 CLICK_ACTION_SIT = 1; +constexpr U8 CLICK_ACTION_BUY = 2; +constexpr U8 CLICK_ACTION_PAY = 3; +constexpr U8 CLICK_ACTION_OPEN = 4; +constexpr U8 CLICK_ACTION_PLAY = 5; +constexpr U8 CLICK_ACTION_OPEN_MEDIA = 6; +constexpr U8 CLICK_ACTION_ZOOM = 7; +constexpr U8 CLICK_ACTION_DISABLED = 8; +constexpr U8 CLICK_ACTION_IGNORE = 9; // DO NOT CHANGE THE SEQUENCE OF THIS LIST!! constexpr U32 BEACON_SHOW_MAP = 0x0001; diff --git a/indra/llcommon/lldefs.h b/indra/llcommon/lldefs.h index 2fbb26dc1a..232987da14 100644 --- a/indra/llcommon/lldefs.h +++ b/indra/llcommon/lldefs.h @@ -171,13 +171,13 @@ constexpr U32 MAXADDRSTR = 17; // 123.567.901.345 = 15 chars + \0 + // recursion tail template -inline auto llmax(T data) +constexpr auto llmax(T data) { return data; } template -inline auto llmax(T0 d0, T1 d1, Ts... rest) +constexpr auto llmax(T0 d0, T1 d1, Ts... rest) { auto maxrest = llmax(d1, rest...); return (d0 > maxrest)? d0 : maxrest; @@ -185,20 +185,20 @@ inline auto llmax(T0 d0, T1 d1, Ts... rest) // recursion tail template -inline auto llmin(T data) +constexpr auto llmin(T data) { return data; } template -inline auto llmin(T0 d0, T1 d1, Ts... rest) +constexpr auto llmin(T0 d0, T1 d1, Ts... rest) { auto minrest = llmin(d1, rest...); return (d0 < minrest) ? d0 : minrest; } template -inline A llclamp(A a, MIN minval, MAX maxval) +constexpr A llclamp(A a, MIN minval, MAX maxval) { A aminval{ static_cast(minval) }, amaxval{ static_cast(maxval) }; if ( a < aminval ) @@ -213,13 +213,13 @@ inline A llclamp(A a, MIN minval, MAX maxval) } template -inline LLDATATYPE llclampf(LLDATATYPE a) +constexpr LLDATATYPE llclampf(LLDATATYPE a) { return llmin(llmax(a, LLDATATYPE(0)), LLDATATYPE(1)); } template -inline LLDATATYPE llclampb(LLDATATYPE a) +constexpr LLDATATYPE llclampb(LLDATATYPE a) { return llmin(llmax(a, LLDATATYPE(0)), LLDATATYPE(255)); } diff --git a/indra/llcommon/stdtypes.h b/indra/llcommon/stdtypes.h index 28e50b3d21..f1e4c2bc78 100644 --- a/indra/llcommon/stdtypes.h +++ b/indra/llcommon/stdtypes.h @@ -164,14 +164,14 @@ private: FROM mValue; public: - narrow(FROM value): mValue(value) {} + constexpr narrow(FROM value): mValue(value) {} /*---------------------- Narrowing unsigned to signed ----------------------*/ template ::value && std::is_signed::value, bool>::type = true> - inline + constexpr operator TO() const { // The reason we skip the @@ -189,7 +189,7 @@ public: typename std::enable_if::value && std::is_signed::value), bool>::type = true> - inline + constexpr operator TO() const { // two different assert()s so we can tell which condition failed diff --git a/indra/llmath/llcamera.h b/indra/llmath/llcamera.h index b6e0e4a2be..6201761c46 100644 --- a/indra/llmath/llcamera.h +++ b/indra/llmath/llcamera.h @@ -33,23 +33,23 @@ #include "llplane.h" #include "llvector4a.h" -const F32 DEFAULT_FIELD_OF_VIEW = 60.f * DEG_TO_RAD; -const F32 DEFAULT_ASPECT_RATIO = 640.f / 480.f; -const F32 DEFAULT_NEAR_PLANE = 0.25f; -const F32 DEFAULT_FAR_PLANE = 64.f; // far reaches across two horizontal, not diagonal, regions +constexpr F32 DEFAULT_FIELD_OF_VIEW = 60.f * DEG_TO_RAD; +constexpr F32 DEFAULT_ASPECT_RATIO = 640.f / 480.f; +constexpr F32 DEFAULT_NEAR_PLANE = 0.25f; +constexpr F32 DEFAULT_FAR_PLANE = 64.f; // far reaches across two horizontal, not diagonal, regions -const F32 MAX_ASPECT_RATIO = 50.0f; -const F32 MAX_NEAR_PLANE = 1023.9f; // Clamp the near plane just before the skybox ends -const F32 MAX_FAR_PLANE = 100000.0f; //1000000.0f; // Max allowed. Not good Z precision though. -const F32 MAX_FAR_CLIP = 512.0f; +constexpr F32 MAX_ASPECT_RATIO = 50.0f; +constexpr F32 MAX_NEAR_PLANE = 1023.9f; // Clamp the near plane just before the skybox ends +constexpr F32 MAX_FAR_PLANE = 100000.0f; //1000000.0f; // Max allowed. Not good Z precision though. +constexpr F32 MAX_FAR_CLIP = 512.0f; -const F32 MIN_ASPECT_RATIO = 0.02f; -const F32 MIN_NEAR_PLANE = 0.1f; -const F32 MIN_FAR_PLANE = 0.2f; +constexpr F32 MIN_ASPECT_RATIO = 0.02f; +constexpr F32 MIN_NEAR_PLANE = 0.1f; +constexpr F32 MIN_FAR_PLANE = 0.2f; // Min/Max FOV values for square views. Call getMin/MaxView to get extremes based on current aspect ratio. -static const F32 MIN_FIELD_OF_VIEW = 5.0f * DEG_TO_RAD; -static const F32 MAX_FIELD_OF_VIEW = 175.f * DEG_TO_RAD; +constexpr F32 MIN_FIELD_OF_VIEW = 5.0f * DEG_TO_RAD; +constexpr F32 MAX_FIELD_OF_VIEW = 175.f * DEG_TO_RAD; // An LLCamera is an LLCoorFrame with a view frustum. // This means that it has several methods for moving it around diff --git a/indra/llmath/llcoordframe.cpp b/indra/llmath/llcoordframe.cpp index 4d6276b2cd..15c9f6ff3f 100644 --- a/indra/llmath/llcoordframe.cpp +++ b/indra/llmath/llcoordframe.cpp @@ -26,7 +26,6 @@ #include "linden_common.h" -//#include "vmath.h" #include "v3math.h" #include "m3math.h" #include "v4math.h" diff --git a/indra/llmath/llcoordframe.h b/indra/llmath/llcoordframe.h index aaa701f792..458f6132c9 100644 --- a/indra/llmath/llcoordframe.h +++ b/indra/llmath/llcoordframe.h @@ -61,7 +61,7 @@ public: //LLCoordFrame(const F32 *origin, const F32 *rotation); // Assumes "origin" is 1x3 and "rotation" is 1x9 array //LLCoordFrame(const F32 *origin_and_rotation); // Assumes "origin_and_rotation" is 1x12 array - bool isFinite() { return mOrigin.isFinite() && mXAxis.isFinite() && mYAxis.isFinite() && mZAxis.isFinite(); } + bool isFinite() const { return mOrigin.isFinite() && mXAxis.isFinite() && mYAxis.isFinite() && mZAxis.isFinite(); } void reset(); void resetAxes(); diff --git a/indra/llmath/llline.h b/indra/llmath/llline.h index 33c1eb61a4..e98e173d1f 100644 --- a/indra/llmath/llline.h +++ b/indra/llmath/llline.h @@ -33,7 +33,7 @@ #include "stdtypes.h" #include "v3math.h" -const F32 DEFAULT_INTERSECTION_ERROR = 0.000001f; +constexpr F32 DEFAULT_INTERSECTION_ERROR = 0.000001f; class LLLine { diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h index fe9a22983d..7f51de7820 100644 --- a/indra/llmath/llmath.h +++ b/indra/llmath/llmath.h @@ -79,7 +79,7 @@ constexpr F32 GIMBAL_THRESHOLD = 0.000436f; // sets the gimballock threshold 0 constexpr F32 FP_MAG_THRESHOLD = 0.0000001f; // TODO: Replace with logic like is_approx_equal -inline bool is_approx_zero( F32 f ) { return (-F_APPROXIMATELY_ZERO < f) && (f < F_APPROXIMATELY_ZERO); } +constexpr bool is_approx_zero(F32 f) { return (-F_APPROXIMATELY_ZERO < f) && (f < F_APPROXIMATELY_ZERO); } // These functions work by interpreting sign+exp+mantissa as an unsigned // integer. @@ -138,33 +138,17 @@ inline F64 llabs(const F64 a) return F64(std::fabs(a)); } -inline S32 lltrunc( F32 f ) +constexpr S32 lltrunc(F32 f) { -#if LL_WINDOWS && !defined( __INTEL_COMPILER ) && (ADDRESS_SIZE == 32) - // Avoids changing the floating point control word. - // Add or subtract 0.5 - epsilon and then round - const static U32 zpfp[] = { 0xBEFFFFFF, 0x3EFFFFFF }; - S32 result; - __asm { - fld f - mov eax, f - shr eax, 29 - and eax, 4 - fadd dword ptr [zpfp + eax] - fistp result - } - return result; -#else - return (S32)f; -#endif + return narrow(f); } -inline S32 lltrunc( F64 f ) +constexpr S32 lltrunc(F64 f) { - return (S32)f; + return narrow(f); } -inline S32 llfloor( F32 f ) +inline S32 llfloor(F32 f) { #if LL_WINDOWS && !defined( __INTEL_COMPILER ) && (ADDRESS_SIZE == 32) // Avoids changing the floating point control word. @@ -274,7 +258,7 @@ constexpr F32 FAST_MAG_BETA = 0.397824734759f; //constexpr F32 FAST_MAG_ALPHA = 0.948059448969f; //constexpr F32 FAST_MAG_BETA = 0.392699081699f; -inline F32 fastMagnitude(F32 a, F32 b) +constexpr F32 fastMagnitude(F32 a, F32 b) { a = (a > 0) ? a : -a; b = (b > 0) ? b : -b; @@ -332,7 +316,7 @@ inline F32 llfastpow(const F32 x, const F32 y) } -inline F32 snap_to_sig_figs(F32 foo, S32 sig_figs) +constexpr F32 snap_to_sig_figs(F32 foo, S32 sig_figs) { // compute the power of ten F32 bar = 1.f; @@ -350,7 +334,7 @@ inline F32 snap_to_sig_figs(F32 foo, S32 sig_figs) using std::lerp; -inline F32 lerp2d(F32 x00, F32 x01, F32 x10, F32 x11, F32 u, F32 v) +constexpr F32 lerp2d(F32 x00, F32 x01, F32 x10, F32 x11, F32 u, F32 v) { F32 a = x00 + (x01-x00)*u; F32 b = x10 + (x11-x10)*u; @@ -358,17 +342,17 @@ inline F32 lerp2d(F32 x00, F32 x01, F32 x10, F32 x11, F32 u, F32 v) return r; } -inline F32 ramp(F32 x, F32 a, F32 b) +constexpr F32 ramp(F32 x, F32 a, F32 b) { return (a == b) ? 0.0f : ((a - x) / (a - b)); } -inline F32 rescale(F32 x, F32 x1, F32 x2, F32 y1, F32 y2) +constexpr F32 rescale(F32 x, F32 x1, F32 x2, F32 y1, F32 y2) { return lerp(y1, y2, ramp(x, x1, x2)); } -inline F32 clamp_rescale(F32 x, F32 x1, F32 x2, F32 y1, F32 y2) +constexpr F32 clamp_rescale(F32 x, F32 x1, F32 x2, F32 y1, F32 y2) { if (y1 < y2) { @@ -381,7 +365,7 @@ inline F32 clamp_rescale(F32 x, F32 x1, F32 x2, F32 y1, F32 y2) } -inline F32 cubic_step( F32 x, F32 x0, F32 x1, F32 s0, F32 s1 ) +constexpr F32 cubic_step( F32 x, F32 x0, F32 x1, F32 s0, F32 s1 ) { if (x <= x0) return s0; @@ -394,14 +378,14 @@ inline F32 cubic_step( F32 x, F32 x0, F32 x1, F32 s0, F32 s1 ) return s0 + (s1 - s0) * (f * f) * (3.0f - 2.0f * f); } -inline F32 cubic_step( F32 x ) +constexpr F32 cubic_step( F32 x ) { x = llclampf(x); return (x * x) * (3.0f - 2.0f * x); } -inline F32 quadratic_step( F32 x, F32 x0, F32 x1, F32 s0, F32 s1 ) +constexpr F32 quadratic_step( F32 x, F32 x0, F32 x1, F32 s0, F32 s1 ) { if (x <= x0) return s0; @@ -415,7 +399,7 @@ inline F32 quadratic_step( F32 x, F32 x0, F32 x1, F32 s0, F32 s1 ) return (s0 * (1.f - f_squared)) + ((s1 - s0) * f_squared); } -inline F32 llsimple_angle(F32 angle) +constexpr F32 llsimple_angle(F32 angle) { while(angle <= -F_PI) angle += F_TWO_PI; @@ -425,7 +409,7 @@ inline F32 llsimple_angle(F32 angle) } //SDK - Renamed this to get_lower_power_two, since this is what this actually does. -inline U32 get_lower_power_two(U32 val, U32 max_power_two) +constexpr U32 get_lower_power_two(U32 val, U32 max_power_two) { if(!max_power_two) { @@ -447,7 +431,7 @@ inline U32 get_lower_power_two(U32 val, U32 max_power_two) // number of digits, then add one. We subtract 1 initially to handle // the case where the number passed in is actually a power of two. // WARNING: this only works with 32 bit ints. -inline U32 get_next_power_two(U32 val, U32 max_power_two) +constexpr U32 get_next_power_two(U32 val, U32 max_power_two) { if(!max_power_two) { @@ -473,7 +457,7 @@ inline U32 get_next_power_two(U32 val, U32 max_power_two) //get the gaussian value given the linear distance from axis x and guassian value o inline F32 llgaussian(F32 x, F32 o) { - return 1.f/(F_SQRT_TWO_PI*o)*powf(F_E, -(x*x)/(2*o*o)); + return 1.f/(F_SQRT_TWO_PI*o)*powf(F_E, -(x*x)/(2.f*o*o)); } //helper function for removing outliers @@ -526,7 +510,8 @@ inline void ll_remove_outliers(std::vector& data, F32 k) // Note: in our code, values labeled as sRGB are ALWAYS gamma corrected linear values, NOT linear values with monitor gamma applied // Note: stored color values should always be gamma corrected linear (i.e. the values returned from an on-screen color swatch) // Note: DO NOT cache the conversion. This leads to error prone synchronization and is actually slower in the typical case due to cache misses -inline float linearTosRGB(const float val) { +inline float linearTosRGB(const float val) +{ if (val < 0.0031308f) { return val * 12.92f; } @@ -541,7 +526,8 @@ inline float linearTosRGB(const float val) { // Note: Stored color values should generally be gamma corrected sRGB. // If you're serializing the return value of this function, you're probably doing it wrong. // Note: DO NOT cache the conversion. This leads to error prone synchronization and is actually slower in the typical case due to cache misses. -inline float sRGBtoLinear(const float val) { +inline float sRGBtoLinear(const float val) +{ if (val < 0.04045f) { return val / 12.92f; } diff --git a/indra/llmath/llquaternion.cpp b/indra/llmath/llquaternion.cpp index aefb82b2f0..1ab3a73d79 100644 --- a/indra/llmath/llquaternion.cpp +++ b/indra/llmath/llquaternion.cpp @@ -30,7 +30,6 @@ #include "llquaternion.h" -//#include "vmath.h" #include "v3math.h" #include "v3dmath.h" #include "v4math.h" diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index 27c5fc5a49..3496928f7b 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -45,7 +45,6 @@ class LLVolumeOctree; #include "lluuid.h" #include "v4color.h" -//#include "vmath.h" #include "v2math.h" #include "v3math.h" #include "v3dmath.h" diff --git a/indra/llmath/m3math.cpp b/indra/llmath/m3math.cpp index 472d340af5..3c2097f947 100644 --- a/indra/llmath/m3math.cpp +++ b/indra/llmath/m3math.cpp @@ -26,7 +26,6 @@ #include "linden_common.h" -//#include "vmath.h" #include "v3math.h" #include "v3dmath.h" #include "v4math.h" diff --git a/indra/llmath/m4math.cpp b/indra/llmath/m4math.cpp index c46ee587cb..a9853fe7e9 100644 --- a/indra/llmath/m4math.cpp +++ b/indra/llmath/m4math.cpp @@ -26,7 +26,6 @@ #include "linden_common.h" -//#include "vmath.h" #include "v3math.h" #include "v4math.h" #include "m4math.h" diff --git a/indra/llmath/v2math.cpp b/indra/llmath/v2math.cpp index 4649e13376..59e6d947ca 100644 --- a/indra/llmath/v2math.cpp +++ b/indra/llmath/v2math.cpp @@ -26,7 +26,6 @@ #include "linden_common.h" -//#include "vmath.h" #include "v2math.h" #include "v3math.h" #include "v4math.h" @@ -47,8 +46,8 @@ bool LLVector2::abs() { bool ret{ false }; - if (mV[0] < 0.f) { mV[0] = -mV[0]; ret = true; } - if (mV[1] < 0.f) { mV[1] = -mV[1]; ret = true; } + if (mV[VX] < 0.f) { mV[VX] = -mV[VX]; ret = true; } + if (mV[VY] < 0.f) { mV[VY] = -mV[VY]; ret = true; } return ret; } @@ -67,14 +66,14 @@ F32 angle_between(const LLVector2& a, const LLVector2& b) return angle; } -bool are_parallel(const LLVector2 &a, const LLVector2 &b, float epsilon) +bool are_parallel(const LLVector2& a, const LLVector2& b, F32 epsilon) { LLVector2 an = a; LLVector2 bn = b; an.normVec(); bn.normVec(); F32 dot = an * bn; - if ( (1.0f - fabs(dot)) < epsilon) + if ((1.0f - fabs(dot)) < epsilon) { return true; } @@ -82,28 +81,28 @@ bool are_parallel(const LLVector2 &a, const LLVector2 &b, float epsilon) } -F32 dist_vec(const LLVector2 &a, const LLVector2 &b) +F32 dist_vec(const LLVector2& a, const LLVector2& b) { - F32 x = a.mV[0] - b.mV[0]; - F32 y = a.mV[1] - b.mV[1]; + F32 x = a.mV[VX] - b.mV[VX]; + F32 y = a.mV[VY] - b.mV[VY]; return (F32) sqrt( x*x + y*y ); } -F32 dist_vec_squared(const LLVector2 &a, const LLVector2 &b) +F32 dist_vec_squared(const LLVector2& a, const LLVector2& b) { - F32 x = a.mV[0] - b.mV[0]; - F32 y = a.mV[1] - b.mV[1]; + F32 x = a.mV[VX] - b.mV[VX]; + F32 y = a.mV[VY] - b.mV[VY]; return x*x + y*y; } -F32 dist_vec_squared2D(const LLVector2 &a, const LLVector2 &b) +F32 dist_vec_squared2D(const LLVector2& a, const LLVector2& b) { - F32 x = a.mV[0] - b.mV[0]; - F32 y = a.mV[1] - b.mV[1]; + F32 x = a.mV[VX] - b.mV[VX]; + F32 y = a.mV[VY] - b.mV[VY]; return x*x + y*y; } -LLVector2 lerp(const LLVector2 &a, const LLVector2 &b, F32 u) +LLVector2 lerp(const LLVector2& a, const LLVector2& b, F32 u) { return LLVector2( a.mV[VX] + (b.mV[VX] - a.mV[VX]) * u, @@ -113,14 +112,14 @@ LLVector2 lerp(const LLVector2 &a, const LLVector2 &b, F32 u) LLSD LLVector2::getValue() const { LLSD ret; - ret[0] = mV[0]; - ret[1] = mV[1]; + ret[VX] = mV[VX]; + ret[VY] = mV[VY]; return ret; } void LLVector2::setValue(const LLSD& sd) { - mV[0] = (F32) sd[0].asReal(); - mV[1] = (F32) sd[1].asReal(); + mV[VX] = (F32) sd[0].asReal(); + mV[VY] = (F32) sd[1].asReal(); } diff --git a/indra/llmath/v2math.h b/indra/llmath/v2math.h index a61c946304..18ad02a411 100644 --- a/indra/llmath/v2math.h +++ b/indra/llmath/v2math.h @@ -36,7 +36,7 @@ class LLQuaternion; // Llvector2 = |x y z w| -static const U32 LENGTHOFVECTOR2 = 2; +static constexpr U32 LENGTHOFVECTOR2 = 2; class LLVector2 { @@ -82,7 +82,7 @@ class LLVector2 const LLVector2& scaleVec(const LLVector2& vec); // scales per component by vec - bool isNull(); // Returns true if vector has a _very_small_ length + bool isNull() const; // Returns true if vector has a _very_small_ length bool isExactlyZero() const { return !mV[VX] && !mV[VY]; } F32 operator[](int idx) const { return mV[idx]; } @@ -113,16 +113,16 @@ class LLVector2 // Non-member functions -F32 angle_between(const LLVector2 &a, const LLVector2 &b); // Returns angle (radians) between a and b -bool are_parallel(const LLVector2 &a, const LLVector2 &b, F32 epsilon=F_APPROXIMATELY_ZERO); // Returns true if a and b are very close to parallel -F32 dist_vec(const LLVector2 &a, const LLVector2 &b); // Returns distance between a and b -F32 dist_vec_squared(const LLVector2 &a, const LLVector2 &b);// Returns distance squared between a and b -F32 dist_vec_squared2D(const LLVector2 &a, const LLVector2 &b);// Returns distance squared between a and b ignoring Z component -LLVector2 lerp(const LLVector2 &a, const LLVector2 &b, F32 u); // Returns a vector that is a linear interpolation between a and b +F32 angle_between(const LLVector2& a, const LLVector2& b); // Returns angle (radians) between a and b +bool are_parallel(const LLVector2& a, const LLVector2& b, F32 epsilon = F_APPROXIMATELY_ZERO); // Returns true if a and b are very close to parallel +F32 dist_vec(const LLVector2& a, const LLVector2& b); // Returns distance between a and b +F32 dist_vec_squared(const LLVector2& a, const LLVector2& b);// Returns distance squared between a and b +F32 dist_vec_squared2D(const LLVector2& a, const LLVector2& b);// Returns distance squared between a and b ignoring Z component +LLVector2 lerp(const LLVector2& a, const LLVector2& b, F32 u); // Returns a vector that is a linear interpolation between a and b // Constructors -inline LLVector2::LLVector2(void) +inline LLVector2::LLVector2() { mV[VX] = 0.f; mV[VY] = 0.f; @@ -153,27 +153,27 @@ inline LLVector2::LLVector2(const LLSD &sd) // Clear and Assignment Functions -inline void LLVector2::clear(void) +inline void LLVector2::clear() { mV[VX] = 0.f; mV[VY] = 0.f; } -inline void LLVector2::setZero(void) +inline void LLVector2::setZero() { mV[VX] = 0.f; mV[VY] = 0.f; } // deprecated -inline void LLVector2::clearVec(void) +inline void LLVector2::clearVec() { mV[VX] = 0.f; mV[VY] = 0.f; } // deprecated -inline void LLVector2::zeroVec(void) +inline void LLVector2::zeroVec() { mV[VX] = 0.f; mV[VY] = 0.f; @@ -222,31 +222,31 @@ inline void LLVector2::setVec(const F32 *vec) // LLVector2 Magnitude and Normalization Functions -inline F32 LLVector2::length(void) const +inline F32 LLVector2::length() const { - return (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1]); + return sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY]); } -inline F32 LLVector2::lengthSquared(void) const +inline F32 LLVector2::lengthSquared() const { - return mV[0]*mV[0] + mV[1]*mV[1]; + return mV[VX]*mV[VX] + mV[VY]*mV[VY]; } -inline F32 LLVector2::normalize(void) +inline F32 LLVector2::normalize() { - F32 mag = (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1]); + F32 mag = sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY]); F32 oomag; if (mag > FP_MAG_THRESHOLD) { oomag = 1.f/mag; - mV[0] *= oomag; - mV[1] *= oomag; + mV[VX] *= oomag; + mV[VY] *= oomag; } else { - mV[0] = 0.f; - mV[1] = 0.f; + mV[VX] = 0.f; + mV[VY] = 0.f; mag = 0; } return (mag); @@ -259,33 +259,33 @@ inline bool LLVector2::isFinite() const } // deprecated -inline F32 LLVector2::magVec(void) const +inline F32 LLVector2::magVec() const { - return (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1]); + return sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY]); } // deprecated -inline F32 LLVector2::magVecSquared(void) const +inline F32 LLVector2::magVecSquared() const { - return mV[0]*mV[0] + mV[1]*mV[1]; + return mV[VX]*mV[VX] + mV[VY]*mV[VY]; } // deprecated -inline F32 LLVector2::normVec(void) +inline F32 LLVector2::normVec() { - F32 mag = (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1]); + F32 mag = sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY]); F32 oomag; if (mag > FP_MAG_THRESHOLD) { oomag = 1.f/mag; - mV[0] *= oomag; - mV[1] *= oomag; + mV[VX] *= oomag; + mV[VY] *= oomag; } else { - mV[0] = 0.f; - mV[1] = 0.f; + mV[VX] = 0.f; + mV[VY] = 0.f; mag = 0; } return (mag); @@ -299,9 +299,9 @@ inline const LLVector2& LLVector2::scaleVec(const LLVector2& vec) return *this; } -inline bool LLVector2::isNull() +inline bool LLVector2::isNull() const { - if ( F_APPROXIMATELY_ZERO > mV[VX]*mV[VX] + mV[VY]*mV[VY] ) + if (F_APPROXIMATELY_ZERO > mV[VX]*mV[VX] + mV[VY]*mV[VY]) { return true; } @@ -312,9 +312,9 @@ inline bool LLVector2::isNull() // LLVector2 Operators // For sorting. By convention, x is "more significant" than y. -inline bool operator<(const LLVector2 &a, const LLVector2 &b) +inline bool operator<(const LLVector2& a, const LLVector2& b) { - if( a.mV[VX] == b.mV[VX] ) + if (a.mV[VX] == b.mV[VX]) { return a.mV[VY] < b.mV[VY]; } @@ -325,95 +325,95 @@ inline bool operator<(const LLVector2 &a, const LLVector2 &b) } -inline LLVector2 operator+(const LLVector2 &a, const LLVector2 &b) +inline LLVector2 operator+(const LLVector2& a, const LLVector2& b) { LLVector2 c(a); return c += b; } -inline LLVector2 operator-(const LLVector2 &a, const LLVector2 &b) +inline LLVector2 operator-(const LLVector2& a, const LLVector2& b) { LLVector2 c(a); return c -= b; } -inline F32 operator*(const LLVector2 &a, const LLVector2 &b) +inline F32 operator*(const LLVector2& a, const LLVector2& b) { - return (a.mV[0]*b.mV[0] + a.mV[1]*b.mV[1]); + return (a.mV[VX]*b.mV[VX] + a.mV[VY]*b.mV[VY]); } -inline LLVector2 operator%(const LLVector2 &a, const LLVector2 &b) +inline LLVector2 operator%(const LLVector2& a, const LLVector2& b) { - return LLVector2(a.mV[0]*b.mV[1] - b.mV[0]*a.mV[1], a.mV[1]*b.mV[0] - b.mV[1]*a.mV[0]); + return LLVector2(a.mV[VX]*b.mV[VY] - b.mV[VX]*a.mV[VY], a.mV[VY]*b.mV[VX] - b.mV[VY]*a.mV[VX]); } -inline LLVector2 operator/(const LLVector2 &a, F32 k) +inline LLVector2 operator/(const LLVector2& a, F32 k) { F32 t = 1.f / k; - return LLVector2( a.mV[0] * t, a.mV[1] * t ); + return LLVector2( a.mV[VX] * t, a.mV[VY] * t ); } -inline LLVector2 operator*(const LLVector2 &a, F32 k) +inline LLVector2 operator*(const LLVector2& a, F32 k) { - return LLVector2( a.mV[0] * k, a.mV[1] * k ); + return LLVector2( a.mV[VX] * k, a.mV[VY] * k ); } -inline LLVector2 operator*(F32 k, const LLVector2 &a) +inline LLVector2 operator*(F32 k, const LLVector2& a) { - return LLVector2( a.mV[0] * k, a.mV[1] * k ); + return LLVector2( a.mV[VX] * k, a.mV[VY] * k ); } -inline bool operator==(const LLVector2 &a, const LLVector2 &b) +inline bool operator==(const LLVector2& a, const LLVector2& b) { - return ( (a.mV[0] == b.mV[0]) - &&(a.mV[1] == b.mV[1])); + return ( (a.mV[VX] == b.mV[VX]) + &&(a.mV[VY] == b.mV[VY])); } -inline bool operator!=(const LLVector2 &a, const LLVector2 &b) +inline bool operator!=(const LLVector2& a, const LLVector2& b) { - return ( (a.mV[0] != b.mV[0]) - ||(a.mV[1] != b.mV[1])); + return ( (a.mV[VX] != b.mV[VX]) + ||(a.mV[VY] != b.mV[VY])); } -inline const LLVector2& operator+=(LLVector2 &a, const LLVector2 &b) +inline const LLVector2& operator+=(LLVector2& a, const LLVector2& b) { - a.mV[0] += b.mV[0]; - a.mV[1] += b.mV[1]; + a.mV[VX] += b.mV[VX]; + a.mV[VY] += b.mV[VY]; return a; } -inline const LLVector2& operator-=(LLVector2 &a, const LLVector2 &b) +inline const LLVector2& operator-=(LLVector2& a, const LLVector2& b) { - a.mV[0] -= b.mV[0]; - a.mV[1] -= b.mV[1]; + a.mV[VX] -= b.mV[VX]; + a.mV[VY] -= b.mV[VY]; return a; } -inline const LLVector2& operator%=(LLVector2 &a, const LLVector2 &b) +inline const LLVector2& operator%=(LLVector2& a, const LLVector2& b) { - LLVector2 ret(a.mV[0]*b.mV[1] - b.mV[0]*a.mV[1], a.mV[1]*b.mV[0] - b.mV[1]*a.mV[0]); + LLVector2 ret(a.mV[VX]*b.mV[VY] - b.mV[VX]*a.mV[VY], a.mV[VY]*b.mV[VX] - b.mV[VY]*a.mV[VX]); a = ret; return a; } -inline const LLVector2& operator*=(LLVector2 &a, F32 k) +inline const LLVector2& operator*=(LLVector2& a, F32 k) { - a.mV[0] *= k; - a.mV[1] *= k; + a.mV[VX] *= k; + a.mV[VY] *= k; return a; } -inline const LLVector2& operator/=(LLVector2 &a, F32 k) +inline const LLVector2& operator/=(LLVector2& a, F32 k) { F32 t = 1.f / k; - a.mV[0] *= t; - a.mV[1] *= t; + a.mV[VX] *= t; + a.mV[VY] *= t; return a; } -inline LLVector2 operator-(const LLVector2 &a) +inline LLVector2 operator-(const LLVector2& a) { - return LLVector2( -a.mV[0], -a.mV[1] ); + return LLVector2( -a.mV[VX], -a.mV[VY] ); } inline void update_min_max(LLVector2& min, LLVector2& max, const LLVector2& pos) @@ -431,7 +431,7 @@ inline void update_min_max(LLVector2& min, LLVector2& max, const LLVector2& pos) } } -inline std::ostream& operator<<(std::ostream& s, const LLVector2 &a) +inline std::ostream& operator<<(std::ostream& s, const LLVector2& a) { s << "{ " << a.mV[VX] << ", " << a.mV[VY] << " }"; return s; diff --git a/indra/llmath/v3color.cpp b/indra/llmath/v3color.cpp index 4367b993f8..08b3795020 100644 --- a/indra/llmath/v3color.cpp +++ b/indra/llmath/v3color.cpp @@ -32,74 +32,79 @@ LLColor3 LLColor3::white(1.0f, 1.0f, 1.0f); LLColor3 LLColor3::black(0.0f, 0.0f, 0.0f); -LLColor3 LLColor3::grey (0.5f, 0.5f, 0.5f); +LLColor3 LLColor3::grey(0.5f, 0.5f, 0.5f); -LLColor3::LLColor3(const LLColor4 &a) +LLColor3::LLColor3(const LLColor4& a) { - mV[0] = a.mV[0]; - mV[1] = a.mV[1]; - mV[2] = a.mV[2]; + mV[VRED] = a.mV[VRED]; + mV[VGREEN] = a.mV[VGREEN]; + mV[VBLUE] = a.mV[VBLUE]; } -LLColor3::LLColor3(const LLVector4 &a) +LLColor3::LLColor3(const LLVector4& a) { - mV[0] = a.mV[0]; - mV[1] = a.mV[1]; - mV[2] = a.mV[2]; + mV[VRED] = a.mV[VRED]; + mV[VGREEN] = a.mV[VGREEN]; + mV[VBLUE] = a.mV[VBLUE]; } -LLColor3::LLColor3(const LLSD &sd) +LLColor3::LLColor3(const LLSD& sd) { setValue(sd); } -const LLColor3& LLColor3::operator=(const LLColor4 &a) +const LLColor3& LLColor3::operator=(const LLColor4& a) { - mV[0] = a.mV[0]; - mV[1] = a.mV[1]; - mV[2] = a.mV[2]; + mV[VRED] = a.mV[VRED]; + mV[VGREEN] = a.mV[VGREEN]; + mV[VBLUE] = a.mV[VBLUE]; return (*this); } -std::ostream& operator<<(std::ostream& s, const LLColor3 &a) +std::ostream& operator<<(std::ostream& s, const LLColor3& a) { s << "{ " << a.mV[VRED] << ", " << a.mV[VGREEN] << ", " << a.mV[VBLUE] << " }"; return s; } -static F32 hueToRgb ( F32 val1In, F32 val2In, F32 valHUeIn ) +static F32 hueToRgb(F32 val1In, F32 val2In, F32 valHUeIn) { - if ( valHUeIn < 0.0f ) valHUeIn += 1.0f; - if ( valHUeIn > 1.0f ) valHUeIn -= 1.0f; - if ( ( 6.0f * valHUeIn ) < 1.0f ) return ( val1In + ( val2In - val1In ) * 6.0f * valHUeIn ); - if ( ( 2.0f * valHUeIn ) < 1.0f ) return ( val2In ); - if ( ( 3.0f * valHUeIn ) < 2.0f ) return ( val1In + ( val2In - val1In ) * ( ( 2.0f / 3.0f ) - valHUeIn ) * 6.0f ); - return ( val1In ); + if (valHUeIn < 0.0f) + valHUeIn += 1.0f; + if (valHUeIn > 1.0f) + valHUeIn -= 1.0f; + if ((6.0f * valHUeIn) < 1.0f) + return (val1In + (val2In - val1In) * 6.0f * valHUeIn); + if ((2.0f * valHUeIn) < 1.0f) + return (val2In); + if ((3.0f * valHUeIn) < 2.0f) + return (val1In + (val2In - val1In) * ((2.0f / 3.0f) - valHUeIn) * 6.0f); + return (val1In); } -void LLColor3::setHSL ( F32 hValIn, F32 sValIn, F32 lValIn) +void LLColor3::setHSL(F32 hValIn, F32 sValIn, F32 lValIn) { - if ( sValIn < 0.00001f ) + if (sValIn < 0.00001f) { - mV[VRED] = lValIn; + mV[VRED] = lValIn; mV[VGREEN] = lValIn; - mV[VBLUE] = lValIn; + mV[VBLUE] = lValIn; } else { F32 interVal1; F32 interVal2; - if ( lValIn < 0.5f ) - interVal2 = lValIn * ( 1.0f + sValIn ); + if (lValIn < 0.5f) + interVal2 = lValIn * (1.0f + sValIn); else - interVal2 = ( lValIn + sValIn ) - ( sValIn * lValIn ); + interVal2 = (lValIn + sValIn) - (sValIn * lValIn); interVal1 = 2.0f * lValIn - interVal2; - mV[VRED] = hueToRgb ( interVal1, interVal2, hValIn + ( 1.f / 3.f ) ); - mV[VGREEN] = hueToRgb ( interVal1, interVal2, hValIn ); - mV[VBLUE] = hueToRgb ( interVal1, interVal2, hValIn - ( 1.f / 3.f ) ); + mV[VRED] = hueToRgb(interVal1, interVal2, hValIn + (1.f / 3.f)); + mV[VGREEN] = hueToRgb(interVal1, interVal2, hValIn); + mV[VBLUE] = hueToRgb(interVal1, interVal2, hValIn - (1.f / 3.f)); } } @@ -109,45 +114,48 @@ void LLColor3::calcHSL(F32* hue, F32* saturation, F32* luminance) const F32 var_G = mV[VGREEN]; F32 var_B = mV[VBLUE]; - F32 var_Min = ( var_R < ( var_G < var_B ? var_G : var_B ) ? var_R : ( var_G < var_B ? var_G : var_B ) ); - F32 var_Max = ( var_R > ( var_G > var_B ? var_G : var_B ) ? var_R : ( var_G > var_B ? var_G : var_B ) ); + F32 var_Min = (var_R < (var_G < var_B ? var_G : var_B) ? var_R : (var_G < var_B ? var_G : var_B)); + F32 var_Max = (var_R > (var_G > var_B ? var_G : var_B) ? var_R : (var_G > var_B ? var_G : var_B)); F32 del_Max = var_Max - var_Min; - F32 L = ( var_Max + var_Min ) / 2.0f; + F32 L = (var_Max + var_Min) / 2.0f; F32 H = 0.0f; F32 S = 0.0f; - if ( del_Max == 0.0f ) + if (del_Max == 0.0f) { - H = 0.0f; - S = 0.0f; + H = 0.0f; + S = 0.0f; } else { - if ( L < 0.5 ) - S = del_Max / ( var_Max + var_Min ); + if (L < 0.5) + S = del_Max / (var_Max + var_Min); else - S = del_Max / ( 2.0f - var_Max - var_Min ); + S = del_Max / (2.0f - var_Max - var_Min); - F32 del_R = ( ( ( var_Max - var_R ) / 6.0f ) + ( del_Max / 2.0f ) ) / del_Max; - F32 del_G = ( ( ( var_Max - var_G ) / 6.0f ) + ( del_Max / 2.0f ) ) / del_Max; - F32 del_B = ( ( ( var_Max - var_B ) / 6.0f ) + ( del_Max / 2.0f ) ) / del_Max; + F32 del_R = (((var_Max - var_R) / 6.0f) + (del_Max / 2.0f)) / del_Max; + F32 del_G = (((var_Max - var_G) / 6.0f) + (del_Max / 2.0f)) / del_Max; + F32 del_B = (((var_Max - var_B) / 6.0f) + (del_Max / 2.0f)) / del_Max; - if ( var_R >= var_Max ) + if (var_R >= var_Max) H = del_B - del_G; - else - if ( var_G >= var_Max ) - H = ( 1.0f / 3.0f ) + del_R - del_B; - else - if ( var_B >= var_Max ) - H = ( 2.0f / 3.0f ) + del_G - del_R; - - if ( H < 0.0f ) H += 1.0f; - if ( H > 1.0f ) H -= 1.0f; + else if (var_G >= var_Max) + H = (1.0f / 3.0f) + del_R - del_B; + else if (var_B >= var_Max) + H = (2.0f / 3.0f) + del_G - del_R; + + if (H < 0.0f) + H += 1.0f; + if (H > 1.0f) + H -= 1.0f; } - if (hue) *hue = H; - if (saturation) *saturation = S; - if (luminance) *luminance = L; + if (hue) + *hue = H; + if (saturation) + *saturation = S; + if (luminance) + *luminance = L; } diff --git a/indra/llmath/v3color.h b/indra/llmath/v3color.h index f7af469e66..48b36e7c8a 100644 --- a/indra/llmath/v3color.h +++ b/indra/llmath/v3color.h @@ -33,12 +33,12 @@ class LLVector4; #include "llerror.h" #include "llmath.h" #include "llsd.h" -#include "v3math.h" // needed for linearColor3v implemtation below +#include "v3math.h" // needed for linearColor3v implemtation below #include // LLColor3 = |r g b| -static const U32 LENGTHOFCOLOR3 = 3; +static constexpr U32 LENGTHOFCOLOR3 = 3; class LLColor3 { @@ -50,44 +50,43 @@ public: static LLColor3 grey; public: - LLColor3(); // Initializes LLColor3 to (0, 0, 0) - LLColor3(F32 r, F32 g, F32 b); // Initializes LLColor3 to (r, g, b) - LLColor3(const F32 *vec); // Initializes LLColor3 to (vec[0]. vec[1], vec[2]) - LLColor3(const char *color_string); // html format color ie "#FFDDEE" - explicit LLColor3(const LLColor4& color4); // "explicit" to avoid automatic conversion - explicit LLColor3(const LLVector4& vector4); // "explicit" to avoid automatic conversion + LLColor3(); // Initializes LLColor3 to (0, 0, 0) + LLColor3(F32 r, F32 g, F32 b); // Initializes LLColor3 to (r, g, b) + LLColor3(const F32* vec); // Initializes LLColor3 to (vec[0]. vec[1], vec[2]) + LLColor3(const char* color_string); // html format color ie "#FFDDEE" + explicit LLColor3(const LLColor4& color4); // "explicit" to avoid automatic conversion + explicit LLColor3(const LLVector4& vector4); // "explicit" to avoid automatic conversion LLColor3(const LLSD& sd); - LLSD getValue() const { LLSD ret; - ret[0] = mV[0]; - ret[1] = mV[1]; - ret[2] = mV[2]; + ret[VRED] = mV[VRED]; + ret[VGREEN] = mV[VGREEN]; + ret[VBLUE] = mV[VBLUE]; return ret; } void setValue(const LLSD& sd) { - mV[0] = (F32) sd[0].asReal();; - mV[1] = (F32) sd[1].asReal();; - mV[2] = (F32) sd[2].asReal();; + mV[VRED] = (F32)sd[VRED].asReal(); + mV[VGREEN] = (F32)sd[VGREEN].asReal(); + mV[VBLUE] = (F32)sd[VBLUE].asReal(); } void setHSL(F32 hue, F32 saturation, F32 luminance); void calcHSL(F32* hue, F32* saturation, F32* luminance) const; - const LLColor3& setToBlack(); // Clears LLColor3 to (0, 0, 0) - const LLColor3& setToWhite(); // Zero LLColor3 to (0, 0, 0) + const LLColor3& setToBlack(); // Clears LLColor3 to (0, 0, 0) + const LLColor3& setToWhite(); // Zero LLColor3 to (0, 0, 0) - const LLColor3& setVec(F32 x, F32 y, F32 z); // deprecated - const LLColor3& setVec(const LLColor3 &vec); // deprecated - const LLColor3& setVec(const F32 *vec); // deprecated + const LLColor3& setVec(F32 x, F32 y, F32 z); // deprecated + const LLColor3& setVec(const LLColor3& vec); // deprecated + const LLColor3& setVec(const F32* vec); // deprecated - const LLColor3& set(F32 x, F32 y, F32 z); // Sets LLColor3 to (x, y, z) - const LLColor3& set(const LLColor3 &vec); // Sets LLColor3 to vec - const LLColor3& set(const F32 *vec); // Sets LLColor3 to vec + const LLColor3& set(F32 x, F32 y, F32 z); // Sets LLColor3 to (x, y, z) + const LLColor3& set(const LLColor3& vec); // Sets LLColor3 to vec + const LLColor3& set(const F32* vec); // Sets LLColor3 to vec // set from a vector of unknown type and size // may leave some data unmodified @@ -99,414 +98,390 @@ public: template void write(std::vector& v) const; - F32 magVec() const; // deprecated - F32 magVecSquared() const; // deprecated - F32 normVec(); // deprecated + F32 magVec() const; // deprecated + F32 magVecSquared() const; // deprecated + F32 normVec(); // deprecated - F32 length() const; // Returns magnitude of LLColor3 - F32 lengthSquared() const; // Returns magnitude squared of LLColor3 - F32 normalize(); // Normalizes and returns the magnitude of LLColor3 + F32 length() const; // Returns magnitude of LLColor3 + F32 lengthSquared() const; // Returns magnitude squared of LLColor3 + F32 normalize(); // Normalizes and returns the magnitude of LLColor3 - F32 brightness() const; // Returns brightness of LLColor3 + F32 brightness() const; // Returns brightness of LLColor3 - const LLColor3& operator=(const LLColor4 &a); + const LLColor3& operator=(const LLColor4& a); - LL_FORCE_INLINE LLColor3 divide(const LLColor3 &col2) + LL_FORCE_INLINE LLColor3 divide(const LLColor3& col2) const { - return LLColor3( - mV[0] / col2.mV[0], - mV[1] / col2.mV[1], - mV[2] / col2.mV[2] ); + return LLColor3(mV[VRED] / col2.mV[VRED], mV[VGREEN] / col2.mV[VGREEN], mV[VBLUE] / col2.mV[VBLUE]); } - LL_FORCE_INLINE LLColor3 color_norm() + LL_FORCE_INLINE LLColor3 color_norm() const { F32 l = length(); - return LLColor3( - mV[0] / l, - mV[1] / l, - mV[2] / l ); + return LLColor3(mV[VRED] / l, mV[VGREEN] / l, mV[VBLUE] / l); } - friend std::ostream& operator<<(std::ostream& s, const LLColor3 &a); // Print a - friend LLColor3 operator+(const LLColor3 &a, const LLColor3 &b); // Return vector a + b - friend LLColor3 operator-(const LLColor3 &a, const LLColor3 &b); // Return vector a minus b + friend std::ostream& operator<<(std::ostream& s, const LLColor3& a); // Print a + friend LLColor3 operator+(const LLColor3& a, const LLColor3& b); // Return vector a + b + friend LLColor3 operator-(const LLColor3& a, const LLColor3& b); // Return vector a minus b - friend const LLColor3& operator+=(LLColor3 &a, const LLColor3 &b); // Return vector a + b - friend const LLColor3& operator-=(LLColor3 &a, const LLColor3 &b); // Return vector a minus b - friend const LLColor3& operator*=(LLColor3 &a, const LLColor3 &b); + friend const LLColor3& operator+=(LLColor3& a, const LLColor3& b); // Return vector a + b + friend const LLColor3& operator-=(LLColor3& a, const LLColor3& b); // Return vector a minus b + friend const LLColor3& operator*=(LLColor3& a, const LLColor3& b); - friend LLColor3 operator*(const LLColor3 &a, const LLColor3 &b); // Return component wise a * b - friend LLColor3 operator*(const LLColor3 &a, F32 k); // Return a times scaler k - friend LLColor3 operator*(F32 k, const LLColor3 &a); // Return a times scaler k + friend LLColor3 operator*(const LLColor3& a, const LLColor3& b); // Return component wise a * b + friend LLColor3 operator*(const LLColor3& a, F32 k); // Return a times scaler k + friend LLColor3 operator*(F32 k, const LLColor3& a); // Return a times scaler k - friend bool operator==(const LLColor3 &a, const LLColor3 &b); // Return a == b - friend bool operator!=(const LLColor3 &a, const LLColor3 &b); // Return a != b + friend bool operator==(const LLColor3& a, const LLColor3& b); // Return a == b + friend bool operator!=(const LLColor3& a, const LLColor3& b); // Return a != b - friend const LLColor3& operator*=(LLColor3 &a, F32 k); // Return a times scaler k + friend const LLColor3& operator*=(LLColor3& a, F32 k); // Return a times scaler k - friend LLColor3 operator-(const LLColor3 &a); // Return vector 1-rgb (inverse) + friend LLColor3 operator-(const LLColor3& a); // Return vector 1-rgb (inverse) inline void clamp(); - inline void exp(); // Do an exponential on the color + inline void exp(); // Do an exponential on the color }; -LLColor3 lerp(const LLColor3 &a, const LLColor3 &b, F32 u); - +LLColor3 lerp(const LLColor3& a, const LLColor3& b, F32 u); void LLColor3::clamp() { // Clamp the color... - if (mV[0] < 0.f) + if (mV[VRED] < 0.f) { - mV[0] = 0.f; + mV[VRED] = 0.f; } - else if (mV[0] > 1.f) + else if (mV[VRED] > 1.f) { - mV[0] = 1.f; + mV[VRED] = 1.f; } - if (mV[1] < 0.f) + if (mV[VGREEN] < 0.f) { - mV[1] = 0.f; + mV[VGREEN] = 0.f; } - else if (mV[1] > 1.f) + else if (mV[VGREEN] > 1.f) { - mV[1] = 1.f; + mV[VGREEN] = 1.f; } - if (mV[2] < 0.f) + if (mV[VBLUE] < 0.f) { - mV[2] = 0.f; + mV[VBLUE] = 0.f; } - else if (mV[2] > 1.f) + else if (mV[VBLUE] > 1.f) { - mV[2] = 1.f; + mV[VBLUE] = 1.f; } } // Non-member functions -F32 distVec(const LLColor3 &a, const LLColor3 &b); // Returns distance between a and b -F32 distVec_squared(const LLColor3 &a, const LLColor3 &b);// Returns distance squared between a and b +F32 distVec(const LLColor3& a, const LLColor3& b); // Returns distance between a and b +F32 distVec_squared(const LLColor3& a, const LLColor3& b); // Returns distance squared between a and b -inline LLColor3::LLColor3(void) +inline LLColor3::LLColor3() { - mV[0] = 0.f; - mV[1] = 0.f; - mV[2] = 0.f; + mV[VRED] = 0.f; + mV[VGREEN] = 0.f; + mV[VBLUE] = 0.f; } inline LLColor3::LLColor3(F32 r, F32 g, F32 b) { - mV[VRED] = r; + mV[VRED] = r; mV[VGREEN] = g; - mV[VBLUE] = b; + mV[VBLUE] = b; } - -inline LLColor3::LLColor3(const F32 *vec) +inline LLColor3::LLColor3(const F32* vec) { - mV[VRED] = vec[VRED]; + mV[VRED] = vec[VRED]; mV[VGREEN] = vec[VGREEN]; - mV[VBLUE] = vec[VBLUE]; + mV[VBLUE] = vec[VBLUE]; } inline LLColor3::LLColor3(const char* color_string) // takes a string of format "RRGGBB" where RR is hex 00..FF { - if (strlen(color_string) < 6) /* Flawfinder: ignore */ + if (strlen(color_string) < 6) /* Flawfinder: ignore */ { - mV[0] = 0.f; - mV[1] = 0.f; - mV[2] = 0.f; + mV[VRED] = 0.f; + mV[VGREEN] = 0.f; + mV[VBLUE] = 0.f; return; } char tempstr[7]; - strncpy(tempstr,color_string,6); /* Flawfinder: ignore */ + strncpy(tempstr, color_string, 6); /* Flawfinder: ignore */ tempstr[6] = '\0'; - mV[VBLUE] = (F32)strtol(&tempstr[4],NULL,16)/255.f; + mV[VBLUE] = (F32)strtol(&tempstr[4], nullptr, 16) / 255.f; tempstr[4] = '\0'; - mV[VGREEN] = (F32)strtol(&tempstr[2],NULL,16)/255.f; + mV[VGREEN] = (F32)strtol(&tempstr[2], nullptr, 16) / 255.f; tempstr[2] = '\0'; - mV[VRED] = (F32)strtol(&tempstr[0],NULL,16)/255.f; + mV[VRED] = (F32)strtol(&tempstr[0], nullptr, 16) / 255.f; } -inline const LLColor3& LLColor3::setToBlack(void) +inline const LLColor3& LLColor3::setToBlack() { - mV[0] = 0.f; - mV[1] = 0.f; - mV[2] = 0.f; + mV[VRED] = 0.f; + mV[VGREEN] = 0.f; + mV[VBLUE] = 0.f; return (*this); } -inline const LLColor3& LLColor3::setToWhite(void) +inline const LLColor3& LLColor3::setToWhite() { - mV[0] = 1.f; - mV[1] = 1.f; - mV[2] = 1.f; + mV[VRED] = 1.f; + mV[VGREEN] = 1.f; + mV[VBLUE] = 1.f; return (*this); } -inline const LLColor3& LLColor3::set(F32 r, F32 g, F32 b) +inline const LLColor3& LLColor3::set(F32 r, F32 g, F32 b) { - mV[0] = r; - mV[1] = g; - mV[2] = b; + mV[VRED] = r; + mV[VGREEN] = g; + mV[VBLUE] = b; return (*this); } -inline const LLColor3& LLColor3::set(const LLColor3 &vec) +inline const LLColor3& LLColor3::set(const LLColor3& vec) { - mV[0] = vec.mV[0]; - mV[1] = vec.mV[1]; - mV[2] = vec.mV[2]; + mV[VRED] = vec.mV[VRED]; + mV[VGREEN] = vec.mV[VGREEN]; + mV[VBLUE] = vec.mV[VBLUE]; return (*this); } -inline const LLColor3& LLColor3::set(const F32 *vec) +inline const LLColor3& LLColor3::set(const F32* vec) { - mV[0] = vec[0]; - mV[1] = vec[1]; - mV[2] = vec[2]; + mV[VRED] = vec[VRED]; + mV[VGREEN] = vec[VGREEN]; + mV[VBLUE] = vec[VBLUE]; return (*this); } // deprecated -inline const LLColor3& LLColor3::setVec(F32 r, F32 g, F32 b) +inline const LLColor3& LLColor3::setVec(F32 r, F32 g, F32 b) { - mV[0] = r; - mV[1] = g; - mV[2] = b; + mV[VRED] = r; + mV[VGREEN] = g; + mV[VBLUE] = b; return (*this); } // deprecated -inline const LLColor3& LLColor3::setVec(const LLColor3 &vec) +inline const LLColor3& LLColor3::setVec(const LLColor3& vec) { - mV[0] = vec.mV[0]; - mV[1] = vec.mV[1]; - mV[2] = vec.mV[2]; + mV[VRED] = vec.mV[VRED]; + mV[VGREEN] = vec.mV[VGREEN]; + mV[VBLUE] = vec.mV[VBLUE]; return (*this); } // deprecated -inline const LLColor3& LLColor3::setVec(const F32 *vec) +inline const LLColor3& LLColor3::setVec(const F32* vec) { - mV[0] = vec[0]; - mV[1] = vec[1]; - mV[2] = vec[2]; + mV[VRED] = vec[VRED]; + mV[VGREEN] = vec[VGREEN]; + mV[VBLUE] = vec[VBLUE]; return (*this); } -inline F32 LLColor3::brightness(void) const +inline F32 LLColor3::brightness() const { - return (mV[0] + mV[1] + mV[2]) / 3.0f; + return (mV[VRED] + mV[VGREEN] + mV[VBLUE]) / 3.0f; } -inline F32 LLColor3::length(void) const +inline F32 LLColor3::length() const { - return (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]); + return sqrt(mV[VRED] * mV[VRED] + mV[VGREEN] * mV[VGREEN] + mV[VBLUE] * mV[VBLUE]); } -inline F32 LLColor3::lengthSquared(void) const +inline F32 LLColor3::lengthSquared() const { - return mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]; + return mV[VRED] * mV[VRED] + mV[VGREEN] * mV[VGREEN] + mV[VBLUE] * mV[VBLUE]; } -inline F32 LLColor3::normalize(void) +inline F32 LLColor3::normalize() { - F32 mag = (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]); + F32 mag = sqrt(mV[VRED] * mV[VRED] + mV[VGREEN] * mV[VGREEN] + mV[VBLUE] * mV[VBLUE]); F32 oomag; if (mag) { - oomag = 1.f/mag; - mV[0] *= oomag; - mV[1] *= oomag; - mV[2] *= oomag; + oomag = 1.f / mag; + mV[VRED] *= oomag; + mV[VGREEN] *= oomag; + mV[VBLUE] *= oomag; } - return (mag); + return mag; } // deprecated -inline F32 LLColor3::magVec(void) const +inline F32 LLColor3::magVec() const { - return (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]); + return sqrt(mV[VRED] * mV[VRED] + mV[VGREEN] * mV[VGREEN] + mV[VBLUE] * mV[VBLUE]); } // deprecated -inline F32 LLColor3::magVecSquared(void) const +inline F32 LLColor3::magVecSquared() const { - return mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]; + return mV[VRED] * mV[VRED] + mV[VGREEN] * mV[VGREEN] + mV[VBLUE] * mV[VBLUE]; } // deprecated -inline F32 LLColor3::normVec(void) +inline F32 LLColor3::normVec() { - F32 mag = (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]); + F32 mag = sqrt(mV[VRED] * mV[VRED] + mV[VGREEN] * mV[VGREEN] + mV[VBLUE] * mV[VBLUE]); F32 oomag; if (mag) { - oomag = 1.f/mag; - mV[0] *= oomag; - mV[1] *= oomag; - mV[2] *= oomag; + oomag = 1.f / mag; + mV[VRED] *= oomag; + mV[VGREEN] *= oomag; + mV[VBLUE] *= oomag; } - return (mag); + return mag; } inline void LLColor3::exp() { #if 0 - mV[0] = ::exp(mV[0]); - mV[1] = ::exp(mV[1]); - mV[2] = ::exp(mV[2]); + mV[VRED] = ::exp(mV[VRED]); + mV[VGREEN] = ::exp(mV[VGREEN]); + mV[VBLUE] = ::exp(mV[VBLUE]); #else - mV[0] = (F32)LL_FAST_EXP(mV[0]); - mV[1] = (F32)LL_FAST_EXP(mV[1]); - mV[2] = (F32)LL_FAST_EXP(mV[2]); + mV[VRED] = (F32)LL_FAST_EXP(mV[VRED]); + mV[VGREEN] = (F32)LL_FAST_EXP(mV[VGREEN]); + mV[VBLUE] = (F32)LL_FAST_EXP(mV[VBLUE]); #endif } - -inline LLColor3 operator+(const LLColor3 &a, const LLColor3 &b) +inline LLColor3 operator+(const LLColor3& a, const LLColor3& b) { - return LLColor3( - a.mV[0] + b.mV[0], - a.mV[1] + b.mV[1], - a.mV[2] + b.mV[2]); + return LLColor3(a.mV[VRED] + b.mV[VRED], a.mV[VGREEN] + b.mV[VGREEN], a.mV[VBLUE] + b.mV[VBLUE]); } -inline LLColor3 operator-(const LLColor3 &a, const LLColor3 &b) +inline LLColor3 operator-(const LLColor3& a, const LLColor3& b) { - return LLColor3( - a.mV[0] - b.mV[0], - a.mV[1] - b.mV[1], - a.mV[2] - b.mV[2]); + return LLColor3(a.mV[VRED] - b.mV[VRED], a.mV[VGREEN] - b.mV[VGREEN], a.mV[VBLUE] - b.mV[VBLUE]); } -inline LLColor3 operator*(const LLColor3 &a, const LLColor3 &b) +inline LLColor3 operator*(const LLColor3& a, const LLColor3& b) { - return LLColor3( - a.mV[0] * b.mV[0], - a.mV[1] * b.mV[1], - a.mV[2] * b.mV[2]); + return LLColor3(a.mV[VRED] * b.mV[VRED], a.mV[VGREEN] * b.mV[VGREEN], a.mV[VBLUE] * b.mV[VBLUE]); } -inline LLColor3 operator*(const LLColor3 &a, F32 k) +inline LLColor3 operator*(const LLColor3& a, F32 k) { - return LLColor3( a.mV[0] * k, a.mV[1] * k, a.mV[2] * k ); + return LLColor3(a.mV[VRED] * k, a.mV[VGREEN] * k, a.mV[VBLUE] * k); } -inline LLColor3 operator*(F32 k, const LLColor3 &a) +inline LLColor3 operator*(F32 k, const LLColor3& a) { - return LLColor3( a.mV[0] * k, a.mV[1] * k, a.mV[2] * k ); + return LLColor3(a.mV[VRED] * k, a.mV[VGREEN] * k, a.mV[VBLUE] * k); } -inline bool operator==(const LLColor3 &a, const LLColor3 &b) +inline bool operator==(const LLColor3& a, const LLColor3& b) { - return ( (a.mV[0] == b.mV[0]) - &&(a.mV[1] == b.mV[1]) - &&(a.mV[2] == b.mV[2])); + return ((a.mV[VRED] == b.mV[VRED]) && (a.mV[VGREEN] == b.mV[VGREEN]) && (a.mV[VBLUE] == b.mV[VBLUE])); } -inline bool operator!=(const LLColor3 &a, const LLColor3 &b) +inline bool operator!=(const LLColor3& a, const LLColor3& b) { - return ( (a.mV[0] != b.mV[0]) - ||(a.mV[1] != b.mV[1]) - ||(a.mV[2] != b.mV[2])); + return ((a.mV[VRED] != b.mV[VRED]) || (a.mV[VGREEN] != b.mV[VGREEN]) || (a.mV[VBLUE] != b.mV[VBLUE])); } -inline const LLColor3 &operator*=(LLColor3 &a, const LLColor3 &b) +inline const LLColor3& operator*=(LLColor3& a, const LLColor3& b) { - a.mV[0] *= b.mV[0]; - a.mV[1] *= b.mV[1]; - a.mV[2] *= b.mV[2]; + a.mV[VRED] *= b.mV[VRED]; + a.mV[VGREEN] *= b.mV[VGREEN]; + a.mV[VBLUE] *= b.mV[VBLUE]; return a; } -inline const LLColor3& operator+=(LLColor3 &a, const LLColor3 &b) +inline const LLColor3& operator+=(LLColor3& a, const LLColor3& b) { - a.mV[0] += b.mV[0]; - a.mV[1] += b.mV[1]; - a.mV[2] += b.mV[2]; + a.mV[VRED] += b.mV[VRED]; + a.mV[VGREEN] += b.mV[VGREEN]; + a.mV[VBLUE] += b.mV[VBLUE]; return a; } -inline const LLColor3& operator-=(LLColor3 &a, const LLColor3 &b) +inline const LLColor3& operator-=(LLColor3& a, const LLColor3& b) { - a.mV[0] -= b.mV[0]; - a.mV[1] -= b.mV[1]; - a.mV[2] -= b.mV[2]; + a.mV[VRED] -= b.mV[VRED]; + a.mV[VGREEN] -= b.mV[VGREEN]; + a.mV[VBLUE] -= b.mV[VBLUE]; return a; } -inline const LLColor3& operator*=(LLColor3 &a, F32 k) +inline const LLColor3& operator*=(LLColor3& a, F32 k) { - a.mV[0] *= k; - a.mV[1] *= k; - a.mV[2] *= k; + a.mV[VRED] *= k; + a.mV[VGREEN] *= k; + a.mV[VBLUE] *= k; return a; } -inline LLColor3 operator-(const LLColor3 &a) +inline LLColor3 operator-(const LLColor3& a) { - return LLColor3( - 1.f - a.mV[0], - 1.f - a.mV[1], - 1.f - a.mV[2] ); + return LLColor3(1.f - a.mV[VRED], 1.f - a.mV[VGREEN], 1.f - a.mV[VBLUE]); } // Non-member functions -inline F32 distVec(const LLColor3 &a, const LLColor3 &b) +inline F32 distVec(const LLColor3& a, const LLColor3& b) { - F32 x = a.mV[0] - b.mV[0]; - F32 y = a.mV[1] - b.mV[1]; - F32 z = a.mV[2] - b.mV[2]; - return (F32) sqrt( x*x + y*y + z*z ); + F32 x = a.mV[VRED] - b.mV[VRED]; + F32 y = a.mV[VGREEN] - b.mV[VGREEN]; + F32 z = a.mV[VBLUE] - b.mV[VBLUE]; + return sqrt(x * x + y * y + z * z); } -inline F32 distVec_squared(const LLColor3 &a, const LLColor3 &b) +inline F32 distVec_squared(const LLColor3& a, const LLColor3& b) { - F32 x = a.mV[0] - b.mV[0]; - F32 y = a.mV[1] - b.mV[1]; - F32 z = a.mV[2] - b.mV[2]; - return x*x + y*y + z*z; + F32 x = a.mV[VRED] - b.mV[VRED]; + F32 y = a.mV[VGREEN] - b.mV[VGREEN]; + F32 z = a.mV[VBLUE] - b.mV[VBLUE]; + return x * x + y * y + z * z; } -inline LLColor3 lerp(const LLColor3 &a, const LLColor3 &b, F32 u) +inline LLColor3 lerp(const LLColor3& a, const LLColor3& b, F32 u) { - return LLColor3( - a.mV[VX] + (b.mV[VX] - a.mV[VX]) * u, - a.mV[VY] + (b.mV[VY] - a.mV[VY]) * u, - a.mV[VZ] + (b.mV[VZ] - a.mV[VZ]) * u); + return LLColor3(a.mV[VX] + (b.mV[VX] - a.mV[VX]) * u, a.mV[VY] + (b.mV[VY] - a.mV[VY]) * u, a.mV[VZ] + (b.mV[VZ] - a.mV[VZ]) * u); } -inline const LLColor3 srgbColor3(const LLColor3 &a) { +inline const LLColor3 srgbColor3(const LLColor3& a) +{ LLColor3 srgbColor; - srgbColor.mV[0] = linearTosRGB(a.mV[0]); - srgbColor.mV[1] = linearTosRGB(a.mV[1]); - srgbColor.mV[2] = linearTosRGB(a.mV[2]); + srgbColor.mV[VRED] = linearTosRGB(a.mV[VRED]); + srgbColor.mV[VGREEN] = linearTosRGB(a.mV[VGREEN]); + srgbColor.mV[VBLUE] = linearTosRGB(a.mV[VBLUE]); return srgbColor; } -inline const LLColor3 linearColor3p(const F32* v) { +inline const LLColor3 linearColor3p(const F32* v) +{ LLColor3 linearColor; - linearColor.mV[0] = sRGBtoLinear(v[0]); - linearColor.mV[1] = sRGBtoLinear(v[1]); - linearColor.mV[2] = sRGBtoLinear(v[2]); + linearColor.mV[VRED] = sRGBtoLinear(v[VRED]); + linearColor.mV[VGREEN] = sRGBtoLinear(v[VGREEN]); + linearColor.mV[VBLUE] = sRGBtoLinear(v[VBLUE]); return linearColor; } template -inline const LLColor3 linearColor3(const T& a) { +inline const LLColor3 linearColor3(const T& a) +{ return linearColor3p(a.mV); } template -inline const LLVector3 linearColor3v(const T& a) { +inline const LLVector3 linearColor3v(const T& a) +{ return LLVector3(linearColor3p(a.mV).mV); } diff --git a/indra/llmath/v3colorutil.h b/indra/llmath/v3colorutil.h index af8799e42a..4dc3100443 100644 --- a/indra/llmath/v3colorutil.h +++ b/indra/llmath/v3colorutil.h @@ -30,59 +30,46 @@ #include "v3color.h" #include "v4color.h" -inline LLColor3 componentDiv(LLColor3 const &left, LLColor3 const & right) +inline LLColor3 componentDiv(const LLColor3& left, const LLColor3& right) { - return LLColor3(left.mV[0] / right.mV[0], - left.mV[1] / right.mV[1], - left.mV[2] / right.mV[2]); + return LLColor3(left.mV[VRED] / right.mV[VRED], left.mV[VGREEN] / right.mV[VGREEN], left.mV[VBLUE] / right.mV[VBLUE]); } - -inline LLColor3 componentMult(LLColor3 const &left, LLColor3 const & right) +inline LLColor3 componentMult(const LLColor3& left, const LLColor3& right) { - return LLColor3(left.mV[0] * right.mV[0], - left.mV[1] * right.mV[1], - left.mV[2] * right.mV[2]); + return LLColor3(left.mV[VRED] * right.mV[VRED], left.mV[VGREEN] * right.mV[VGREEN], left.mV[VBLUE] * right.mV[VBLUE]); } - -inline LLColor3 componentExp(LLColor3 const &v) +inline LLColor3 componentExp(const LLColor3& v) { - return LLColor3(exp(v.mV[0]), - exp(v.mV[1]), - exp(v.mV[2])); + return LLColor3(exp(v.mV[VRED]), exp(v.mV[VGREEN]), exp(v.mV[VBLUE])); } -inline LLColor3 componentPow(LLColor3 const &v, F32 exponent) +inline LLColor3 componentPow(const LLColor3& v, F32 exponent) { - return LLColor3(pow(v.mV[0], exponent), - pow(v.mV[1], exponent), - pow(v.mV[2], exponent)); + return LLColor3(pow(v.mV[VRED], exponent), pow(v.mV[VGREEN], exponent), pow(v.mV[VBLUE], exponent)); } -inline LLColor3 componentSaturate(LLColor3 const &v) +inline LLColor3 componentSaturate(const LLColor3& v) { - return LLColor3(std::max(std::min(v.mV[0], 1.f), 0.f), - std::max(std::min(v.mV[1], 1.f), 0.f), - std::max(std::min(v.mV[2], 1.f), 0.f)); + return LLColor3(std::max(std::min(v.mV[VRED], 1.f), 0.f), + std::max(std::min(v.mV[VGREEN], 1.f), 0.f), + std::max(std::min(v.mV[VBLUE], 1.f), 0.f)); } - -inline LLColor3 componentSqrt(LLColor3 const &v) +inline LLColor3 componentSqrt(const LLColor3& v) { - return LLColor3(sqrt(v.mV[0]), - sqrt(v.mV[1]), - sqrt(v.mV[2])); + return LLColor3(sqrt(v.mV[VRED]), sqrt(v.mV[VGREEN]), sqrt(v.mV[VBLUE])); } -inline void componentMultBy(LLColor3 & left, LLColor3 const & right) +inline void componentMultBy(LLColor3& left, const LLColor3& right) { - left.mV[0] *= right.mV[0]; - left.mV[1] *= right.mV[1]; - left.mV[2] *= right.mV[2]; + left.mV[VRED] *= right.mV[VRED]; + left.mV[VGREEN] *= right.mV[VGREEN]; + left.mV[VBLUE] *= right.mV[VBLUE]; } -inline LLColor3 colorMix(LLColor3 const & left, LLColor3 const & right, F32 amount) +inline LLColor3 colorMix(const LLColor3& left, const LLColor3& right, F32 amount) { return (left + ((right - left) * amount)); } @@ -92,25 +79,24 @@ inline LLColor3 smear(F32 val) return LLColor3(val, val, val); } -inline F32 color_intens(const LLColor3 &col) +inline F32 color_intens(const LLColor3& col) { - return col.mV[0] + col.mV[1] + col.mV[2]; + return col.mV[VRED] + col.mV[VGREEN] + col.mV[VBLUE]; } -inline F32 color_max(const LLColor3 &col) +inline F32 color_max(const LLColor3& col) { - return llmax(col.mV[0], col.mV[1], col.mV[2]); + return llmax(col.mV[VRED], col.mV[VGREEN], col.mV[VBLUE]); } -inline F32 color_max(const LLColor4 &col) +inline F32 color_max(const LLColor4& col) { - return llmax(col.mV[0], col.mV[1], col.mV[2]); + return llmax(col.mV[VRED], col.mV[VGREEN], col.mV[VBLUE]); } - -inline F32 color_min(const LLColor3 &col) +inline F32 color_min(const LLColor3& col) { - return llmin(col.mV[0], col.mV[1], col.mV[2]); + return llmin(col.mV[VRED], col.mV[VGREEN], col.mV[VBLUE]); } #endif diff --git a/indra/llmath/v3dmath.cpp b/indra/llmath/v3dmath.cpp index bb55c812b5..b051303686 100644 --- a/indra/llmath/v3dmath.cpp +++ b/indra/llmath/v3dmath.cpp @@ -30,7 +30,6 @@ #include "v3dmath.h" -//#include "vmath.h" #include "v4math.h" #include "m4math.h" #include "m3math.h" @@ -57,13 +56,13 @@ bool LLVector3d::clamp(F64 min, F64 max) { bool ret{ false }; - if (mdV[0] < min) { mdV[0] = min; ret = true; } - if (mdV[1] < min) { mdV[1] = min; ret = true; } - if (mdV[2] < min) { mdV[2] = min; ret = true; } + if (mdV[VX] < min) { mdV[VX] = min; ret = true; } + if (mdV[VY] < min) { mdV[VY] = min; ret = true; } + if (mdV[VZ] < min) { mdV[VZ] = min; ret = true; } - if (mdV[0] > max) { mdV[0] = max; ret = true; } - if (mdV[1] > max) { mdV[1] = max; ret = true; } - if (mdV[2] > max) { mdV[2] = max; ret = true; } + if (mdV[VX] > max) { mdV[VX] = max; ret = true; } + if (mdV[VY] > max) { mdV[VY] = max; ret = true; } + if (mdV[VZ] > max) { mdV[VZ] = max; ret = true; } return ret; } @@ -74,9 +73,9 @@ bool LLVector3d::abs() { bool ret{ false }; - if (mdV[0] < 0.0) { mdV[0] = -mdV[0]; ret = true; } - if (mdV[1] < 0.0) { mdV[1] = -mdV[1]; ret = true; } - if (mdV[2] < 0.0) { mdV[2] = -mdV[2]; ret = true; } + if (mdV[VX] < 0.0) { mdV[VX] = -mdV[VX]; ret = true; } + if (mdV[VY] < 0.0) { mdV[VY] = -mdV[VY]; ret = true; } + if (mdV[VZ] < 0.0) { mdV[VZ] = -mdV[VZ]; ret = true; } return ret; } @@ -89,37 +88,37 @@ std::ostream& operator<<(std::ostream& s, const LLVector3d &a) const LLVector3d& LLVector3d::operator=(const LLVector4 &a) { - mdV[0] = a.mV[0]; - mdV[1] = a.mV[1]; - mdV[2] = a.mV[2]; + mdV[VX] = a.mV[VX]; + mdV[VY] = a.mV[VY]; + mdV[VZ] = a.mV[VZ]; return *this; } -const LLVector3d& LLVector3d::rotVec(const LLMatrix3 &mat) +const LLVector3d& LLVector3d::rotVec(const LLMatrix3& mat) { *this = *this * mat; return *this; } -const LLVector3d& LLVector3d::rotVec(const LLQuaternion &q) +const LLVector3d& LLVector3d::rotVec(const LLQuaternion& q) { *this = *this * q; return *this; } -const LLVector3d& LLVector3d::rotVec(F64 angle, const LLVector3d &vec) +const LLVector3d& LLVector3d::rotVec(F64 angle, const LLVector3d& vec) { - if ( !vec.isExactlyZero() && angle ) + if (!vec.isExactlyZero() && angle) { *this = *this * LLMatrix3((F32)angle, vec); } return *this; } -const LLVector3d& LLVector3d::rotVec(F64 angle, F64 x, F64 y, F64 z) +const LLVector3d& LLVector3d::rotVec(F64 angle, F64 x, F64 y, F64 z) { LLVector3d vec(x, y, z); - if ( !vec.isExactlyZero() && angle ) + if (!vec.isExactlyZero() && angle) { *this = *this * LLMatrix3((F32)angle, vec); } @@ -129,16 +128,16 @@ const LLVector3d& LLVector3d::rotVec(F64 angle, F64 x, F64 y, F64 z) bool LLVector3d::parseVector3d(const std::string& buf, LLVector3d* value) { - if( buf.empty() || value == nullptr) + if (buf.empty() || value == nullptr) { return false; } LLVector3d v; - S32 count = sscanf( buf.c_str(), "%lf %lf %lf", v.mdV + 0, v.mdV + 1, v.mdV + 2 ); - if( 3 == count ) + S32 count = sscanf(buf.c_str(), "%lf %lf %lf", v.mdV + VX, v.mdV + VY, v.mdV + VZ); + if (3 == count) { - value->setVec( v ); + value->setVec(v); return true; } diff --git a/indra/llmath/v3dmath.h b/indra/llmath/v3dmath.h index ece8c54ea4..e72c150cdc 100644 --- a/indra/llmath/v3dmath.h +++ b/indra/llmath/v3dmath.h @@ -32,128 +32,127 @@ class LLVector3d { - public: - F64 mdV[3]; - - const static LLVector3d zero; - const static LLVector3d x_axis; - const static LLVector3d y_axis; - const static LLVector3d z_axis; - const static LLVector3d x_axis_neg; - const static LLVector3d y_axis_neg; - const static LLVector3d z_axis_neg; - - inline LLVector3d(); // Initializes LLVector3d to (0, 0, 0) - inline LLVector3d(const F64 x, const F64 y, const F64 z); // Initializes LLVector3d to (x. y, z) - inline explicit LLVector3d(const F64 *vec); // Initializes LLVector3d to (vec[0]. vec[1], vec[2]) - inline explicit LLVector3d(const LLVector3 &vec); - explicit LLVector3d(const LLSD& sd) - { - setValue(sd); - } - - void setValue(const LLSD& sd) - { - mdV[0] = sd[0].asReal(); - mdV[1] = sd[1].asReal(); - mdV[2] = sd[2].asReal(); - } - - LLSD getValue() const - { - LLSD ret; - ret[0] = mdV[0]; - ret[1] = mdV[1]; - ret[2] = mdV[2]; - return ret; - } - - inline bool isFinite() const; // checks to see if all values of LLVector3d are finite - bool clamp(const F64 min, const F64 max); // Clamps all values to (min,max), returns true if data changed - bool abs(); // sets all values to absolute value of original value (first octant), returns true if changed - - inline const LLVector3d& clear(); // Clears LLVector3d to (0, 0, 0, 1) - inline const LLVector3d& clearVec(); // deprecated - inline const LLVector3d& setZero(); // Zero LLVector3d to (0, 0, 0, 0) - inline const LLVector3d& zeroVec(); // deprecated - inline const LLVector3d& set(const F64 x, const F64 y, const F64 z); // Sets LLVector3d to (x, y, z, 1) - inline const LLVector3d& set(const LLVector3d &vec); // Sets LLVector3d to vec - inline const LLVector3d& set(const F64 *vec); // Sets LLVector3d to vec - inline const LLVector3d& set(const LLVector3 &vec); - inline const LLVector3d& setVec(const F64 x, const F64 y, const F64 z); // deprecated - inline const LLVector3d& setVec(const LLVector3d &vec); // deprecated - inline const LLVector3d& setVec(const F64 *vec); // deprecated - inline const LLVector3d& setVec(const LLVector3 &vec); // deprecated - - F64 magVec() const; // deprecated - F64 magVecSquared() const; // deprecated - inline F64 normVec(); // deprecated - - F64 length() const; // Returns magnitude of LLVector3d - F64 lengthSquared() const; // Returns magnitude squared of LLVector3d - inline F64 normalize(); // Normalizes and returns the magnitude of LLVector3d - - const LLVector3d& rotVec(const F64 angle, const LLVector3d &vec); // Rotates about vec by angle radians - const LLVector3d& rotVec(const F64 angle, const F64 x, const F64 y, const F64 z); // Rotates about x,y,z by angle radians - const LLVector3d& rotVec(const LLMatrix3 &mat); // Rotates by LLMatrix4 mat - const LLVector3d& rotVec(const LLQuaternion &q); // Rotates by LLQuaternion q - - bool isNull() const; // Returns true if vector has a _very_small_ length - bool isExactlyZero() const { return !mdV[VX] && !mdV[VY] && !mdV[VZ]; } - - const LLVector3d& operator=(const LLVector4 &a); - - F64 operator[](int idx) const { return mdV[idx]; } - F64 &operator[](int idx) { return mdV[idx]; } - - friend LLVector3d operator+(const LLVector3d& a, const LLVector3d& b); // Return vector a + b - friend LLVector3d operator-(const LLVector3d& a, const LLVector3d& b); // Return vector a minus b - friend F64 operator*(const LLVector3d& a, const LLVector3d& b); // Return a dot b - friend LLVector3d operator%(const LLVector3d& a, const LLVector3d& b); // Return a cross b - friend LLVector3d operator*(const LLVector3d& a, const F64 k); // Return a times scaler k - friend LLVector3d operator/(const LLVector3d& a, const F64 k); // Return a divided by scaler k - friend LLVector3d operator*(const F64 k, const LLVector3d& a); // Return a times scaler k - friend bool operator==(const LLVector3d& a, const LLVector3d& b); // Return a == b - friend bool operator!=(const LLVector3d& a, const LLVector3d& b); // Return a != b - - friend const LLVector3d& operator+=(LLVector3d& a, const LLVector3d& b); // Return vector a + b - friend const LLVector3d& operator-=(LLVector3d& a, const LLVector3d& b); // Return vector a minus b - friend const LLVector3d& operator%=(LLVector3d& a, const LLVector3d& b); // Return a cross b - friend const LLVector3d& operator*=(LLVector3d& a, const F64 k); // Return a times scaler k - friend const LLVector3d& operator/=(LLVector3d& a, const F64 k); // Return a divided by scaler k - - friend LLVector3d operator-(const LLVector3d& a); // Return vector -a - - friend std::ostream& operator<<(std::ostream& s, const LLVector3d& a); // Stream a - - static bool parseVector3d(const std::string& buf, LLVector3d* value); +public: + F64 mdV[3]; + + const static LLVector3d zero; + const static LLVector3d x_axis; + const static LLVector3d y_axis; + const static LLVector3d z_axis; + const static LLVector3d x_axis_neg; + const static LLVector3d y_axis_neg; + const static LLVector3d z_axis_neg; + + inline LLVector3d(); // Initializes LLVector3d to (0, 0, 0) + inline LLVector3d(const F64 x, const F64 y, const F64 z); // Initializes LLVector3d to (x. y, z) + inline explicit LLVector3d(const F64 *vec); // Initializes LLVector3d to (vec[0]. vec[1], vec[2]) + inline explicit LLVector3d(const LLVector3 &vec); + explicit LLVector3d(const LLSD& sd) + { + setValue(sd); + } + + void setValue(const LLSD& sd) + { + mdV[VX] = sd[0].asReal(); + mdV[VY] = sd[1].asReal(); + mdV[VZ] = sd[2].asReal(); + } + LLSD getValue() const + { + LLSD ret; + ret[0] = mdV[VX]; + ret[1] = mdV[VY]; + ret[2] = mdV[VZ]; + return ret; + } + + inline bool isFinite() const; // checks to see if all values of LLVector3d are finite + bool clamp(const F64 min, const F64 max); // Clamps all values to (min,max), returns true if data changed + bool abs(); // sets all values to absolute value of original value (first octant), returns true if changed + + inline const LLVector3d& clear(); // Clears LLVector3d to (0, 0, 0, 1) + inline const LLVector3d& clearVec(); // deprecated + inline const LLVector3d& setZero(); // Zero LLVector3d to (0, 0, 0, 0) + inline const LLVector3d& zeroVec(); // deprecated + inline const LLVector3d& set(const F64 x, const F64 y, const F64 z); // Sets LLVector3d to (x, y, z, 1) + inline const LLVector3d& set(const LLVector3d &vec); // Sets LLVector3d to vec + inline const LLVector3d& set(const F64 *vec); // Sets LLVector3d to vec + inline const LLVector3d& set(const LLVector3 &vec); + inline const LLVector3d& setVec(const F64 x, const F64 y, const F64 z); // deprecated + inline const LLVector3d& setVec(const LLVector3d &vec); // deprecated + inline const LLVector3d& setVec(const F64 *vec); // deprecated + inline const LLVector3d& setVec(const LLVector3 &vec); // deprecated + + F64 magVec() const; // deprecated + F64 magVecSquared() const; // deprecated + inline F64 normVec(); // deprecated + + F64 length() const; // Returns magnitude of LLVector3d + F64 lengthSquared() const; // Returns magnitude squared of LLVector3d + inline F64 normalize(); // Normalizes and returns the magnitude of LLVector3d + + const LLVector3d& rotVec(const F64 angle, const LLVector3d &vec); // Rotates about vec by angle radians + const LLVector3d& rotVec(const F64 angle, const F64 x, const F64 y, const F64 z); // Rotates about x,y,z by angle radians + const LLVector3d& rotVec(const LLMatrix3 &mat); // Rotates by LLMatrix4 mat + const LLVector3d& rotVec(const LLQuaternion &q); // Rotates by LLQuaternion q + + bool isNull() const; // Returns true if vector has a _very_small_ length + bool isExactlyZero() const { return !mdV[VX] && !mdV[VY] && !mdV[VZ]; } + + const LLVector3d& operator=(const LLVector4 &a); + + F64 operator[](int idx) const { return mdV[idx]; } + F64 &operator[](int idx) { return mdV[idx]; } + + friend LLVector3d operator+(const LLVector3d& a, const LLVector3d& b); // Return vector a + b + friend LLVector3d operator-(const LLVector3d& a, const LLVector3d& b); // Return vector a minus b + friend F64 operator*(const LLVector3d& a, const LLVector3d& b); // Return a dot b + friend LLVector3d operator%(const LLVector3d& a, const LLVector3d& b); // Return a cross b + friend LLVector3d operator*(const LLVector3d& a, const F64 k); // Return a times scaler k + friend LLVector3d operator/(const LLVector3d& a, const F64 k); // Return a divided by scaler k + friend LLVector3d operator*(const F64 k, const LLVector3d& a); // Return a times scaler k + friend bool operator==(const LLVector3d& a, const LLVector3d& b); // Return a == b + friend bool operator!=(const LLVector3d& a, const LLVector3d& b); // Return a != b + + friend const LLVector3d& operator+=(LLVector3d& a, const LLVector3d& b); // Return vector a + b + friend const LLVector3d& operator-=(LLVector3d& a, const LLVector3d& b); // Return vector a minus b + friend const LLVector3d& operator%=(LLVector3d& a, const LLVector3d& b); // Return a cross b + friend const LLVector3d& operator*=(LLVector3d& a, const F64 k); // Return a times scaler k + friend const LLVector3d& operator/=(LLVector3d& a, const F64 k); // Return a divided by scaler k + + friend LLVector3d operator-(const LLVector3d& a); // Return vector -a + + friend std::ostream& operator<<(std::ostream& s, const LLVector3d& a); // Stream a + + static bool parseVector3d(const std::string& buf, LLVector3d* value); }; typedef LLVector3d LLGlobalVec; inline const LLVector3d &LLVector3d::set(const LLVector3 &vec) { - mdV[0] = vec.mV[0]; - mdV[1] = vec.mV[1]; - mdV[2] = vec.mV[2]; + mdV[VX] = vec.mV[VX]; + mdV[VY] = vec.mV[VY]; + mdV[VZ] = vec.mV[VZ]; return *this; } inline const LLVector3d &LLVector3d::setVec(const LLVector3 &vec) { - mdV[0] = vec.mV[0]; - mdV[1] = vec.mV[1]; - mdV[2] = vec.mV[2]; + mdV[VX] = vec.mV[VX]; + mdV[VY] = vec.mV[VY]; + mdV[VZ] = vec.mV[VZ]; return *this; } inline LLVector3d::LLVector3d(void) { - mdV[0] = 0.f; - mdV[1] = 0.f; - mdV[2] = 0.f; + mdV[VX] = 0.f; + mdV[VY] = 0.f; + mdV[VZ] = 0.f; } inline LLVector3d::LLVector3d(const F64 x, const F64 y, const F64 z) @@ -199,33 +198,33 @@ inline bool LLVector3d::isFinite() const inline const LLVector3d& LLVector3d::clear(void) { - mdV[0] = 0.f; - mdV[1] = 0.f; - mdV[2]= 0.f; + mdV[VX] = 0.f; + mdV[VY] = 0.f; + mdV[VZ] = 0.f; return (*this); } inline const LLVector3d& LLVector3d::clearVec(void) { - mdV[0] = 0.f; - mdV[1] = 0.f; - mdV[2]= 0.f; + mdV[VX] = 0.f; + mdV[VY] = 0.f; + mdV[VZ] = 0.f; return (*this); } inline const LLVector3d& LLVector3d::setZero(void) { - mdV[0] = 0.f; - mdV[1] = 0.f; - mdV[2] = 0.f; + mdV[VX] = 0.f; + mdV[VY] = 0.f; + mdV[VZ] = 0.f; return (*this); } inline const LLVector3d& LLVector3d::zeroVec(void) { - mdV[0] = 0.f; - mdV[1] = 0.f; - mdV[2] = 0.f; + mdV[VX] = 0.f; + mdV[VY] = 0.f; + mdV[VZ] = 0.f; return (*this); } @@ -239,17 +238,17 @@ inline const LLVector3d& LLVector3d::set(const F64 x, const F64 y, const F64 inline const LLVector3d& LLVector3d::set(const LLVector3d &vec) { - mdV[0] = vec.mdV[0]; - mdV[1] = vec.mdV[1]; - mdV[2] = vec.mdV[2]; + mdV[VX] = vec.mdV[VX]; + mdV[VY] = vec.mdV[VY]; + mdV[VZ] = vec.mdV[VZ]; return (*this); } inline const LLVector3d& LLVector3d::set(const F64 *vec) { - mdV[0] = vec[0]; - mdV[1] = vec[1]; - mdV[2] = vec[2]; + mdV[VX] = vec[0]; + mdV[VY] = vec[1]; + mdV[VZ] = vec[2]; return (*this); } @@ -261,61 +260,61 @@ inline const LLVector3d& LLVector3d::setVec(const F64 x, const F64 y, const F return (*this); } -inline const LLVector3d& LLVector3d::setVec(const LLVector3d &vec) +inline const LLVector3d& LLVector3d::setVec(const LLVector3d& vec) { - mdV[0] = vec.mdV[0]; - mdV[1] = vec.mdV[1]; - mdV[2] = vec.mdV[2]; + mdV[VX] = vec.mdV[VX]; + mdV[VY] = vec.mdV[VY]; + mdV[VZ] = vec.mdV[VZ]; return (*this); } -inline const LLVector3d& LLVector3d::setVec(const F64 *vec) +inline const LLVector3d& LLVector3d::setVec(const F64* vec) { - mdV[0] = vec[0]; - mdV[1] = vec[1]; - mdV[2] = vec[2]; + mdV[VX] = vec[VX]; + mdV[VY] = vec[VY]; + mdV[VZ] = vec[VZ]; return (*this); } -inline F64 LLVector3d::normVec(void) +inline F64 LLVector3d::normVec() { - F64 mag = (F32) sqrt(mdV[0]*mdV[0] + mdV[1]*mdV[1] + mdV[2]*mdV[2]); + F64 mag = sqrt(mdV[VX]*mdV[VX] + mdV[VY]*mdV[VY] + mdV[VZ]*mdV[VZ]); F64 oomag; if (mag > FP_MAG_THRESHOLD) { oomag = 1.f/mag; - mdV[0] *= oomag; - mdV[1] *= oomag; - mdV[2] *= oomag; + mdV[VX] *= oomag; + mdV[VY] *= oomag; + mdV[VZ] *= oomag; } else { - mdV[0] = 0.f; - mdV[1] = 0.f; - mdV[2] = 0.f; + mdV[VX] = 0.f; + mdV[VY] = 0.f; + mdV[VZ] = 0.f; mag = 0; } return (mag); } -inline F64 LLVector3d::normalize(void) +inline F64 LLVector3d::normalize() { - F64 mag = (F32) sqrt(mdV[0]*mdV[0] + mdV[1]*mdV[1] + mdV[2]*mdV[2]); + F64 mag = sqrt(mdV[VX]*mdV[VX] + mdV[VY]*mdV[VY] + mdV[VZ]*mdV[VZ]); F64 oomag; if (mag > FP_MAG_THRESHOLD) { oomag = 1.f/mag; - mdV[0] *= oomag; - mdV[1] *= oomag; - mdV[2] *= oomag; + mdV[VX] *= oomag; + mdV[VY] *= oomag; + mdV[VZ] *= oomag; } else { - mdV[0] = 0.f; - mdV[1] = 0.f; - mdV[2] = 0.f; + mdV[VX] = 0.f; + mdV[VY] = 0.f; + mdV[VZ] = 0.f; mag = 0; } return (mag); @@ -323,24 +322,24 @@ inline F64 LLVector3d::normalize(void) // LLVector3d Magnitude and Normalization Functions -inline F64 LLVector3d::magVec(void) const +inline F64 LLVector3d::magVec() const { - return (F32) sqrt(mdV[0]*mdV[0] + mdV[1]*mdV[1] + mdV[2]*mdV[2]); + return sqrt(mdV[VX]*mdV[VX] + mdV[VY]*mdV[VY] + mdV[VZ]*mdV[VZ]); } -inline F64 LLVector3d::magVecSquared(void) const +inline F64 LLVector3d::magVecSquared() const { - return mdV[0]*mdV[0] + mdV[1]*mdV[1] + mdV[2]*mdV[2]; + return mdV[VX]*mdV[VX] + mdV[VY]*mdV[VY] + mdV[VZ]*mdV[VZ]; } -inline F64 LLVector3d::length(void) const +inline F64 LLVector3d::length() const { - return (F32) sqrt(mdV[0]*mdV[0] + mdV[1]*mdV[1] + mdV[2]*mdV[2]); + return sqrt(mdV[VX]*mdV[VX] + mdV[VY]*mdV[VY] + mdV[VZ]*mdV[VZ]); } -inline F64 LLVector3d::lengthSquared(void) const +inline F64 LLVector3d::lengthSquared() const { - return mdV[0]*mdV[0] + mdV[1]*mdV[1] + mdV[2]*mdV[2]; + return mdV[VX]*mdV[VX] + mdV[VY]*mdV[VY] + mdV[VZ]*mdV[VZ]; } inline LLVector3d operator+(const LLVector3d& a, const LLVector3d& b) @@ -357,109 +356,109 @@ inline LLVector3d operator-(const LLVector3d& a, const LLVector3d& b) inline F64 operator*(const LLVector3d& a, const LLVector3d& b) { - return (a.mdV[0]*b.mdV[0] + a.mdV[1]*b.mdV[1] + a.mdV[2]*b.mdV[2]); + return (a.mdV[VX]*b.mdV[VX] + a.mdV[VY]*b.mdV[VY] + a.mdV[VZ]*b.mdV[VZ]); } inline LLVector3d operator%(const LLVector3d& a, const LLVector3d& b) { - return LLVector3d( a.mdV[1]*b.mdV[2] - b.mdV[1]*a.mdV[2], a.mdV[2]*b.mdV[0] - b.mdV[2]*a.mdV[0], a.mdV[0]*b.mdV[1] - b.mdV[0]*a.mdV[1] ); + return LLVector3d( a.mdV[VY]*b.mdV[VZ] - b.mdV[VY]*a.mdV[VZ], a.mdV[VZ]*b.mdV[VX] - b.mdV[VZ]*a.mdV[VX], a.mdV[VX]*b.mdV[VY] - b.mdV[VX]*a.mdV[VY] ); } inline LLVector3d operator/(const LLVector3d& a, const F64 k) { F64 t = 1.f / k; - return LLVector3d( a.mdV[0] * t, a.mdV[1] * t, a.mdV[2] * t ); + return LLVector3d( a.mdV[VX] * t, a.mdV[VY] * t, a.mdV[VZ] * t ); } inline LLVector3d operator*(const LLVector3d& a, const F64 k) { - return LLVector3d( a.mdV[0] * k, a.mdV[1] * k, a.mdV[2] * k ); + return LLVector3d( a.mdV[VX] * k, a.mdV[VY] * k, a.mdV[VZ] * k ); } inline LLVector3d operator*(F64 k, const LLVector3d& a) { - return LLVector3d( a.mdV[0] * k, a.mdV[1] * k, a.mdV[2] * k ); + return LLVector3d( a.mdV[VX] * k, a.mdV[VY] * k, a.mdV[VZ] * k ); } inline bool operator==(const LLVector3d& a, const LLVector3d& b) { - return ( (a.mdV[0] == b.mdV[0]) - &&(a.mdV[1] == b.mdV[1]) - &&(a.mdV[2] == b.mdV[2])); + return ( (a.mdV[VX] == b.mdV[VX]) + &&(a.mdV[VY] == b.mdV[VY]) + &&(a.mdV[VZ] == b.mdV[VZ])); } inline bool operator!=(const LLVector3d& a, const LLVector3d& b) { - return ( (a.mdV[0] != b.mdV[0]) - ||(a.mdV[1] != b.mdV[1]) - ||(a.mdV[2] != b.mdV[2])); + return ( (a.mdV[VX] != b.mdV[VX]) + ||(a.mdV[VY] != b.mdV[VY]) + ||(a.mdV[VZ] != b.mdV[VZ])); } inline const LLVector3d& operator+=(LLVector3d& a, const LLVector3d& b) { - a.mdV[0] += b.mdV[0]; - a.mdV[1] += b.mdV[1]; - a.mdV[2] += b.mdV[2]; + a.mdV[VX] += b.mdV[VX]; + a.mdV[VY] += b.mdV[VY]; + a.mdV[VZ] += b.mdV[VZ]; return a; } inline const LLVector3d& operator-=(LLVector3d& a, const LLVector3d& b) { - a.mdV[0] -= b.mdV[0]; - a.mdV[1] -= b.mdV[1]; - a.mdV[2] -= b.mdV[2]; + a.mdV[VX] -= b.mdV[VX]; + a.mdV[VY] -= b.mdV[VY]; + a.mdV[VZ] -= b.mdV[VZ]; return a; } inline const LLVector3d& operator%=(LLVector3d& a, const LLVector3d& b) { - LLVector3d ret( a.mdV[1]*b.mdV[2] - b.mdV[1]*a.mdV[2], a.mdV[2]*b.mdV[0] - b.mdV[2]*a.mdV[0], a.mdV[0]*b.mdV[1] - b.mdV[0]*a.mdV[1]); + LLVector3d ret( a.mdV[VY]*b.mdV[VZ] - b.mdV[VY]*a.mdV[VZ], a.mdV[VZ]*b.mdV[VX] - b.mdV[VZ]*a.mdV[VX], a.mdV[VX]*b.mdV[VY] - b.mdV[VX]*a.mdV[VY]); a = ret; return a; } inline const LLVector3d& operator*=(LLVector3d& a, const F64 k) { - a.mdV[0] *= k; - a.mdV[1] *= k; - a.mdV[2] *= k; + a.mdV[VX] *= k; + a.mdV[VY] *= k; + a.mdV[VZ] *= k; return a; } inline const LLVector3d& operator/=(LLVector3d& a, const F64 k) { F64 t = 1.f / k; - a.mdV[0] *= t; - a.mdV[1] *= t; - a.mdV[2] *= t; + a.mdV[VX] *= t; + a.mdV[VY] *= t; + a.mdV[VZ] *= t; return a; } inline LLVector3d operator-(const LLVector3d& a) { - return LLVector3d( -a.mdV[0], -a.mdV[1], -a.mdV[2] ); + return LLVector3d( -a.mdV[VX], -a.mdV[VY], -a.mdV[VZ] ); } inline F64 dist_vec(const LLVector3d& a, const LLVector3d& b) { - F64 x = a.mdV[0] - b.mdV[0]; - F64 y = a.mdV[1] - b.mdV[1]; - F64 z = a.mdV[2] - b.mdV[2]; + F64 x = a.mdV[VX] - b.mdV[VX]; + F64 y = a.mdV[VY] - b.mdV[VY]; + F64 z = a.mdV[VZ] - b.mdV[VZ]; return (F32) sqrt( x*x + y*y + z*z ); } inline F64 dist_vec_squared(const LLVector3d& a, const LLVector3d& b) { - F64 x = a.mdV[0] - b.mdV[0]; - F64 y = a.mdV[1] - b.mdV[1]; - F64 z = a.mdV[2] - b.mdV[2]; + F64 x = a.mdV[VX] - b.mdV[VX]; + F64 y = a.mdV[VY] - b.mdV[VY]; + F64 z = a.mdV[VZ] - b.mdV[VZ]; return x*x + y*y + z*z; } inline F64 dist_vec_squared2D(const LLVector3d& a, const LLVector3d& b) { - F64 x = a.mdV[0] - b.mdV[0]; - F64 y = a.mdV[1] - b.mdV[1]; + F64 x = a.mdV[VX] - b.mdV[VX]; + F64 y = a.mdV[VY] - b.mdV[VY]; return x*x + y*y; } diff --git a/indra/llmath/v3math.cpp b/indra/llmath/v3math.cpp index 73ad2a4ed6..eac95ed023 100644 --- a/indra/llmath/v3math.cpp +++ b/indra/llmath/v3math.cpp @@ -28,7 +28,6 @@ #include "v3math.h" -//#include "vmath.h" #include "v2math.h" #include "v4math.h" #include "m4math.h" @@ -58,13 +57,13 @@ bool LLVector3::clamp(F32 min, F32 max) { bool ret{ false }; - if (mV[0] < min) { mV[0] = min; ret = true; } - if (mV[1] < min) { mV[1] = min; ret = true; } - if (mV[2] < min) { mV[2] = min; ret = true; } + if (mV[VX] < min) { mV[VX] = min; ret = true; } + if (mV[VY] < min) { mV[VY] = min; ret = true; } + if (mV[VZ] < min) { mV[VZ] = min; ret = true; } - if (mV[0] > max) { mV[0] = max; ret = true; } - if (mV[1] > max) { mV[1] = max; ret = true; } - if (mV[2] > max) { mV[2] = max; ret = true; } + if (mV[VX] > max) { mV[VX] = max; ret = true; } + if (mV[VY] > max) { mV[VY] = max; ret = true; } + if (mV[VZ] > max) { mV[VZ] = max; ret = true; } return ret; } @@ -85,9 +84,9 @@ bool LLVector3::clampLength( F32 length_limit ) { length_limit = 0.f; } - mV[0] *= length_limit; - mV[1] *= length_limit; - mV[2] *= length_limit; + mV[VX] *= length_limit; + mV[VY] *= length_limit; + mV[VZ] *= length_limit; changed = true; } } @@ -116,35 +115,35 @@ bool LLVector3::clampLength( F32 length_limit ) { // yes it can be salvaged --> // bring the components down before we normalize - mV[0] /= max_abs_component; - mV[1] /= max_abs_component; - mV[2] /= max_abs_component; + mV[VX] /= max_abs_component; + mV[VY] /= max_abs_component; + mV[VZ] /= max_abs_component; normalize(); if (length_limit < 0.f) { length_limit = 0.f; } - mV[0] *= length_limit; - mV[1] *= length_limit; - mV[2] *= length_limit; + mV[VX] *= length_limit; + mV[VY] *= length_limit; + mV[VZ] *= length_limit; } } return changed; } -bool LLVector3::clamp(const LLVector3 &min_vec, const LLVector3 &max_vec) +bool LLVector3::clamp(const LLVector3& min_vec, const LLVector3& max_vec) { bool ret{ false }; - if (mV[0] < min_vec[0]) { mV[0] = min_vec[0]; ret = true; } - if (mV[1] < min_vec[1]) { mV[1] = min_vec[1]; ret = true; } - if (mV[2] < min_vec[2]) { mV[2] = min_vec[2]; ret = true; } + if (mV[VX] < min_vec[0]) { mV[VX] = min_vec[0]; ret = true; } + if (mV[VY] < min_vec[1]) { mV[VY] = min_vec[1]; ret = true; } + if (mV[VZ] < min_vec[2]) { mV[VZ] = min_vec[2]; ret = true; } - if (mV[0] > max_vec[0]) { mV[0] = max_vec[0]; ret = true; } - if (mV[1] > max_vec[1]) { mV[1] = max_vec[1]; ret = true; } - if (mV[2] > max_vec[2]) { mV[2] = max_vec[2]; ret = true; } + if (mV[VX] > max_vec[0]) { mV[VX] = max_vec[0]; ret = true; } + if (mV[VY] > max_vec[1]) { mV[VY] = max_vec[1]; ret = true; } + if (mV[VZ] > max_vec[2]) { mV[VZ] = max_vec[2]; ret = true; } return ret; } @@ -156,15 +155,15 @@ bool LLVector3::abs() { bool ret{ false }; - if (mV[0] < 0.f) { mV[0] = -mV[0]; ret = true; } - if (mV[1] < 0.f) { mV[1] = -mV[1]; ret = true; } - if (mV[2] < 0.f) { mV[2] = -mV[2]; ret = true; } + if (mV[VX] < 0.f) { mV[VX] = -mV[VX]; ret = true; } + if (mV[VY] < 0.f) { mV[VY] = -mV[VY]; ret = true; } + if (mV[VZ] < 0.f) { mV[VZ] = -mV[VZ]; ret = true; } return ret; } // Quatizations -void LLVector3::quantize16(F32 lowerxy, F32 upperxy, F32 lowerz, F32 upperz) +void LLVector3::quantize16(F32 lowerxy, F32 upperxy, F32 lowerz, F32 upperz) { F32 x = mV[VX]; F32 y = mV[VY]; @@ -179,7 +178,7 @@ void LLVector3::quantize16(F32 lowerxy, F32 upperxy, F32 lowerz, F32 upperz) mV[VZ] = z; } -void LLVector3::quantize8(F32 lowerxy, F32 upperxy, F32 lowerz, F32 upperz) +void LLVector3::quantize8(F32 lowerxy, F32 upperxy, F32 lowerz, F32 upperz) { mV[VX] = U8_to_F32(F32_to_U8(mV[VX], lowerxy, upperxy), lowerxy, upperxy);; mV[VY] = U8_to_F32(F32_to_U8(mV[VY], lowerxy, upperxy), lowerxy, upperxy); @@ -187,20 +186,20 @@ void LLVector3::quantize8(F32 lowerxy, F32 upperxy, F32 lowerz, F32 upperz) } -void LLVector3::snap(S32 sig_digits) +void LLVector3::snap(S32 sig_digits) { mV[VX] = snap_to_sig_figs(mV[VX], sig_digits); mV[VY] = snap_to_sig_figs(mV[VY], sig_digits); mV[VZ] = snap_to_sig_figs(mV[VZ], sig_digits); } -const LLVector3& LLVector3::rotVec(const LLMatrix3 &mat) +const LLVector3& LLVector3::rotVec(const LLMatrix3& mat) { *this = *this * mat; return *this; } -const LLVector3& LLVector3::rotVec(const LLQuaternion &q) +const LLVector3& LLVector3::rotVec(const LLQuaternion& q) { *this = *this * q; return *this; @@ -228,26 +227,26 @@ const LLVector3& LLVector3::transVec(const LLMatrix4& mat) } -const LLVector3& LLVector3::rotVec(F32 angle, const LLVector3 &vec) +const LLVector3& LLVector3::rotVec(F32 angle, const LLVector3& vec) { - if ( !vec.isExactlyZero() && angle ) + if (!vec.isExactlyZero() && angle) { *this = *this * LLQuaternion(angle, vec); } return *this; } -const LLVector3& LLVector3::rotVec(F32 angle, F32 x, F32 y, F32 z) +const LLVector3& LLVector3::rotVec(F32 angle, F32 x, F32 y, F32 z) { LLVector3 vec(x, y, z); - if ( !vec.isExactlyZero() && angle ) + if (!vec.isExactlyZero() && angle) { *this = *this * LLQuaternion(angle, vec); } return *this; } -const LLVector3& LLVector3::scaleVec(const LLVector3& vec) +const LLVector3& LLVector3::scaleVec(const LLVector3& vec) { mV[VX] *= vec.mV[VX]; mV[VY] *= vec.mV[VY]; @@ -256,42 +255,42 @@ const LLVector3& LLVector3::scaleVec(const LLVector3& vec) return *this; } -LLVector3 LLVector3::scaledVec(const LLVector3& vec) const +LLVector3 LLVector3::scaledVec(const LLVector3& vec) const { LLVector3 ret = LLVector3(*this); ret.scaleVec(vec); return ret; } -const LLVector3& LLVector3::set(const LLVector3d &vec) +const LLVector3& LLVector3::set(const LLVector3d& vec) { - mV[0] = (F32)vec.mdV[0]; - mV[1] = (F32)vec.mdV[1]; - mV[2] = (F32)vec.mdV[2]; + mV[VX] = (F32)vec.mdV[VX]; + mV[VY] = (F32)vec.mdV[VY]; + mV[VZ] = (F32)vec.mdV[VZ]; return (*this); } -const LLVector3& LLVector3::set(const LLVector4 &vec) +const LLVector3& LLVector3::set(const LLVector4& vec) { - mV[0] = vec.mV[0]; - mV[1] = vec.mV[1]; - mV[2] = vec.mV[2]; + mV[VX] = vec.mV[VX]; + mV[VY] = vec.mV[VY]; + mV[VZ] = vec.mV[VZ]; return (*this); } -const LLVector3& LLVector3::setVec(const LLVector3d &vec) +const LLVector3& LLVector3::setVec(const LLVector3d& vec) { - mV[0] = (F32)vec.mdV[0]; - mV[1] = (F32)vec.mdV[1]; - mV[2] = (F32)vec.mdV[2]; + mV[VX] = (F32)vec.mdV[0]; + mV[VY] = (F32)vec.mdV[1]; + mV[VZ] = (F32)vec.mdV[2]; return (*this); } -const LLVector3& LLVector3::setVec(const LLVector4 &vec) +const LLVector3& LLVector3::setVec(const LLVector4& vec) { - mV[0] = vec.mV[0]; - mV[1] = vec.mV[1]; - mV[2] = vec.mV[2]; + mV[VX] = vec.mV[VX]; + mV[VY] = vec.mV[VY]; + mV[VZ] = vec.mV[VZ]; return (*this); } @@ -299,17 +298,17 @@ LLVector3::LLVector3(const LLVector2 &vec) { mV[VX] = (F32)vec.mV[VX]; mV[VY] = (F32)vec.mV[VY]; - mV[VZ] = 0; + mV[VZ] = 0.f; } -LLVector3::LLVector3(const LLVector3d &vec) +LLVector3::LLVector3(const LLVector3d& vec) { mV[VX] = (F32)vec.mdV[VX]; mV[VY] = (F32)vec.mdV[VY]; mV[VZ] = (F32)vec.mdV[VZ]; } -LLVector3::LLVector3(const LLVector4 &vec) +LLVector3::LLVector3(const LLVector4& vec) { mV[VX] = (F32)vec.mV[VX]; mV[VY] = (F32)vec.mV[VY]; @@ -319,7 +318,6 @@ LLVector3::LLVector3(const LLVector4 &vec) LLVector3::LLVector3(const LLVector4a& vec) : LLVector3(vec.getF32ptr()) { - } LLVector3::LLVector3(const LLSD& sd) @@ -330,20 +328,20 @@ LLVector3::LLVector3(const LLSD& sd) LLSD LLVector3::getValue() const { LLSD ret; - ret[0] = mV[0]; - ret[1] = mV[1]; - ret[2] = mV[2]; + ret[VX] = mV[VX]; + ret[VY] = mV[VY]; + ret[VZ] = mV[VZ]; return ret; } void LLVector3::setValue(const LLSD& sd) { - mV[0] = (F32) sd[0].asReal(); - mV[1] = (F32) sd[1].asReal(); - mV[2] = (F32) sd[2].asReal(); + mV[VX] = (F32) sd[VX].asReal(); + mV[VY] = (F32) sd[VY].asReal(); + mV[VZ] = (F32) sd[VZ].asReal(); } -const LLVector3& operator*=(LLVector3 &a, const LLQuaternion &rot) +const LLVector3& operator*=(LLVector3& a, const LLQuaternion& rot) { const F32 rw = - rot.mQ[VX] * a.mV[VX] - rot.mQ[VY] * a.mV[VY] - rot.mQ[VZ] * a.mV[VZ]; const F32 rx = rot.mQ[VW] * a.mV[VX] + rot.mQ[VY] * a.mV[VZ] - rot.mQ[VZ] * a.mV[VY]; @@ -360,16 +358,16 @@ const LLVector3& operator*=(LLVector3 &a, const LLQuaternion &rot) // static bool LLVector3::parseVector3(const std::string& buf, LLVector3* value) { - if( buf.empty() || value == nullptr) + if (buf.empty() || value == nullptr) { return false; } LLVector3 v; - S32 count = sscanf( buf.c_str(), "%f %f %f", v.mV + 0, v.mV + 1, v.mV + 2 ); - if( 3 == count ) + S32 count = sscanf(buf.c_str(), "%f %f %f", v.mV + VX, v.mV + VY, v.mV + VZ); + if (3 == count) { - value->setVec( v ); + value->setVec(v); return true; } @@ -381,7 +379,7 @@ bool LLVector3::parseVector3(const std::string& buf, LLVector3* value) LLVector3 point_to_box_offset(LLVector3& pos, const LLVector3* box) { LLVector3 offset; - for (S32 k=0; k<3; k++) + for (S32 k = 0; k < 3; k++) { offset[k] = 0; if (pos[k] < box[0][k]) @@ -410,4 +408,3 @@ bool box_valid_and_non_zero(const LLVector3* box) } return false; } - diff --git a/indra/llmath/v3math.h b/indra/llmath/v3math.h index a3bfa68060..551c7df6c9 100644 --- a/indra/llmath/v3math.h +++ b/indra/llmath/v3math.h @@ -46,7 +46,7 @@ class LLQuaternion; // LLvector3 = |x y z w| -static const U32 LENGTHOFVECTOR3 = 3; +static constexpr U32 LENGTHOFVECTOR3 = 3; class LLVector3 { @@ -181,11 +181,11 @@ LLVector3 lerp(const LLVector3 &a, const LLVector3 &b, F32 u); // Returns a vect LLVector3 point_to_box_offset(LLVector3& pos, const LLVector3* box); // Displacement from query point to nearest point on bounding box. bool box_valid_and_non_zero(const LLVector3* box); -inline LLVector3::LLVector3(void) +inline LLVector3::LLVector3() { - mV[0] = 0.f; - mV[1] = 0.f; - mV[2] = 0.f; + mV[VX] = 0.f; + mV[VY] = 0.f; + mV[VZ] = 0.f; } inline LLVector3::LLVector3(const F32 x, const F32 y, const F32 z) @@ -236,32 +236,32 @@ inline bool LLVector3::isFinite() const // Clear and Assignment Functions -inline void LLVector3::clear(void) +inline void LLVector3::clear() { - mV[0] = 0.f; - mV[1] = 0.f; - mV[2] = 0.f; + mV[VX] = 0.f; + mV[VY] = 0.f; + mV[VZ] = 0.f; } -inline void LLVector3::setZero(void) +inline void LLVector3::setZero() { - mV[0] = 0.f; - mV[1] = 0.f; - mV[2] = 0.f; + mV[VX] = 0.f; + mV[VY] = 0.f; + mV[VZ] = 0.f; } -inline void LLVector3::clearVec(void) +inline void LLVector3::clearVec() { - mV[0] = 0.f; - mV[1] = 0.f; - mV[2] = 0.f; + mV[VX] = 0.f; + mV[VY] = 0.f; + mV[VZ] = 0.f; } -inline void LLVector3::zeroVec(void) +inline void LLVector3::zeroVec() { - mV[0] = 0.f; - mV[1] = 0.f; - mV[2] = 0.f; + mV[VX] = 0.f; + mV[VY] = 0.f; + mV[VZ] = 0.f; } inline void LLVector3::set(F32 x, F32 y, F32 z) @@ -271,18 +271,18 @@ inline void LLVector3::set(F32 x, F32 y, F32 z) mV[VZ] = z; } -inline void LLVector3::set(const LLVector3 &vec) +inline void LLVector3::set(const LLVector3& vec) { - mV[0] = vec.mV[0]; - mV[1] = vec.mV[1]; - mV[2] = vec.mV[2]; + mV[VX] = vec.mV[VX]; + mV[VY] = vec.mV[VY]; + mV[VZ] = vec.mV[VZ]; } -inline void LLVector3::set(const F32 *vec) +inline void LLVector3::set(const F32* vec) { - mV[0] = vec[0]; - mV[1] = vec[1]; - mV[2] = vec[2]; + mV[VX] = vec[VX]; + mV[VY] = vec[VY]; + mV[VZ] = vec[VZ]; } inline void LLVector3::set(const glm::vec4& vec) @@ -308,61 +308,61 @@ inline void LLVector3::setVec(F32 x, F32 y, F32 z) } // deprecated -inline void LLVector3::setVec(const LLVector3 &vec) +inline void LLVector3::setVec(const LLVector3& vec) { - mV[0] = vec.mV[0]; - mV[1] = vec.mV[1]; - mV[2] = vec.mV[2]; + mV[VX] = vec.mV[VX]; + mV[VY] = vec.mV[VY]; + mV[VZ] = vec.mV[VZ]; } // deprecated -inline void LLVector3::setVec(const F32 *vec) +inline void LLVector3::setVec(const F32* vec) { - mV[0] = vec[0]; - mV[1] = vec[1]; - mV[2] = vec[2]; + mV[VX] = vec[0]; + mV[VY] = vec[1]; + mV[VZ] = vec[2]; } -inline F32 LLVector3::normalize(void) +inline F32 LLVector3::normalize() { - F32 mag = (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]); + F32 mag = (F32) sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]); F32 oomag; if (mag > FP_MAG_THRESHOLD) { oomag = 1.f/mag; - mV[0] *= oomag; - mV[1] *= oomag; - mV[2] *= oomag; + mV[VX] *= oomag; + mV[VY] *= oomag; + mV[VZ] *= oomag; } else { - mV[0] = 0.f; - mV[1] = 0.f; - mV[2] = 0.f; + mV[VX] = 0.f; + mV[VY] = 0.f; + mV[VZ] = 0.f; mag = 0; } return (mag); } // deprecated -inline F32 LLVector3::normVec(void) +inline F32 LLVector3::normVec() { - F32 mag = (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]); + F32 mag = sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]); F32 oomag; if (mag > FP_MAG_THRESHOLD) { oomag = 1.f/mag; - mV[0] *= oomag; - mV[1] *= oomag; - mV[2] *= oomag; + mV[VX] *= oomag; + mV[VY] *= oomag; + mV[VZ] *= oomag; } else { - mV[0] = 0.f; - mV[1] = 0.f; - mV[2] = 0.f; + mV[VX] = 0.f; + mV[VY] = 0.f; + mV[VZ] = 0.f; mag = 0; } return (mag); @@ -370,145 +370,144 @@ inline F32 LLVector3::normVec(void) // LLVector3 Magnitude and Normalization Functions -inline F32 LLVector3::length(void) const +inline F32 LLVector3::length() const { - return (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]); + return sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]); } -inline F32 LLVector3::lengthSquared(void) const +inline F32 LLVector3::lengthSquared() const { - return mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]; + return mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]; } -inline F32 LLVector3::magVec(void) const +inline F32 LLVector3::magVec() const { - return (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]); + return sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]); } -inline F32 LLVector3::magVecSquared(void) const +inline F32 LLVector3::magVecSquared() const { - return mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]; + return mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]; } inline bool LLVector3::inRange( F32 min, F32 max ) const { - return mV[0] >= min && mV[0] <= max && - mV[1] >= min && mV[1] <= max && - mV[2] >= min && mV[2] <= max; + return mV[VX] >= min && mV[VX] <= max && + mV[VY] >= min && mV[VY] <= max && + mV[VZ] >= min && mV[VZ] <= max; } -inline LLVector3 operator+(const LLVector3 &a, const LLVector3 &b) +inline LLVector3 operator+(const LLVector3& a, const LLVector3& b) { LLVector3 c(a); return c += b; } -inline LLVector3 operator-(const LLVector3 &a, const LLVector3 &b) +inline LLVector3 operator-(const LLVector3& a, const LLVector3& b) { LLVector3 c(a); return c -= b; } -inline F32 operator*(const LLVector3 &a, const LLVector3 &b) +inline F32 operator*(const LLVector3& a, const LLVector3& b) { - return (a.mV[0]*b.mV[0] + a.mV[1]*b.mV[1] + a.mV[2]*b.mV[2]); + return (a.mV[VX]*b.mV[VX] + a.mV[VY]*b.mV[VY] + a.mV[VZ]*b.mV[VZ]); } -inline LLVector3 operator%(const LLVector3 &a, const LLVector3 &b) +inline LLVector3 operator%(const LLVector3& a, const LLVector3& b) { - return LLVector3( a.mV[1]*b.mV[2] - b.mV[1]*a.mV[2], a.mV[2]*b.mV[0] - b.mV[2]*a.mV[0], a.mV[0]*b.mV[1] - b.mV[0]*a.mV[1] ); + return LLVector3( a.mV[VY]*b.mV[VZ] - b.mV[VY]*a.mV[VZ], a.mV[VZ]*b.mV[VX] - b.mV[VZ]*a.mV[VX], a.mV[VX]*b.mV[VY] - b.mV[VX]*a.mV[VY] ); } -inline LLVector3 operator/(const LLVector3 &a, F32 k) +inline LLVector3 operator/(const LLVector3& a, F32 k) { F32 t = 1.f / k; - return LLVector3( a.mV[0] * t, a.mV[1] * t, a.mV[2] * t ); + return LLVector3( a.mV[VX] * t, a.mV[VY] * t, a.mV[VZ] * t ); } -inline LLVector3 operator*(const LLVector3 &a, F32 k) +inline LLVector3 operator*(const LLVector3& a, F32 k) { - return LLVector3( a.mV[0] * k, a.mV[1] * k, a.mV[2] * k ); + return LLVector3( a.mV[VX] * k, a.mV[VY] * k, a.mV[VZ] * k ); } -inline LLVector3 operator*(F32 k, const LLVector3 &a) +inline LLVector3 operator*(F32 k, const LLVector3& a) { - return LLVector3( a.mV[0] * k, a.mV[1] * k, a.mV[2] * k ); + return LLVector3( a.mV[VX] * k, a.mV[VY] * k, a.mV[VZ] * k ); } -inline bool operator==(const LLVector3 &a, const LLVector3 &b) +inline bool operator==(const LLVector3& a, const LLVector3& b) { - return ( (a.mV[0] == b.mV[0]) - &&(a.mV[1] == b.mV[1]) - &&(a.mV[2] == b.mV[2])); + return ( (a.mV[VX] == b.mV[VX]) + &&(a.mV[VY] == b.mV[VY]) + &&(a.mV[VZ] == b.mV[VZ])); } -inline bool operator!=(const LLVector3 &a, const LLVector3 &b) +inline bool operator!=(const LLVector3& a, const LLVector3& b) { - return ( (a.mV[0] != b.mV[0]) - ||(a.mV[1] != b.mV[1]) - ||(a.mV[2] != b.mV[2])); + return ( (a.mV[VX] != b.mV[VX]) + ||(a.mV[VY] != b.mV[VY]) + ||(a.mV[VZ] != b.mV[VZ])); } -inline bool operator<(const LLVector3 &a, const LLVector3 &b) +inline bool operator<(const LLVector3& a, const LLVector3& b) { - return (a.mV[0] < b.mV[0] - || (a.mV[0] == b.mV[0] - && (a.mV[1] < b.mV[1] - || ((a.mV[1] == b.mV[1]) - && a.mV[2] < b.mV[2])))); + return (a.mV[VX] < b.mV[VX] + || (a.mV[VX] == b.mV[VX] + && (a.mV[VY] < b.mV[VY] + || ((a.mV[VY] == b.mV[VY]) + && a.mV[VZ] < b.mV[VZ])))); } -inline const LLVector3& operator+=(LLVector3 &a, const LLVector3 &b) +inline const LLVector3& operator+=(LLVector3& a, const LLVector3& b) { - a.mV[0] += b.mV[0]; - a.mV[1] += b.mV[1]; - a.mV[2] += b.mV[2]; + a.mV[VX] += b.mV[VX]; + a.mV[VY] += b.mV[VY]; + a.mV[VZ] += b.mV[VZ]; return a; } -inline const LLVector3& operator-=(LLVector3 &a, const LLVector3 &b) +inline const LLVector3& operator-=(LLVector3& a, const LLVector3& b) { - a.mV[0] -= b.mV[0]; - a.mV[1] -= b.mV[1]; - a.mV[2] -= b.mV[2]; + a.mV[VX] -= b.mV[VX]; + a.mV[VY] -= b.mV[VY]; + a.mV[VZ] -= b.mV[VZ]; return a; } -inline const LLVector3& operator%=(LLVector3 &a, const LLVector3 &b) +inline const LLVector3& operator%=(LLVector3& a, const LLVector3& b) { - LLVector3 ret( a.mV[1]*b.mV[2] - b.mV[1]*a.mV[2], a.mV[2]*b.mV[0] - b.mV[2]*a.mV[0], a.mV[0]*b.mV[1] - b.mV[0]*a.mV[1]); + LLVector3 ret( a.mV[VY]*b.mV[VZ] - b.mV[VY]*a.mV[VZ], a.mV[VZ]*b.mV[VX] - b.mV[VZ]*a.mV[VX], a.mV[VX]*b.mV[VY] - b.mV[VX]*a.mV[VY]); a = ret; return a; } -inline const LLVector3& operator*=(LLVector3 &a, F32 k) +inline const LLVector3& operator*=(LLVector3& a, F32 k) { - a.mV[0] *= k; - a.mV[1] *= k; - a.mV[2] *= k; + a.mV[VX] *= k; + a.mV[VY] *= k; + a.mV[VZ] *= k; return a; } -inline const LLVector3& operator*=(LLVector3 &a, const LLVector3 &b) +inline const LLVector3& operator*=(LLVector3& a, const LLVector3& b) { - a.mV[0] *= b.mV[0]; - a.mV[1] *= b.mV[1]; - a.mV[2] *= b.mV[2]; + a.mV[VX] *= b.mV[VX]; + a.mV[VY] *= b.mV[VY]; + a.mV[VZ] *= b.mV[VZ]; return a; } -inline const LLVector3& operator/=(LLVector3 &a, F32 k) +inline const LLVector3& operator/=(LLVector3& a, F32 k) { - F32 t = 1.f / k; - a.mV[0] *= t; - a.mV[1] *= t; - a.mV[2] *= t; + a.mV[VX] /= k; + a.mV[VY] /= k; + a.mV[VZ] /= k; return a; } -inline LLVector3 operator-(const LLVector3 &a) +inline LLVector3 operator-(const LLVector3& a) { - return LLVector3( -a.mV[0], -a.mV[1], -a.mV[2] ); + return LLVector3(-a.mV[VX], -a.mV[VY], -a.mV[VZ]); } inline LLVector3::operator glm::vec3() const @@ -522,30 +521,30 @@ inline LLVector3::operator glm::vec4() const return glm::vec4(mV[VX], mV[VY], mV[VZ], 1.f); } -inline F32 dist_vec(const LLVector3 &a, const LLVector3 &b) +inline F32 dist_vec(const LLVector3& a, const LLVector3& b) { - F32 x = a.mV[0] - b.mV[0]; - F32 y = a.mV[1] - b.mV[1]; - F32 z = a.mV[2] - b.mV[2]; - return (F32) sqrt( x*x + y*y + z*z ); + F32 x = a.mV[VX] - b.mV[VX]; + F32 y = a.mV[VY] - b.mV[VY]; + F32 z = a.mV[VZ] - b.mV[VZ]; + return sqrt( x*x + y*y + z*z ); } -inline F32 dist_vec_squared(const LLVector3 &a, const LLVector3 &b) +inline F32 dist_vec_squared(const LLVector3& a, const LLVector3& b) { - F32 x = a.mV[0] - b.mV[0]; - F32 y = a.mV[1] - b.mV[1]; - F32 z = a.mV[2] - b.mV[2]; + F32 x = a.mV[VX] - b.mV[VX]; + F32 y = a.mV[VY] - b.mV[VY]; + F32 z = a.mV[VZ] - b.mV[VZ]; return x*x + y*y + z*z; } -inline F32 dist_vec_squared2D(const LLVector3 &a, const LLVector3 &b) +inline F32 dist_vec_squared2D(const LLVector3& a, const LLVector3& b) { - F32 x = a.mV[0] - b.mV[0]; - F32 y = a.mV[1] - b.mV[1]; + F32 x = a.mV[VX] - b.mV[VX]; + F32 y = a.mV[VY] - b.mV[VY]; return x*x + y*y; } -inline LLVector3 projected_vec(const LLVector3 &a, const LLVector3 &b) +inline LLVector3 projected_vec(const LLVector3& a, const LLVector3& b) { F32 bb = b * b; if (bb > FP_MAG_THRESHOLD * FP_MAG_THRESHOLD) @@ -570,18 +569,18 @@ inline LLVector3 inverse_projected_vec(const LLVector3& a, const LLVector3& b) return normalized_a * (b_length / dot_product); } -inline LLVector3 parallel_component(const LLVector3 &a, const LLVector3 &b) +inline LLVector3 parallel_component(const LLVector3& a, const LLVector3& b) { return projected_vec(a, b); } -inline LLVector3 orthogonal_component(const LLVector3 &a, const LLVector3 &b) +inline LLVector3 orthogonal_component(const LLVector3& a, const LLVector3& b) { return a - projected_vec(a, b); } -inline LLVector3 lerp(const LLVector3 &a, const LLVector3 &b, F32 u) +inline LLVector3 lerp(const LLVector3& a, const LLVector3& b, F32 u) { return LLVector3( a.mV[VX] + (b.mV[VX] - a.mV[VX]) * u, @@ -640,7 +639,7 @@ inline F32 angle_between(const LLVector3& a, const LLVector3& b) return atan2f(sqrtf(c * c), ab); // return the angle } -inline bool are_parallel(const LLVector3 &a, const LLVector3 &b, F32 epsilon) +inline bool are_parallel(const LLVector3& a, const LLVector3& b, F32 epsilon) { LLVector3 an = a; LLVector3 bn = b; diff --git a/indra/llmath/v4color.cpp b/indra/llmath/v4color.cpp index ad13656bbd..1b687642ca 100644 --- a/indra/llmath/v4color.cpp +++ b/indra/llmath/v4color.cpp @@ -124,65 +124,64 @@ LLColor4 LLColor4::cyan6(0.2f, 0.6f, 0.6f, 1.0f); // conversion LLColor4::operator LLColor4U() const { - return LLColor4U( - (U8)llclampb(ll_round(mV[VRED]*255.f)), - (U8)llclampb(ll_round(mV[VGREEN]*255.f)), - (U8)llclampb(ll_round(mV[VBLUE]*255.f)), - (U8)llclampb(ll_round(mV[VALPHA]*255.f))); + return LLColor4U((U8)llclampb(ll_round(mV[VRED] * 255.f)), + (U8)llclampb(ll_round(mV[VGREEN] * 255.f)), + (U8)llclampb(ll_round(mV[VBLUE] * 255.f)), + (U8)llclampb(ll_round(mV[VALPHA] * 255.f))); } -LLColor4::LLColor4(const LLColor3 &vec, F32 a) +LLColor4::LLColor4(const LLColor3& vec, F32 a) { - mV[VRED] = vec.mV[VRED]; + mV[VRED] = vec.mV[VRED]; mV[VGREEN] = vec.mV[VGREEN]; - mV[VBLUE] = vec.mV[VBLUE]; + mV[VBLUE] = vec.mV[VBLUE]; mV[VALPHA] = a; } LLColor4::LLColor4(const LLColor4U& color4u) { - const F32 SCALE = 1.f/255.f; - mV[VRED] = color4u.mV[VRED] * SCALE; - mV[VGREEN] = color4u.mV[VGREEN] * SCALE; - mV[VBLUE] = color4u.mV[VBLUE] * SCALE; - mV[VALPHA] = color4u.mV[VALPHA] * SCALE; + constexpr F32 SCALE = 1.f / 255.f; + mV[VRED] = color4u.mV[VRED] * SCALE; + mV[VGREEN] = color4u.mV[VGREEN] * SCALE; + mV[VBLUE] = color4u.mV[VBLUE] * SCALE; + mV[VALPHA] = color4u.mV[VALPHA] * SCALE; } LLColor4::LLColor4(const LLVector4& vector4) { - mV[VRED] = vector4.mV[VRED]; + mV[VRED] = vector4.mV[VRED]; mV[VGREEN] = vector4.mV[VGREEN]; - mV[VBLUE] = vector4.mV[VBLUE]; + mV[VBLUE] = vector4.mV[VBLUE]; mV[VALPHA] = vector4.mV[VALPHA]; } const LLColor4& LLColor4::set(const LLColor4U& color4u) { - const F32 SCALE = 1.f/255.f; - mV[VRED] = color4u.mV[VRED] * SCALE; - mV[VGREEN] = color4u.mV[VGREEN] * SCALE; - mV[VBLUE] = color4u.mV[VBLUE] * SCALE; - mV[VALPHA] = color4u.mV[VALPHA] * SCALE; + constexpr F32 SCALE = 1.f / 255.f; + mV[VRED] = color4u.mV[VRED] * SCALE; + mV[VGREEN] = color4u.mV[VGREEN] * SCALE; + mV[VBLUE] = color4u.mV[VBLUE] * SCALE; + mV[VALPHA] = color4u.mV[VALPHA] * SCALE; return (*this); } -const LLColor4& LLColor4::set(const LLColor3 &vec) +const LLColor4& LLColor4::set(const LLColor3& vec) { - mV[VRED] = vec.mV[VRED]; + mV[VRED] = vec.mV[VRED]; mV[VGREEN] = vec.mV[VGREEN]; - mV[VBLUE] = vec.mV[VBLUE]; + mV[VBLUE] = vec.mV[VBLUE]; -// no change to alpha! -// mV[VALPHA] = 1.f; + // no change to alpha! + // mV[VALPHA] = 1.f; return (*this); } -const LLColor4& LLColor4::set(const LLColor3 &vec, F32 a) +const LLColor4& LLColor4::set(const LLColor3& vec, F32 a) { - mV[VRED] = vec.mV[VRED]; + mV[VRED] = vec.mV[VRED]; mV[VGREEN] = vec.mV[VGREEN]; - mV[VBLUE] = vec.mV[VBLUE]; + mV[VBLUE] = vec.mV[VBLUE]; mV[VALPHA] = a; return (*this); } @@ -190,33 +189,33 @@ const LLColor4& LLColor4::set(const LLColor3 &vec, F32 a) // deprecated -- use set() const LLColor4& LLColor4::setVec(const LLColor4U& color4u) { - const F32 SCALE = 1.f/255.f; - mV[VRED] = color4u.mV[VRED] * SCALE; - mV[VGREEN] = color4u.mV[VGREEN] * SCALE; - mV[VBLUE] = color4u.mV[VBLUE] * SCALE; - mV[VALPHA] = color4u.mV[VALPHA] * SCALE; + constexpr F32 SCALE = 1.f / 255.f; + mV[VRED] = color4u.mV[VRED] * SCALE; + mV[VGREEN] = color4u.mV[VGREEN] * SCALE; + mV[VBLUE] = color4u.mV[VBLUE] * SCALE; + mV[VALPHA] = color4u.mV[VALPHA] * SCALE; return (*this); } // deprecated -- use set() -const LLColor4& LLColor4::setVec(const LLColor3 &vec) +const LLColor4& LLColor4::setVec(const LLColor3& vec) { - mV[VRED] = vec.mV[VRED]; + mV[VRED] = vec.mV[VRED]; mV[VGREEN] = vec.mV[VGREEN]; - mV[VBLUE] = vec.mV[VBLUE]; + mV[VBLUE] = vec.mV[VBLUE]; -// no change to alpha! -// mV[VALPHA] = 1.f; + // no change to alpha! + // mV[VALPHA] = 1.f; return (*this); } // deprecated -- use set() -const LLColor4& LLColor4::setVec(const LLColor3 &vec, F32 a) +const LLColor4& LLColor4::setVec(const LLColor3& vec, F32 a) { - mV[VRED] = vec.mV[VRED]; + mV[VRED] = vec.mV[VRED]; mV[VGREEN] = vec.mV[VGREEN]; - mV[VBLUE] = vec.mV[VBLUE]; + mV[VBLUE] = vec.mV[VBLUE]; mV[VALPHA] = a; return (*this); } @@ -228,110 +227,110 @@ void LLColor4::setValue(const LLSD& sd) F32 val; bool out_of_range = false; val = sd[0].asReal(); - mV[0] = llclamp(val, 0.f, 1.f); - out_of_range = mV[0] != val; + mV[VRED] = llclamp(val, 0.f, 1.f); + out_of_range = mV[VRED] != val; val = sd[1].asReal(); - mV[1] = llclamp(val, 0.f, 1.f); - out_of_range |= mV[1] != val; + mV[VGREEN] = llclamp(val, 0.f, 1.f); + out_of_range |= mV[VGREEN] != val; val = sd[2].asReal(); - mV[2] = llclamp(val, 0.f, 1.f); - out_of_range |= mV[2] != val; + mV[VBLUE] = llclamp(val, 0.f, 1.f); + out_of_range |= mV[VBLUE] != val; val = sd[3].asReal(); - mV[3] = llclamp(val, 0.f, 1.f); - out_of_range |= mV[3] != val; + mV[VALPHA] = llclamp(val, 0.f, 1.f); + out_of_range |= mV[VALPHA] != val; if (out_of_range) { LL_WARNS() << "LLSD color value out of range!" << LL_ENDL; } #else - mV[0] = (F32) sd[0].asReal(); - mV[1] = (F32) sd[1].asReal(); - mV[2] = (F32) sd[2].asReal(); - mV[3] = (F32) sd[3].asReal(); + mV[VRED] = (F32)sd[VRED].asReal(); + mV[VGREEN] = (F32)sd[VGREEN].asReal(); + mV[VBLUE] = (F32)sd[VBLUE].asReal(); + mV[VALPHA] = (F32)sd[VALPHA].asReal(); #endif } -const LLColor4& LLColor4::operator=(const LLColor3 &a) +const LLColor4& LLColor4::operator=(const LLColor3& a) { - mV[VRED] = a.mV[VRED]; + mV[VRED] = a.mV[VRED]; mV[VGREEN] = a.mV[VGREEN]; - mV[VBLUE] = a.mV[VBLUE]; + mV[VBLUE] = a.mV[VBLUE]; -// converting from an rgb sets a=1 (opaque) + // converting from an rgb sets a=1 (opaque) mV[VALPHA] = 1.f; return (*this); } - -std::ostream& operator<<(std::ostream& s, const LLColor4 &a) +std::ostream& operator<<(std::ostream& s, const LLColor4& a) { s << "{ " << a.mV[VRED] << ", " << a.mV[VGREEN] << ", " << a.mV[VBLUE] << ", " << a.mV[VALPHA] << " }"; return s; } -bool operator==(const LLColor4 &a, const LLColor3 &b) +bool operator==(const LLColor4& a, const LLColor3& b) { - return ( (a.mV[VRED] == b.mV[VRED]) - &&(a.mV[VGREEN] == b.mV[VGREEN]) - &&(a.mV[VBLUE] == b.mV[VBLUE])); + return ((a.mV[VRED] == b.mV[VRED]) && (a.mV[VGREEN] == b.mV[VGREEN]) && (a.mV[VBLUE] == b.mV[VBLUE])); } -bool operator!=(const LLColor4 &a, const LLColor3 &b) +bool operator!=(const LLColor4& a, const LLColor3& b) { - return ( (a.mV[VRED] != b.mV[VRED]) - ||(a.mV[VGREEN] != b.mV[VGREEN]) - ||(a.mV[VBLUE] != b.mV[VBLUE])); + return ((a.mV[VRED] != b.mV[VRED]) || (a.mV[VGREEN] != b.mV[VGREEN]) || (a.mV[VBLUE] != b.mV[VBLUE])); } -LLColor3 vec4to3(const LLColor4 &vec) +LLColor3 vec4to3(const LLColor4& vec) { - LLColor3 temp(vec.mV[VRED], vec.mV[VGREEN], vec.mV[VBLUE]); + LLColor3 temp(vec.mV[VRED], vec.mV[VGREEN], vec.mV[VBLUE]); return temp; } -LLColor4 vec3to4(const LLColor3 &vec) +LLColor4 vec3to4(const LLColor3& vec) { - LLColor3 temp(vec.mV[VRED], vec.mV[VGREEN], vec.mV[VBLUE]); + LLColor3 temp(vec.mV[VRED], vec.mV[VGREEN], vec.mV[VBLUE]); return temp; } -static F32 hueToRgb ( F32 val1In, F32 val2In, F32 valHUeIn ) +static F32 hueToRgb(F32 val1In, F32 val2In, F32 valHUeIn) { - if ( valHUeIn < 0.0f ) valHUeIn += 1.0f; - if ( valHUeIn > 1.0f ) valHUeIn -= 1.0f; - if ( ( 6.0f * valHUeIn ) < 1.0f ) return ( val1In + ( val2In - val1In ) * 6.0f * valHUeIn ); - if ( ( 2.0f * valHUeIn ) < 1.0f ) return ( val2In ); - if ( ( 3.0f * valHUeIn ) < 2.0f ) return ( val1In + ( val2In - val1In ) * ( ( 2.0f / 3.0f ) - valHUeIn ) * 6.0f ); - return ( val1In ); + if (valHUeIn < 0.0f) + valHUeIn += 1.0f; + if (valHUeIn > 1.0f) + valHUeIn -= 1.0f; + if ((6.0f * valHUeIn) < 1.0f) + return (val1In + (val2In - val1In) * 6.0f * valHUeIn); + if ((2.0f * valHUeIn) < 1.0f) + return (val2In); + if ((3.0f * valHUeIn) < 2.0f) + return (val1In + (val2In - val1In) * ((2.0f / 3.0f) - valHUeIn) * 6.0f); + return (val1In); } -void LLColor4::setHSL ( F32 hValIn, F32 sValIn, F32 lValIn) +void LLColor4::setHSL(F32 hValIn, F32 sValIn, F32 lValIn) { - if ( sValIn < 0.00001f ) + if (sValIn < 0.00001f) { - mV[VRED] = lValIn; + mV[VRED] = lValIn; mV[VGREEN] = lValIn; - mV[VBLUE] = lValIn; + mV[VBLUE] = lValIn; } else { F32 interVal1; F32 interVal2; - if ( lValIn < 0.5f ) - interVal2 = lValIn * ( 1.0f + sValIn ); + if (lValIn < 0.5f) + interVal2 = lValIn * (1.0f + sValIn); else - interVal2 = ( lValIn + sValIn ) - ( sValIn * lValIn ); + interVal2 = (lValIn + sValIn) - (sValIn * lValIn); interVal1 = 2.0f * lValIn - interVal2; - mV[VRED] = hueToRgb ( interVal1, interVal2, hValIn + ( 1.f / 3.f ) ); - mV[VGREEN] = hueToRgb ( interVal1, interVal2, hValIn ); - mV[VBLUE] = hueToRgb ( interVal1, interVal2, hValIn - ( 1.f / 3.f ) ); + mV[VRED] = hueToRgb(interVal1, interVal2, hValIn + (1.f / 3.f)); + mV[VGREEN] = hueToRgb(interVal1, interVal2, hValIn); + mV[VBLUE] = hueToRgb(interVal1, interVal2, hValIn - (1.f / 3.f)); } } @@ -341,58 +340,61 @@ void LLColor4::calcHSL(F32* hue, F32* saturation, F32* luminance) const F32 var_G = mV[VGREEN]; F32 var_B = mV[VBLUE]; - F32 var_Min = ( var_R < ( var_G < var_B ? var_G : var_B ) ? var_R : ( var_G < var_B ? var_G : var_B ) ); - F32 var_Max = ( var_R > ( var_G > var_B ? var_G : var_B ) ? var_R : ( var_G > var_B ? var_G : var_B ) ); + F32 var_Min = (var_R < (var_G < var_B ? var_G : var_B) ? var_R : (var_G < var_B ? var_G : var_B)); + F32 var_Max = (var_R > (var_G > var_B ? var_G : var_B) ? var_R : (var_G > var_B ? var_G : var_B)); F32 del_Max = var_Max - var_Min; - F32 L = ( var_Max + var_Min ) / 2.0f; + F32 L = (var_Max + var_Min) / 2.0f; F32 H = 0.0f; F32 S = 0.0f; - if ( del_Max == 0.0f ) + if (del_Max == 0.0f) { - H = 0.0f; - S = 0.0f; + H = 0.0f; + S = 0.0f; } else { - if ( L < 0.5 ) - S = del_Max / ( var_Max + var_Min ); + if (L < 0.5f) + S = del_Max / (var_Max + var_Min); else - S = del_Max / ( 2.0f - var_Max - var_Min ); + S = del_Max / (2.0f - var_Max - var_Min); - F32 del_R = ( ( ( var_Max - var_R ) / 6.0f ) + ( del_Max / 2.0f ) ) / del_Max; - F32 del_G = ( ( ( var_Max - var_G ) / 6.0f ) + ( del_Max / 2.0f ) ) / del_Max; - F32 del_B = ( ( ( var_Max - var_B ) / 6.0f ) + ( del_Max / 2.0f ) ) / del_Max; + F32 del_R = (((var_Max - var_R) / 6.0f) + (del_Max / 2.0f)) / del_Max; + F32 del_G = (((var_Max - var_G) / 6.0f) + (del_Max / 2.0f)) / del_Max; + F32 del_B = (((var_Max - var_B) / 6.0f) + (del_Max / 2.0f)) / del_Max; - if ( var_R >= var_Max ) + if (var_R >= var_Max) H = del_B - del_G; - else - if ( var_G >= var_Max ) - H = ( 1.0f / 3.0f ) + del_R - del_B; - else - if ( var_B >= var_Max ) - H = ( 2.0f / 3.0f ) + del_G - del_R; - - if ( H < 0.0f ) H += 1.0f; - if ( H > 1.0f ) H -= 1.0f; + else if (var_G >= var_Max) + H = (1.0f / 3.0f) + del_R - del_B; + else if (var_B >= var_Max) + H = (2.0f / 3.0f) + del_G - del_R; + + if (H < 0.0f) + H += 1.0f; + if (H > 1.0f) + H -= 1.0f; } - if (hue) *hue = H; - if (saturation) *saturation = S; - if (luminance) *luminance = L; + if (hue) + *hue = H; + if (saturation) + *saturation = S; + if (luminance) + *luminance = L; } // static bool LLColor4::parseColor(const std::string& buf, LLColor4* color) { - if( buf.empty() || color == nullptr) + if (buf.empty() || color == nullptr) { return false; } - boost_tokenizer tokens(buf, boost::char_separator(", ")); + boost_tokenizer tokens(buf, boost::char_separator(", ")); boost_tokenizer::iterator token_iter = tokens.begin(); if (token_iter == tokens.end()) { @@ -401,16 +403,16 @@ bool LLColor4::parseColor(const std::string& buf, LLColor4* color) // Grab the first token into a string, since we don't know // if this is a float or a color name. - std::string color_name( (*token_iter) ); + std::string color_name((*token_iter)); ++token_iter; if (token_iter != tokens.end()) { // There are more tokens to read. This must be a vector. LLColor4 v; - LLStringUtil::convertToF32( color_name, v.mV[VRED] ); - LLStringUtil::convertToF32( *token_iter, v.mV[VGREEN] ); - v.mV[VBLUE] = 0.0f; + LLStringUtil::convertToF32(color_name, v.mV[VRED]); + LLStringUtil::convertToF32(*token_iter, v.mV[VGREEN]); + v.mV[VBLUE] = 0.0f; v.mV[VALPHA] = 1.0f; ++token_iter; @@ -422,283 +424,284 @@ bool LLColor4::parseColor(const std::string& buf, LLColor4* color) else { // There is a z-component. - LLStringUtil::convertToF32( *token_iter, v.mV[VBLUE] ); + LLStringUtil::convertToF32(*token_iter, v.mV[VBLUE]); ++token_iter; if (token_iter != tokens.end()) { // There is an alpha component. - LLStringUtil::convertToF32( *token_iter, v.mV[VALPHA] ); + LLStringUtil::convertToF32(*token_iter, v.mV[VALPHA]); } } // Make sure all values are between 0 and 1. if (v.mV[VRED] > 1.f || v.mV[VGREEN] > 1.f || v.mV[VBLUE] > 1.f || v.mV[VALPHA] > 1.f) { - v = v * (1.f / 255.f); + constexpr F32 SCALE{ 1.f / 255.f }; + v *= SCALE; } - color->set( v ); + color->set(v); } else // Single value. Read as a named color. { // We have a color name - if ( "red" == color_name ) + if ("red" == color_name) { color->set(LLColor4::red); } - else if ( "red1" == color_name ) + else if ("red1" == color_name) { color->set(LLColor4::red1); } - else if ( "red2" == color_name ) + else if ("red2" == color_name) { color->set(LLColor4::red2); } - else if ( "red3" == color_name ) + else if ("red3" == color_name) { color->set(LLColor4::red3); } - else if ( "red4" == color_name ) + else if ("red4" == color_name) { color->set(LLColor4::red4); } - else if ( "red5" == color_name ) + else if ("red5" == color_name) { color->set(LLColor4::red5); } - else if( "green" == color_name ) + else if ("green" == color_name) { color->set(LLColor4::green); } - else if( "green1" == color_name ) + else if ("green1" == color_name) { color->set(LLColor4::green1); } - else if( "green2" == color_name ) + else if ("green2" == color_name) { color->set(LLColor4::green2); } - else if( "green3" == color_name ) + else if ("green3" == color_name) { color->set(LLColor4::green3); } - else if( "green4" == color_name ) + else if ("green4" == color_name) { color->set(LLColor4::green4); } - else if( "green5" == color_name ) + else if ("green5" == color_name) { color->set(LLColor4::green5); } - else if( "green6" == color_name ) + else if ("green6" == color_name) { color->set(LLColor4::green6); } - else if( "blue" == color_name ) + else if ("blue" == color_name) { color->set(LLColor4::blue); } - else if( "blue1" == color_name ) + else if ("blue1" == color_name) { color->set(LLColor4::blue1); } - else if( "blue2" == color_name ) + else if ("blue2" == color_name) { color->set(LLColor4::blue2); } - else if( "blue3" == color_name ) + else if ("blue3" == color_name) { color->set(LLColor4::blue3); } - else if( "blue4" == color_name ) + else if ("blue4" == color_name) { color->set(LLColor4::blue4); } - else if( "blue5" == color_name ) + else if ("blue5" == color_name) { color->set(LLColor4::blue5); } - else if( "blue6" == color_name ) + else if ("blue6" == color_name) { color->set(LLColor4::blue6); } - else if( "black" == color_name ) + else if ("black" == color_name) { color->set(LLColor4::black); } - else if( "white" == color_name ) + else if ("white" == color_name) { color->set(LLColor4::white); } - else if( "yellow" == color_name ) + else if ("yellow" == color_name) { color->set(LLColor4::yellow); } - else if( "yellow1" == color_name ) + else if ("yellow1" == color_name) { color->set(LLColor4::yellow1); } - else if( "yellow2" == color_name ) + else if ("yellow2" == color_name) { color->set(LLColor4::yellow2); } - else if( "yellow3" == color_name ) + else if ("yellow3" == color_name) { color->set(LLColor4::yellow3); } - else if( "yellow4" == color_name ) + else if ("yellow4" == color_name) { color->set(LLColor4::yellow4); } - else if( "yellow5" == color_name ) + else if ("yellow5" == color_name) { color->set(LLColor4::yellow5); } - else if( "yellow6" == color_name ) + else if ("yellow6" == color_name) { color->set(LLColor4::yellow6); } - else if( "magenta" == color_name ) + else if ("magenta" == color_name) { color->set(LLColor4::magenta); } - else if( "magenta1" == color_name ) + else if ("magenta1" == color_name) { color->set(LLColor4::magenta1); } - else if( "magenta2" == color_name ) + else if ("magenta2" == color_name) { color->set(LLColor4::magenta2); } - else if( "magenta3" == color_name ) + else if ("magenta3" == color_name) { color->set(LLColor4::magenta3); } - else if( "magenta4" == color_name ) + else if ("magenta4" == color_name) { color->set(LLColor4::magenta4); } - else if( "purple" == color_name ) + else if ("purple" == color_name) { color->set(LLColor4::purple); } - else if( "purple1" == color_name ) + else if ("purple1" == color_name) { color->set(LLColor4::purple1); } - else if( "purple2" == color_name ) + else if ("purple2" == color_name) { color->set(LLColor4::purple2); } - else if( "purple3" == color_name ) + else if ("purple3" == color_name) { color->set(LLColor4::purple3); } - else if( "purple4" == color_name ) + else if ("purple4" == color_name) { color->set(LLColor4::purple4); } - else if( "purple5" == color_name ) + else if ("purple5" == color_name) { color->set(LLColor4::purple5); } - else if( "purple6" == color_name ) + else if ("purple6" == color_name) { color->set(LLColor4::purple6); } - else if( "pink" == color_name ) + else if ("pink" == color_name) { color->set(LLColor4::pink); } - else if( "pink1" == color_name ) + else if ("pink1" == color_name) { color->set(LLColor4::pink1); } - else if( "pink2" == color_name ) + else if ("pink2" == color_name) { color->set(LLColor4::pink2); } - else if( "cyan" == color_name ) + else if ("cyan" == color_name) { color->set(LLColor4::cyan); } - else if( "cyan1" == color_name ) + else if ("cyan1" == color_name) { color->set(LLColor4::cyan1); } - else if( "cyan2" == color_name ) + else if ("cyan2" == color_name) { color->set(LLColor4::cyan2); } - else if( "cyan3" == color_name ) + else if ("cyan3" == color_name) { color->set(LLColor4::cyan3); } - else if( "cyan4" == color_name ) + else if ("cyan4" == color_name) { color->set(LLColor4::cyan4); } - else if( "cyan5" == color_name ) + else if ("cyan5" == color_name) { color->set(LLColor4::cyan5); } - else if( "cyan6" == color_name ) + else if ("cyan6" == color_name) { color->set(LLColor4::cyan6); } - else if( "smoke" == color_name ) + else if ("smoke" == color_name) { color->set(LLColor4::smoke); } - else if( "grey" == color_name ) + else if ("grey" == color_name) { color->set(LLColor4::grey); } - else if( "grey1" == color_name ) + else if ("grey1" == color_name) { color->set(LLColor4::grey1); } - else if( "grey2" == color_name ) + else if ("grey2" == color_name) { color->set(LLColor4::grey2); } - else if( "grey3" == color_name ) + else if ("grey3" == color_name) { color->set(LLColor4::grey3); } - else if( "grey4" == color_name ) + else if ("grey4" == color_name) { color->set(LLColor4::grey4); } - else if( "orange" == color_name ) + else if ("orange" == color_name) { color->set(LLColor4::orange); } - else if( "orange1" == color_name ) + else if ("orange1" == color_name) { color->set(LLColor4::orange1); } - else if( "orange2" == color_name ) + else if ("orange2" == color_name) { color->set(LLColor4::orange2); } - else if( "orange3" == color_name ) + else if ("orange3" == color_name) { color->set(LLColor4::orange3); } - else if( "orange4" == color_name ) + else if ("orange4" == color_name) { color->set(LLColor4::orange4); } - else if( "orange5" == color_name ) + else if ("orange5" == color_name) { color->set(LLColor4::orange5); } - else if( "orange6" == color_name ) + else if ("orange6" == color_name) { color->set(LLColor4::orange6); } - else if ( "clear" == color_name ) + else if ("clear" == color_name) { color->set(0.f, 0.f, 0.f, 0.f); } @@ -714,21 +717,21 @@ bool LLColor4::parseColor(const std::string& buf, LLColor4* color) // static bool LLColor4::parseColor4(const std::string& buf, LLColor4* value) { - if( buf.empty() || value == nullptr) + if (buf.empty() || value == nullptr) { return false; } LLColor4 v; - S32 count = sscanf( buf.c_str(), "%f, %f, %f, %f", v.mV + 0, v.mV + 1, v.mV + 2, v.mV + 3 ); - if (1 == count ) + S32 count = sscanf(buf.c_str(), "%f, %f, %f, %f", v.mV + 0, v.mV + 1, v.mV + 2, v.mV + 3); + if (1 == count) { // try this format - count = sscanf( buf.c_str(), "%f %f %f %f", v.mV + 0, v.mV + 1, v.mV + 2, v.mV + 3 ); + count = sscanf(buf.c_str(), "%f %f %f %f", v.mV + 0, v.mV + 1, v.mV + 2, v.mV + 3); } - if( 4 == count ) + if (4 == count) { - value->setVec( v ); + value->setVec(v); return true; } diff --git a/indra/llmath/v4color.h b/indra/llmath/v4color.h index cafdbd9d7c..2f1cb21113 100644 --- a/indra/llmath/v4color.h +++ b/indra/llmath/v4color.h @@ -28,7 +28,6 @@ #define LL_V4COLOR_H #include "llerror.h" -//#include "vmath.h" #include "llmath.h" #include "llsd.h" @@ -38,213 +37,212 @@ class LLVector4; // LLColor4 = |x y z w| -static const U32 LENGTHOFCOLOR4 = 4; +static constexpr U32 LENGTHOFCOLOR4 = 4; -static const U32 MAX_LENGTH_OF_COLOR_NAME = 15; //Give plenty of room for additional colors... +static constexpr U32 MAX_LENGTH_OF_COLOR_NAME = 15; // Give plenty of room for additional colors... class LLColor4 { - public: - F32 mV[LENGTHOFCOLOR4]; - LLColor4(); // Initializes LLColor4 to (0, 0, 0, 1) - LLColor4(F32 r, F32 g, F32 b); // Initializes LLColor4 to (r, g, b, 1) - LLColor4(F32 r, F32 g, F32 b, F32 a); // Initializes LLColor4 to (r. g, b, a) - LLColor4(const LLColor3 &vec, F32 a = 1.f); // Initializes LLColor4 to (vec, a) - explicit LLColor4(const LLSD& sd); - explicit LLColor4(const F32 *vec); // Initializes LLColor4 to (vec[0]. vec[1], vec[2], 1) - explicit LLColor4(U32 clr); // Initializes LLColor4 to (r=clr>>24, etc)) - explicit LLColor4(const LLColor4U& color4u); // "explicit" to avoid automatic conversion - explicit LLColor4(const LLVector4& vector4); // "explicit" to avoid automatic conversion - - LLSD getValue() const - { - LLSD ret; - ret[0] = mV[0]; - ret[1] = mV[1]; - ret[2] = mV[2]; - ret[3] = mV[3]; - return ret; - } - - void setValue(const LLSD& sd); - - void setHSL(F32 hue, F32 saturation, F32 luminance); - void calcHSL(F32* hue, F32* saturation, F32* luminance) const; - - const LLColor4& setToBlack(); // zero LLColor4 to (0, 0, 0, 1) - const LLColor4& setToWhite(); // zero LLColor4 to (0, 0, 0, 1) - - const LLColor4& setVec(F32 r, F32 g, F32 b, F32 a); // deprecated -- use set() - const LLColor4& setVec(F32 r, F32 g, F32 b); // deprecated -- use set() - const LLColor4& setVec(const LLColor4 &vec); // deprecated -- use set() - const LLColor4& setVec(const LLColor3 &vec); // deprecated -- use set() - const LLColor4& setVec(const LLColor3 &vec, F32 a); // deprecated -- use set() - const LLColor4& setVec(const F32 *vec); // deprecated -- use set() - const LLColor4& setVec(const LLColor4U& color4u); // deprecated -- use set() - - const LLColor4& set(F32 r, F32 g, F32 b, F32 a); // Sets LLColor4 to (r, g, b, a) - const LLColor4& set(F32 r, F32 g, F32 b); // Sets LLColor4 to (r, g, b) (no change in a) - const LLColor4& set(const LLColor4 &vec); // Sets LLColor4 to vec - const LLColor4& set(const LLColor3 &vec); // Sets LLColor4 to LLColor3 vec (no change in alpha) - const LLColor4& set(const LLColor3 &vec, F32 a); // Sets LLColor4 to LLColor3 vec, with alpha specified - const LLColor4& set(const F32 *vec); // Sets LLColor4 to vec - const LLColor4& set(const F64 *vec); // Sets LLColor4 to (double)vec - const LLColor4& set(const LLColor4U& color4u); // Sets LLColor4 to color4u, rescaled. - - // set from a vector of unknown type and size - // may leave some data unmodified - template - const LLColor4& set(const std::vector& v); - - // write to a vector of unknown type and size - // maye leave some data unmodified - template - void write(std::vector& v) const; - - const LLColor4& setAlpha(F32 a); - - F32 magVec() const; // deprecated -- use length() - F32 magVecSquared() const; // deprecated -- use lengthSquared() - F32 normVec(); // deprecated -- use normalize() - - F32 length() const; // Returns magnitude of LLColor4 - F32 lengthSquared() const; // Returns magnitude squared of LLColor4 - F32 normalize(); // deprecated -- use normalize() - - bool isOpaque() { return mV[VALPHA] == 1.f; } - - F32 operator[](int idx) const { return mV[idx]; } - F32 &operator[](int idx) { return mV[idx]; } - - const LLColor4& operator=(const LLColor3 &a); // Assigns vec3 to vec4 and returns vec4 - - bool operator<(const LLColor4& rhs) const; - friend std::ostream& operator<<(std::ostream& s, const LLColor4 &a); // Print a - friend LLColor4 operator+(const LLColor4 &a, const LLColor4 &b); // Return vector a + b - friend LLColor4 operator-(const LLColor4 &a, const LLColor4 &b); // Return vector a minus b - friend LLColor4 operator*(const LLColor4 &a, const LLColor4 &b); // Return component wise a * b - friend LLColor4 operator*(const LLColor4 &a, F32 k); // Return rgb times scaler k (no alpha change) - friend LLColor4 operator/(const LLColor4 &a, F32 k); // Return rgb divided by scalar k (no alpha change) - friend LLColor4 operator*(F32 k, const LLColor4 &a); // Return rgb times scaler k (no alpha change) - friend LLColor4 operator%(const LLColor4 &a, F32 k); // Return alpha times scaler k (no rgb change) - friend LLColor4 operator%(F32 k, const LLColor4 &a); // Return alpha times scaler k (no rgb change) - - friend bool operator==(const LLColor4 &a, const LLColor4 &b); // Return a == b - friend bool operator!=(const LLColor4 &a, const LLColor4 &b); // Return a != b - - friend bool operator==(const LLColor4 &a, const LLColor3 &b); // Return a == b - friend bool operator!=(const LLColor4 &a, const LLColor3 &b); // Return a != b - - friend const LLColor4& operator+=(LLColor4 &a, const LLColor4 &b); // Return vector a + b - friend const LLColor4& operator-=(LLColor4 &a, const LLColor4 &b); // Return vector a minus b - friend const LLColor4& operator*=(LLColor4 &a, F32 k); // Return rgb times scaler k (no alpha change) - friend const LLColor4& operator%=(LLColor4 &a, F32 k); // Return alpha times scaler k (no rgb change) - - friend const LLColor4& operator*=(LLColor4 &a, const LLColor4 &b); // Doesn't multiply alpha! (for lighting) - - // conversion - operator LLColor4U() const; - - // Basic color values. - static LLColor4 red; - static LLColor4 green; - static LLColor4 blue; - static LLColor4 black; - static LLColor4 white; - static LLColor4 yellow; - static LLColor4 magenta; - static LLColor4 cyan; - static LLColor4 smoke; - static LLColor4 grey; - static LLColor4 orange; - static LLColor4 purple; - static LLColor4 pink; - static LLColor4 transparent; - - // Extra color values. - static LLColor4 grey1; - static LLColor4 grey2; - static LLColor4 grey3; - static LLColor4 grey4; - - static LLColor4 red1; - static LLColor4 red2; - static LLColor4 red3; - static LLColor4 red4; - static LLColor4 red5; - - static LLColor4 green1; - static LLColor4 green2; - static LLColor4 green3; - static LLColor4 green4; - static LLColor4 green5; - static LLColor4 green6; - - static LLColor4 blue1; - static LLColor4 blue2; - static LLColor4 blue3; - static LLColor4 blue4; - static LLColor4 blue5; - static LLColor4 blue6; - - static LLColor4 yellow1; - static LLColor4 yellow2; - static LLColor4 yellow3; - static LLColor4 yellow4; - static LLColor4 yellow5; - static LLColor4 yellow6; - static LLColor4 yellow7; - static LLColor4 yellow8; - static LLColor4 yellow9; - - static LLColor4 orange1; - static LLColor4 orange2; - static LLColor4 orange3; - static LLColor4 orange4; - static LLColor4 orange5; - static LLColor4 orange6; - - static LLColor4 magenta1; - static LLColor4 magenta2; - static LLColor4 magenta3; - static LLColor4 magenta4; - - static LLColor4 purple1; - static LLColor4 purple2; - static LLColor4 purple3; - static LLColor4 purple4; - static LLColor4 purple5; - static LLColor4 purple6; - - static LLColor4 pink1; - static LLColor4 pink2; - - static LLColor4 cyan1; - static LLColor4 cyan2; - static LLColor4 cyan3; - static LLColor4 cyan4; - static LLColor4 cyan5; - static LLColor4 cyan6; - - static bool parseColor(const std::string& buf, LLColor4* color); - static bool parseColor4(const std::string& buf, LLColor4* color); - - inline void clamp(); -}; +public: + F32 mV[LENGTHOFCOLOR4]; + LLColor4(); // Initializes LLColor4 to (0, 0, 0, 1) + LLColor4(F32 r, F32 g, F32 b); // Initializes LLColor4 to (r, g, b, 1) + LLColor4(F32 r, F32 g, F32 b, F32 a); // Initializes LLColor4 to (r. g, b, a) + LLColor4(const LLColor3& vec, F32 a = 1.f); // Initializes LLColor4 to (vec, a) + explicit LLColor4(const LLSD& sd); + explicit LLColor4(const F32* vec); // Initializes LLColor4 to (vec[0]. vec[1], vec[2], 1) + explicit LLColor4(U32 clr); // Initializes LLColor4 to (r=clr>>24, etc)) + explicit LLColor4(const LLColor4U& color4u); // "explicit" to avoid automatic conversion + explicit LLColor4(const LLVector4& vector4); // "explicit" to avoid automatic conversion + + LLSD getValue() const + { + LLSD ret; + ret[VRED] = mV[VRED]; + ret[VGREEN] = mV[VGREEN]; + ret[VBLUE] = mV[VBLUE]; + ret[VALPHA] = mV[VALPHA]; + return ret; + } + void setValue(const LLSD& sd); + + void setHSL(F32 hue, F32 saturation, F32 luminance); + void calcHSL(F32* hue, F32* saturation, F32* luminance) const; + + const LLColor4& setToBlack(); // zero LLColor4 to (0, 0, 0, 1) + const LLColor4& setToWhite(); // zero LLColor4 to (0, 0, 0, 1) + + const LLColor4& setVec(F32 r, F32 g, F32 b, F32 a); // deprecated -- use set() + const LLColor4& setVec(F32 r, F32 g, F32 b); // deprecated -- use set() + const LLColor4& setVec(const LLColor4& vec); // deprecated -- use set() + const LLColor4& setVec(const LLColor3& vec); // deprecated -- use set() + const LLColor4& setVec(const LLColor3& vec, F32 a); // deprecated -- use set() + const LLColor4& setVec(const F32* vec); // deprecated -- use set() + const LLColor4& setVec(const LLColor4U& color4u); // deprecated -- use set() + + const LLColor4& set(F32 r, F32 g, F32 b, F32 a); // Sets LLColor4 to (r, g, b, a) + const LLColor4& set(F32 r, F32 g, F32 b); // Sets LLColor4 to (r, g, b) (no change in a) + const LLColor4& set(const LLColor4& vec); // Sets LLColor4 to vec + const LLColor4& set(const LLColor3& vec); // Sets LLColor4 to LLColor3 vec (no change in alpha) + const LLColor4& set(const LLColor3& vec, F32 a); // Sets LLColor4 to LLColor3 vec, with alpha specified + const LLColor4& set(const F32* vec); // Sets LLColor4 to vec + const LLColor4& set(const F64* vec); // Sets LLColor4 to (double)vec + const LLColor4& set(const LLColor4U& color4u); // Sets LLColor4 to color4u, rescaled. + + // set from a vector of unknown type and size + // may leave some data unmodified + template + const LLColor4& set(const std::vector& v); + + // write to a vector of unknown type and size + // maye leave some data unmodified + template + void write(std::vector& v) const; + + const LLColor4& setAlpha(F32 a); + + F32 magVec() const; // deprecated -- use length() + F32 magVecSquared() const; // deprecated -- use lengthSquared() + F32 normVec(); // deprecated -- use normalize() + + F32 length() const; // Returns magnitude of LLColor4 + F32 lengthSquared() const; // Returns magnitude squared of LLColor4 + F32 normalize(); // deprecated -- use normalize() + + bool isOpaque() const { return mV[VALPHA] == 1.f; } + + F32 operator[](int idx) const { return mV[idx]; } + F32& operator[](int idx) { return mV[idx]; } + + const LLColor4& operator=(const LLColor3& a); // Assigns vec3 to vec4 and returns vec4 + + bool operator<(const LLColor4& rhs) const; + friend std::ostream& operator<<(std::ostream& s, const LLColor4& a); // Print a + friend LLColor4 operator+(const LLColor4& a, const LLColor4& b); // Return vector a + b + friend LLColor4 operator-(const LLColor4& a, const LLColor4& b); // Return vector a minus b + friend LLColor4 operator*(const LLColor4& a, const LLColor4& b); // Return component wise a * b + friend LLColor4 operator*(const LLColor4& a, F32 k); // Return rgb times scaler k (no alpha change) + friend LLColor4 operator/(const LLColor4& a, F32 k); // Return rgb divided by scalar k (no alpha change) + friend LLColor4 operator*(F32 k, const LLColor4& a); // Return rgb times scaler k (no alpha change) + friend LLColor4 operator%(const LLColor4& a, F32 k); // Return alpha times scaler k (no rgb change) + friend LLColor4 operator%(F32 k, const LLColor4& a); // Return alpha times scaler k (no rgb change) + + friend bool operator==(const LLColor4& a, const LLColor4& b); // Return a == b + friend bool operator!=(const LLColor4& a, const LLColor4& b); // Return a != b + + friend bool operator==(const LLColor4& a, const LLColor3& b); // Return a == b + friend bool operator!=(const LLColor4& a, const LLColor3& b); // Return a != b + + friend const LLColor4& operator+=(LLColor4& a, const LLColor4& b); // Return vector a + b + friend const LLColor4& operator-=(LLColor4& a, const LLColor4& b); // Return vector a minus b + friend const LLColor4& operator*=(LLColor4& a, F32 k); // Return rgb times scaler k (no alpha change) + friend const LLColor4& operator%=(LLColor4& a, F32 k); // Return alpha times scaler k (no rgb change) + + friend const LLColor4& operator*=(LLColor4& a, const LLColor4& b); // Doesn't multiply alpha! (for lighting) + + // conversion + operator LLColor4U() const; + + // Basic color values. + static LLColor4 red; + static LLColor4 green; + static LLColor4 blue; + static LLColor4 black; + static LLColor4 white; + static LLColor4 yellow; + static LLColor4 magenta; + static LLColor4 cyan; + static LLColor4 smoke; + static LLColor4 grey; + static LLColor4 orange; + static LLColor4 purple; + static LLColor4 pink; + static LLColor4 transparent; + + // Extra color values. + static LLColor4 grey1; + static LLColor4 grey2; + static LLColor4 grey3; + static LLColor4 grey4; + + static LLColor4 red1; + static LLColor4 red2; + static LLColor4 red3; + static LLColor4 red4; + static LLColor4 red5; + + static LLColor4 green1; + static LLColor4 green2; + static LLColor4 green3; + static LLColor4 green4; + static LLColor4 green5; + static LLColor4 green6; + + static LLColor4 blue1; + static LLColor4 blue2; + static LLColor4 blue3; + static LLColor4 blue4; + static LLColor4 blue5; + static LLColor4 blue6; + + static LLColor4 yellow1; + static LLColor4 yellow2; + static LLColor4 yellow3; + static LLColor4 yellow4; + static LLColor4 yellow5; + static LLColor4 yellow6; + static LLColor4 yellow7; + static LLColor4 yellow8; + static LLColor4 yellow9; + + static LLColor4 orange1; + static LLColor4 orange2; + static LLColor4 orange3; + static LLColor4 orange4; + static LLColor4 orange5; + static LLColor4 orange6; + + static LLColor4 magenta1; + static LLColor4 magenta2; + static LLColor4 magenta3; + static LLColor4 magenta4; + + static LLColor4 purple1; + static LLColor4 purple2; + static LLColor4 purple3; + static LLColor4 purple4; + static LLColor4 purple5; + static LLColor4 purple6; + + static LLColor4 pink1; + static LLColor4 pink2; + + static LLColor4 cyan1; + static LLColor4 cyan2; + static LLColor4 cyan3; + static LLColor4 cyan4; + static LLColor4 cyan5; + static LLColor4 cyan6; + + static bool parseColor(const std::string& buf, LLColor4* color); + static bool parseColor4(const std::string& buf, LLColor4* color); + + inline void clamp(); +}; // Non-member functions -F32 distVec(const LLColor4 &a, const LLColor4 &b); // Returns distance between a and b -F32 distVec_squared(const LLColor4 &a, const LLColor4 &b); // Returns distance squared between a and b -LLColor3 vec4to3(const LLColor4 &vec); -LLColor4 vec3to4(const LLColor3 &vec); -LLColor4 lerp(const LLColor4 &a, const LLColor4 &b, F32 u); +F32 distVec(const LLColor4& a, const LLColor4& b); // Returns distance between a and b +F32 distVec_squared(const LLColor4& a, const LLColor4& b); // Returns distance squared between a and b +LLColor3 vec4to3(const LLColor4& vec); +LLColor4 vec3to4(const LLColor3& vec); +LLColor4 lerp(const LLColor4& a, const LLColor4& b, F32 u); -inline LLColor4::LLColor4(void) +inline LLColor4::LLColor4() { - mV[VRED] = 0.f; + mV[VRED] = 0.f; mV[VGREEN] = 0.f; - mV[VBLUE] = 0.f; + mV[VBLUE] = 0.f; mV[VALPHA] = 1.f; } @@ -255,149 +253,146 @@ inline LLColor4::LLColor4(const LLSD& sd) inline LLColor4::LLColor4(F32 r, F32 g, F32 b) { - mV[VRED] = r; + mV[VRED] = r; mV[VGREEN] = g; - mV[VBLUE] = b; + mV[VBLUE] = b; mV[VALPHA] = 1.f; } inline LLColor4::LLColor4(F32 r, F32 g, F32 b, F32 a) { - mV[VRED] = r; + mV[VRED] = r; mV[VGREEN] = g; - mV[VBLUE] = b; + mV[VBLUE] = b; mV[VALPHA] = a; } inline LLColor4::LLColor4(U32 clr) { - mV[VRED] = (clr&0xff) * (1.0f/255.0f); - mV[VGREEN] = ((clr>>8)&0xff) * (1.0f/255.0f); - mV[VBLUE] = ((clr>>16)&0xff) * (1.0f/255.0f); - mV[VALPHA] = (clr>>24) * (1.0f/255.0f); + mV[VRED] = (clr & 0xff) * (1.0f / 255.0f); + mV[VGREEN] = ((clr >> 8) & 0xff) * (1.0f / 255.0f); + mV[VBLUE] = ((clr >> 16) & 0xff) * (1.0f / 255.0f); + mV[VALPHA] = (clr >> 24) * (1.0f / 255.0f); } - -inline LLColor4::LLColor4(const F32 *vec) +inline LLColor4::LLColor4(const F32* vec) { - mV[VRED] = vec[VRED]; + mV[VRED] = vec[VRED]; mV[VGREEN] = vec[VGREEN]; - mV[VBLUE] = vec[VBLUE]; + mV[VBLUE] = vec[VBLUE]; mV[VALPHA] = vec[VALPHA]; } -inline const LLColor4& LLColor4::setToBlack(void) +inline const LLColor4& LLColor4::setToBlack(void) { - mV[VRED] = 0.f; + mV[VRED] = 0.f; mV[VGREEN] = 0.f; - mV[VBLUE] = 0.f; + mV[VBLUE] = 0.f; mV[VALPHA] = 1.f; return (*this); } -inline const LLColor4& LLColor4::setToWhite(void) +inline const LLColor4& LLColor4::setToWhite(void) { - mV[VRED] = 1.f; + mV[VRED] = 1.f; mV[VGREEN] = 1.f; - mV[VBLUE] = 1.f; + mV[VBLUE] = 1.f; mV[VALPHA] = 1.f; return (*this); } -inline const LLColor4& LLColor4::set(F32 x, F32 y, F32 z) +inline const LLColor4& LLColor4::set(F32 x, F32 y, F32 z) { - mV[VRED] = x; + mV[VRED] = x; mV[VGREEN] = y; - mV[VBLUE] = z; + mV[VBLUE] = z; -// no change to alpha! -// mV[VALPHA] = 1.f; + // no change to alpha! + // mV[VALPHA] = 1.f; return (*this); } -inline const LLColor4& LLColor4::set(F32 x, F32 y, F32 z, F32 a) +inline const LLColor4& LLColor4::set(F32 x, F32 y, F32 z, F32 a) { - mV[VRED] = x; + mV[VRED] = x; mV[VGREEN] = y; - mV[VBLUE] = z; + mV[VBLUE] = z; mV[VALPHA] = a; return (*this); } -inline const LLColor4& LLColor4::set(const LLColor4 &vec) +inline const LLColor4& LLColor4::set(const LLColor4& vec) { - mV[VRED] = vec.mV[VRED]; + mV[VRED] = vec.mV[VRED]; mV[VGREEN] = vec.mV[VGREEN]; - mV[VBLUE] = vec.mV[VBLUE]; + mV[VBLUE] = vec.mV[VBLUE]; mV[VALPHA] = vec.mV[VALPHA]; return (*this); } - -inline const LLColor4& LLColor4::set(const F32 *vec) +inline const LLColor4& LLColor4::set(const F32* vec) { - mV[VRED] = vec[VRED]; + mV[VRED] = vec[VRED]; mV[VGREEN] = vec[VGREEN]; - mV[VBLUE] = vec[VBLUE]; + mV[VBLUE] = vec[VBLUE]; mV[VALPHA] = vec[VALPHA]; return (*this); } -inline const LLColor4& LLColor4::set(const F64 *vec) +inline const LLColor4& LLColor4::set(const F64* vec) { - mV[VRED] = static_cast(vec[VRED]); + mV[VRED] = static_cast(vec[VRED]); mV[VGREEN] = static_cast(vec[VGREEN]); - mV[VBLUE] = static_cast(vec[VBLUE]); + mV[VBLUE] = static_cast(vec[VBLUE]); mV[VALPHA] = static_cast(vec[VALPHA]); return (*this); } // deprecated -inline const LLColor4& LLColor4::setVec(F32 x, F32 y, F32 z) +inline const LLColor4& LLColor4::setVec(F32 x, F32 y, F32 z) { - mV[VRED] = x; + mV[VRED] = x; mV[VGREEN] = y; - mV[VBLUE] = z; + mV[VBLUE] = z; -// no change to alpha! -// mV[VALPHA] = 1.f; + // no change to alpha! + // mV[VALPHA] = 1.f; return (*this); } // deprecated -inline const LLColor4& LLColor4::setVec(F32 x, F32 y, F32 z, F32 a) +inline const LLColor4& LLColor4::setVec(F32 x, F32 y, F32 z, F32 a) { - mV[VRED] = x; + mV[VRED] = x; mV[VGREEN] = y; - mV[VBLUE] = z; + mV[VBLUE] = z; mV[VALPHA] = a; return (*this); } // deprecated -inline const LLColor4& LLColor4::setVec(const LLColor4 &vec) +inline const LLColor4& LLColor4::setVec(const LLColor4& vec) { - mV[VRED] = vec.mV[VRED]; + mV[VRED] = vec.mV[VRED]; mV[VGREEN] = vec.mV[VGREEN]; - mV[VBLUE] = vec.mV[VBLUE]; + mV[VBLUE] = vec.mV[VBLUE]; mV[VALPHA] = vec.mV[VALPHA]; return (*this); } - // deprecated -inline const LLColor4& LLColor4::setVec(const F32 *vec) +inline const LLColor4& LLColor4::setVec(const F32* vec) { - mV[VRED] = vec[VRED]; + mV[VRED] = vec[VRED]; mV[VGREEN] = vec[VGREEN]; - mV[VBLUE] = vec[VBLUE]; + mV[VBLUE] = vec[VBLUE]; mV[VALPHA] = vec[VALPHA]; return (*this); } -inline const LLColor4& LLColor4::setAlpha(F32 a) +inline const LLColor4& LLColor4::setAlpha(F32 a) { mV[VALPHA] = a; return (*this); @@ -405,155 +400,116 @@ inline const LLColor4& LLColor4::setAlpha(F32 a) // LLColor4 Magnitude and Normalization Functions -inline F32 LLColor4::length(void) const +inline F32 LLColor4::length() const { - return (F32) sqrt(mV[VRED]*mV[VRED] + mV[VGREEN]*mV[VGREEN] + mV[VBLUE]*mV[VBLUE]); + return sqrt(mV[VRED] * mV[VRED] + mV[VGREEN] * mV[VGREEN] + mV[VBLUE] * mV[VBLUE]); } -inline F32 LLColor4::lengthSquared(void) const +inline F32 LLColor4::lengthSquared() const { - return mV[VRED]*mV[VRED] + mV[VGREEN]*mV[VGREEN] + mV[VBLUE]*mV[VBLUE]; + return mV[VRED] * mV[VRED] + mV[VGREEN] * mV[VGREEN] + mV[VBLUE] * mV[VBLUE]; } -inline F32 LLColor4::normalize(void) +inline F32 LLColor4::normalize() { - F32 mag = (F32) sqrt(mV[VRED]*mV[VRED] + mV[VGREEN]*mV[VGREEN] + mV[VBLUE]*mV[VBLUE]); + F32 mag = sqrt(mV[VRED] * mV[VRED] + mV[VGREEN] * mV[VGREEN] + mV[VBLUE] * mV[VBLUE]); F32 oomag; if (mag) { - oomag = 1.f/mag; + oomag = 1.f / mag; mV[VRED] *= oomag; mV[VGREEN] *= oomag; mV[VBLUE] *= oomag; } - return (mag); + return mag; } // deprecated -inline F32 LLColor4::magVec(void) const +inline F32 LLColor4::magVec() const { - return (F32) sqrt(mV[VRED]*mV[VRED] + mV[VGREEN]*mV[VGREEN] + mV[VBLUE]*mV[VBLUE]); + return sqrt(mV[VRED] * mV[VRED] + mV[VGREEN] * mV[VGREEN] + mV[VBLUE] * mV[VBLUE]); } // deprecated -inline F32 LLColor4::magVecSquared(void) const +inline F32 LLColor4::magVecSquared() const { - return mV[VRED]*mV[VRED] + mV[VGREEN]*mV[VGREEN] + mV[VBLUE]*mV[VBLUE]; + return mV[VRED] * mV[VRED] + mV[VGREEN] * mV[VGREEN] + mV[VBLUE] * mV[VBLUE]; } // deprecated -inline F32 LLColor4::normVec(void) +inline F32 LLColor4::normVec() { - F32 mag = (F32) sqrt(mV[VRED]*mV[VRED] + mV[VGREEN]*mV[VGREEN] + mV[VBLUE]*mV[VBLUE]); + F32 mag = sqrt(mV[VRED] * mV[VRED] + mV[VGREEN] * mV[VGREEN] + mV[VBLUE] * mV[VBLUE]); F32 oomag; if (mag) { - oomag = 1.f/mag; + oomag = 1.f / mag; mV[VRED] *= oomag; mV[VGREEN] *= oomag; mV[VBLUE] *= oomag; } - return (mag); + return mag; } // LLColor4 Operators - -inline LLColor4 operator+(const LLColor4 &a, const LLColor4 &b) +inline LLColor4 operator+(const LLColor4& a, const LLColor4& b) { - return LLColor4( - a.mV[VRED] + b.mV[VRED], - a.mV[VGREEN] + b.mV[VGREEN], - a.mV[VBLUE] + b.mV[VBLUE], - a.mV[VALPHA] + b.mV[VALPHA]); + return LLColor4(a.mV[VRED] + b.mV[VRED], a.mV[VGREEN] + b.mV[VGREEN], a.mV[VBLUE] + b.mV[VBLUE], a.mV[VALPHA] + b.mV[VALPHA]); } -inline LLColor4 operator-(const LLColor4 &a, const LLColor4 &b) +inline LLColor4 operator-(const LLColor4& a, const LLColor4& b) { - return LLColor4( - a.mV[VRED] - b.mV[VRED], - a.mV[VGREEN] - b.mV[VGREEN], - a.mV[VBLUE] - b.mV[VBLUE], - a.mV[VALPHA] - b.mV[VALPHA]); + return LLColor4(a.mV[VRED] - b.mV[VRED], a.mV[VGREEN] - b.mV[VGREEN], a.mV[VBLUE] - b.mV[VBLUE], a.mV[VALPHA] - b.mV[VALPHA]); } -inline LLColor4 operator*(const LLColor4 &a, const LLColor4 &b) +inline LLColor4 operator*(const LLColor4& a, const LLColor4& b) { - return LLColor4( - a.mV[VRED] * b.mV[VRED], - a.mV[VGREEN] * b.mV[VGREEN], - a.mV[VBLUE] * b.mV[VBLUE], - a.mV[VALPHA] * b.mV[VALPHA]); + return LLColor4(a.mV[VRED] * b.mV[VRED], a.mV[VGREEN] * b.mV[VGREEN], a.mV[VBLUE] * b.mV[VBLUE], a.mV[VALPHA] * b.mV[VALPHA]); } -inline LLColor4 operator*(const LLColor4 &a, F32 k) +inline LLColor4 operator*(const LLColor4& a, F32 k) { // only affects rgb (not a!) - return LLColor4( - a.mV[VRED] * k, - a.mV[VGREEN] * k, - a.mV[VBLUE] * k, - a.mV[VALPHA]); + return LLColor4(a.mV[VRED] * k, a.mV[VGREEN] * k, a.mV[VBLUE] * k, a.mV[VALPHA]); } -inline LLColor4 operator/(const LLColor4 &a, F32 k) +inline LLColor4 operator/(const LLColor4& a, F32 k) { - return LLColor4( - a.mV[VRED] / k, - a.mV[VGREEN] / k, - a.mV[VBLUE] / k, - a.mV[VALPHA]); + return LLColor4(a.mV[VRED] / k, a.mV[VGREEN] / k, a.mV[VBLUE] / k, a.mV[VALPHA]); } -inline LLColor4 operator*(F32 k, const LLColor4 &a) +inline LLColor4 operator*(F32 k, const LLColor4& a) { // only affects rgb (not a!) - return LLColor4( - a.mV[VRED] * k, - a.mV[VGREEN] * k, - a.mV[VBLUE] * k, - a.mV[VALPHA]); + return LLColor4(a.mV[VRED] * k, a.mV[VGREEN] * k, a.mV[VBLUE] * k, a.mV[VALPHA]); } -inline LLColor4 operator%(F32 k, const LLColor4 &a) +inline LLColor4 operator%(F32 k, const LLColor4& a) { // only affects alpha (not rgb!) - return LLColor4( - a.mV[VRED], - a.mV[VGREEN], - a.mV[VBLUE], - a.mV[VALPHA] * k); + return LLColor4(a.mV[VRED], a.mV[VGREEN], a.mV[VBLUE], a.mV[VALPHA] * k); } -inline LLColor4 operator%(const LLColor4 &a, F32 k) +inline LLColor4 operator%(const LLColor4& a, F32 k) { // only affects alpha (not rgb!) - return LLColor4( - a.mV[VRED], - a.mV[VGREEN], - a.mV[VBLUE], - a.mV[VALPHA] * k); + return LLColor4(a.mV[VRED], a.mV[VGREEN], a.mV[VBLUE], a.mV[VALPHA] * k); } -inline bool operator==(const LLColor4 &a, const LLColor4 &b) +inline bool operator==(const LLColor4& a, const LLColor4& b) { - return ( (a.mV[VRED] == b.mV[VRED]) - &&(a.mV[VGREEN] == b.mV[VGREEN]) - &&(a.mV[VBLUE] == b.mV[VBLUE]) - &&(a.mV[VALPHA] == b.mV[VALPHA])); + return ((a.mV[VRED] == b.mV[VRED]) && (a.mV[VGREEN] == b.mV[VGREEN]) && (a.mV[VBLUE] == b.mV[VBLUE]) && (a.mV[VALPHA] == b.mV[VALPHA])); } -inline bool operator!=(const LLColor4 &a, const LLColor4 &b) +inline bool operator!=(const LLColor4& a, const LLColor4& b) { - return ( (a.mV[VRED] != b.mV[VRED]) - ||(a.mV[VGREEN] != b.mV[VGREEN]) - ||(a.mV[VBLUE] != b.mV[VBLUE]) - ||(a.mV[VALPHA] != b.mV[VALPHA])); + return ((a.mV[VRED] != b.mV[VRED]) || (a.mV[VGREEN] != b.mV[VGREEN]) || (a.mV[VBLUE] != b.mV[VBLUE]) || (a.mV[VALPHA] != b.mV[VALPHA])); } -inline const LLColor4& operator+=(LLColor4 &a, const LLColor4 &b) +inline const LLColor4& operator+=(LLColor4& a, const LLColor4& b) { a.mV[VRED] += b.mV[VRED]; a.mV[VGREEN] += b.mV[VGREEN]; @@ -562,7 +518,7 @@ inline const LLColor4& operator+=(LLColor4 &a, const LLColor4 &b) return a; } -inline const LLColor4& operator-=(LLColor4 &a, const LLColor4 &b) +inline const LLColor4& operator-=(LLColor4& a, const LLColor4& b) { a.mV[VRED] -= b.mV[VRED]; a.mV[VGREEN] -= b.mV[VGREEN]; @@ -571,7 +527,7 @@ inline const LLColor4& operator-=(LLColor4 &a, const LLColor4 &b) return a; } -inline const LLColor4& operator*=(LLColor4 &a, F32 k) +inline const LLColor4& operator*=(LLColor4& a, F32 k) { // only affects rgb (not a!) a.mV[VRED] *= k; @@ -580,121 +536,120 @@ inline const LLColor4& operator*=(LLColor4 &a, F32 k) return a; } -inline const LLColor4& operator *=(LLColor4 &a, const LLColor4 &b) +inline const LLColor4& operator*=(LLColor4& a, const LLColor4& b) { a.mV[VRED] *= b.mV[VRED]; a.mV[VGREEN] *= b.mV[VGREEN]; a.mV[VBLUE] *= b.mV[VBLUE]; -// a.mV[VALPHA] *= b.mV[VALPHA]; + // a.mV[VALPHA] *= b.mV[VALPHA]; return a; } -inline const LLColor4& operator%=(LLColor4 &a, F32 k) +inline const LLColor4& operator%=(LLColor4& a, F32 k) { // only affects alpha (not rgb!) a.mV[VALPHA] *= k; return a; } - // Non-member functions -inline F32 distVec(const LLColor4 &a, const LLColor4 &b) +inline F32 distVec(const LLColor4& a, const LLColor4& b) { LLColor4 vec = a - b; - return (vec.length()); + return vec.length(); } -inline F32 distVec_squared(const LLColor4 &a, const LLColor4 &b) +inline F32 distVec_squared(const LLColor4& a, const LLColor4& b) { LLColor4 vec = a - b; - return (vec.lengthSquared()); + return vec.lengthSquared(); } -inline LLColor4 lerp(const LLColor4 &a, const LLColor4 &b, F32 u) +inline LLColor4 lerp(const LLColor4& a, const LLColor4& b, F32 u) { - return LLColor4( - a.mV[VRED] + (b.mV[VRED] - a.mV[VRED]) * u, - a.mV[VGREEN] + (b.mV[VGREEN] - a.mV[VGREEN]) * u, - a.mV[VBLUE] + (b.mV[VBLUE] - a.mV[VBLUE]) * u, - a.mV[VALPHA] + (b.mV[VALPHA] - a.mV[VALPHA]) * u); + return LLColor4(a.mV[VRED] + (b.mV[VRED] - a.mV[VRED]) * u, + a.mV[VGREEN] + (b.mV[VGREEN] - a.mV[VGREEN]) * u, + a.mV[VBLUE] + (b.mV[VBLUE] - a.mV[VBLUE]) * u, + a.mV[VALPHA] + (b.mV[VALPHA] - a.mV[VALPHA]) * u); } inline bool LLColor4::operator<(const LLColor4& rhs) const { - if (mV[0] != rhs.mV[0]) + if (mV[VRED] != rhs.mV[VRED]) { - return mV[0] < rhs.mV[0]; + return mV[VRED] < rhs.mV[VRED]; } - if (mV[1] != rhs.mV[1]) + if (mV[VGREEN] != rhs.mV[VGREEN]) { - return mV[1] < rhs.mV[1]; + return mV[VGREEN] < rhs.mV[VGREEN]; } - if (mV[2] != rhs.mV[2]) + if (mV[VBLUE] != rhs.mV[VBLUE]) { - return mV[2] < rhs.mV[2]; + return mV[VBLUE] < rhs.mV[VBLUE]; } - return mV[3] < rhs.mV[3]; + return mV[VALPHA] < rhs.mV[VALPHA]; } void LLColor4::clamp() { // Clamp the color... - if (mV[0] < 0.f) + if (mV[VRED] < 0.f) { - mV[0] = 0.f; + mV[VRED] = 0.f; } - else if (mV[0] > 1.f) + else if (mV[VRED] > 1.f) { - mV[0] = 1.f; + mV[VRED] = 1.f; } - if (mV[1] < 0.f) + if (mV[VGREEN] < 0.f) { - mV[1] = 0.f; + mV[VGREEN] = 0.f; } - else if (mV[1] > 1.f) + else if (mV[VGREEN] > 1.f) { - mV[1] = 1.f; + mV[VGREEN] = 1.f; } - if (mV[2] < 0.f) + if (mV[VBLUE] < 0.f) { - mV[2] = 0.f; + mV[VBLUE] = 0.f; } - else if (mV[2] > 1.f) + else if (mV[VBLUE] > 1.f) { - mV[2] = 1.f; + mV[VBLUE] = 1.f; } - if (mV[3] < 0.f) + if (mV[VALPHA] < 0.f) { - mV[3] = 0.f; + mV[VALPHA] = 0.f; } - else if (mV[3] > 1.f) + else if (mV[VALPHA] > 1.f) { - mV[3] = 1.f; + mV[VALPHA] = 1.f; } } // Return the given linear space color value in gamma corrected (sRGB) space -inline const LLColor4 srgbColor4(const LLColor4 &a) { +inline const LLColor4 srgbColor4(const LLColor4& a) +{ LLColor4 srgbColor; - srgbColor.mV[0] = linearTosRGB(a.mV[0]); - srgbColor.mV[1] = linearTosRGB(a.mV[1]); - srgbColor.mV[2] = linearTosRGB(a.mV[2]); - srgbColor.mV[3] = a.mV[3]; + srgbColor.mV[VRED] = linearTosRGB(a.mV[VRED]); + srgbColor.mV[VGREEN] = linearTosRGB(a.mV[VGREEN]); + srgbColor.mV[VBLUE] = linearTosRGB(a.mV[VBLUE]); + srgbColor.mV[VALPHA] = a.mV[VALPHA]; return srgbColor; } // Return the given gamma corrected (sRGB) color in linear space -inline const LLColor4 linearColor4(const LLColor4 &a) +inline const LLColor4 linearColor4(const LLColor4& a) { LLColor4 linearColor; - linearColor.mV[0] = sRGBtoLinear(a.mV[0]); - linearColor.mV[1] = sRGBtoLinear(a.mV[1]); - linearColor.mV[2] = sRGBtoLinear(a.mV[2]); - linearColor.mV[3] = a.mV[3]; + linearColor.mV[VRED] = sRGBtoLinear(a.mV[VRED]); + linearColor.mV[VGREEN] = sRGBtoLinear(a.mV[VGREEN]); + linearColor.mV[VBLUE] = sRGBtoLinear(a.mV[VBLUE]); + linearColor.mV[VALPHA] = a.mV[VALPHA]; return linearColor; } @@ -720,4 +675,3 @@ void LLColor4::write(std::vector& v) const } #endif - diff --git a/indra/llmath/v4coloru.cpp b/indra/llmath/v4coloru.cpp index acf349245a..c495ffdb4c 100644 --- a/indra/llmath/v4coloru.cpp +++ b/indra/llmath/v4coloru.cpp @@ -26,10 +26,7 @@ #include "linden_common.h" -//#include "v3coloru.h" #include "v4coloru.h" -#include "v4color.h" -//#include "vmath.h" #include "llmath.h" // LLColor4U @@ -39,49 +36,7 @@ LLColor4U LLColor4U::red (255, 0, 0, 255); LLColor4U LLColor4U::green( 0, 255, 0, 255); LLColor4U LLColor4U::blue ( 0, 0, 255, 255); -// conversion -/* inlined to fix gcc compile link error -LLColor4U::operator LLColor4() -{ - return(LLColor4((F32)mV[VRED]/255.f,(F32)mV[VGREEN]/255.f,(F32)mV[VBLUE]/255.f,(F32)mV[VALPHA]/255.f)); -} -*/ - -// Constructors - - -/* -LLColor4U::LLColor4U(const LLColor3 &vec) -{ - mV[VRED] = vec.mV[VRED]; - mV[VGREEN] = vec.mV[VGREEN]; - mV[VBLUE] = vec.mV[VBLUE]; - mV[VALPHA] = 255; -} -*/ - - -// Clear and Assignment Functions - - - -// LLColor4U Operators - -/* -LLColor4U LLColor4U::operator=(const LLColor3 &a) -{ - mV[VRED] = a.mV[VRED]; - mV[VGREEN] = a.mV[VGREEN]; - mV[VBLUE] = a.mV[VBLUE]; - -// converting from an rgb sets a=1 (opaque) - mV[VALPHA] = 255; - return (*this); -} -*/ - - -std::ostream& operator<<(std::ostream& s, const LLColor4U &a) +std::ostream& operator<<(std::ostream& s, const LLColor4U& a) { s << "{ " << (S32)a.mV[VRED] << ", " << (S32)a.mV[VGREEN] << ", " << (S32)a.mV[VBLUE] << ", " << (S32)a.mV[VALPHA] << " }"; return s; @@ -90,31 +45,31 @@ std::ostream& operator<<(std::ostream& s, const LLColor4U &a) // static bool LLColor4U::parseColor4U(const std::string& buf, LLColor4U* value) { - if( buf.empty() || value == nullptr) + if (buf.empty() || value == nullptr) { return false; } - U32 v[4]; - S32 count = sscanf( buf.c_str(), "%u, %u, %u, %u", v + 0, v + 1, v + 2, v + 3 ); - if (1 == count ) + U32 v[4]{}; + S32 count = sscanf(buf.c_str(), "%u, %u, %u, %u", v + 0, v + 1, v + 2, v + 3); + if (1 == count) { // try this format - count = sscanf( buf.c_str(), "%u %u %u %u", v + 0, v + 1, v + 2, v + 3 ); + count = sscanf(buf.c_str(), "%u %u %u %u", v + 0, v + 1, v + 2, v + 3); } - if( 4 != count ) + if (4 != count) { return false; } - for( S32 i = 0; i < 4; i++ ) + for (S32 i = 0; i < 4; i++) { - if( v[i] > U8_MAX ) + if (v[i] > U8_MAX) { return false; } } - value->set( U8(v[0]), U8(v[1]), U8(v[2]), U8(v[3]) ); + value->set(U8(v[VRED]), U8(v[VGREEN]), U8(v[VBLUE]), U8(v[VALPHA])); return true; } diff --git a/indra/llmath/v4coloru.h b/indra/llmath/v4coloru.h index 29128a08a7..bfa998bc58 100644 --- a/indra/llmath/v4coloru.h +++ b/indra/llmath/v4coloru.h @@ -28,104 +28,93 @@ #define LL_V4COLORU_H #include "llerror.h" -//#include "vmath.h" #include "llmath.h" -//#include "v4color.h" #include "v3color.h" #include "v4color.h" -//class LLColor3U; class LLColor4; // LLColor4U = | red green blue alpha | -static const U32 LENGTHOFCOLOR4U = 4; - +static constexpr U32 LENGTHOFCOLOR4U = 4; class LLColor4U { public: - U8 mV[LENGTHOFCOLOR4U]; - LLColor4U(); // Initializes LLColor4U to (0, 0, 0, 1) - LLColor4U(U8 r, U8 g, U8 b); // Initializes LLColor4U to (r, g, b, 1) - LLColor4U(U8 r, U8 g, U8 b, U8 a); // Initializes LLColor4U to (r. g, b, a) - LLColor4U(const U8 *vec); // Initializes LLColor4U to (vec[0]. vec[1], vec[2], 1) - explicit LLColor4U(const LLSD& sd) - { - setValue(sd); - } + LLColor4U(); // Initializes LLColor4U to (0, 0, 0, 1) + LLColor4U(U8 r, U8 g, U8 b); // Initializes LLColor4U to (r, g, b, 1) + LLColor4U(U8 r, U8 g, U8 b, U8 a); // Initializes LLColor4U to (r. g, b, a) + LLColor4U(const U8* vec); // Initializes LLColor4U to (vec[0]. vec[1], vec[2], 1) + explicit LLColor4U(const LLSD& sd) { setValue(sd); } void setValue(const LLSD& sd) { - mV[0] = sd[0].asInteger(); - mV[1] = sd[1].asInteger(); - mV[2] = sd[2].asInteger(); - mV[3] = sd[3].asInteger(); + mV[VRED] = sd[VRED].asInteger(); + mV[VGREEN] = sd[VGREEN].asInteger(); + mV[VBLUE] = sd[VBLUE].asInteger(); + mV[VALPHA] = sd[VALPHA].asInteger(); } LLSD getValue() const { LLSD ret; - ret[0] = mV[0]; - ret[1] = mV[1]; - ret[2] = mV[2]; - ret[3] = mV[3]; + ret[VRED] = mV[VRED]; + ret[VGREEN] = mV[VGREEN]; + ret[VBLUE] = mV[VBLUE]; + ret[VALPHA] = mV[VALPHA]; return ret; } - const LLColor4U& setToBlack(); // zero LLColor4U to (0, 0, 0, 1) - const LLColor4U& setToWhite(); // zero LLColor4U to (0, 0, 0, 1) + const LLColor4U& setToBlack(); // zero LLColor4U to (0, 0, 0, 1) + const LLColor4U& setToWhite(); // zero LLColor4U to (0, 0, 0, 1) - const LLColor4U& set(U8 r, U8 g, U8 b, U8 a);// Sets LLColor4U to (r, g, b, a) - const LLColor4U& set(U8 r, U8 g, U8 b); // Sets LLColor4U to (r, g, b) (no change in a) - const LLColor4U& set(const LLColor4U &vec); // Sets LLColor4U to vec - const LLColor4U& set(const U8 *vec); // Sets LLColor4U to vec + const LLColor4U& set(U8 r, U8 g, U8 b, U8 a); // Sets LLColor4U to (r, g, b, a) + const LLColor4U& set(U8 r, U8 g, U8 b); // Sets LLColor4U to (r, g, b) (no change in a) + const LLColor4U& set(const LLColor4U& vec); // Sets LLColor4U to vec + const LLColor4U& set(const U8* vec); // Sets LLColor4U to vec - const LLColor4U& setVec(U8 r, U8 g, U8 b, U8 a); // deprecated -- use set() - const LLColor4U& setVec(U8 r, U8 g, U8 b); // deprecated -- use set() - const LLColor4U& setVec(const LLColor4U &vec); // deprecated -- use set() - const LLColor4U& setVec(const U8 *vec); // deprecated -- use set() + const LLColor4U& setVec(U8 r, U8 g, U8 b, U8 a); // deprecated -- use set() + const LLColor4U& setVec(U8 r, U8 g, U8 b); // deprecated -- use set() + const LLColor4U& setVec(const LLColor4U& vec); // deprecated -- use set() + const LLColor4U& setVec(const U8* vec); // deprecated -- use set() - const LLColor4U& setAlpha(U8 a); + const LLColor4U& setAlpha(U8 a); - F32 magVec() const; // deprecated -- use length() - F32 magVecSquared() const; // deprecated -- use lengthSquared() + F32 magVec() const; // deprecated -- use length() + F32 magVecSquared() const; // deprecated -- use lengthSquared() - F32 length() const; // Returns magnitude squared of LLColor4U - F32 lengthSquared() const; // Returns magnitude squared of LLColor4U + F32 length() const; // Returns magnitude squared of LLColor4U + F32 lengthSquared() const; // Returns magnitude squared of LLColor4U - friend std::ostream& operator<<(std::ostream& s, const LLColor4U &a); // Print a - friend LLColor4U operator+(const LLColor4U &a, const LLColor4U &b); // Return vector a + b - friend LLColor4U operator-(const LLColor4U &a, const LLColor4U &b); // Return vector a minus b - friend LLColor4U operator*(const LLColor4U &a, const LLColor4U &b); // Return a * b - friend bool operator==(const LLColor4U &a, const LLColor4U &b); // Return a == b - friend bool operator!=(const LLColor4U &a, const LLColor4U &b); // Return a != b + friend std::ostream& operator<<(std::ostream& s, const LLColor4U& a); // Print a + friend LLColor4U operator+(const LLColor4U& a, const LLColor4U& b); // Return vector a + b + friend LLColor4U operator-(const LLColor4U& a, const LLColor4U& b); // Return vector a minus b + friend LLColor4U operator*(const LLColor4U& a, const LLColor4U& b); // Return a * b + friend bool operator==(const LLColor4U& a, const LLColor4U& b); // Return a == b + friend bool operator!=(const LLColor4U& a, const LLColor4U& b); // Return a != b - friend const LLColor4U& operator+=(LLColor4U &a, const LLColor4U &b); // Return vector a + b - friend const LLColor4U& operator-=(LLColor4U &a, const LLColor4U &b); // Return vector a minus b - friend const LLColor4U& operator*=(LLColor4U &a, U8 k); // Return rgb times scaler k (no alpha change) - friend const LLColor4U& operator%=(LLColor4U &a, U8 k); // Return alpha times scaler k (no rgb change) + friend const LLColor4U& operator+=(LLColor4U& a, const LLColor4U& b); // Return vector a + b + friend const LLColor4U& operator-=(LLColor4U& a, const LLColor4U& b); // Return vector a minus b + friend const LLColor4U& operator*=(LLColor4U& a, U8 k); // Return rgb times scaler k (no alpha change) + friend const LLColor4U& operator%=(LLColor4U& a, U8 k); // Return alpha times scaler k (no rgb change) - LLColor4U addClampMax(const LLColor4U &color); // Add and clamp the max + LLColor4U addClampMax(const LLColor4U& color); // Add and clamp the max - LLColor4U multAll(const F32 k); // Multiply ALL channels by scalar k + LLColor4U multAll(const F32 k); // Multiply ALL channels by scalar k - inline void setVecScaleClamp(const LLColor3 &color); - inline void setVecScaleClamp(const LLColor4 &color); + inline void setVecScaleClamp(const LLColor3& color); + inline void setVecScaleClamp(const LLColor4& color); static bool parseColor4U(const std::string& buf, LLColor4U* value); // conversion - operator LLColor4() const - { - return LLColor4(*this); - } + operator LLColor4() const { return LLColor4(*this); } - U32 asRGBA() const; - void fromRGBA( U32 aVal ); + U32 asRGBA() const; + void fromRGBA(U32 aVal); static LLColor4U white; static LLColor4U black; @@ -134,104 +123,95 @@ public: static LLColor4U blue; }; - // Non-member functions -F32 distVec(const LLColor4U &a, const LLColor4U &b); // Returns distance between a and b -F32 distVec_squared(const LLColor4U &a, const LLColor4U &b); // Returns distance squared between a and b - +F32 distVec(const LLColor4U& a, const LLColor4U& b); // Returns distance between a and b +F32 distVec_squared(const LLColor4U& a, const LLColor4U& b); // Returns distance squared between a and b inline LLColor4U::LLColor4U() { - mV[VRED] = 0; + mV[VRED] = 0; mV[VGREEN] = 0; - mV[VBLUE] = 0; + mV[VBLUE] = 0; mV[VALPHA] = 255; } inline LLColor4U::LLColor4U(U8 r, U8 g, U8 b) { - mV[VRED] = r; + mV[VRED] = r; mV[VGREEN] = g; - mV[VBLUE] = b; + mV[VBLUE] = b; mV[VALPHA] = 255; } inline LLColor4U::LLColor4U(U8 r, U8 g, U8 b, U8 a) { - mV[VRED] = r; + mV[VRED] = r; mV[VGREEN] = g; - mV[VBLUE] = b; + mV[VBLUE] = b; mV[VALPHA] = a; } -inline LLColor4U::LLColor4U(const U8 *vec) +inline LLColor4U::LLColor4U(const U8* vec) { - mV[VRED] = vec[VRED]; + mV[VRED] = vec[VRED]; mV[VGREEN] = vec[VGREEN]; - mV[VBLUE] = vec[VBLUE]; + mV[VBLUE] = vec[VBLUE]; mV[VALPHA] = vec[VALPHA]; } -/* -inline LLColor4U::operator LLColor4() -{ - return(LLColor4((F32)mV[VRED]/255.f,(F32)mV[VGREEN]/255.f,(F32)mV[VBLUE]/255.f,(F32)mV[VALPHA]/255.f)); -} -*/ - inline const LLColor4U& LLColor4U::setToBlack(void) { - mV[VRED] = 0; + mV[VRED] = 0; mV[VGREEN] = 0; - mV[VBLUE] = 0; + mV[VBLUE] = 0; mV[VALPHA] = 255; return (*this); } inline const LLColor4U& LLColor4U::setToWhite(void) { - mV[VRED] = 255; + mV[VRED] = 255; mV[VGREEN] = 255; - mV[VBLUE] = 255; + mV[VBLUE] = 255; mV[VALPHA] = 255; return (*this); } inline const LLColor4U& LLColor4U::set(const U8 x, const U8 y, const U8 z) { - mV[VRED] = x; + mV[VRED] = x; mV[VGREEN] = y; - mV[VBLUE] = z; + mV[VBLUE] = z; -// no change to alpha! -// mV[VALPHA] = 255; + // no change to alpha! + // mV[VALPHA] = 255; return (*this); } inline const LLColor4U& LLColor4U::set(const U8 r, const U8 g, const U8 b, U8 a) { - mV[0] = r; - mV[1] = g; - mV[2] = b; - mV[3] = a; + mV[VRED] = r; + mV[VGREEN] = g; + mV[VBLUE] = b; + mV[VALPHA] = a; return (*this); } -inline const LLColor4U& LLColor4U::set(const LLColor4U &vec) +inline const LLColor4U& LLColor4U::set(const LLColor4U& vec) { - mV[VRED] = vec.mV[VRED]; + mV[VRED] = vec.mV[VRED]; mV[VGREEN] = vec.mV[VGREEN]; - mV[VBLUE] = vec.mV[VBLUE]; + mV[VBLUE] = vec.mV[VBLUE]; mV[VALPHA] = vec.mV[VALPHA]; return (*this); } -inline const LLColor4U& LLColor4U::set(const U8 *vec) +inline const LLColor4U& LLColor4U::set(const U8* vec) { - mV[VRED] = vec[VRED]; + mV[VRED] = vec[VRED]; mV[VGREEN] = vec[VGREEN]; - mV[VBLUE] = vec[VBLUE]; + mV[VBLUE] = vec[VBLUE]; mV[VALPHA] = vec[VALPHA]; return (*this); } @@ -239,12 +219,12 @@ inline const LLColor4U& LLColor4U::set(const U8 *vec) // deprecated inline const LLColor4U& LLColor4U::setVec(const U8 x, const U8 y, const U8 z) { - mV[VRED] = x; + mV[VRED] = x; mV[VGREEN] = y; - mV[VBLUE] = z; + mV[VBLUE] = z; -// no change to alpha! -// mV[VALPHA] = 255; + // no change to alpha! + // mV[VALPHA] = 255; return (*this); } @@ -252,29 +232,29 @@ inline const LLColor4U& LLColor4U::setVec(const U8 x, const U8 y, const U8 z) // deprecated inline const LLColor4U& LLColor4U::setVec(const U8 r, const U8 g, const U8 b, U8 a) { - mV[0] = r; - mV[1] = g; - mV[2] = b; - mV[3] = a; + mV[VRED] = r; + mV[VGREEN] = g; + mV[VBLUE] = b; + mV[VALPHA] = a; return (*this); } // deprecated -inline const LLColor4U& LLColor4U::setVec(const LLColor4U &vec) +inline const LLColor4U& LLColor4U::setVec(const LLColor4U& vec) { - mV[VRED] = vec.mV[VRED]; + mV[VRED] = vec.mV[VRED]; mV[VGREEN] = vec.mV[VGREEN]; - mV[VBLUE] = vec.mV[VBLUE]; + mV[VBLUE] = vec.mV[VBLUE]; mV[VALPHA] = vec.mV[VALPHA]; return (*this); } // deprecated -inline const LLColor4U& LLColor4U::setVec(const U8 *vec) +inline const LLColor4U& LLColor4U::setVec(const U8* vec) { - mV[VRED] = vec[VRED]; + mV[VRED] = vec[VRED]; mV[VGREEN] = vec[VGREEN]; - mV[VBLUE] = vec[VBLUE]; + mV[VBLUE] = vec[VBLUE]; mV[VALPHA] = vec[VALPHA]; return (*this); } @@ -287,131 +267,68 @@ inline const LLColor4U& LLColor4U::setAlpha(U8 a) // LLColor4U Magnitude and Normalization Functions -inline F32 LLColor4U::length(void) const +inline F32 LLColor4U::length() const { - return (F32) sqrt( ((F32)mV[VRED]) * mV[VRED] + ((F32)mV[VGREEN]) * mV[VGREEN] + ((F32)mV[VBLUE]) * mV[VBLUE] ); + return sqrt(((F32)mV[VRED]) * mV[VRED] + ((F32)mV[VGREEN]) * mV[VGREEN] + ((F32)mV[VBLUE]) * mV[VBLUE]); } -inline F32 LLColor4U::lengthSquared(void) const +inline F32 LLColor4U::lengthSquared() const { return ((F32)mV[VRED]) * mV[VRED] + ((F32)mV[VGREEN]) * mV[VGREEN] + ((F32)mV[VBLUE]) * mV[VBLUE]; } // deprecated -inline F32 LLColor4U::magVec(void) const +inline F32 LLColor4U::magVec() const { - return (F32) sqrt( ((F32)mV[VRED]) * mV[VRED] + ((F32)mV[VGREEN]) * mV[VGREEN] + ((F32)mV[VBLUE]) * mV[VBLUE] ); + return sqrt(((F32)mV[VRED]) * mV[VRED] + ((F32)mV[VGREEN]) * mV[VGREEN] + ((F32)mV[VBLUE]) * mV[VBLUE]); } // deprecated -inline F32 LLColor4U::magVecSquared(void) const +inline F32 LLColor4U::magVecSquared() const { return ((F32)mV[VRED]) * mV[VRED] + ((F32)mV[VGREEN]) * mV[VGREEN] + ((F32)mV[VBLUE]) * mV[VBLUE]; } -inline LLColor4U operator+(const LLColor4U &a, const LLColor4U &b) +inline LLColor4U operator+(const LLColor4U& a, const LLColor4U& b) { - return LLColor4U( - a.mV[VRED] + b.mV[VRED], - a.mV[VGREEN] + b.mV[VGREEN], - a.mV[VBLUE] + b.mV[VBLUE], - a.mV[VALPHA] + b.mV[VALPHA]); + return LLColor4U(a.mV[VRED] + b.mV[VRED], a.mV[VGREEN] + b.mV[VGREEN], a.mV[VBLUE] + b.mV[VBLUE], a.mV[VALPHA] + b.mV[VALPHA]); } -inline LLColor4U operator-(const LLColor4U &a, const LLColor4U &b) +inline LLColor4U operator-(const LLColor4U& a, const LLColor4U& b) { - return LLColor4U( - a.mV[VRED] - b.mV[VRED], - a.mV[VGREEN] - b.mV[VGREEN], - a.mV[VBLUE] - b.mV[VBLUE], - a.mV[VALPHA] - b.mV[VALPHA]); + return LLColor4U(a.mV[VRED] - b.mV[VRED], a.mV[VGREEN] - b.mV[VGREEN], a.mV[VBLUE] - b.mV[VBLUE], a.mV[VALPHA] - b.mV[VALPHA]); } -inline LLColor4U operator*(const LLColor4U &a, const LLColor4U &b) +inline LLColor4U operator*(const LLColor4U& a, const LLColor4U& b) { - return LLColor4U( - a.mV[VRED] * b.mV[VRED], - a.mV[VGREEN] * b.mV[VGREEN], - a.mV[VBLUE] * b.mV[VBLUE], - a.mV[VALPHA] * b.mV[VALPHA]); + return LLColor4U(a.mV[VRED] * b.mV[VRED], a.mV[VGREEN] * b.mV[VGREEN], a.mV[VBLUE] * b.mV[VBLUE], a.mV[VALPHA] * b.mV[VALPHA]); } -inline LLColor4U LLColor4U::addClampMax(const LLColor4U &color) +inline LLColor4U LLColor4U::addClampMax(const LLColor4U& color) { return LLColor4U(llmin((S32)mV[VRED] + color.mV[VRED], 255), - llmin((S32)mV[VGREEN] + color.mV[VGREEN], 255), - llmin((S32)mV[VBLUE] + color.mV[VBLUE], 255), - llmin((S32)mV[VALPHA] + color.mV[VALPHA], 255)); + llmin((S32)mV[VGREEN] + color.mV[VGREEN], 255), + llmin((S32)mV[VBLUE] + color.mV[VBLUE], 255), + llmin((S32)mV[VALPHA] + color.mV[VALPHA], 255)); } inline LLColor4U LLColor4U::multAll(const F32 k) { // Round to nearest - return LLColor4U( - (U8)ll_round(mV[VRED] * k), - (U8)ll_round(mV[VGREEN] * k), - (U8)ll_round(mV[VBLUE] * k), - (U8)ll_round(mV[VALPHA] * k)); -} -/* -inline LLColor4U operator*(const LLColor4U &a, U8 k) -{ - // only affects rgb (not a!) - return LLColor4U( - a.mV[VRED] * k, - a.mV[VGREEN] * k, - a.mV[VBLUE] * k, - a.mV[VALPHA]); + return LLColor4U((U8)ll_round(mV[VRED] * k), (U8)ll_round(mV[VGREEN] * k), (U8)ll_round(mV[VBLUE] * k), (U8)ll_round(mV[VALPHA] * k)); } -inline LLColor4U operator*(U8 k, const LLColor4U &a) +inline bool operator==(const LLColor4U& a, const LLColor4U& b) { - // only affects rgb (not a!) - return LLColor4U( - a.mV[VRED] * k, - a.mV[VGREEN] * k, - a.mV[VBLUE] * k, - a.mV[VALPHA]); + return ((a.mV[VRED] == b.mV[VRED]) && (a.mV[VGREEN] == b.mV[VGREEN]) && (a.mV[VBLUE] == b.mV[VBLUE]) && (a.mV[VALPHA] == b.mV[VALPHA])); } -inline LLColor4U operator%(U8 k, const LLColor4U &a) +inline bool operator!=(const LLColor4U& a, const LLColor4U& b) { - // only affects alpha (not rgb!) - return LLColor4U( - a.mV[VRED], - a.mV[VGREEN], - a.mV[VBLUE], - a.mV[VALPHA] * k ); + return ((a.mV[VRED] != b.mV[VRED]) || (a.mV[VGREEN] != b.mV[VGREEN]) || (a.mV[VBLUE] != b.mV[VBLUE]) || (a.mV[VALPHA] != b.mV[VALPHA])); } -inline LLColor4U operator%(const LLColor4U &a, U8 k) -{ - // only affects alpha (not rgb!) - return LLColor4U( - a.mV[VRED], - a.mV[VGREEN], - a.mV[VBLUE], - a.mV[VALPHA] * k ); -} -*/ - -inline bool operator==(const LLColor4U &a, const LLColor4U &b) -{ - return ( (a.mV[VRED] == b.mV[VRED]) - &&(a.mV[VGREEN] == b.mV[VGREEN]) - &&(a.mV[VBLUE] == b.mV[VBLUE]) - &&(a.mV[VALPHA] == b.mV[VALPHA])); -} - -inline bool operator!=(const LLColor4U &a, const LLColor4U &b) -{ - return ( (a.mV[VRED] != b.mV[VRED]) - ||(a.mV[VGREEN] != b.mV[VGREEN]) - ||(a.mV[VBLUE] != b.mV[VBLUE]) - ||(a.mV[VALPHA] != b.mV[VALPHA])); -} - -inline const LLColor4U& operator+=(LLColor4U &a, const LLColor4U &b) +inline const LLColor4U& operator+=(LLColor4U& a, const LLColor4U& b) { a.mV[VRED] += b.mV[VRED]; a.mV[VGREEN] += b.mV[VGREEN]; @@ -420,7 +337,7 @@ inline const LLColor4U& operator+=(LLColor4U &a, const LLColor4U &b) return a; } -inline const LLColor4U& operator-=(LLColor4U &a, const LLColor4U &b) +inline const LLColor4U& operator-=(LLColor4U& a, const LLColor4U& b) { a.mV[VRED] -= b.mV[VRED]; a.mV[VGREEN] -= b.mV[VGREEN]; @@ -429,7 +346,7 @@ inline const LLColor4U& operator-=(LLColor4U &a, const LLColor4U &b) return a; } -inline const LLColor4U& operator*=(LLColor4U &a, U8 k) +inline const LLColor4U& operator*=(LLColor4U& a, U8 k) { // only affects rgb (not a!) a.mV[VRED] *= k; @@ -438,20 +355,20 @@ inline const LLColor4U& operator*=(LLColor4U &a, U8 k) return a; } -inline const LLColor4U& operator%=(LLColor4U &a, U8 k) +inline const LLColor4U& operator%=(LLColor4U& a, U8 k) { // only affects alpha (not rgb!) a.mV[VALPHA] *= k; return a; } -inline F32 distVec(const LLColor4U &a, const LLColor4U &b) +inline F32 distVec(const LLColor4U& a, const LLColor4U& b) { LLColor4U vec = a - b; return (vec.length()); } -inline F32 distVec_squared(const LLColor4U &a, const LLColor4U &b) +inline F32 distVec_squared(const LLColor4U& a, const LLColor4U& b) { LLColor4U vec = a - b; return (vec.lengthSquared()); @@ -460,13 +377,13 @@ inline F32 distVec_squared(const LLColor4U &a, const LLColor4U &b) void LLColor4U::setVecScaleClamp(const LLColor4& color) { F32 color_scale_factor = 255.f; - F32 max_color = llmax(color.mV[0], color.mV[1], color.mV[2]); + F32 max_color = llmax(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE]); if (max_color > 1.f) { color_scale_factor /= max_color; } - const S32 MAX_COLOR = 255; - S32 r = ll_round(color.mV[0] * color_scale_factor); + constexpr S32 MAX_COLOR = 255; + S32 r = ll_round(color.mV[VRED] * color_scale_factor); if (r > MAX_COLOR) { r = MAX_COLOR; @@ -475,9 +392,9 @@ void LLColor4U::setVecScaleClamp(const LLColor4& color) { r = 0; } - mV[0] = r; + mV[VRED] = r; - S32 g = ll_round(color.mV[1] * color_scale_factor); + S32 g = ll_round(color.mV[VGREEN] * color_scale_factor); if (g > MAX_COLOR) { g = MAX_COLOR; @@ -486,9 +403,9 @@ void LLColor4U::setVecScaleClamp(const LLColor4& color) { g = 0; } - mV[1] = g; + mV[VGREEN] = g; - S32 b = ll_round(color.mV[2] * color_scale_factor); + S32 b = ll_round(color.mV[VBLUE] * color_scale_factor); if (b > MAX_COLOR) { b = MAX_COLOR; @@ -497,10 +414,10 @@ void LLColor4U::setVecScaleClamp(const LLColor4& color) { b = 0; } - mV[2] = b; + mV[VBLUE] = b; // Alpha shouldn't be scaled, just clamped... - S32 a = ll_round(color.mV[3] * MAX_COLOR); + S32 a = ll_round(color.mV[VALPHA] * MAX_COLOR); if (a > MAX_COLOR) { a = MAX_COLOR; @@ -509,44 +426,42 @@ void LLColor4U::setVecScaleClamp(const LLColor4& color) { a = 0; } - mV[3] = a; + mV[VALPHA] = a; } void LLColor4U::setVecScaleClamp(const LLColor3& color) { F32 color_scale_factor = 255.f; - F32 max_color = llmax(color.mV[0], color.mV[1], color.mV[2]); + F32 max_color = llmax(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE]); if (max_color > 1.f) { color_scale_factor /= max_color; } const S32 MAX_COLOR = 255; - S32 r = ll_round(color.mV[0] * color_scale_factor); + S32 r = ll_round(color.mV[VRED] * color_scale_factor); if (r > MAX_COLOR) { r = MAX_COLOR; } - else - if (r < 0) + else if (r < 0) { r = 0; } - mV[0] = r; + mV[VRED] = r; - S32 g = ll_round(color.mV[1] * color_scale_factor); + S32 g = ll_round(color.mV[VGREEN] * color_scale_factor); if (g > MAX_COLOR) { g = MAX_COLOR; } - else - if (g < 0) + else if (g < 0) { g = 0; } - mV[1] = g; + mV[VGREEN] = g; - S32 b = ll_round(color.mV[2] * color_scale_factor); + S32 b = ll_round(color.mV[VBLUE] * color_scale_factor); if (b > MAX_COLOR) { b = MAX_COLOR; @@ -555,31 +470,29 @@ void LLColor4U::setVecScaleClamp(const LLColor3& color) { b = 0; } - mV[2] = b; + mV[VBLUE] = b; - mV[3] = 255; + mV[VALPHA] = 255; } inline U32 LLColor4U::asRGBA() const { // Little endian: values are swapped in memory. The original code access the array like a U32, so we need to swap here - return (mV[3] << 24) | (mV[2] << 16) | (mV[1] << 8) | mV[0]; + return (mV[VALPHA] << 24) | (mV[VBLUE] << 16) | (mV[VGREEN] << 8) | mV[VRED]; } -inline void LLColor4U::fromRGBA( U32 aVal ) +inline void LLColor4U::fromRGBA(U32 aVal) { // Little endian: values are swapped in memory. The original code access the array like a U32, so we need to swap here - mV[ 0 ] = aVal & 0xFF; + mV[VRED] = aVal & 0xFF; aVal >>= 8; - mV[ 1 ] = aVal & 0xFF; + mV[VGREEN] = aVal & 0xFF; aVal >>= 8; - mV[ 2 ] = aVal & 0xFF; + mV[VBLUE] = aVal & 0xFF; aVal >>= 8; - mV[ 3 ] = aVal & 0xFF; + mV[VALPHA] = aVal & 0xFF; } - #endif - diff --git a/indra/llmath/v4math.cpp b/indra/llmath/v4math.cpp index 0aa6eb09c3..cd475380d6 100644 --- a/indra/llmath/v4math.cpp +++ b/indra/llmath/v4math.cpp @@ -26,7 +26,6 @@ #include "linden_common.h" -//#include "vmath.h" #include "v3math.h" #include "v4math.h" #include "m4math.h" @@ -36,13 +35,13 @@ // LLVector4 // Axis-Angle rotations -const LLVector4& LLVector4::rotVec(const LLMatrix4 &mat) +const LLVector4& LLVector4::rotVec(const LLMatrix4& mat) { *this = *this * mat; return *this; } -const LLVector4& LLVector4::rotVec(const LLQuaternion &q) +const LLVector4& LLVector4::rotVec(const LLQuaternion& q) { *this = *this * q; return *this; @@ -64,16 +63,16 @@ bool LLVector4::abs() { bool ret{ false }; - if (mV[0] < 0.f) { mV[0] = -mV[0]; ret = true; } - if (mV[1] < 0.f) { mV[1] = -mV[1]; ret = true; } - if (mV[2] < 0.f) { mV[2] = -mV[2]; ret = true; } - if (mV[3] < 0.f) { mV[3] = -mV[3]; ret = true; } + if (mV[VX] < 0.f) { mV[VX] = -mV[VX]; ret = true; } + if (mV[VY] < 0.f) { mV[VY] = -mV[VY]; ret = true; } + if (mV[VZ] < 0.f) { mV[VZ] = -mV[VZ]; ret = true; } + if (mV[VW] < 0.f) { mV[VW] = -mV[VW]; ret = true; } return ret; } -std::ostream& operator<<(std::ostream& s, const LLVector4 &a) +std::ostream& operator<<(std::ostream& s, const LLVector4& a) { s << "{ " << a.mV[VX] << ", " << a.mV[VY] << ", " << a.mV[VZ] << ", " << a.mV[VW] << " }"; return s; @@ -108,12 +107,12 @@ bool are_parallel(const LLVector4 &a, const LLVector4 &b, F32 epsilon) } -LLVector3 vec4to3(const LLVector4 &vec) +LLVector3 vec4to3(const LLVector4& vec) { return LLVector3( vec.mV[VX], vec.mV[VY], vec.mV[VZ] ); } -LLVector4 vec3to4(const LLVector3 &vec) +LLVector4 vec3to4(const LLVector3& vec) { return LLVector4(vec.mV[VX], vec.mV[VY], vec.mV[VZ]); } diff --git a/indra/llmath/v4math.h b/indra/llmath/v4math.h index a4c9668fdd..37492e7f98 100644 --- a/indra/llmath/v4math.h +++ b/indra/llmath/v4math.h @@ -42,108 +42,108 @@ class LLQuaternion; // LLVector4 = |x y z w| -static const U32 LENGTHOFVECTOR4 = 4; +static constexpr U32 LENGTHOFVECTOR4 = 4; class LLVector4 { - public: - F32 mV[LENGTHOFVECTOR4]; - LLVector4(); // Initializes LLVector4 to (0, 0, 0, 1) - explicit LLVector4(const F32 *vec); // Initializes LLVector4 to (vec[0]. vec[1], vec[2], vec[3]) - explicit LLVector4(const F64 *vec); // Initialized LLVector4 to ((F32) vec[0], (F32) vec[1], (F32) vec[3], (F32) vec[4]); - explicit LLVector4(const LLVector2 &vec); - explicit LLVector4(const LLVector2 &vec, F32 z, F32 w); - explicit LLVector4(const LLVector3 &vec); // Initializes LLVector4 to (vec, 1) - explicit LLVector4(const LLVector3 &vec, F32 w); // Initializes LLVector4 to (vec, w) - explicit LLVector4(const LLSD &sd); - LLVector4(F32 x, F32 y, F32 z); // Initializes LLVector4 to (x. y, z, 1) - LLVector4(F32 x, F32 y, F32 z, F32 w); - - LLSD getValue() const - { - LLSD ret; - ret[0] = mV[0]; - ret[1] = mV[1]; - ret[2] = mV[2]; - ret[3] = mV[3]; - return ret; - } - - void setValue(const LLSD& sd) - { - mV[0] = (F32)sd[0].asReal(); - mV[1] = (F32)sd[1].asReal(); - mV[2] = (F32)sd[2].asReal(); - mV[3] = (F32)sd[3].asReal(); - } - - // GLM interop - explicit LLVector4(const glm::vec3& vec); // Initializes LLVector4 to (vec, 1) - explicit LLVector4(const glm::vec4& vec); // Initializes LLVector4 to vec - explicit operator glm::vec3() const; // Initializes glm::vec3 to (vec[0]. vec[1], vec[2]) - explicit operator glm::vec4() const; // Initializes glm::vec4 to (vec[0]. vec[1], vec[2], vec[3]) - - inline bool isFinite() const; // checks to see if all values of LLVector3 are finite - - inline void clear(); // Clears LLVector4 to (0, 0, 0, 1) - inline void clearVec(); // deprecated - inline void zeroVec(); // deprecated - - inline void set(F32 x, F32 y, F32 z); // Sets LLVector4 to (x, y, z, 1) - inline void set(F32 x, F32 y, F32 z, F32 w); // Sets LLVector4 to (x, y, z, w) - inline void set(const LLVector4 &vec); // Sets LLVector4 to vec - inline void set(const LLVector3 &vec, F32 w = 1.f); // Sets LLVector4 to LLVector3 vec - inline void set(const F32 *vec); // Sets LLVector4 to vec - inline void set(const glm::vec4& vec); // Sets LLVector4 to vec - inline void set(const glm::vec3& vec, F32 w = 1.f); // Sets LLVector4 to LLVector3 vec with w defaulted to 1 - - inline void setVec(F32 x, F32 y, F32 z); // deprecated - inline void setVec(F32 x, F32 y, F32 z, F32 w); // deprecated - inline void setVec(const LLVector4 &vec); // deprecated - inline void setVec(const LLVector3 &vec, F32 w = 1.f); // deprecated - inline void setVec(const F32 *vec); // deprecated - - F32 length() const; // Returns magnitude of LLVector4 - F32 lengthSquared() const; // Returns magnitude squared of LLVector4 - F32 normalize(); // Normalizes and returns the magnitude of LLVector4 - - F32 magVec() const; // deprecated - F32 magVecSquared() const; // deprecated - F32 normVec(); // deprecated - - // Sets all values to absolute value of their original values - // Returns true if data changed - bool abs(); - - bool isExactlyClear() const { return (mV[VW] == 1.0f) && !mV[VX] && !mV[VY] && !mV[VZ]; } - bool isExactlyZero() const { return !mV[VW] && !mV[VX] && !mV[VY] && !mV[VZ]; } - - const LLVector4& rotVec(const LLMatrix4 &mat); // Rotates by MAT4 mat - const LLVector4& rotVec(const LLQuaternion &q); // Rotates by QUAT q - - const LLVector4& scaleVec(const LLVector4& vec); // Scales component-wise by vec - - F32 operator[](int idx) const { return mV[idx]; } - F32 &operator[](int idx) { return mV[idx]; } - - friend std::ostream& operator<<(std::ostream& s, const LLVector4 &a); // Print a - friend LLVector4 operator+(const LLVector4 &a, const LLVector4 &b); // Return vector a + b - friend LLVector4 operator-(const LLVector4 &a, const LLVector4 &b); // Return vector a minus b - friend F32 operator*(const LLVector4 &a, const LLVector4 &b); // Return a dot b - friend LLVector4 operator%(const LLVector4 &a, const LLVector4 &b); // Return a cross b - friend LLVector4 operator/(const LLVector4 &a, F32 k); // Return a divided by scaler k - friend LLVector4 operator*(const LLVector4 &a, F32 k); // Return a times scaler k - friend LLVector4 operator*(F32 k, const LLVector4 &a); // Return a times scaler k - friend bool operator==(const LLVector4 &a, const LLVector4 &b); // Return a == b - friend bool operator!=(const LLVector4 &a, const LLVector4 &b); // Return a != b - - friend const LLVector4& operator+=(LLVector4 &a, const LLVector4 &b); // Return vector a + b - friend const LLVector4& operator-=(LLVector4 &a, const LLVector4 &b); // Return vector a minus b - friend const LLVector4& operator%=(LLVector4 &a, const LLVector4 &b); // Return a cross b - friend const LLVector4& operator*=(LLVector4 &a, F32 k); // Return a times scaler k - friend const LLVector4& operator/=(LLVector4 &a, F32 k); // Return a divided by scaler k - - friend LLVector4 operator-(const LLVector4 &a); // Return vector -a +public: + F32 mV[LENGTHOFVECTOR4]; + LLVector4(); // Initializes LLVector4 to (0, 0, 0, 1) + explicit LLVector4(const F32 *vec); // Initializes LLVector4 to (vec[0]. vec[1], vec[2], vec[3]) + explicit LLVector4(const F64 *vec); // Initialized LLVector4 to ((F32) vec[0], (F32) vec[1], (F32) vec[3], (F32) vec[4]); + explicit LLVector4(const LLVector2 &vec); + explicit LLVector4(const LLVector2 &vec, F32 z, F32 w); + explicit LLVector4(const LLVector3 &vec); // Initializes LLVector4 to (vec, 1) + explicit LLVector4(const LLVector3 &vec, F32 w); // Initializes LLVector4 to (vec, w) + explicit LLVector4(const LLSD &sd); + LLVector4(F32 x, F32 y, F32 z); // Initializes LLVector4 to (x. y, z, 1) + LLVector4(F32 x, F32 y, F32 z, F32 w); + + LLSD getValue() const + { + LLSD ret; + ret[VX] = mV[VX]; + ret[VY] = mV[VY]; + ret[VZ] = mV[VZ]; + ret[VW] = mV[VW]; + return ret; + } + + void setValue(const LLSD& sd) + { + mV[VX] = (F32)sd[VX].asReal(); + mV[VY] = (F32)sd[VY].asReal(); + mV[VZ] = (F32)sd[VZ].asReal(); + mV[VW] = (F32)sd[VW].asReal(); + } + + // GLM interop + explicit LLVector4(const glm::vec3& vec); // Initializes LLVector4 to (vec, 1) + explicit LLVector4(const glm::vec4& vec); // Initializes LLVector4 to vec + explicit operator glm::vec3() const; // Initializes glm::vec3 to (vec[0]. vec[1], vec[2]) + explicit operator glm::vec4() const; // Initializes glm::vec4 to (vec[0]. vec[1], vec[2], vec[3]) + + inline bool isFinite() const; // checks to see if all values of LLVector3 are finite + + inline void clear(); // Clears LLVector4 to (0, 0, 0, 1) + inline void clearVec(); // deprecated + inline void zeroVec(); // deprecated + + inline void set(F32 x, F32 y, F32 z); // Sets LLVector4 to (x, y, z, 1) + inline void set(F32 x, F32 y, F32 z, F32 w); // Sets LLVector4 to (x, y, z, w) + inline void set(const LLVector4 &vec); // Sets LLVector4 to vec + inline void set(const LLVector3 &vec, F32 w = 1.f); // Sets LLVector4 to LLVector3 vec + inline void set(const F32 *vec); // Sets LLVector4 to vec + inline void set(const glm::vec4& vec); // Sets LLVector4 to vec + inline void set(const glm::vec3& vec, F32 w = 1.f); // Sets LLVector4 to LLVector3 vec with w defaulted to 1 + + inline void setVec(F32 x, F32 y, F32 z); // deprecated + inline void setVec(F32 x, F32 y, F32 z, F32 w); // deprecated + inline void setVec(const LLVector4 &vec); // deprecated + inline void setVec(const LLVector3 &vec, F32 w = 1.f); // deprecated + inline void setVec(const F32 *vec); // deprecated + + F32 length() const; // Returns magnitude of LLVector4 + F32 lengthSquared() const; // Returns magnitude squared of LLVector4 + F32 normalize(); // Normalizes and returns the magnitude of LLVector4 + + F32 magVec() const; // deprecated + F32 magVecSquared() const; // deprecated + F32 normVec(); // deprecated + + // Sets all values to absolute value of their original values + // Returns true if data changed + bool abs(); + + bool isExactlyClear() const { return (mV[VW] == 1.0f) && !mV[VX] && !mV[VY] && !mV[VZ]; } + bool isExactlyZero() const { return !mV[VW] && !mV[VX] && !mV[VY] && !mV[VZ]; } + + const LLVector4& rotVec(const LLMatrix4 &mat); // Rotates by MAT4 mat + const LLVector4& rotVec(const LLQuaternion &q); // Rotates by QUAT q + + const LLVector4& scaleVec(const LLVector4& vec); // Scales component-wise by vec + + F32 operator[](int idx) const { return mV[idx]; } + F32 &operator[](int idx) { return mV[idx]; } + + friend std::ostream& operator<<(std::ostream& s, const LLVector4 &a); // Print a + friend LLVector4 operator+(const LLVector4 &a, const LLVector4 &b); // Return vector a + b + friend LLVector4 operator-(const LLVector4 &a, const LLVector4 &b); // Return vector a minus b + friend F32 operator*(const LLVector4 &a, const LLVector4 &b); // Return a dot b + friend LLVector4 operator%(const LLVector4 &a, const LLVector4 &b); // Return a cross b + friend LLVector4 operator/(const LLVector4 &a, F32 k); // Return a divided by scaler k + friend LLVector4 operator*(const LLVector4 &a, F32 k); // Return a times scaler k + friend LLVector4 operator*(F32 k, const LLVector4 &a); // Return a times scaler k + friend bool operator==(const LLVector4 &a, const LLVector4 &b); // Return a == b + friend bool operator!=(const LLVector4 &a, const LLVector4 &b); // Return a != b + + friend const LLVector4& operator+=(LLVector4 &a, const LLVector4 &b); // Return vector a + b + friend const LLVector4& operator-=(LLVector4 &a, const LLVector4 &b); // Return vector a minus b + friend const LLVector4& operator%=(LLVector4 &a, const LLVector4 &b); // Return a cross b + friend const LLVector4& operator*=(LLVector4 &a, F32 k); // Return a times scaler k + friend const LLVector4& operator/=(LLVector4 &a, F32 k); // Return a divided by scaler k + + friend LLVector4 operator-(const LLVector4 &a); // Return vector -a }; // Non-member functions @@ -257,7 +257,7 @@ inline bool LLVector4::isFinite() const // Clear and Assignment Functions -inline void LLVector4::clear(void) +inline void LLVector4::clear() { mV[VX] = 0.f; mV[VY] = 0.f; @@ -266,7 +266,7 @@ inline void LLVector4::clear(void) } // deprecated -inline void LLVector4::clearVec(void) +inline void LLVector4::clearVec() { mV[VX] = 0.f; mV[VY] = 0.f; @@ -275,7 +275,7 @@ inline void LLVector4::clearVec(void) } // deprecated -inline void LLVector4::zeroVec(void) +inline void LLVector4::zeroVec() { mV[VX] = 0.f; mV[VY] = 0.f; @@ -299,7 +299,7 @@ inline void LLVector4::set(F32 x, F32 y, F32 z, F32 w) mV[VW] = w; } -inline void LLVector4::set(const LLVector4 &vec) +inline void LLVector4::set(const LLVector4& vec) { mV[VX] = vec.mV[VX]; mV[VY] = vec.mV[VY]; @@ -307,7 +307,7 @@ inline void LLVector4::set(const LLVector4 &vec) mV[VW] = vec.mV[VW]; } -inline void LLVector4::set(const LLVector3 &vec, F32 w) +inline void LLVector4::set(const LLVector3& vec, F32 w) { mV[VX] = vec.mV[VX]; mV[VY] = vec.mV[VY]; @@ -315,7 +315,7 @@ inline void LLVector4::set(const LLVector3 &vec, F32 w) mV[VW] = w; } -inline void LLVector4::set(const F32 *vec) +inline void LLVector4::set(const F32* vec) { mV[VX] = vec[VX]; mV[VY] = vec[VY]; @@ -358,7 +358,7 @@ inline void LLVector4::setVec(F32 x, F32 y, F32 z, F32 w) } // deprecated -inline void LLVector4::setVec(const LLVector4 &vec) +inline void LLVector4::setVec(const LLVector4& vec) { mV[VX] = vec.mV[VX]; mV[VY] = vec.mV[VY]; @@ -367,7 +367,7 @@ inline void LLVector4::setVec(const LLVector4 &vec) } // deprecated -inline void LLVector4::setVec(const LLVector3 &vec, F32 w) +inline void LLVector4::setVec(const LLVector3& vec, F32 w) { mV[VX] = vec.mV[VX]; mV[VY] = vec.mV[VY]; @@ -376,7 +376,7 @@ inline void LLVector4::setVec(const LLVector3 &vec, F32 w) } // deprecated -inline void LLVector4::setVec(const F32 *vec) +inline void LLVector4::setVec(const F32* vec) { mV[VX] = vec[VX]; mV[VY] = vec[VY]; @@ -386,75 +386,75 @@ inline void LLVector4::setVec(const F32 *vec) // LLVector4 Magnitude and Normalization Functions -inline F32 LLVector4::length(void) const +inline F32 LLVector4::length() const { - return (F32) sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]); + return sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]); } -inline F32 LLVector4::lengthSquared(void) const +inline F32 LLVector4::lengthSquared() const { return mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]; } -inline F32 LLVector4::magVec(void) const +inline F32 LLVector4::magVec() const { - return (F32) sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]); + return sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]); } -inline F32 LLVector4::magVecSquared(void) const +inline F32 LLVector4::magVecSquared() const { return mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]; } // LLVector4 Operators -inline LLVector4 operator+(const LLVector4 &a, const LLVector4 &b) +inline LLVector4 operator+(const LLVector4& a, const LLVector4& b) { LLVector4 c(a); return c += b; } -inline LLVector4 operator-(const LLVector4 &a, const LLVector4 &b) +inline LLVector4 operator-(const LLVector4& a, const LLVector4& b) { LLVector4 c(a); return c -= b; } -inline F32 operator*(const LLVector4 &a, const LLVector4 &b) +inline F32 operator*(const LLVector4& a, const LLVector4& b) { return (a.mV[VX]*b.mV[VX] + a.mV[VY]*b.mV[VY] + a.mV[VZ]*b.mV[VZ]); } -inline LLVector4 operator%(const LLVector4 &a, const LLVector4 &b) +inline LLVector4 operator%(const LLVector4& a, const LLVector4& b) { return LLVector4(a.mV[VY]*b.mV[VZ] - b.mV[VY]*a.mV[VZ], a.mV[VZ]*b.mV[VX] - b.mV[VZ]*a.mV[VX], a.mV[VX]*b.mV[VY] - b.mV[VX]*a.mV[VY]); } -inline LLVector4 operator/(const LLVector4 &a, F32 k) +inline LLVector4 operator/(const LLVector4& a, F32 k) { F32 t = 1.f / k; return LLVector4( a.mV[VX] * t, a.mV[VY] * t, a.mV[VZ] * t ); } -inline LLVector4 operator*(const LLVector4 &a, F32 k) +inline LLVector4 operator*(const LLVector4& a, F32 k) { return LLVector4( a.mV[VX] * k, a.mV[VY] * k, a.mV[VZ] * k ); } -inline LLVector4 operator*(F32 k, const LLVector4 &a) +inline LLVector4 operator*(F32 k, const LLVector4& a) { return LLVector4( a.mV[VX] * k, a.mV[VY] * k, a.mV[VZ] * k ); } -inline bool operator==(const LLVector4 &a, const LLVector4 &b) +inline bool operator==(const LLVector4& a, const LLVector4& b) { return ( (a.mV[VX] == b.mV[VX]) &&(a.mV[VY] == b.mV[VY]) &&(a.mV[VZ] == b.mV[VZ])); } -inline bool operator!=(const LLVector4 &a, const LLVector4 &b) +inline bool operator!=(const LLVector4& a, const LLVector4& b) { return ( (a.mV[VX] != b.mV[VX]) ||(a.mV[VY] != b.mV[VY]) @@ -462,7 +462,7 @@ inline bool operator!=(const LLVector4 &a, const LLVector4 &b) ||(a.mV[VW] != b.mV[VW]) ); } -inline const LLVector4& operator+=(LLVector4 &a, const LLVector4 &b) +inline const LLVector4& operator+=(LLVector4& a, const LLVector4& b) { a.mV[VX] += b.mV[VX]; a.mV[VY] += b.mV[VY]; @@ -470,7 +470,7 @@ inline const LLVector4& operator+=(LLVector4 &a, const LLVector4 &b) return a; } -inline const LLVector4& operator-=(LLVector4 &a, const LLVector4 &b) +inline const LLVector4& operator-=(LLVector4& a, const LLVector4& b) { a.mV[VX] -= b.mV[VX]; a.mV[VY] -= b.mV[VY]; @@ -478,14 +478,14 @@ inline const LLVector4& operator-=(LLVector4 &a, const LLVector4 &b) return a; } -inline const LLVector4& operator%=(LLVector4 &a, const LLVector4 &b) +inline const LLVector4& operator%=(LLVector4& a, const LLVector4& b) { LLVector4 ret(a.mV[VY]*b.mV[VZ] - b.mV[VY]*a.mV[VZ], a.mV[VZ]*b.mV[VX] - b.mV[VZ]*a.mV[VX], a.mV[VX]*b.mV[VY] - b.mV[VX]*a.mV[VY]); a = ret; return a; } -inline const LLVector4& operator*=(LLVector4 &a, F32 k) +inline const LLVector4& operator*=(LLVector4& a, F32 k) { a.mV[VX] *= k; a.mV[VY] *= k; @@ -493,7 +493,7 @@ inline const LLVector4& operator*=(LLVector4 &a, F32 k) return a; } -inline const LLVector4& operator/=(LLVector4 &a, F32 k) +inline const LLVector4& operator/=(LLVector4& a, F32 k) { F32 t = 1.f / k; a.mV[VX] *= t; @@ -502,7 +502,7 @@ inline const LLVector4& operator/=(LLVector4 &a, F32 k) return a; } -inline LLVector4 operator-(const LLVector4 &a) +inline LLVector4 operator-(const LLVector4& a) { return LLVector4( -a.mV[VX], -a.mV[VY], -a.mV[VZ] ); } @@ -517,19 +517,19 @@ inline LLVector4::operator glm::vec4() const return glm::make_vec4(mV); } -inline F32 dist_vec(const LLVector4 &a, const LLVector4 &b) +inline F32 dist_vec(const LLVector4& a, const LLVector4& b) { LLVector4 vec = a - b; return (vec.length()); } -inline F32 dist_vec_squared(const LLVector4 &a, const LLVector4 &b) +inline F32 dist_vec_squared(const LLVector4& a, const LLVector4& b) { LLVector4 vec = a - b; return (vec.lengthSquared()); } -inline LLVector4 lerp(const LLVector4 &a, const LLVector4 &b, F32 u) +inline LLVector4 lerp(const LLVector4& a, const LLVector4& b, F32 u) { return LLVector4( a.mV[VX] + (b.mV[VX] - a.mV[VX]) * u, @@ -538,9 +538,9 @@ inline LLVector4 lerp(const LLVector4 &a, const LLVector4 &b, F32 u) a.mV[VW] + (b.mV[VW] - a.mV[VW]) * u); } -inline F32 LLVector4::normalize(void) +inline F32 LLVector4::normalize() { - F32 mag = (F32) sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]); + F32 mag = sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]); F32 oomag; if (mag > FP_MAG_THRESHOLD) @@ -552,18 +552,18 @@ inline F32 LLVector4::normalize(void) } else { - mV[0] = 0.f; - mV[1] = 0.f; - mV[2] = 0.f; - mag = 0; + mV[VX] = 0.f; + mV[VY] = 0.f; + mV[VZ] = 0.f; + mag = 0.f; } return (mag); } // deprecated -inline F32 LLVector4::normVec(void) +inline F32 LLVector4::normVec() { - F32 mag = (F32) sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]); + F32 mag = sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]); F32 oomag; if (mag > FP_MAG_THRESHOLD) @@ -575,22 +575,23 @@ inline F32 LLVector4::normVec(void) } else { - mV[0] = 0.f; - mV[1] = 0.f; - mV[2] = 0.f; - mag = 0; + mV[VX] = 0.f; + mV[VY] = 0.f; + mV[VZ] = 0.f; + mag = 0.f; } return (mag); } // Because apparently some parts of the viewer use this for color info. -inline const LLVector4 srgbVector4(const LLVector4 &a) { +inline const LLVector4 srgbVector4(const LLVector4& a) +{ LLVector4 srgbColor; - srgbColor.mV[0] = linearTosRGB(a.mV[0]); - srgbColor.mV[1] = linearTosRGB(a.mV[1]); - srgbColor.mV[2] = linearTosRGB(a.mV[2]); - srgbColor.mV[3] = a.mV[3]; + srgbColor.mV[VX] = linearTosRGB(a.mV[VX]); + srgbColor.mV[VY] = linearTosRGB(a.mV[VY]); + srgbColor.mV[VZ] = linearTosRGB(a.mV[VZ]); + srgbColor.mV[VW] = a.mV[VW]; return srgbColor; } diff --git a/indra/llmath/xform.h b/indra/llmath/xform.h index 7434301670..fa45fffeae 100644 --- a/indra/llmath/xform.h +++ b/indra/llmath/xform.h @@ -115,7 +115,7 @@ public: void clearChanged(U32 bits) { mChanged &= ~bits; } void setScaleChildOffset(bool scale) { mScaleChildOffset = scale; } - bool getScaleChildOffset() { return mScaleChildOffset; } + bool getScaleChildOffset() const { return mScaleChildOffset; } LLXform* getParent() const { return mParent; } LLXform* getRoot() const; -- cgit v1.2.3 From 922cc94ae673275e769617bc5ce2b8e01b591134 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Fri, 18 Apr 2025 00:58:33 +0200 Subject: Remove obsolete cmake_minimum_required that is lower than the required version in the main CMakeLists.txt --- indra/doxygen/CMakeLists.txt | 6 ------ 1 file changed, 6 deletions(-) diff --git a/indra/doxygen/CMakeLists.txt b/indra/doxygen/CMakeLists.txt index 616b5cd09c..354ae7b636 100644 --- a/indra/doxygen/CMakeLists.txt +++ b/indra/doxygen/CMakeLists.txt @@ -1,11 +1,5 @@ # -*- cmake -*- -# cmake_minimum_required should appear before any -# other commands to guarantee full compatibility -# with the version specified -## prior to 2.8, the add_custom_target commands used in setting the version did not work correctly -cmake_minimum_required(VERSION 3.8.0 FATAL_ERROR) - set(ROOT_PROJECT_NAME "SecondLife" CACHE STRING "The root project/makefile/solution name. Defaults to SecondLife.") project(${ROOT_PROJECT_NAME}) -- cgit v1.2.3 From a7e84c918da94fde58e99e0770dfd90db14739a9 Mon Sep 17 00:00:00 2001 From: Ansariel Hiller Date: Wed, 25 Sep 2024 18:10:00 +0200 Subject: Restore currently entered text in chat entry textbox after going through history with Ctrl-PgUp/PgDown (#2680) --- indra/llui/llchatentry.cpp | 16 +++++++++++----- indra/llui/llchatentry.h | 2 ++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/indra/llui/llchatentry.cpp b/indra/llui/llchatentry.cpp index da5afd0386..e8d942b8af 100644 --- a/indra/llui/llchatentry.cpp +++ b/indra/llui/llchatentry.cpp @@ -45,7 +45,8 @@ LLChatEntry::LLChatEntry(const Params& p) mExpandLinesCount(p.expand_lines_count), mPrevLinesCount(0), mSingleLineMode(false), - mPrevExpandedLineCount(S32_MAX) + mPrevExpandedLineCount(S32_MAX), + mCurrentInput("") { // Initialize current history line iterator mCurrentHistoryLine = mLineHistory.begin(); @@ -189,6 +190,7 @@ bool LLChatEntry::handleSpecialKey(const KEY key, const MASK mask) { needsReflow(); } + mCurrentInput = ""; break; case KEY_UP: @@ -196,6 +198,11 @@ bool LLChatEntry::handleSpecialKey(const KEY key, const MASK mask) { if (!mLineHistory.empty() && mCurrentHistoryLine > mLineHistory.begin()) { + if (mCurrentHistoryLine == mLineHistory.end()) + { + mCurrentInput = getText(); + } + setText(*(--mCurrentHistoryLine)); endOfDoc(); } @@ -210,16 +217,15 @@ bool LLChatEntry::handleSpecialKey(const KEY key, const MASK mask) case KEY_DOWN: if (mHasHistory && MASK_CONTROL == mask) { - if (!mLineHistory.empty() && mCurrentHistoryLine < (mLineHistory.end() - 1) ) + if (!mLineHistory.empty() && mCurrentHistoryLine < (mLineHistory.end() - 1)) { setText(*(++mCurrentHistoryLine)); endOfDoc(); } - else if (!mLineHistory.empty() && mCurrentHistoryLine == (mLineHistory.end() - 1) ) + else if (!mLineHistory.empty() && mCurrentHistoryLine == (mLineHistory.end() - 1)) { mCurrentHistoryLine++; - std::string empty(""); - setText(empty); + setText(mCurrentInput); needsReflow(); endOfDoc(); } diff --git a/indra/llui/llchatentry.h b/indra/llui/llchatentry.h index 5621ede1e7..9a0e8ee91e 100644 --- a/indra/llui/llchatentry.h +++ b/indra/llui/llchatentry.h @@ -101,6 +101,8 @@ private: S32 mExpandLinesCount; S32 mPrevLinesCount; S32 mPrevExpandedLineCount; + + std::string mCurrentInput; }; #endif /* LLCHATENTRY_H_ */ -- cgit v1.2.3 From 698a3017a0de2efbf06e4e0c906494f9f6ef172f Mon Sep 17 00:00:00 2001 From: Ansariel Date: Wed, 25 Sep 2024 22:14:39 +0200 Subject: Remove orphaned LLPanelOutfitSnapshotInventory # Conflicts: # indra/newview/llpanelsnapshotinventory.cpp --- indra/newview/llpanelsnapshotinventory.cpp | 106 ++++------------------------- indra/newview/llpanelsnapshotlocal.cpp | 20 +++--- indra/newview/llpanelsnapshotoptions.cpp | 4 +- indra/newview/llpanelsnapshotpostcard.cpp | 20 +++--- indra/newview/llpanelsnapshotprofile.cpp | 18 ++--- 5 files changed, 45 insertions(+), 123 deletions(-) diff --git a/indra/newview/llpanelsnapshotinventory.cpp b/indra/newview/llpanelsnapshotinventory.cpp index 96b17acc40..74dadce960 100644 --- a/indra/newview/llpanelsnapshotinventory.cpp +++ b/indra/newview/llpanelsnapshotinventory.cpp @@ -42,77 +42,33 @@ /** * The panel provides UI for saving snapshot as an inventory texture. */ -class LLPanelSnapshotInventoryBase - : public LLPanelSnapshot -{ - LOG_CLASS(LLPanelSnapshotInventoryBase); - -public: - LLPanelSnapshotInventoryBase(); - - /*virtual*/ bool postBuild(); -protected: - void onSend(); - /*virtual*/ LLSnapshotModel::ESnapshotType getSnapshotType(); -}; - class LLPanelSnapshotInventory - : public LLPanelSnapshotInventoryBase + : public LLPanelSnapshot { LOG_CLASS(LLPanelSnapshotInventory); public: LLPanelSnapshotInventory(); - /*virtual*/ bool postBuild(); - /*virtual*/ void onOpen(const LLSD& key); + bool postBuild() override; + void onOpen(const LLSD& key) override; void onResolutionCommit(LLUICtrl* ctrl); private: - /*virtual*/ std::string getWidthSpinnerName() const { return "inventory_snapshot_width"; } - /*virtual*/ std::string getHeightSpinnerName() const { return "inventory_snapshot_height"; } - /*virtual*/ std::string getAspectRatioCBName() const { return "inventory_keep_aspect_check"; } - /*virtual*/ std::string getImageSizeComboName() const { return "texture_size_combo"; } - /*virtual*/ std::string getImageSizePanelName() const { return LLStringUtil::null; } - /*virtual*/ void updateControls(const LLSD& info); - -}; - -class LLPanelOutfitSnapshotInventory - : public LLPanelSnapshotInventoryBase -{ - LOG_CLASS(LLPanelOutfitSnapshotInventory); + std::string getWidthSpinnerName() const override { return "inventory_snapshot_width"; } + std::string getHeightSpinnerName() const override { return "inventory_snapshot_height"; } + std::string getAspectRatioCBName() const override { return "inventory_keep_aspect_check"; } + std::string getImageSizeComboName() const override { return "texture_size_combo"; } + std::string getImageSizePanelName() const override { return LLStringUtil::null; } + LLSnapshotModel::ESnapshotType getSnapshotType() override; + void updateControls(const LLSD& info) override; -public: - LLPanelOutfitSnapshotInventory(); - /*virtual*/ bool postBuild(); - /*virtual*/ void onOpen(const LLSD& key); - -private: - /*virtual*/ std::string getWidthSpinnerName() const { return ""; } - /*virtual*/ std::string getHeightSpinnerName() const { return ""; } - /*virtual*/ std::string getAspectRatioCBName() const { return ""; } - /*virtual*/ std::string getImageSizeComboName() const { return "texture_size_combo"; } - /*virtual*/ std::string getImageSizePanelName() const { return LLStringUtil::null; } - /*virtual*/ void updateControls(const LLSD& info); - - /*virtual*/ void cancel(); + void onSend(); }; static LLPanelInjector panel_class1("llpanelsnapshotinventory"); -static LLPanelInjector panel_class2("llpaneloutfitsnapshotinventory"); - -LLPanelSnapshotInventoryBase::LLPanelSnapshotInventoryBase() -{ -} - -bool LLPanelSnapshotInventoryBase::postBuild() -{ - return LLPanelSnapshot::postBuild(); -} - -LLSnapshotModel::ESnapshotType LLPanelSnapshotInventoryBase::getSnapshotType() +LLSnapshotModel::ESnapshotType LLPanelSnapshotInventory::getSnapshotType() { return LLSnapshotModel::SNAPSHOT_TEXTURE; } @@ -130,7 +86,7 @@ bool LLPanelSnapshotInventory::postBuild() getChild(getHeightSpinnerName())->setAllowEdit(false); getChild(getImageSizeComboName())->setCommitCallback(boost::bind(&LLPanelSnapshotInventory::onResolutionCommit, this, _1)); - return LLPanelSnapshotInventoryBase::postBuild(); + return LLPanelSnapshot::postBuild(); } // virtual @@ -153,7 +109,7 @@ void LLPanelSnapshotInventory::onResolutionCommit(LLUICtrl* ctrl) getChild(getHeightSpinnerName())->setVisible(!current_window_selected); } -void LLPanelSnapshotInventoryBase::onSend() +void LLPanelSnapshotInventory::onSend() { S32 w = 0; S32 h = 0; @@ -187,37 +143,3 @@ void LLPanelSnapshotInventoryBase::onSend() } } } - -LLPanelOutfitSnapshotInventory::LLPanelOutfitSnapshotInventory() -{ - mCommitCallbackRegistrar.add("Inventory.SaveOutfitPhoto", boost::bind(&LLPanelOutfitSnapshotInventory::onSend, this)); - mCommitCallbackRegistrar.add("Inventory.SaveOutfitCancel", boost::bind(&LLPanelOutfitSnapshotInventory::cancel, this)); -} - -// virtual -bool LLPanelOutfitSnapshotInventory::postBuild() -{ - return LLPanelSnapshotInventoryBase::postBuild(); -} - -// virtual -void LLPanelOutfitSnapshotInventory::onOpen(const LLSD& key) -{ - getChild("hint_lbl")->setTextArg("[UPLOAD_COST]", llformat("%d", LLAgentBenefitsMgr::current().getTextureUploadCost())); - LLPanelSnapshot::onOpen(key); -} - -// virtual -void LLPanelOutfitSnapshotInventory::updateControls(const LLSD& info) -{ - const bool have_snapshot = info.has("have-snapshot") ? info["have-snapshot"].asBoolean() : true; - getChild("save_btn")->setEnabled(have_snapshot); -} - -void LLPanelOutfitSnapshotInventory::cancel() -{ - if (mSnapshotFloater) - { - mSnapshotFloater->closeFloater(); - } -} diff --git a/indra/newview/llpanelsnapshotlocal.cpp b/indra/newview/llpanelsnapshotlocal.cpp index 366030c0fa..57759fbcaa 100644 --- a/indra/newview/llpanelsnapshotlocal.cpp +++ b/indra/newview/llpanelsnapshotlocal.cpp @@ -47,18 +47,18 @@ class LLPanelSnapshotLocal public: LLPanelSnapshotLocal(); - /*virtual*/ bool postBuild(); - /*virtual*/ void onOpen(const LLSD& key); + bool postBuild() override; + void onOpen(const LLSD& key) override; private: - /*virtual*/ std::string getWidthSpinnerName() const { return "local_snapshot_width"; } - /*virtual*/ std::string getHeightSpinnerName() const { return "local_snapshot_height"; } - /*virtual*/ std::string getAspectRatioCBName() const { return "local_keep_aspect_check"; } - /*virtual*/ std::string getImageSizeComboName() const { return "local_size_combo"; } - /*virtual*/ std::string getImageSizePanelName() const { return "local_image_size_lp"; } - /*virtual*/ LLSnapshotModel::ESnapshotFormat getImageFormat() const; - /*virtual*/ LLSnapshotModel::ESnapshotType getSnapshotType(); - /*virtual*/ void updateControls(const LLSD& info); + std::string getWidthSpinnerName() const override { return "local_snapshot_width"; } + std::string getHeightSpinnerName() const override { return "local_snapshot_height"; } + std::string getAspectRatioCBName() const override { return "local_keep_aspect_check"; } + std::string getImageSizeComboName() const override { return "local_size_combo"; } + std::string getImageSizePanelName() const override { return "local_image_size_lp"; } + LLSnapshotModel::ESnapshotFormat getImageFormat() const override; + LLSnapshotModel::ESnapshotType getSnapshotType() override; + void updateControls(const LLSD& info) override; S32 mLocalFormat; diff --git a/indra/newview/llpanelsnapshotoptions.cpp b/indra/newview/llpanelsnapshotoptions.cpp index 962d3bba16..63dd50996a 100644 --- a/indra/newview/llpanelsnapshotoptions.cpp +++ b/indra/newview/llpanelsnapshotoptions.cpp @@ -47,8 +47,8 @@ class LLPanelSnapshotOptions public: LLPanelSnapshotOptions(); ~LLPanelSnapshotOptions(); - /*virtual*/ bool postBuild(); - /*virtual*/ void onOpen(const LLSD& key); + bool postBuild() override; + void onOpen(const LLSD& key) override; private: void updateUploadCost(); diff --git a/indra/newview/llpanelsnapshotpostcard.cpp b/indra/newview/llpanelsnapshotpostcard.cpp index 23e8789e3f..f3dfdc9250 100644 --- a/indra/newview/llpanelsnapshotpostcard.cpp +++ b/indra/newview/llpanelsnapshotpostcard.cpp @@ -56,18 +56,18 @@ class LLPanelSnapshotPostcard public: LLPanelSnapshotPostcard(); - /*virtual*/ bool postBuild(); - /*virtual*/ void onOpen(const LLSD& key); + bool postBuild() override; + void onOpen(const LLSD& key) override; private: - /*virtual*/ std::string getWidthSpinnerName() const { return "postcard_snapshot_width"; } - /*virtual*/ std::string getHeightSpinnerName() const { return "postcard_snapshot_height"; } - /*virtual*/ std::string getAspectRatioCBName() const { return "postcard_keep_aspect_check"; } - /*virtual*/ std::string getImageSizeComboName() const { return "postcard_size_combo"; } - /*virtual*/ std::string getImageSizePanelName() const { return "postcard_image_size_lp"; } - /*virtual*/ LLSnapshotModel::ESnapshotFormat getImageFormat() const { return LLSnapshotModel::SNAPSHOT_FORMAT_JPEG; } - /*virtual*/ LLSnapshotModel::ESnapshotType getSnapshotType(); - /*virtual*/ void updateControls(const LLSD& info); + std::string getWidthSpinnerName() const override { return "postcard_snapshot_width"; } + std::string getHeightSpinnerName() const override { return "postcard_snapshot_height"; } + std::string getAspectRatioCBName() const override { return "postcard_keep_aspect_check"; } + std::string getImageSizeComboName() const override { return "postcard_size_combo"; } + std::string getImageSizePanelName() const override { return "postcard_image_size_lp"; } + LLSnapshotModel::ESnapshotFormat getImageFormat() const override { return LLSnapshotModel::SNAPSHOT_FORMAT_JPEG; } + LLSnapshotModel::ESnapshotType getSnapshotType() override; + void updateControls(const LLSD& info) override; bool missingSubjMsgAlertCallback(const LLSD& notification, const LLSD& response); static void sendPostcardFinished(LLSD result); diff --git a/indra/newview/llpanelsnapshotprofile.cpp b/indra/newview/llpanelsnapshotprofile.cpp index aa257dea9e..b533d7bbbc 100644 --- a/indra/newview/llpanelsnapshotprofile.cpp +++ b/indra/newview/llpanelsnapshotprofile.cpp @@ -49,17 +49,17 @@ class LLPanelSnapshotProfile public: LLPanelSnapshotProfile(); - /*virtual*/ bool postBuild(); - /*virtual*/ void onOpen(const LLSD& key); + bool postBuild() override; + void onOpen(const LLSD& key) override; private: - /*virtual*/ std::string getWidthSpinnerName() const { return "profile_snapshot_width"; } - /*virtual*/ std::string getHeightSpinnerName() const { return "profile_snapshot_height"; } - /*virtual*/ std::string getAspectRatioCBName() const { return "profile_keep_aspect_check"; } - /*virtual*/ std::string getImageSizeComboName() const { return "profile_size_combo"; } - /*virtual*/ std::string getImageSizePanelName() const { return "profile_image_size_lp"; } - /*virtual*/ LLSnapshotModel::ESnapshotFormat getImageFormat() const { return LLSnapshotModel::SNAPSHOT_FORMAT_PNG; } - /*virtual*/ void updateControls(const LLSD& info); + std::string getWidthSpinnerName() const override { return "profile_snapshot_width"; } + std::string getHeightSpinnerName() const override { return "profile_snapshot_height"; } + std::string getAspectRatioCBName() const override { return "profile_keep_aspect_check"; } + std::string getImageSizeComboName() const override { return "profile_size_combo"; } + std::string getImageSizePanelName() const override { return "profile_image_size_lp"; } + LLSnapshotModel::ESnapshotFormat getImageFormat() const override { return LLSnapshotModel::SNAPSHOT_FORMAT_PNG; } + void updateControls(const LLSD& info) override; void onSend(); }; -- cgit v1.2.3 From 0c380ebc085df0f7edce3bac51c57c150dd1e999 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Wed, 25 Sep 2024 23:05:44 +0200 Subject: Fix upload cost calculation for snapshots to inventory based on encoded image size and display upload cost to user --- indra/newview/llpanelsnapshotinventory.cpp | 42 +++++++++++++++------- .../default/xui/de/panel_snapshot_inventory.xml | 2 +- .../default/xui/en/panel_snapshot_inventory.xml | 4 ++- .../default/xui/es/panel_snapshot_inventory.xml | 2 +- .../default/xui/fr/panel_snapshot_inventory.xml | 2 +- .../default/xui/it/panel_snapshot_inventory.xml | 2 +- .../default/xui/ja/panel_snapshot_inventory.xml | 2 +- .../default/xui/pt/panel_snapshot_inventory.xml | 2 +- .../default/xui/ru/panel_snapshot_inventory.xml | 2 +- .../default/xui/tr/panel_snapshot_inventory.xml | 2 +- .../default/xui/zh/panel_snapshot_inventory.xml | 2 +- 11 files changed, 41 insertions(+), 23 deletions(-) diff --git a/indra/newview/llpanelsnapshotinventory.cpp b/indra/newview/llpanelsnapshotinventory.cpp index 74dadce960..b81b891685 100644 --- a/indra/newview/llpanelsnapshotinventory.cpp +++ b/indra/newview/llpanelsnapshotinventory.cpp @@ -64,6 +64,8 @@ private: void updateControls(const LLSD& info) override; void onSend(); + void updateUploadCost(); + S32 calculateUploadCost(); }; static LLPanelInjector panel_class1("llpanelsnapshotinventory"); @@ -92,6 +94,8 @@ bool LLPanelSnapshotInventory::postBuild() // virtual void LLPanelSnapshotInventory::onOpen(const LLSD& key) { + updateUploadCost(); + LLPanelSnapshot::onOpen(key); } @@ -100,6 +104,8 @@ void LLPanelSnapshotInventory::updateControls(const LLSD& info) { const bool have_snapshot = info.has("have-snapshot") ? info["have-snapshot"].asBoolean() : true; getChild("save_btn")->setEnabled(have_snapshot); + + updateUploadCost(); } void LLPanelSnapshotInventory::onResolutionCommit(LLUICtrl* ctrl) @@ -111,19 +117,7 @@ void LLPanelSnapshotInventory::onResolutionCommit(LLUICtrl* ctrl) void LLPanelSnapshotInventory::onSend() { - S32 w = 0; - S32 h = 0; - - if( mSnapshotFloater ) - { - LLSnapshotLivePreview* preview = mSnapshotFloater->getPreviewView(); - if( preview ) - { - preview->getSize(w, h); - } - } - - S32 expected_upload_cost = LLAgentBenefitsMgr::current().getTextureUploadCost(w, h); + S32 expected_upload_cost = calculateUploadCost(); if (can_afford_transaction(expected_upload_cost)) { if (mSnapshotFloater) @@ -143,3 +137,25 @@ void LLPanelSnapshotInventory::onSend() } } } + +void LLPanelSnapshotInventory::updateUploadCost() +{ + getChild("hint_lbl")->setTextArg("[UPLOAD_COST]", llformat("%d", calculateUploadCost())); +} + +S32 LLPanelSnapshotInventory::calculateUploadCost() +{ + S32 w = 0; + S32 h = 0; + + if (mSnapshotFloater) + { + if (LLSnapshotLivePreview* preview = mSnapshotFloater->getPreviewView()) + { + w = preview->getEncodedImageWidth(); + h = preview->getEncodedImageHeight(); + } + } + + return LLAgentBenefitsMgr::current().getTextureUploadCost(w, h); +} diff --git a/indra/newview/skins/default/xui/de/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/de/panel_snapshot_inventory.xml index 602424821f..09447cbbaf 100644 --- a/indra/newview/skins/default/xui/de/panel_snapshot_inventory.xml +++ b/indra/newview/skins/default/xui/de/panel_snapshot_inventory.xml @@ -7,7 +7,7 @@ - + diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml index f8040b9a65..0cac1b410f 100644 --- a/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml @@ -60,7 +60,7 @@ name="Large(512x512)" value="[i512,i512]" /> To save your image as a texture select one of the square formats. + +Upload cost: L$[UPLOAD_COST]