diff options
author | Jacek Antonelli | 2008-08-15 23:45:07 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:07 -0500 |
commit | 8465910c79b8e746e04fd581cca2d60399e569b9 (patch) | |
tree | f43fec3e83c46e0d6190dca923d6fb268b52ffdd /linden/indra/newview/llviewermessage.cpp | |
parent | Second Life viewer sources 1.18.2.1 (diff) | |
download | meta-impy-8465910c79b8e746e04fd581cca2d60399e569b9.zip meta-impy-8465910c79b8e746e04fd581cca2d60399e569b9.tar.gz meta-impy-8465910c79b8e746e04fd581cca2d60399e569b9.tar.bz2 meta-impy-8465910c79b8e746e04fd581cca2d60399e569b9.tar.xz |
Second Life viewer sources 1.18.3.2-RC
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llviewermessage.cpp | 202 |
1 files changed, 139 insertions, 63 deletions
diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index 6bca17e..8f3cd96 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp | |||
@@ -84,6 +84,7 @@ | |||
84 | #include "llfloatermute.h" | 84 | #include "llfloatermute.h" |
85 | #include "llfloaterpostcard.h" | 85 | #include "llfloaterpostcard.h" |
86 | #include "llfloaterpreference.h" | 86 | #include "llfloaterpreference.h" |
87 | #include "llfloaterreleasemsg.h" | ||
87 | #include "llfollowcam.h" | 88 | #include "llfollowcam.h" |
88 | #include "llgroupnotify.h" | 89 | #include "llgroupnotify.h" |
89 | #include "llhudeffect.h" | 90 | #include "llhudeffect.h" |
@@ -573,6 +574,15 @@ void join_group_callback(S32 option, void* user_data) | |||
573 | LLJoinGroupData* data = (LLJoinGroupData*)user_data; | 574 | LLJoinGroupData* data = (LLJoinGroupData*)user_data; |
574 | BOOL delete_context_data = TRUE; | 575 | BOOL delete_context_data = TRUE; |
575 | bool accept_invite = false; | 576 | bool accept_invite = false; |
577 | |||
578 | if (option == 2 && data && !data->mGroupID.isNull()) | ||
579 | { | ||
580 | LLFloaterGroupInfo::showFromUUID(data->mGroupID); | ||
581 | LLString::format_map_t args; | ||
582 | args["[MESSAGE]"] = data->mMessage; | ||
583 | LLNotifyBox::showXml("JoinGroup", args, &join_group_callback, data); | ||
584 | return; | ||
585 | } | ||
576 | if(option == 0 && data && !data->mGroupID.isNull()) | 586 | if(option == 0 && data && !data->mGroupID.isNull()) |
577 | { | 587 | { |
578 | // check for promotion or demotion. | 588 | // check for promotion or demotion. |
@@ -763,7 +773,7 @@ bool check_offer_throttle(const std::string& from_name, bool check_only) | |||
763 | //llinfos << "Throttle Not Expired, Count: " << throttle_count << llendl; | 773 | //llinfos << "Throttle Not Expired, Count: " << throttle_count << llendl; |
764 | // When downloading the initial inventory we get a lot of new items | 774 | // When downloading the initial inventory we get a lot of new items |
765 | // coming in and can't tell that from spam. JC | 775 | // coming in and can't tell that from spam. JC |
766 | if (gStartupState >= STATE_STARTED | 776 | if (LLStartUp::getStartupState() >= STATE_STARTED |
767 | && throttle_count >= OFFER_THROTTLE_MAX_COUNT) | 777 | && throttle_count >= OFFER_THROTTLE_MAX_COUNT) |
768 | { | 778 | { |
769 | if (!throttle_logged) | 779 | if (!throttle_logged) |
@@ -2162,7 +2172,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) | |||
2162 | { | 2172 | { |
2163 | is_muted = gMuteListp->isMuted(from_id, from_name, LLMute::flagTextChat) | 2173 | is_muted = gMuteListp->isMuted(from_id, from_name, LLMute::flagTextChat) |
2164 | || gMuteListp->isMuted(owner_id); | 2174 | || gMuteListp->isMuted(owner_id); |
2165 | is_linden = gMuteListp->isLinden(from_name); | 2175 | is_linden = chat.mSourceType != CHAT_SOURCE_OBJECT && gMuteListp->isLinden(from_name); |
2166 | } | 2176 | } |
2167 | 2177 | ||
2168 | BOOL is_audible = (CHAT_AUDIBLE_FULLY == chat.mAudible); | 2178 | BOOL is_audible = (CHAT_AUDIBLE_FULLY == chat.mAudible); |
@@ -2319,16 +2329,16 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) | |||
2319 | } | 2329 | } |
2320 | 2330 | ||
2321 | // truth table: | 2331 | // truth table: |
2322 | // LINDEN BUSY MUTED OWNED_BY_YOU DISPLAY STORE IN HISTORY | 2332 | // LINDEN BUSY MUTED OWNED_BY_YOU TASK DISPLAY STORE IN HISTORY |
2323 | // F F F F Yes Yes | 2333 | // F F F F * Yes Yes |
2324 | // F F F T Yes Yes | 2334 | // F F F T * Yes Yes |
2325 | // F F T F No No | 2335 | // F F T F * No No |
2326 | // F F T T No No | 2336 | // F F T T * No No |
2327 | // F T F F No Yes | 2337 | // F T F F * No Yes |
2328 | // F T F T Yes Yes | 2338 | // F T F T * Yes Yes |
2329 | // F T T F No No | 2339 | // F T T F * No No |
2330 | // F T T T No No | 2340 | // F T T T * No No |
2331 | // T * * * Yes Yes | 2341 | // T * * * F Yes Yes |
2332 | 2342 | ||
2333 | chat.mMuted = is_muted && !is_linden; | 2343 | chat.mMuted = is_muted && !is_linden; |
2334 | 2344 | ||
@@ -2427,47 +2437,103 @@ public: | |||
2427 | { | 2437 | { |
2428 | LLIsType is_landmark(LLAssetType::AT_LANDMARK); | 2438 | LLIsType is_landmark(LLAssetType::AT_LANDMARK); |
2429 | LLIsType is_card(LLAssetType::AT_CALLINGCARD); | 2439 | LLIsType is_card(LLAssetType::AT_CALLINGCARD); |
2430 | LLInventoryModel::cat_array_t cats; | 2440 | |
2431 | LLInventoryModel::item_array_t items; | 2441 | LLInventoryModel::cat_array_t card_cats; |
2442 | LLInventoryModel::item_array_t card_items; | ||
2443 | LLInventoryModel::cat_array_t land_cats; | ||
2444 | LLInventoryModel::item_array_t land_items; | ||
2445 | |||
2432 | folder_ref_t::iterator it = mCompleteFolders.begin(); | 2446 | folder_ref_t::iterator it = mCompleteFolders.begin(); |
2433 | folder_ref_t::iterator end = mCompleteFolders.end(); | 2447 | folder_ref_t::iterator end = mCompleteFolders.end(); |
2434 | for(; it != end; ++it) | 2448 | for(; it != end; ++it) |
2435 | { | 2449 | { |
2436 | gInventory.collectDescendentsIf( | 2450 | gInventory.collectDescendentsIf( |
2437 | (*it), | 2451 | (*it), |
2438 | cats, | 2452 | land_cats, |
2439 | items, | 2453 | land_items, |
2440 | LLInventoryModel::EXCLUDE_TRASH, | 2454 | LLInventoryModel::EXCLUDE_TRASH, |
2441 | is_landmark); | 2455 | is_landmark); |
2442 | gInventory.collectDescendentsIf( | 2456 | gInventory.collectDescendentsIf( |
2443 | (*it), | 2457 | (*it), |
2444 | cats, | 2458 | card_cats, |
2445 | items, | 2459 | card_items, |
2446 | LLInventoryModel::EXCLUDE_TRASH, | 2460 | LLInventoryModel::EXCLUDE_TRASH, |
2447 | is_card); | 2461 | is_card); |
2448 | } | 2462 | } |
2449 | S32 count = items.count(); | 2463 | LLString::format_map_t args; |
2450 | for(S32 i = 0; i < count; ++i) | 2464 | if ( land_items.count() > 0 ) |
2451 | { | 2465 | { // Show notification that they can now teleport to landmarks. Use a random landmark from the inventory |
2452 | LLString::format_map_t args; | 2466 | S32 random_land = ll_rand( land_items.count() - 1 ); |
2453 | args["[NAME]"] = items[i]->getName(); | 2467 | args["[NAME]"] = land_items[random_land]->getName(); |
2454 | switch(items[i]->getType()) | 2468 | LLNotifyBox::showXml("TeleportToLandmark",args); |
2455 | { | 2469 | } |
2456 | case LLAssetType::AT_LANDMARK: | 2470 | if ( card_items.count() > 0 ) |
2457 | LLNotifyBox::showXml("TeleportToLandmark",args); | 2471 | { // Show notification that they can now contact people. Use a random calling card from the inventory |
2458 | break; | 2472 | S32 random_card = ll_rand( card_items.count() - 1 ); |
2459 | case LLAssetType::AT_CALLINGCARD: | 2473 | args["[NAME]"] = card_items[random_card]->getName(); |
2460 | LLNotifyBox::showXml("TeleportToPerson",args); | 2474 | LLNotifyBox::showXml("TeleportToPerson",args); |
2461 | break; | ||
2462 | default: | ||
2463 | break; | ||
2464 | } | ||
2465 | } | 2475 | } |
2476 | |||
2466 | gInventory.removeObserver(this); | 2477 | gInventory.removeObserver(this); |
2467 | delete this; | 2478 | delete this; |
2468 | } | 2479 | } |
2469 | }; | 2480 | }; |
2470 | 2481 | ||
2482 | |||
2483 | |||
2484 | class LLPostTeleportNotifiers : public LLEventTimer | ||
2485 | { | ||
2486 | public: | ||
2487 | LLPostTeleportNotifiers(); | ||
2488 | virtual ~LLPostTeleportNotifiers(); | ||
2489 | |||
2490 | //function to be called at the supplied frequency | ||
2491 | virtual BOOL tick(); | ||
2492 | }; | ||
2493 | |||
2494 | LLPostTeleportNotifiers::LLPostTeleportNotifiers() : LLEventTimer( 2.0 ) | ||
2495 | { | ||
2496 | }; | ||
2497 | |||
2498 | LLPostTeleportNotifiers::~LLPostTeleportNotifiers() | ||
2499 | { | ||
2500 | } | ||
2501 | |||
2502 | BOOL LLPostTeleportNotifiers::tick() | ||
2503 | { | ||
2504 | BOOL all_done = FALSE; | ||
2505 | if ( gAgent.getTeleportState() == LLAgent::TELEPORT_NONE ) | ||
2506 | { | ||
2507 | // get callingcards and landmarks available to the user arriving. | ||
2508 | LLInventoryFetchDescendentsObserver::folder_ref_t folders; | ||
2509 | LLUUID folder_id; | ||
2510 | folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_CALLINGCARD); | ||
2511 | if(folder_id.notNull()) | ||
2512 | folders.push_back(folder_id); | ||
2513 | folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK); | ||
2514 | if(folder_id.notNull()) | ||
2515 | folders.push_back(folder_id); | ||
2516 | if(!folders.empty()) | ||
2517 | { | ||
2518 | LLFetchInWelcomeArea* fetcher = new LLFetchInWelcomeArea; | ||
2519 | fetcher->fetchDescendents(folders); | ||
2520 | if(fetcher->isEverythingComplete()) | ||
2521 | { | ||
2522 | fetcher->done(); | ||
2523 | } | ||
2524 | else | ||
2525 | { | ||
2526 | gInventory.addObserver(fetcher); | ||
2527 | } | ||
2528 | } | ||
2529 | all_done = TRUE; | ||
2530 | } | ||
2531 | |||
2532 | return all_done; | ||
2533 | } | ||
2534 | |||
2535 | |||
2536 | |||
2471 | // Teleport notification from the simulator | 2537 | // Teleport notification from the simulator |
2472 | // We're going to pretend to be a new agent | 2538 | // We're going to pretend to be a new agent |
2473 | void process_teleport_finish(LLMessageSystem* msg, void**) | 2539 | void process_teleport_finish(LLMessageSystem* msg, void**) |
@@ -2513,26 +2579,9 @@ void process_teleport_finish(LLMessageSystem* msg, void**) | |||
2513 | { | 2579 | { |
2514 | gAgent.setHomePosRegion(region_handle, pos); | 2580 | gAgent.setHomePosRegion(region_handle, pos); |
2515 | 2581 | ||
2516 | // get callingcards and landmarks available to the user arriving. | 2582 | // Create a timer that will send notices when teleporting is all finished. Since this is |
2517 | LLInventoryFetchDescendentsObserver::folder_ref_t folders; | 2583 | // based on the LLEventTimer class, it will be managed by that class and not orphaned or leaked. |
2518 | LLUUID folder_id; | 2584 | new LLPostTeleportNotifiers(); |
2519 | folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_CALLINGCARD); | ||
2520 | if(folder_id.notNull()) folders.push_back(folder_id); | ||
2521 | folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK); | ||
2522 | if(folder_id.notNull()) folders.push_back(folder_id); | ||
2523 | if(!folders.empty()) | ||
2524 | { | ||
2525 | LLFetchInWelcomeArea* fetcher = new LLFetchInWelcomeArea; | ||
2526 | fetcher->fetchDescendents(folders); | ||
2527 | if(fetcher->isEverythingComplete()) | ||
2528 | { | ||
2529 | fetcher->done(); | ||
2530 | } | ||
2531 | else | ||
2532 | { | ||
2533 | gInventory.addObserver(fetcher); | ||
2534 | } | ||
2535 | } | ||
2536 | } | 2585 | } |
2537 | 2586 | ||
2538 | LLHost sim_host(sim_ip, sim_port); | 2587 | LLHost sim_host(sim_ip, sim_port); |
@@ -2632,6 +2681,9 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) | |||
2632 | msg->getVector3Fast(_PREHASH_Data, _PREHASH_LookAt, look_at); | 2681 | msg->getVector3Fast(_PREHASH_Data, _PREHASH_LookAt, look_at); |
2633 | U64 region_handle; | 2682 | U64 region_handle; |
2634 | msg->getU64Fast(_PREHASH_Data, _PREHASH_RegionHandle, region_handle); | 2683 | msg->getU64Fast(_PREHASH_Data, _PREHASH_RegionHandle, region_handle); |
2684 | |||
2685 | char version_channel_char[MAX_STRING]; | ||
2686 | msg->getString("SimData", "ChannelVersion", MAX_STRING, version_channel_char); | ||
2635 | 2687 | ||
2636 | LLVOAvatar* avatarp = gAgent.getAvatarObject(); | 2688 | LLVOAvatar* avatarp = gAgent.getAvatarObject(); |
2637 | if (!avatarp) | 2689 | if (!avatarp) |
@@ -2765,6 +2817,23 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) | |||
2765 | msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); | 2817 | msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); |
2766 | msg->addBOOLFast(_PREHASH_AlwaysRun, gAgent.getAlwaysRun()); | 2818 | msg->addBOOLFast(_PREHASH_AlwaysRun, gAgent.getAlwaysRun()); |
2767 | gAgent.sendReliableMessage(); | 2819 | gAgent.sendReliableMessage(); |
2820 | |||
2821 | |||
2822 | LLString version_channel = LLString(version_channel_char); | ||
2823 | |||
2824 | if (gLastVersionChannel != version_channel) | ||
2825 | { | ||
2826 | //show release message if not on initial login | ||
2827 | if (!gLastVersionChannel.empty()) | ||
2828 | { | ||
2829 | gLastVersionChannel = version_channel; | ||
2830 | LLFloaterReleaseMsg::show(); | ||
2831 | } | ||
2832 | else { | ||
2833 | gLastVersionChannel = version_channel; | ||
2834 | } | ||
2835 | } | ||
2836 | |||
2768 | } | 2837 | } |
2769 | 2838 | ||
2770 | void process_crossed_region(LLMessageSystem* msg, void**) | 2839 | void process_crossed_region(LLMessageSystem* msg, void**) |
@@ -4006,12 +4075,10 @@ void process_alert_core(const char* buffer, BOOL modal) | |||
4006 | else if( !strcmp( buffer, "Home position set." ) ) | 4075 | else if( !strcmp( buffer, "Home position set." ) ) |
4007 | { | 4076 | { |
4008 | // save the home location image to disk | 4077 | // save the home location image to disk |
4009 | char temp_str[LL_MAX_PATH]; /* Flawfinder: ignore */ | 4078 | LLString snap_filename = gDirUtilp->getLindenUserDir(); |
4010 | strncpy(temp_str, gDirUtilp->getLindenUserDir().c_str(), LL_MAX_PATH -1); /* Flawfinder: ignore */ | 4079 | snap_filename += gDirUtilp->getDirDelimiter(); |
4011 | temp_str[LL_MAX_PATH -1] = '\0'; | 4080 | snap_filename += SCREEN_HOME_FILENAME; |
4012 | strcat(temp_str, "/"); /* Flawfinder: ignore */ | 4081 | gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidth(), gViewerWindow->getWindowHeight(), FALSE, FALSE); |
4013 | strcat(temp_str,SCREEN_HOME_FILENAME); /* Flawfinder: ignore */ | ||
4014 | gViewerWindow->saveSnapshot(temp_str, gViewerWindow->getWindowWidth(), gViewerWindow->getWindowHeight(), FALSE, FALSE); | ||
4015 | } | 4082 | } |
4016 | 4083 | ||
4017 | // Translate system messages here. | 4084 | // Translate system messages here. |
@@ -4562,7 +4629,16 @@ void process_teleport_failed(LLMessageSystem *msg, void**) | |||
4562 | msg->getStringFast(_PREHASH_Info, _PREHASH_Reason, STD_STRING_BUF_SIZE, reason); | 4629 | msg->getStringFast(_PREHASH_Info, _PREHASH_Reason, STD_STRING_BUF_SIZE, reason); |
4563 | 4630 | ||
4564 | LLStringBase<char>::format_map_t args; | 4631 | LLStringBase<char>::format_map_t args; |
4565 | args["[REASON]"] = LLAgent::sTeleportErrorMessages[reason]; | 4632 | LLString big_reason = LLAgent::sTeleportErrorMessages[reason]; |
4633 | if ( big_reason.size() > 0 ) | ||
4634 | { // Substitute verbose reason from the local map | ||
4635 | args["[REASON]"] = big_reason; | ||
4636 | } | ||
4637 | else | ||
4638 | { // Nothing found in the map - use what the server returned | ||
4639 | args["[REASON]"] = reason; | ||
4640 | } | ||
4641 | |||
4566 | gViewerWindow->alertXml("CouldNotTeleportReason", args); | 4642 | gViewerWindow->alertXml("CouldNotTeleportReason", args); |
4567 | 4643 | ||
4568 | if( gAgent.getTeleportState() != LLAgent::TELEPORT_NONE ) | 4644 | if( gAgent.getTeleportState() != LLAgent::TELEPORT_NONE ) |
@@ -5027,7 +5103,7 @@ void process_load_url(LLMessageSystem* msg, void**) | |||
5027 | } | 5103 | } |
5028 | 5104 | ||
5029 | 5105 | ||
5030 | void callback_download_complete(void** data, S32 result) | 5106 | void callback_download_complete(void** data, S32 result, LLExtStat ext_status) |
5031 | { | 5107 | { |
5032 | LLString* filepath = (LLString*)data; | 5108 | LLString* filepath = (LLString*)data; |
5033 | LLString::format_map_t args; | 5109 | LLString::format_map_t args; |
@@ -5164,7 +5240,7 @@ void callbackCacheEstateOwnerName( | |||
5164 | void onCovenantLoadComplete(LLVFS *vfs, | 5240 | void onCovenantLoadComplete(LLVFS *vfs, |
5165 | const LLUUID& asset_uuid, | 5241 | const LLUUID& asset_uuid, |
5166 | LLAssetType::EType type, | 5242 | LLAssetType::EType type, |
5167 | void* user_data, S32 status) | 5243 | void* user_data, S32 status, LLExtStat ext_status) |
5168 | { | 5244 | { |
5169 | llinfos << "onCovenantLoadComplete()" << llendl; | 5245 | llinfos << "onCovenantLoadComplete()" << llendl; |
5170 | std::string covenant_text; | 5246 | std::string covenant_text; |