aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewermessage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llviewermessage.cpp')
-rw-r--r--linden/indra/newview/llviewermessage.cpp125
1 files changed, 58 insertions, 67 deletions
diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp
index c624ab9..bad2f1c 100644
--- a/linden/indra/newview/llviewermessage.cpp
+++ b/linden/indra/newview/llviewermessage.cpp
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -50,6 +50,7 @@
50#include "llfloaterimport.h" 50#include "llfloaterimport.h"
51#include "llfocusmgr.h" 51#include "llfocusmgr.h"
52#include "llfollowcamparams.h" 52#include "llfollowcamparams.h"
53#include "llfloaterreleasemsg.h"
53#include "llinstantmessage.h" 54#include "llinstantmessage.h"
54#include "llquantize.h" 55#include "llquantize.h"
55#include "llregionflags.h" 56#include "llregionflags.h"
@@ -59,7 +60,6 @@
59#include "llteleportflags.h" 60#include "llteleportflags.h"
60#include "lltracker.h" 61#include "lltracker.h"
61#include "lltransactionflags.h" 62#include "lltransactionflags.h"
62#include "llwindow.h" // shell_open()
63#include "llxfermanager.h" 63#include "llxfermanager.h"
64#include "message.h" 64#include "message.h"
65#include "sound_ids.h" 65#include "sound_ids.h"
@@ -131,6 +131,7 @@
131#include "pipeline.h" 131#include "pipeline.h"
132#include "llappviewer.h" 132#include "llappviewer.h"
133#include "llfloaterworldmap.h" 133#include "llfloaterworldmap.h"
134#include "llkeythrottle.h"
134#include "llviewerdisplay.h" 135#include "llviewerdisplay.h"
135#include "llkeythrottle.h" 136#include "llkeythrottle.h"
136 137
@@ -284,6 +285,7 @@ void process_logout_reply(LLMessageSystem* msg, void**)
284 285
285void process_layer_data(LLMessageSystem *mesgsys, void **user_data) 286void process_layer_data(LLMessageSystem *mesgsys, void **user_data)
286{ 287{
288 if(!gWorldp) return;
287 LLViewerRegion *regionp = gWorldp->getRegion(mesgsys->getSender()); 289 LLViewerRegion *regionp = gWorldp->getRegion(mesgsys->getSender());
288 290
289 if (!regionp || gNoRender) 291 if (!regionp || gNoRender)
@@ -883,10 +885,8 @@ void open_offer(const std::vector<LLUUID>& items, const std::string& from_name)
883 //highlight item 885 //highlight item
884 886
885 LLUICtrl* focus_ctrl = gFocusMgr.getKeyboardFocus(); 887 LLUICtrl* focus_ctrl = gFocusMgr.getKeyboardFocus();
886 LLFocusMgr::FocusLostCallback callback;
887 callback = gFocusMgr.getFocusCallback();
888 view->getPanel()->setSelection(item->getUUID(), TAKE_FOCUS_NO); 888 view->getPanel()->setSelection(item->getUUID(), TAKE_FOCUS_NO);
889 gFocusMgr.setKeyboardFocus(focus_ctrl, callback); 889 gFocusMgr.setKeyboardFocus(focus_ctrl);
890 } 890 }
891} 891}
892 892
@@ -915,7 +915,7 @@ void inventory_offer_mute_callback(const LLUUID& blocked_id,
915 LLMute mute(blocked_id, from_name, type); 915 LLMute mute(blocked_id, from_name, type);
916 if (gMuteListp->add(mute)) 916 if (gMuteListp->add(mute))
917 { 917 {
918 gFloaterMute->show(); 918 LLFloaterMute::showInstance();
919 gFloaterMute->selectMute(blocked_id); 919 gFloaterMute->selectMute(blocked_id);
920 } 920 }
921 921
@@ -1193,7 +1193,22 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task)
1193 1193
1194 LLString::format_map_t args; 1194 LLString::format_map_t args;
1195 args["[OBJECTNAME]"] = info->mDesc; 1195 args["[OBJECTNAME]"] = info->mDesc;
1196 args["[OBJECTTYPE]"] = LLAssetType::lookupHumanReadable(info->mType); 1196 // must protect against a NULL return from lookupHumanReadable()
1197 const char* typestr = LLAssetType::lookupHumanReadable(info->mType);
1198 if (typestr)
1199 {
1200 args["[OBJECTTYPE]"] = typestr;
1201 }
1202 else
1203 {
1204 llwarns << "LLAssetType::lookupHumanReadable() returned NULL - probably bad asset type: " << info->mType << llendl;
1205 args["[OBJECTTYPE]"] = "";
1206
1207 // This seems safest, rather than propagating bogosity
1208 llwarns << "Forcing an inventory-decline for probably-bad asset type." << llendl;
1209 inventory_offer_callback(IOR_DECLINE, info);
1210 return;
1211 }
1197 1212
1198 // Name cache callbacks don't store userdata, so can't save 1213 // Name cache callbacks don't store userdata, so can't save
1199 // off the LLOfferInfo. Argh. JC 1214 // off the LLOfferInfo. Argh. JC
@@ -2174,9 +2189,13 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
2174 BOOL is_linden = FALSE; 2189 BOOL is_linden = FALSE;
2175 if (gMuteListp) 2190 if (gMuteListp)
2176 { 2191 {
2177 is_muted = gMuteListp->isMuted(from_id, from_name, LLMute::flagTextChat) 2192 is_muted = gMuteListp->isMuted(
2178 || gMuteListp->isMuted(owner_id, LLMute::flagTextChat); 2193 from_id,
2179 is_linden = chat.mSourceType != CHAT_SOURCE_OBJECT && gMuteListp->isLinden(from_name); 2194 from_name,
2195 LLMute::flagTextChat)
2196 || gMuteListp->isMuted(owner_id, LLMute::flagTextChat);
2197 is_linden = chat.mSourceType != CHAT_SOURCE_OBJECT &&
2198 gMuteListp->isLinden(from_name);
2180 } 2199 }
2181 2200
2182 BOOL is_audible = (CHAT_AUDIBLE_FULLY == chat.mAudible); 2201 BOOL is_audible = (CHAT_AUDIBLE_FULLY == chat.mAudible);
@@ -2217,7 +2236,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
2217 BOOL visible_in_chat_bubble = FALSE; 2236 BOOL visible_in_chat_bubble = FALSE;
2218 std::string verb; 2237 std::string verb;
2219 2238
2220 color.setVec(1,1,1,1); 2239 color.setVec(1.f,1.f,1.f,1.f);
2221 msg->getStringFast(_PREHASH_ChatData, _PREHASH_Message, DB_CHAT_MSG_BUF_SIZE, mesg); 2240 msg->getStringFast(_PREHASH_ChatData, _PREHASH_Message, DB_CHAT_MSG_BUF_SIZE, mesg);
2222 2241
2223 BOOL ircstyle = FALSE; 2242 BOOL ircstyle = FALSE;
@@ -2592,6 +2611,7 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
2592 2611
2593 // Viewer trusts the simulator. 2612 // Viewer trusts the simulator.
2594 gMessageSystem->enableCircuit(sim_host, TRUE); 2613 gMessageSystem->enableCircuit(sim_host, TRUE);
2614 if(!gWorldp) return;
2595 LLViewerRegion* regionp = gWorldp->addRegion(region_handle, sim_host); 2615 LLViewerRegion* regionp = gWorldp->addRegion(region_handle, sim_host);
2596 2616
2597/* 2617/*
@@ -2660,6 +2680,13 @@ void process_avatar_init_complete(LLMessageSystem* msg, void**)
2660} 2680}
2661*/ 2681*/
2662 2682
2683static void display_release_message(S32, void* data)
2684{
2685 std::string* msg = (std::string*)data;
2686 LLFloaterReleaseMsg::displayMessage(msg->c_str());
2687 delete msg;
2688}
2689
2663void process_agent_movement_complete(LLMessageSystem* msg, void**) 2690void process_agent_movement_complete(LLMessageSystem* msg, void**)
2664{ 2691{
2665 gAgentMovementCompleted = TRUE; 2692 gAgentMovementCompleted = TRUE;
@@ -2699,6 +2726,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
2699 2726
2700 F32 x, y; 2727 F32 x, y;
2701 from_region_handle(region_handle, &x, &y); 2728 from_region_handle(region_handle, &x, &y);
2729 if(!gWorldp) return;
2702 LLViewerRegion* regionp = gWorldp->getRegionFromHandle(region_handle); 2730 LLViewerRegion* regionp = gWorldp->getRegionFromHandle(region_handle);
2703 if (!regionp) 2731 if (!regionp)
2704 { 2732 {
@@ -2729,9 +2757,9 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
2729 gViewerThrottle.sendToSim(); 2757 gViewerThrottle.sendToSim();
2730 gViewerWindow->sendShapeToSim(); 2758 gViewerWindow->sendShapeToSim();
2731 2759
2732 bool is_teleport = false; 2760 bool is_teleport = gAgent.getTeleportState() == LLAgent::TELEPORT_MOVING;
2733 2761
2734 if( gAgent.getTeleportState() == LLAgent::TELEPORT_MOVING ) 2762 if( is_teleport )
2735 { 2763 {
2736 // Force the camera back onto the agent, don't animate. JC 2764 // Force the camera back onto the agent, don't animate. JC
2737 gAgent.setFocusOnAvatar(TRUE, FALSE); 2765 gAgent.setFocusOnAvatar(TRUE, FALSE);
@@ -2746,15 +2774,20 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
2746 2774
2747 if (avatarp) 2775 if (avatarp)
2748 { 2776 {
2777 // Chat the "back" SLURL. (DEV-4907)
2778 LLChat chat("Teleport completed from " + gAgent.getTeleportSourceSLURL());
2779 chat.mSourceType = CHAT_SOURCE_SYSTEM;
2780 LLFloaterChat::addChatHistory(chat);
2781
2782 // Set the new position
2749 avatarp->setPositionAgent(agent_pos); 2783 avatarp->setPositionAgent(agent_pos);
2750 avatarp->clearChat(); 2784 avatarp->clearChat();
2751 avatarp->slamPosition(); 2785 avatarp->slamPosition();
2752 } 2786 }
2753
2754 is_teleport = true;
2755 } 2787 }
2756 else 2788 else
2757 { 2789 {
2790 // This is likely just the initial logging in phase.
2758 gAgent.setTeleportState( LLAgent::TELEPORT_NONE ); 2791 gAgent.setTeleportState( LLAgent::TELEPORT_NONE );
2759 } 2792 }
2760 2793
@@ -2822,22 +2855,10 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
2822 msg->addBOOLFast(_PREHASH_AlwaysRun, gAgent.getAlwaysRun()); 2855 msg->addBOOLFast(_PREHASH_AlwaysRun, gAgent.getAlwaysRun());
2823 gAgent.sendReliableMessage(); 2856 gAgent.sendReliableMessage();
2824 2857
2825 2858 if (LLFloaterReleaseMsg::checkVersion(version_channel_char))
2826 LLString version_channel = LLString(version_channel_char);
2827
2828 if (gLastVersionChannel != version_channel)
2829 { 2859 {
2830 //show release message if not on initial login 2860 LLNotifyBox::showXml("ServerVersionChanged", display_release_message, new std::string(version_channel_char) );
2831 if (!gLastVersionChannel.empty())
2832 {
2833 gLastVersionChannel = version_channel;
2834 LLFloaterReleaseMsg::show();
2835 }
2836 else {
2837 gLastVersionChannel = version_channel;
2838 }
2839 } 2861 }
2840
2841} 2862}
2842 2863
2843void process_crossed_region(LLMessageSystem* msg, void**) 2864void process_crossed_region(LLMessageSystem* msg, void**)
@@ -2867,6 +2888,7 @@ void process_crossed_region(LLMessageSystem* msg, void**)
2867 2888
2868 send_complete_agent_movement(sim_host); 2889 send_complete_agent_movement(sim_host);
2869 2890
2891 if(!gWorldp) return;
2870 LLViewerRegion* regionp = gWorldp->addRegion(region_handle, sim_host); 2892 LLViewerRegion* regionp = gWorldp->addRegion(region_handle, sim_host);
2871 regionp->setSeedCapability(std::string(seedCap)); 2893 regionp->setSeedCapability(std::string(seedCap));
2872} 2894}
@@ -3251,6 +3273,7 @@ void process_time_synch(LLMessageSystem *mesgsys, void **user_data)
3251 mesgsys->getVector3Fast(_PREHASH_TimeInfo, _PREHASH_SunDirection, sun_direction); 3273 mesgsys->getVector3Fast(_PREHASH_TimeInfo, _PREHASH_SunDirection, sun_direction);
3252 mesgsys->getVector3Fast(_PREHASH_TimeInfo, _PREHASH_SunAngVelocity, sun_ang_velocity); 3274 mesgsys->getVector3Fast(_PREHASH_TimeInfo, _PREHASH_SunAngVelocity, sun_ang_velocity);
3253 3275
3276 if(!gWorldp) return;
3254 gWorldp->setSpaceTimeUSec(space_time_usec); 3277 gWorldp->setSpaceTimeUSec(space_time_usec);
3255 3278
3256 //lldebugs << "time_synch() - " << sun_direction << ", " << sun_ang_velocity 3279 //lldebugs << "time_synch() - " << sun_direction << ", " << sun_ang_velocity
@@ -3309,7 +3332,7 @@ void process_sound_trigger(LLMessageSystem *msg, void **)
3309 return; 3332 return;
3310 } 3333 }
3311 3334
3312 F32 volume = gain * gSavedSettings.getF32("AudioLevelSFX"); 3335 F32 volume = gSavedSettings.getBOOL("MuteSounds") ? 0.f : (gain * gSavedSettings.getF32("AudioLevelSFX"));
3313 gAudiop->triggerSound(sound_id, owner_id, volume, pos_global); 3336 gAudiop->triggerSound(sound_id, owner_id, volume, pos_global);
3314} 3337}
3315 3338
@@ -3395,29 +3418,6 @@ void process_attached_sound_gain_change(LLMessageSystem *mesgsys, void **user_da
3395 objectp->adjustAudioGain(gain); 3418 objectp->adjustAudioGain(gain);
3396} 3419}
3397 3420
3398/* Unused July 2006
3399void process_attached_sound_cutoff_radius(LLMessageSystem *mesgsys, void **user_data)
3400{
3401 F32 radius = 0;
3402 LLUUID object_guid;
3403 LLViewerObject *objectp = NULL;
3404
3405 mesgsys->getUUIDFast(_PREHASH_DataBlock, _PREHASH_ObjectID, object_guid);
3406
3407 if (!((objectp = gObjectList.findObject(object_guid))))
3408 {
3409 // we don't know about this object, just bail
3410 return;
3411 }
3412
3413 mesgsys->getF32Fast(_PREHASH_DataBlock, _PREHASH_Radius, radius);
3414
3415 if (gAudiop)
3416 {
3417// gAudiop->attachToObject(sound_guid, object_guid, gain, priority, flags);
3418 }
3419}
3420*/
3421 3421
3422void process_health_message(LLMessageSystem *mesgsys, void **user_data) 3422void process_health_message(LLMessageSystem *mesgsys, void **user_data)
3423{ 3423{
@@ -3563,19 +3563,6 @@ void process_sim_stats(LLMessageSystem *msg, void **user_data)
3563} 3563}
3564 3564
3565 3565
3566// This info is requested by the simulator when the agent first logs in
3567// or when it moves into a simulator in which it did not already have
3568// a child agent.
3569/*
3570void process_avatar_info_request(LLMessageSystem *mesgsys, void **user_data)
3571{
3572 llinfos << "process_avatar_info_request()" << llendl;
3573
3574 // Send the avatar appearance (parameters and texture entry UUIDs)
3575 gAgent.sendAgentSetAppearance();
3576 send_agent_update(TRUE, TRUE);
3577}*/
3578
3579 3566
3580void process_avatar_animation(LLMessageSystem *mesgsys, void **user_data) 3567void process_avatar_animation(LLMessageSystem *mesgsys, void **user_data)
3581{ 3568{
@@ -4435,6 +4422,10 @@ void script_question_cb(S32 option, void* user_data)
4435 notify_cautioned_script_question(cbdata, orig, allowed); 4422 notify_cautioned_script_question(cbdata, orig, allowed);
4436 } 4423 }
4437 4424
4425 if ( option == 2 )
4426 {
4427 gMuteListp->add(LLMute(cbdata->mItemID, cbdata->mObjectName, LLMute::OBJECT));
4428 }
4438 delete cbdata; 4429 delete cbdata;
4439} 4430}
4440 4431