mirror of
https://github.com/opensim/opensim.git
synced 2026-05-14 02:39:52 +08:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
18ed68cd31 | ||
|
|
4d712ddaae | ||
|
|
dd544f811a | ||
|
|
4423630f1e | ||
|
|
5caae0293a | ||
|
|
3d053b194a | ||
|
|
83929c69e3 | ||
|
|
84b0a23e19 |
@@ -1,8 +1,59 @@
|
||||
<!-- -*- xml -*- -->
|
||||
<!-- please leave the top comment for us emacs folks -->
|
||||
<property name="projectdir" value="opensim-0.5.5" />
|
||||
<property name="nunitcmd" value="nunit-console" />
|
||||
|
||||
<!-- For safety/laziness sake, we're going to take the approach of deleting known extraneous files here rather than
|
||||
trying to copy across only the essential ones -->
|
||||
<property name="distbindir" value="distbin" />
|
||||
<target name="distbin">
|
||||
<copy file="bin/OpenSim.ini.example" tofile="bin/OpenSim.ini"/>
|
||||
<delete dir="${distbindir}"/>
|
||||
<!-- <copy file="*" todir="${distbindir}"/> -->
|
||||
<copy todir="${distbindir}">
|
||||
<fileset>
|
||||
<include name="**"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
<delete dir="${distbindir}/OpenSim"/>
|
||||
<delete dir="${distbindir}/Prebuild"/>
|
||||
<delete dir="${distbindir}/%temp%"/>
|
||||
<delete dir="${distbindir}/.nant"/>
|
||||
<delete>
|
||||
<fileset basedir="${distbindir}">
|
||||
<include name="Makefile"/>
|
||||
<include name="nant-color"/>
|
||||
<include name="OpenSim.*"/>
|
||||
<include name="prebuild.xml"/>
|
||||
<include name="runprebuild*"/>
|
||||
<include name="TESTING.txt"/>
|
||||
<include name="TestResult.xml"/>
|
||||
<include name="bin/OpenSim.Server.ini"/>
|
||||
<include name="bin/Regions/*"/>
|
||||
<include name="bin/*.db"/>
|
||||
<include name="**/.git/**"/>
|
||||
<include name=".gitignore"/>
|
||||
<include name=".hgignore"/>
|
||||
</fileset>
|
||||
</delete>
|
||||
|
||||
</target>
|
||||
|
||||
<!-- I don't think these targets are being actively used. But just in case, we'll just comment them out for now - justincc -->
|
||||
<!--
|
||||
<property name="projectdir" value="opensim-0.6.9" />
|
||||
<target name="dist" depends="distdir">
|
||||
<zip zipfile="${projectdir}.zip">
|
||||
<fileset basedir=".">
|
||||
<include name="${projectdir}/**" />
|
||||
</fileset>
|
||||
</zip>
|
||||
<tar destfile="${projectdir}.tar.gz" compression="GZip">
|
||||
<fileset basedir=".">
|
||||
<include name="${projectdir}/**" />
|
||||
</fileset>
|
||||
</tar>
|
||||
</target>
|
||||
|
||||
<target name="distdir">
|
||||
<delete dir="${projectdir}" />
|
||||
<copy todir="${projectdir}">
|
||||
@@ -21,14 +72,14 @@
|
||||
<include name="bin/assets/**" />
|
||||
<include name="bin/data/**" />
|
||||
<include name="bin/OpenSim*xml" />
|
||||
<!-- the next is to exclude built libs -->
|
||||
<exclude name="bin/OpenSim.*dll" />
|
||||
<include name="bin/OpenSim.ini" />
|
||||
<include name="bin/defaultstripe.png" />
|
||||
<exclude name="bin/OpenSim.*dll" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<touch file="${projectdir}/bin/startup_commands.txt" />
|
||||
</target>
|
||||
-->
|
||||
|
||||
<target name="test" depends="build, find-nunit">
|
||||
<setenv name="MONO_THREADS_PER_CPU" value="100" />
|
||||
@@ -317,17 +368,3 @@
|
||||
<target name="doxygen">
|
||||
<exec program="doxygen" workingdir="doc" commandline="doxygen.conf" />
|
||||
</target>
|
||||
|
||||
|
||||
<target name="dist" depends="distdir">
|
||||
<zip zipfile="${projectdir}.zip">
|
||||
<fileset basedir=".">
|
||||
<include name="${projectdir}/**" />
|
||||
</fileset>
|
||||
</zip>
|
||||
<tar destfile="${projectdir}.tar.gz" compression="GZip">
|
||||
<fileset basedir=".">
|
||||
<include name="${projectdir}/**" />
|
||||
</fileset>
|
||||
</tar>
|
||||
</target>
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace OpenSim
|
||||
public class VersionInfo
|
||||
{
|
||||
private const string VERSION_NUMBER = "0.6.9";
|
||||
private const Flavour VERSION_FLAVOUR = Flavour.Dev;
|
||||
private const Flavour VERSION_FLAVOUR = Flavour.RC1;
|
||||
|
||||
public enum Flavour
|
||||
{
|
||||
|
||||
@@ -2339,9 +2339,18 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
EventManager.TriggerOnAttach(localID, itemID, avatarID);
|
||||
}
|
||||
|
||||
public UUID RezSingleAttachment(IClientAPI remoteClient, UUID itemID,
|
||||
uint AttachmentPt)
|
||||
/// <summary>
|
||||
/// Called when the client receives a request to rez a single attachment on to the avatar from inventory
|
||||
/// (RezSingleAttachmentFromInv packet).
|
||||
/// </summary>
|
||||
/// <param name="remoteClient"></param>
|
||||
/// <param name="itemID"></param>
|
||||
/// <param name="AttachmentPt"></param>
|
||||
/// <returns></returns>
|
||||
public UUID RezSingleAttachment(IClientAPI remoteClient, UUID itemID, uint AttachmentPt)
|
||||
{
|
||||
m_log.DebugFormat("[USER INVENTORY]: Rezzing single attachment from item {0} for {1}", itemID, remoteClient.Name);
|
||||
|
||||
SceneObjectGroup att = m_sceneGraph.RezSingleAttachment(remoteClient, itemID, AttachmentPt);
|
||||
|
||||
if (att == null)
|
||||
@@ -2353,9 +2362,20 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return RezSingleAttachment(att, remoteClient, itemID, AttachmentPt);
|
||||
}
|
||||
|
||||
public UUID RezSingleAttachment(SceneObjectGroup att,
|
||||
IClientAPI remoteClient, UUID itemID, uint AttachmentPt)
|
||||
/// <summary>
|
||||
/// Update the user inventory to reflect an attachment
|
||||
/// </summary>
|
||||
/// <param name="att"></param>
|
||||
/// <param name="remoteClient"></param>
|
||||
/// <param name="itemID"></param>
|
||||
/// <param name="AttachmentPt"></param>
|
||||
/// <returns></returns>
|
||||
public UUID RezSingleAttachment(SceneObjectGroup att, IClientAPI remoteClient, UUID itemID, uint AttachmentPt)
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[USER INVENTORY]: Updating inventory of {0} to show attachment of {1} (item ID {2})",
|
||||
remoteClient.Name, att.Name, itemID);
|
||||
|
||||
if (!att.IsDeleted)
|
||||
AttachmentPt = att.RootPart.AttachmentPoint;
|
||||
|
||||
@@ -2394,8 +2414,19 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return m_sceneGraph.AttachObject(controllingClient, localID, attachPoint, rot, pos, silent);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This registers the item as attached in a user's inventory
|
||||
/// </summary>
|
||||
/// <param name="remoteClient"></param>
|
||||
/// <param name="AttachmentPt"></param>
|
||||
/// <param name="itemID"></param>
|
||||
/// <param name="att"></param>
|
||||
public void AttachObject(IClientAPI remoteClient, uint AttachmentPt, UUID itemID, SceneObjectGroup att)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[USER INVENTORY]: Updating attachment {0} for {1} at {2} using item ID {3}",
|
||||
// att.Name, remoteClient.Name, AttachmentPt, itemID);
|
||||
|
||||
if (UUID.Zero == itemID)
|
||||
{
|
||||
m_log.Error("[SCENE INVENTORY]: Unable to save attachment. Error inventory item ID.");
|
||||
@@ -2423,10 +2454,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/);
|
||||
|
||||
if (m_AvatarFactory != null)
|
||||
{
|
||||
m_AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2509,6 +2537,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
sog.SetOwnerId(ownerID);
|
||||
sog.SetGroup(groupID, remoteClient);
|
||||
sog.ScheduleGroupForFullUpdate();
|
||||
|
||||
foreach (SceneObjectPart child in sog.Children.Values)
|
||||
child.Inventory.ChangeInventoryOwner(ownerID);
|
||||
@@ -2530,6 +2559,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
sog.SetOwnerId(groupID);
|
||||
sog.ApplyNextOwnerPermissions();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
foreach (uint localID in localIDs)
|
||||
|
||||
@@ -1813,14 +1813,22 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
//m_log.DebugFormat(
|
||||
// "[SCENE]: Scene.AddNewPrim() pcode {0} called for {1} in {2}", shape.PCode, ownerID, RegionInfo.RegionName);
|
||||
|
||||
SceneObjectGroup sceneObject = null;
|
||||
|
||||
// If an entity creator has been registered for this prim type then use that
|
||||
if (m_entityCreators.ContainsKey((PCode)shape.PCode))
|
||||
return m_entityCreators[(PCode)shape.PCode].CreateEntity(ownerID, groupID, pos, rot, shape);
|
||||
{
|
||||
sceneObject = m_entityCreators[(PCode)shape.PCode].CreateEntity(ownerID, groupID, pos, rot, shape);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Otherwise, use this default creation code;
|
||||
sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape);
|
||||
AddNewSceneObject(sceneObject, true);
|
||||
sceneObject.SetGroup(groupID, null);
|
||||
}
|
||||
|
||||
// Otherwise, use this default creation code;
|
||||
SceneObjectGroup sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape);
|
||||
AddNewSceneObject(sceneObject, true);
|
||||
sceneObject.SetGroup(groupID, null);
|
||||
sceneObject.ScheduleGroupForFullUpdate();
|
||||
|
||||
return sceneObject;
|
||||
}
|
||||
@@ -1848,7 +1856,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add a newly created object to the scene
|
||||
/// Add a newly created object to the scene. Updates are also sent to viewers.
|
||||
/// </summary>
|
||||
/// <param name="sceneObject"></param>
|
||||
/// <param name="attachToBackup">
|
||||
@@ -1857,8 +1865,25 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// </param>
|
||||
public bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup)
|
||||
{
|
||||
return m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup);
|
||||
return AddNewSceneObject(sceneObject, attachToBackup, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add a newly created object to the scene
|
||||
/// </summary>
|
||||
/// <param name="sceneObject"></param>
|
||||
/// <param name="attachToBackup">
|
||||
/// If true, the object is made persistent into the scene.
|
||||
/// If false, the object will not persist over server restarts
|
||||
/// </param>
|
||||
/// <param name="sendClientUpdates">
|
||||
/// If true, updates for the new scene object are sent to all viewers in range.
|
||||
/// If false, it is left to the caller to schedule the update
|
||||
/// </param>
|
||||
public bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates)
|
||||
{
|
||||
return m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup, sendClientUpdates);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete every object from the scene
|
||||
@@ -3322,7 +3347,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
else
|
||||
m_log.Debug("[SCENE]: Unable to register with InterregionCommsIn");
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -228,7 +228,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
sceneObject.HasGroupChanged = true;
|
||||
}
|
||||
|
||||
return AddSceneObject(sceneObject, attachToBackup);
|
||||
return AddSceneObject(sceneObject, attachToBackup, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -243,12 +243,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <returns>
|
||||
/// true if the object was added, false if an object with the same uuid was already in the scene
|
||||
/// </returns>
|
||||
protected internal bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup)
|
||||
protected internal bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates)
|
||||
{
|
||||
// Ensure that we persist this new scene object
|
||||
sceneObject.HasGroupChanged = true;
|
||||
|
||||
return AddSceneObject(sceneObject, attachToBackup);
|
||||
return AddSceneObject(sceneObject, attachToBackup, sendClientUpdates);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -260,12 +260,19 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// If true, the object is made persistent into the scene.
|
||||
/// If false, the object will not persist over server restarts
|
||||
/// </param>
|
||||
/// <returns>true if the object was added, false if an object with the same uuid was already in the scene
|
||||
/// <param name="sendClientUpdates">
|
||||
/// If true, updates for the new scene object are sent to all viewers in range.
|
||||
/// If false, it is left to the caller to schedule the update
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// true if the object was added, false if an object with the same uuid was already in the scene
|
||||
/// </returns>
|
||||
protected bool AddSceneObject(SceneObjectGroup sceneObject, bool attachToBackup)
|
||||
protected bool AddSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates)
|
||||
{
|
||||
if (sceneObject == null || sceneObject.RootPart == null || sceneObject.RootPart.UUID == UUID.Zero)
|
||||
return false;
|
||||
|
||||
bool alreadyExisted = false;
|
||||
|
||||
if (m_parentScene.m_clampPrimSize)
|
||||
{
|
||||
@@ -286,6 +293,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
sceneObject.AttachToScene(m_parentScene);
|
||||
|
||||
if (sendClientUpdates)
|
||||
sceneObject.ScheduleGroupForFullUpdate();
|
||||
|
||||
lock (sceneObject)
|
||||
{
|
||||
if (!Entities.ContainsKey(sceneObject.UUID))
|
||||
@@ -309,12 +319,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
SceneObjectGroupsByLocalID[part.LocalId] = sceneObject;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
alreadyExisted = true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return alreadyExisted;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -521,26 +533,34 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
itemID, Vector3.Zero, Vector3.Zero, UUID.Zero, (byte)1, true,
|
||||
false, false, remoteClient.AgentId, true);
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENE GRAPH]: Retrieved single object {0} for attachment to {1} on point {2}",
|
||||
// objatt.Name, remoteClient.Name, AttachmentPt);
|
||||
|
||||
if (objatt != null)
|
||||
{
|
||||
bool tainted = false;
|
||||
if (AttachmentPt != 0 && AttachmentPt != objatt.GetAttachmentPoint())
|
||||
tainted = true;
|
||||
|
||||
if (AttachObject(
|
||||
remoteClient, objatt.LocalId, AttachmentPt, Quaternion.Identity, objatt.AbsolutePosition, false))
|
||||
{
|
||||
objatt.ScheduleGroupForFullUpdate();
|
||||
if (tainted)
|
||||
objatt.HasGroupChanged = true;
|
||||
|
||||
// Fire after attach, so we don't get messy perms dialogs
|
||||
// 3 == AttachedRez
|
||||
objatt.CreateScriptInstances(0, true, m_parentScene.DefaultScriptEngine, 3);
|
||||
AttachObject(remoteClient, objatt.LocalId, AttachmentPt, Quaternion.Identity, objatt.AbsolutePosition, false);
|
||||
//objatt.ScheduleGroupForFullUpdate();
|
||||
|
||||
// Do this last so that event listeners have access to all the effects of the attachment
|
||||
m_parentScene.EventManager.TriggerOnAttach(objatt.LocalId, itemID, remoteClient.AgentId);
|
||||
}
|
||||
if (tainted)
|
||||
objatt.HasGroupChanged = true;
|
||||
|
||||
// Fire after attach, so we don't get messy perms dialogs
|
||||
// 3 == AttachedRez
|
||||
objatt.CreateScriptInstances(0, true, m_parentScene.DefaultScriptEngine, 3);
|
||||
|
||||
// Do this last so that event listeners have access to all the effects of the attachment
|
||||
m_parentScene.EventManager.TriggerOnAttach(objatt.LocalId, itemID, remoteClient.AgentId);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.WarnFormat(
|
||||
"[SCENE GRAPH]: Could not retrieve item {0} for attaching to avatar {1} at point {2}",
|
||||
itemID, remoteClient.Name, AttachmentPt);
|
||||
}
|
||||
|
||||
return objatt;
|
||||
|
||||
@@ -567,8 +567,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
|
||||
ApplyPhysics(m_scene.m_physicalPrim);
|
||||
|
||||
ScheduleGroupForFullUpdate();
|
||||
|
||||
// Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled
|
||||
// for the same object with very different properties. The caller must schedule the update.
|
||||
//ScheduleGroupForFullUpdate();
|
||||
}
|
||||
|
||||
public Vector3 GroupScale()
|
||||
@@ -956,10 +958,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// don't attach attachments to child agents
|
||||
if (avatar.IsChildAgent) return;
|
||||
|
||||
// m_log.DebugFormat("[SOG]: Adding attachment {0} to avatar {1}", Name, avatar.Name);
|
||||
|
||||
DetachFromBackup();
|
||||
|
||||
// Remove from database and parcel prim count
|
||||
//
|
||||
m_scene.DeleteFromStorage(UUID);
|
||||
m_scene.EventManager.TriggerParcelPrimCountTainted();
|
||||
|
||||
@@ -985,7 +988,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
SetAttachmentPoint(Convert.ToByte(attachmentpoint));
|
||||
|
||||
avatar.AddAttachment(this);
|
||||
m_log.Debug("[SOG]: Added attachment " + UUID + " to avatar " + avatar.UUID);
|
||||
|
||||
if (!silent)
|
||||
{
|
||||
@@ -1002,6 +1004,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
ScheduleGroupForFullUpdate();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.WarnFormat(
|
||||
"[SOG]: Tried to add attachment {0} to avatar with UUID {1} in region {2} but the avatar is not present",
|
||||
UUID, agentID, Scene.RegionInfo.RegionName);
|
||||
}
|
||||
}
|
||||
|
||||
public byte GetAttachmentPoint()
|
||||
@@ -1986,6 +1994,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public void ScheduleFullUpdateToAvatar(ScenePresence presence)
|
||||
{
|
||||
// m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1} just to avatar {2}", Name, UUID, presence.Name);
|
||||
|
||||
RootPart.AddFullUpdateToAvatar(presence);
|
||||
|
||||
lock (m_parts)
|
||||
@@ -2000,6 +2010,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public void ScheduleTerseUpdateToAvatar(ScenePresence presence)
|
||||
{
|
||||
// m_log.DebugFormat("[SOG]: Scheduling terse update for {0} {1} just to avatar {2}", Name, UUID, presence.Name);
|
||||
|
||||
lock (m_parts)
|
||||
{
|
||||
foreach (SceneObjectPart part in m_parts.Values)
|
||||
@@ -2014,6 +2026,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// </summary>
|
||||
public void ScheduleGroupForFullUpdate()
|
||||
{
|
||||
// m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, UUID);
|
||||
|
||||
checkAtTargets();
|
||||
RootPart.ScheduleFullUpdate();
|
||||
|
||||
@@ -2032,6 +2046,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// </summary>
|
||||
public void ScheduleGroupForTerseUpdate()
|
||||
{
|
||||
// m_log.DebugFormat("[SOG]: Scheduling terse update for {0} {1}", Name, UUID);
|
||||
|
||||
lock (m_parts)
|
||||
{
|
||||
foreach (SceneObjectPart part in m_parts.Values)
|
||||
@@ -2045,9 +2061,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// Immediately send a full update for this scene object.
|
||||
/// </summary>
|
||||
public void SendGroupFullUpdate()
|
||||
{
|
||||
{
|
||||
if (IsDeleted)
|
||||
return;
|
||||
|
||||
// m_log.DebugFormat("[SOG]: Sending immediate full group update for {0} {1}", Name, UUID);
|
||||
|
||||
RootPart.SendFullUpdateToAllClients();
|
||||
|
||||
@@ -2064,7 +2082,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <summary>
|
||||
/// Immediately send an update for this scene object's root prim only.
|
||||
/// This is for updates regarding the object as a whole, and none of its parts in particular.
|
||||
/// Note: this may not be cused by opensim (it probably should) but it's used by
|
||||
/// Note: this may not be used by opensim (it probably should) but it's used by
|
||||
/// external modules.
|
||||
/// </summary>
|
||||
public void SendGroupRootTerseUpdate()
|
||||
@@ -2079,6 +2097,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
if (m_scene == null) // Need to check here as it's null during object creation
|
||||
return;
|
||||
|
||||
m_scene.SceneGraph.AddToUpdateList(this);
|
||||
}
|
||||
|
||||
@@ -3557,7 +3576,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
HasGroupChanged = true;
|
||||
}
|
||||
|
||||
ScheduleGroupForFullUpdate();
|
||||
// Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled
|
||||
// for the same object with very different properties. The caller must schedule the update.
|
||||
//ScheduleGroupForFullUpdate();
|
||||
}
|
||||
|
||||
public void TriggerScriptChangedEvent(Changed val)
|
||||
|
||||
@@ -4680,5 +4680,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_log.Error("[Physics] " + ex);
|
||||
}
|
||||
}
|
||||
|
||||
public Color4 GetTextColor()
|
||||
{
|
||||
return new Color4((byte)Color.R, (byte)Color.G, (byte)Color.B, (byte)(0xFF - Color.A));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5406,12 +5406,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
public void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
SetTextureAnim(m_host, mode, face, sizex, sizey, start, length, rate);
|
||||
}
|
||||
|
||||
public void llSetLinkTextureAnim(int linknumber, int mode, int face, int sizex, int sizey, double start, double length, double rate)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
List<SceneObjectPart> parts = GetLinkParts(linknumber);
|
||||
|
||||
foreach (var part in parts)
|
||||
{
|
||||
SetTextureAnim(part, mode, face, sizex, sizey, start, length, rate);
|
||||
}
|
||||
}
|
||||
|
||||
private void SetTextureAnim(SceneObjectPart part, int mode, int face, int sizex, int sizey, double start, double length, double rate)
|
||||
{
|
||||
|
||||
Primitive.TextureAnimation pTexAnim = new Primitive.TextureAnimation();
|
||||
pTexAnim.Flags = (Primitive.TextureAnimMode)mode;
|
||||
|
||||
//ALL_SIDES
|
||||
if (face == ScriptBaseClass.ALL_SIDES)
|
||||
face = 255;
|
||||
face = 255;
|
||||
|
||||
pTexAnim.Face = (uint)face;
|
||||
pTexAnim.Length = (float)length;
|
||||
@@ -5420,9 +5439,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
pTexAnim.SizeY = (uint)sizey;
|
||||
pTexAnim.Start = (float)start;
|
||||
|
||||
m_host.AddTextureAnimation(pTexAnim);
|
||||
m_host.SendFullUpdateToAllClients();
|
||||
m_host.ParentGroup.HasGroupChanged = true;
|
||||
part.AddTextureAnimation(pTexAnim);
|
||||
part.SendFullUpdateToAllClients();
|
||||
part.ParentGroup.HasGroupChanged = true;
|
||||
}
|
||||
|
||||
public void llTriggerSoundLimited(string sound, double volume, LSL_Vector top_north_east,
|
||||
@@ -5819,13 +5838,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
return ps;
|
||||
}
|
||||
|
||||
public void llLinkParticleSystem(int linknumber, LSL_List rules)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
List<SceneObjectPart> parts = GetLinkParts(linknumber);
|
||||
|
||||
foreach (var part in parts)
|
||||
{
|
||||
SetParticleSystem(part, rules);
|
||||
}
|
||||
}
|
||||
|
||||
public void llParticleSystem(LSL_List rules)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
SetParticleSystem(m_host, rules);
|
||||
}
|
||||
|
||||
private void SetParticleSystem(SceneObjectPart part, LSL_List rules) {
|
||||
|
||||
|
||||
if (rules.Length == 0)
|
||||
{
|
||||
m_host.RemoveParticleSystem();
|
||||
m_host.ParentGroup.HasGroupChanged = true;
|
||||
part.RemoveParticleSystem();
|
||||
part.ParentGroup.HasGroupChanged = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5836,7 +5873,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
for (int i = 0; i < rules.Length; i += 2)
|
||||
{
|
||||
switch (Convert.ToInt32(rules.Data[i]))
|
||||
switch (rules.GetLSLIntegerItem(i))
|
||||
{
|
||||
case (int)ScriptBaseClass.PSYS_PART_FLAGS:
|
||||
prules.PartDataFlags = (Primitive.ParticleSystem.ParticleDataFlags)(uint)rules.GetLSLIntegerItem(i + 1);
|
||||
@@ -5936,7 +5973,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
else
|
||||
{
|
||||
prules.Target = m_host.UUID;
|
||||
prules.Target = part.UUID;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -5962,10 +5999,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
prules.CRC = 1;
|
||||
|
||||
m_host.AddNewParticleSystem(prules);
|
||||
m_host.ParentGroup.HasGroupChanged = true;
|
||||
part.AddNewParticleSystem(prules);
|
||||
part.ParentGroup.HasGroupChanged = true;
|
||||
}
|
||||
m_host.SendFullUpdateToAllClients();
|
||||
part.SendFullUpdateToAllClients();
|
||||
}
|
||||
|
||||
public void llGroundRepel(double height, int water, double tau)
|
||||
@@ -6759,6 +6796,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
SetPrimParams(part, rules);
|
||||
}
|
||||
|
||||
public void llSetLinkPrimitiveParamsFast(int linknumber, LSL_List rules)
|
||||
{
|
||||
llSetLinkPrimitiveParams(linknumber, rules);
|
||||
}
|
||||
|
||||
protected void SetPrimParams(SceneObjectPart part, LSL_List rules)
|
||||
{
|
||||
int idx = 0;
|
||||
@@ -7114,6 +7156,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
face = rules.GetLSLIntegerItem(idx++);
|
||||
int style = rules.GetLSLIntegerItem(idx++);
|
||||
SetTexGen(part, face, style);
|
||||
break;
|
||||
case (int)ScriptBaseClass.PRIM_TEXT:
|
||||
if (remain < 3)
|
||||
return;
|
||||
string primText = rules.GetLSLStringItem(idx++);
|
||||
LSL_Vector primTextColor = rules.GetVector3Item(idx++);
|
||||
LSL_Float primTextAlpha = rules.GetLSLFloatItem(idx++);
|
||||
Vector3 av3 = new Vector3(Util.Clip((float)primTextColor.x, 0.0f, 1.0f),
|
||||
Util.Clip((float)primTextColor.y, 0.0f, 1.0f),
|
||||
Util.Clip((float)primTextColor.z, 0.0f, 1.0f));
|
||||
part.SetText(primText, av3, Util.Clip((float)primTextAlpha, 0.0f, 1.0f));
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -7358,6 +7412,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
return GetLinkPrimitiveParams(m_host, rules);
|
||||
}
|
||||
|
||||
public LSL_List llGetLinkPrimitiveParams(int linknumber, LSL_List rules)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
List<SceneObjectPart> parts = GetLinkParts(linknumber);
|
||||
|
||||
LSL_List res = new LSL_List();
|
||||
|
||||
foreach (var part in parts)
|
||||
{
|
||||
LSL_List partRes = GetLinkPrimitiveParams(part, rules);
|
||||
res += partRes;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
public LSL_List GetLinkPrimitiveParams(SceneObjectPart part, LSL_List rules)
|
||||
{
|
||||
LSL_List res = new LSL_List();
|
||||
@@ -7635,6 +7706,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
res.Add(new LSL_Float(0));
|
||||
break;
|
||||
case (int)ScriptBaseClass.PRIM_TEXT:
|
||||
Color4 textColor = part.GetTextColor();
|
||||
res.Add(part.Text);
|
||||
res.Add(new LSL_Vector(textColor.R,
|
||||
textColor.G,
|
||||
textColor.B));
|
||||
res.Add(new LSL_Float(textColor.A));
|
||||
break;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
|
||||
@@ -135,6 +135,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||
LSL_Key llGetLinkKey(int linknum);
|
||||
LSL_String llGetLinkName(int linknum);
|
||||
LSL_Integer llGetLinkNumber();
|
||||
LSL_List llGetLinkPrimitiveParams(int linknum, LSL_List rules);
|
||||
LSL_Integer llGetListEntryType(LSL_List src, int index);
|
||||
LSL_Integer llGetListLength(LSL_List src);
|
||||
LSL_Vector llGetLocalPos();
|
||||
@@ -206,6 +207,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||
void llInstantMessage(string user, string message);
|
||||
LSL_String llIntegerToBase64(int number);
|
||||
LSL_String llKey2Name(string id);
|
||||
void llLinkParticleSystem(int linknum, LSL_List rules);
|
||||
LSL_String llList2CSV(LSL_List src);
|
||||
LSL_Float llList2Float(LSL_List src, int index);
|
||||
LSL_Integer llList2Integer(LSL_List src, int index);
|
||||
@@ -322,6 +324,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||
void llSetLinkColor(int linknumber, LSL_Vector color, int face);
|
||||
void llSetLinkPrimitiveParams(int linknumber, LSL_List rules);
|
||||
void llSetLinkTexture(int linknumber, string texture, int face);
|
||||
void llSetLinkTextureAnim(int linknum, int mode, int face, int sizex, int sizey, double start, double length, double rate);
|
||||
void llSetLocalRot(LSL_Rotation rot);
|
||||
void llSetObjectDesc(string desc);
|
||||
void llSetObjectName(string name);
|
||||
@@ -330,6 +333,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||
void llSetPayPrice(int price, LSL_List quick_pay_buttons);
|
||||
void llSetPos(LSL_Vector pos);
|
||||
void llSetPrimitiveParams(LSL_List rules);
|
||||
void llSetLinkPrimitiveParamsFast(int linknum, LSL_List rules);
|
||||
void llSetPrimURL(string url);
|
||||
void llSetRemoteScriptAccessPin(int pin);
|
||||
void llSetRot(LSL_Rotation rot);
|
||||
|
||||
@@ -313,6 +313,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
public const int PRIM_CAST_SHADOWS = 24; // Not implemented, here for completeness sake
|
||||
public const int PRIM_POINT_LIGHT = 23; // Huh?
|
||||
public const int PRIM_GLOW = 25;
|
||||
public const int PRIM_TEXT = 26;
|
||||
public const int PRIM_TEXGEN_DEFAULT = 0;
|
||||
public const int PRIM_TEXGEN_PLANAR = 1;
|
||||
|
||||
|
||||
@@ -674,6 +674,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
return m_LSL_Functions.llGetPrimitiveParams(rules);
|
||||
}
|
||||
|
||||
public LSL_List llGetLinkPrimitiveParams(int linknum, LSL_List rules)
|
||||
{
|
||||
return m_LSL_Functions.llGetLinkPrimitiveParams(linknum, rules);
|
||||
}
|
||||
|
||||
public LSL_Integer llGetRegionAgentCount()
|
||||
{
|
||||
return m_LSL_Functions.llGetRegionAgentCount();
|
||||
@@ -889,6 +894,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
return m_LSL_Functions.llKey2Name(id);
|
||||
}
|
||||
|
||||
public void llLinkParticleSystem(int linknum, LSL_List rules)
|
||||
{
|
||||
m_LSL_Functions.llLinkParticleSystem(linknum, rules);
|
||||
}
|
||||
|
||||
public LSL_String llList2CSV(LSL_List src)
|
||||
{
|
||||
return m_LSL_Functions.llList2CSV(src);
|
||||
@@ -1468,6 +1478,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
m_LSL_Functions.llSetLinkTexture(linknumber, texture, face);
|
||||
}
|
||||
|
||||
public void llSetLinkTextureAnim(int linknum, int mode, int face, int sizex, int sizey, double start, double length, double rate)
|
||||
{
|
||||
m_LSL_Functions.llSetLinkTextureAnim(linknum, mode, face, sizex, sizey, start, length, rate);
|
||||
}
|
||||
|
||||
public void llSetLocalRot(LSL_Rotation rot)
|
||||
{
|
||||
m_LSL_Functions.llSetLocalRot(rot);
|
||||
@@ -1508,6 +1523,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
m_LSL_Functions.llSetPrimitiveParams(rules);
|
||||
}
|
||||
|
||||
public void llSetLinkPrimitiveParamsFast(int linknum, LSL_List rules)
|
||||
{
|
||||
m_LSL_Functions.llSetLinkPrimitiveParamsFast(linknum, rules);
|
||||
}
|
||||
|
||||
public void llSetPrimURL(string url)
|
||||
{
|
||||
m_LSL_Functions.llSetPrimURL(url);
|
||||
|
||||
@@ -416,7 +416,6 @@ namespace OpenSim.Region.ScriptEngine.Shared
|
||||
|
||||
public list(params object[] args)
|
||||
{
|
||||
m_data = new object[args.Length];
|
||||
m_data = args;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user