mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 02:36:00 +08:00
add proper way for viewers to request mute of collision sounds by setting flag 0x80 on agent update Flags (const U8 AU_FLAGS_MUTECOLLISIONS = 0x80;). Their current method of comparing sound UUIDS is just BROKEN, even at SL.
This commit is contained in:
@@ -265,7 +265,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
int thisMatScaled = thisMaterial * MaxMaterials;
|
||||
|
||||
// bool doneownsound = false;
|
||||
// bool doneownsound = false;
|
||||
|
||||
CollisionForSoundInfo colInfo;
|
||||
uint id;
|
||||
|
||||
@@ -2916,19 +2916,19 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (soundID.IsZero())
|
||||
return;
|
||||
|
||||
int now = Util.EnvironmentTickCount();
|
||||
if (Util.EnvironmentTickCountSubtract(now, LastColSoundSentTime) < 200)
|
||||
return;
|
||||
|
||||
ISoundModule soundModule = ParentGroup.Scene.RequestModuleInterface<ISoundModule>();
|
||||
if (soundModule == null)
|
||||
return;
|
||||
|
||||
if (volume > 1)
|
||||
volume = 1;
|
||||
if (volume < 0)
|
||||
else if (volume < 0)
|
||||
volume = 0;
|
||||
|
||||
int now = Util.EnvironmentTickCount();
|
||||
if(Util.EnvironmentTickCountSubtract(now, LastColSoundSentTime) < 200)
|
||||
return;
|
||||
|
||||
LastColSoundSentTime = now;
|
||||
|
||||
UUID ownerID = OwnerID;
|
||||
@@ -2936,7 +2936,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
UUID parentID = ParentGroup.UUID;
|
||||
ulong regionHandle = ParentGroup.Scene.RegionInfo.RegionHandle;
|
||||
|
||||
soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle);
|
||||
soundModule.TriggerCollisionSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle);
|
||||
}
|
||||
|
||||
public void PhysicsOutOfBounds(Vector3 pos)
|
||||
|
||||
@@ -72,9 +72,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
enum AgentUpdateFlags: byte
|
||||
{
|
||||
None = 0,
|
||||
HideTitle = 1,
|
||||
CliAutoPilot = 2
|
||||
None = 0,
|
||||
HideTitle = 0x01,
|
||||
CliAutoPilot = 0x02,
|
||||
MuteCollisions = 0x80
|
||||
}
|
||||
|
||||
public delegate void SendCoarseLocationsMethod(UUID scene, ScenePresence presence, List<Vector3> coarseLocations, List<UUID> avatarUUIDs);
|
||||
@@ -142,7 +143,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
public bool HideTitle = false;
|
||||
public bool HideTitle;
|
||||
public bool MuteCollisions;
|
||||
|
||||
private ScenePresenceStateMachine m_stateMachine;
|
||||
|
||||
@@ -2652,6 +2654,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
SendAvatarDataToAllAgents();
|
||||
}
|
||||
|
||||
MuteCollisions = (agentData.Flags & (byte)AgentUpdateFlags.MuteCollisions) != 0;
|
||||
|
||||
// FIXME: This does not work as intended because the viewer only sends the lbutton down when the button
|
||||
// is first pressed, not whilst it is held down. If this is required in the future then need to look
|
||||
// for an AGENT_CONTROL_LBUTTON_UP event and make sure to handle cases where an initial DOWN is not
|
||||
|
||||
Reference in New Issue
Block a user