diff options
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
| -rw-r--r-- | indra/newview/llviewermessage.cpp | 50 |
1 files changed, 42 insertions, 8 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index b35be7d385..c54feba06b 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3072,6 +3072,11 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) } } +#ifdef LL_DISCORD + if (gSavedSettings.getBOOL("EnableDiscord")) + LLAppViewer::updateDiscordActivity(); +#endif + if ( LLTracker::isTracking(NULL) ) { // Check distance to beacon, if < 5m, remove beacon @@ -3154,7 +3159,10 @@ void process_crossed_region(LLMessageSystem* msg, void**) return; } LL_INFOS("Messaging") << "process_crossed_region()" << LL_ENDL; - gAgentAvatarp->resetRegionCrossingTimer(); + if (isAgentAvatarValid()) + { + gAgentAvatarp->resetRegionCrossingTimer(); + } U32 sim_ip; msg->getIPAddrFast(_PREHASH_RegionData, _PREHASH_SimIP, sim_ip); @@ -3209,6 +3217,7 @@ void send_agent_update(bool force_send, bool send_reliable) static F64 last_send_time = 0.0; static U32 last_control_flags = 0; + static bool control_flags_follow_up = false; static U8 last_render_state = 0; static U8 last_flags = AU_FLAGS_NONE; static LLQuaternion last_body_rot, @@ -3286,6 +3295,20 @@ void send_agent_update(bool force_send, bool send_reliable) break; } + // example: + // user taps crouch (control_flags 4128), viewer sends 4128 then immediately 0 + // server starts crouching motion but does not stop it, only once viewer sends 0 + // second time will server stop the motion. follow_up exists to make sure all + // states like 'crouch' motion are properly cleared server side. + // + // P.S. Server probably shouldn't require a reminder to stop a motion, + // but at the moment it does. + if (control_flags_follow_up) + { + send_update = true; + break; + } + // check translation constexpr F32 TRANSLATE_THRESHOLD = 0.01f; if ((last_camera_pos_agent - camera_pos_agent).magVec() > TRANSLATE_THRESHOLD) @@ -3364,6 +3387,14 @@ void send_agent_update(bool force_send, bool send_reliable) msg->addVector3Fast(_PREHASH_CameraUpAxis, LLViewerCamera::getInstance()->getUpAxis()); static F32 last_draw_disatance_step = 1024; + F32 memory_limited_draw_distance = gAgentCamera.mDrawDistance; + + if (LLViewerTexture::isSystemMemoryCritical()) + { + // If we are low on memory, reduce requested draw distance + memory_limited_draw_distance = llmax(gAgentCamera.mDrawDistance / LLViewerTexture::getSystemMemoryBudgetFactor(), gAgentCamera.mDrawDistance / 2.f); + } + if (tp_state == LLAgent::TELEPORT_ARRIVING || LLStartUp::getStartupState() < STATE_MISC) { // Inform interest list, prioritize closer area. @@ -3372,25 +3403,25 @@ void send_agent_update(bool force_send, bool send_reliable) // closer ones. // Todo: revise and remove once server gets distance sorting. last_draw_disatance_step = llmax((F32)(gAgentCamera.mDrawDistance / 2.f), 50.f); + last_draw_disatance_step = llmin(last_draw_disatance_step, memory_limited_draw_distance); msg->addF32Fast(_PREHASH_Far, last_draw_disatance_step); } - else if (last_draw_disatance_step < gAgentCamera.mDrawDistance) + else if (last_draw_disatance_step < memory_limited_draw_distance) { static LLFrameTimer last_step_time; if (last_step_time.getElapsedTimeF32() > 1.f) { // gradually increase draw distance - // Idealy this should be not per second, but based on how loaded - // mesh thread is, but hopefully this is temporary. last_step_time.reset(); - F32 step = gAgentCamera.mDrawDistance * 0.1f; - last_draw_disatance_step = llmin(last_draw_disatance_step + step, gAgentCamera.mDrawDistance); + F32 step = memory_limited_draw_distance * 0.1f; + last_draw_disatance_step = llmin(last_draw_disatance_step + step, memory_limited_draw_distance); } msg->addF32Fast(_PREHASH_Far, last_draw_disatance_step); } else { - msg->addF32Fast(_PREHASH_Far, gAgentCamera.mDrawDistance); + last_draw_disatance_step = memory_limited_draw_distance; + msg->addF32Fast(_PREHASH_Far, memory_limited_draw_distance); } msg->addU32Fast(_PREHASH_ControlFlags, control_flags); @@ -3419,6 +3450,7 @@ void send_agent_update(bool force_send, bool send_reliable) // remember last update data last_send_time = now; + control_flags_follow_up = last_control_flags != control_flags; last_control_flags = control_flags; last_render_state = render_state; last_flags = flags; @@ -3668,7 +3700,7 @@ void process_kill_object(LLMessageSystem *mesgsys, void **user_data) gObjectList.killObject(objectp); } - if(delete_object) + if(delete_object && regionp) { regionp->killCacheEntry(local_id); } @@ -4212,6 +4244,8 @@ void process_avatar_sit_response(LLMessageSystem *mesgsys, void **user_data) { LL_WARNS("Messaging") << "Received sit approval for unknown object " << sitObjectID << LL_ENDL; } + + gAgent.setSitObjectID(sitObjectID); } void process_clear_follow_cam_properties(LLMessageSystem *mesgsys, void **user_data) |
