mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 09:16:28 +08:00
Revolution is on the roll again! :)
Fixes: Undo, T-pose of others on login, modifiedBulletX works again, feet now stand on the ground instead of in the ground, adds checks to CombatModule. Adds: Redo, Land Undo, checks to agentUpdate (so one can not fall off of a region), more vehicle parts. Finishes almost all of LSL (1 function left, 2 events). Direct flames and kudos to Revolution, please Signed-off-by: Melanie <melanie@t-data.com>
This commit is contained in:
@@ -148,13 +148,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
|
||||
private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID)
|
||||
{
|
||||
ILandObject obj = avatar.Scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y);
|
||||
if ((obj.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0)
|
||||
try
|
||||
{
|
||||
avatar.Invulnerable = false;
|
||||
if ((obj.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0)
|
||||
{
|
||||
avatar.Invulnerable = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
avatar.Invulnerable = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
catch (Exception ex)
|
||||
{
|
||||
avatar.Invulnerable = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace OpenSim.Region.CoreModules.World.Sound
|
||||
}
|
||||
|
||||
public virtual void PlayAttachedSound(
|
||||
UUID soundID, UUID ownerID, UUID objectID, double gain, Vector3 position, byte flags)
|
||||
UUID soundID, UUID ownerID, UUID objectID, double gain, Vector3 position, byte flags, float radius)
|
||||
{
|
||||
foreach (ScenePresence p in m_scene.GetAvatars())
|
||||
{
|
||||
@@ -69,14 +69,17 @@ namespace OpenSim.Region.CoreModules.World.Sound
|
||||
continue;
|
||||
|
||||
// Scale by distance
|
||||
gain = (float)((double)gain*((100.0 - dis) / 100.0));
|
||||
if (radius == 0)
|
||||
gain = (float)((double)gain * ((100.0 - dis) / 100.0));
|
||||
else
|
||||
gain = (float)((double)gain * ((radius - dis) / radius));
|
||||
|
||||
p.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, (float)gain, flags);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void TriggerSound(
|
||||
UUID soundId, UUID ownerID, UUID objectID, UUID parentID, double gain, Vector3 position, UInt64 handle)
|
||||
UUID soundId, UUID ownerID, UUID objectID, UUID parentID, double gain, Vector3 position, UInt64 handle, float radius)
|
||||
{
|
||||
foreach (ScenePresence p in m_scene.GetAvatars())
|
||||
{
|
||||
@@ -85,7 +88,10 @@ namespace OpenSim.Region.CoreModules.World.Sound
|
||||
continue;
|
||||
|
||||
// Scale by distance
|
||||
gain = (float)((double)gain*((100.0 - dis) / 100.0));
|
||||
if (radius == 0)
|
||||
gain = (float)((double)gain * ((100.0 - dis) / 100.0));
|
||||
else
|
||||
gain = (float)((double)gain * ((radius - dis) / radius));
|
||||
|
||||
p.ControllingClient.SendTriggeredSound(
|
||||
soundId, ownerID, objectID, parentID, handle, position, (float)gain);
|
||||
|
||||
@@ -84,6 +84,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||
private ITerrainChannel m_revert;
|
||||
private Scene m_scene;
|
||||
private volatile bool m_tainted;
|
||||
private readonly UndoStack<LandUndoState> m_undo = new UndoStack<LandUndoState>(5);
|
||||
|
||||
#region ICommandableModule Members
|
||||
|
||||
@@ -174,6 +175,11 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||
|
||||
#region ITerrainModule Members
|
||||
|
||||
public void UndoTerrain(ITerrainChannel channel)
|
||||
{
|
||||
m_channel = channel;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads a terrain file from disk and installs it in the scene.
|
||||
/// </summary>
|
||||
@@ -574,6 +580,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||
{
|
||||
client.OnModifyTerrain += client_OnModifyTerrain;
|
||||
client.OnBakeTerrain += client_OnBakeTerrain;
|
||||
client.OnLandUndo += client_OnLandUndo;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -664,6 +671,19 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||
return changesLimited;
|
||||
}
|
||||
|
||||
private void client_OnLandUndo(IClientAPI client)
|
||||
{
|
||||
lock (m_undo)
|
||||
{
|
||||
if (m_undo.Count > 0)
|
||||
{
|
||||
LandUndoState goback = m_undo.Pop();
|
||||
if (goback != null)
|
||||
goback.PlaybackState();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends a copy of the current terrain to the scenes clients
|
||||
/// </summary>
|
||||
@@ -718,6 +738,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||
}
|
||||
if (allowed)
|
||||
{
|
||||
StoreUndoState();
|
||||
m_painteffects[(StandardTerrainEffects) action].PaintEffect(
|
||||
m_channel, allowMask, west, south, height, size, seconds);
|
||||
|
||||
@@ -758,6 +779,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||
|
||||
if (allowed)
|
||||
{
|
||||
StoreUndoState();
|
||||
m_floodeffects[(StandardTerrainEffects) action].FloodEffect(
|
||||
m_channel, fillArea, size);
|
||||
|
||||
@@ -782,6 +804,25 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||
}
|
||||
}
|
||||
|
||||
private void StoreUndoState()
|
||||
{
|
||||
lock (m_undo)
|
||||
{
|
||||
if (m_undo.Count > 0)
|
||||
{
|
||||
LandUndoState last = m_undo.Peek();
|
||||
if (last != null)
|
||||
{
|
||||
if (last.Compare(m_channel))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
LandUndoState nUndo = new LandUndoState(this, m_channel);
|
||||
m_undo.Push(nUndo);
|
||||
}
|
||||
}
|
||||
|
||||
#region Console Commands
|
||||
|
||||
private void InterfaceLoadFile(Object[] args)
|
||||
|
||||
Reference in New Issue
Block a user