Merge branch 'master' of git://opensimulator.org/git/opensim
commit
a724ebacd7
|
@ -169,6 +169,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||||
|
|
||||||
public bool SendAppearance(UUID agentId)
|
public bool SendAppearance(UUID agentId)
|
||||||
{
|
{
|
||||||
|
// m_log.DebugFormat("[AVFACTORY]: Sending appearance for {0}", agentId);
|
||||||
|
|
||||||
ScenePresence sp = m_scene.GetScenePresence(agentId);
|
ScenePresence sp = m_scene.GetScenePresence(agentId);
|
||||||
if (sp == null)
|
if (sp == null)
|
||||||
{
|
{
|
||||||
|
@ -257,7 +259,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void QueueAppearanceSend(UUID agentid)
|
public void QueueAppearanceSend(UUID agentid)
|
||||||
{
|
{
|
||||||
// m_log.WarnFormat("[AVFACTORY]: Queue appearance send for {0}", agentid);
|
// m_log.DebugFormat("[AVFACTORY]: Queue appearance send for {0}", agentid);
|
||||||
|
|
||||||
// 10000 ticks per millisecond, 1000 milliseconds per second
|
// 10000 ticks per millisecond, 1000 milliseconds per second
|
||||||
long timestamp = DateTime.Now.Ticks + Convert.ToInt64(m_sendtime * 1000 * 10000);
|
long timestamp = DateTime.Now.Ticks + Convert.ToInt64(m_sendtime * 1000 * 10000);
|
||||||
|
@ -393,10 +395,17 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||||
Dictionary<UUID, long> sends = new Dictionary<UUID, long>(m_sendqueue);
|
Dictionary<UUID, long> sends = new Dictionary<UUID, long>(m_sendqueue);
|
||||||
foreach (KeyValuePair<UUID, long> kvp in sends)
|
foreach (KeyValuePair<UUID, long> kvp in sends)
|
||||||
{
|
{
|
||||||
if (kvp.Value < now)
|
// We have to load the key and value into local parameters to avoid a race condition if we loop
|
||||||
|
// around and load kvp with a different value before FireAndForget has launched its thread.
|
||||||
|
UUID avatarID = kvp.Key;
|
||||||
|
long sendTime = kvp.Value;
|
||||||
|
|
||||||
|
// m_log.DebugFormat("[AVFACTORY]: Handling queued appearance updates for {0}, update delta to now is {1}", avatarID, sendTime - now);
|
||||||
|
|
||||||
|
if (sendTime < now)
|
||||||
{
|
{
|
||||||
Util.FireAndForget(delegate(object o) { SendAppearance(kvp.Key); });
|
Util.FireAndForget(o => SendAppearance(avatarID));
|
||||||
m_sendqueue.Remove(kvp.Key);
|
m_sendqueue.Remove(avatarID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -406,10 +415,15 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||||
Dictionary<UUID, long> saves = new Dictionary<UUID, long>(m_savequeue);
|
Dictionary<UUID, long> saves = new Dictionary<UUID, long>(m_savequeue);
|
||||||
foreach (KeyValuePair<UUID, long> kvp in saves)
|
foreach (KeyValuePair<UUID, long> kvp in saves)
|
||||||
{
|
{
|
||||||
if (kvp.Value < now)
|
// We have to load the key and value into local parameters to avoid a race condition if we loop
|
||||||
|
// around and load kvp with a different value before FireAndForget has launched its thread.
|
||||||
|
UUID avatarID = kvp.Key;
|
||||||
|
long sendTime = kvp.Value;
|
||||||
|
|
||||||
|
if (sendTime < now)
|
||||||
{
|
{
|
||||||
Util.FireAndForget(delegate(object o) { SaveAppearance(kvp.Key); });
|
Util.FireAndForget(o => SaveAppearance(avatarID));
|
||||||
m_savequeue.Remove(kvp.Key);
|
m_savequeue.Remove(avatarID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -395,9 +395,11 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
|
||||||
{
|
{
|
||||||
result = OpenJPEG.EncodeFromImage(joint, true);
|
result = OpenJPEG.EncodeFromImage(joint, true);
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
m_log.Error("[DYNAMICTEXTUREMODULE]: OpenJpeg Encode Failed. Empty byte data returned!");
|
m_log.ErrorFormat(
|
||||||
|
"[DYNAMICTEXTUREMODULE]: OpenJpeg Encode Failed. Exception {0}{1}",
|
||||||
|
e.Message, e.StackTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -338,10 +338,11 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
|
||||||
{
|
{
|
||||||
imageJ2000 = OpenJPEG.EncodeFromImage(bitmap, true);
|
imageJ2000 = OpenJPEG.EncodeFromImage(bitmap, true);
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
m_log.Error(
|
m_log.ErrorFormat(
|
||||||
"[VECTORRENDERMODULE]: OpenJpeg Encode Failed. Empty byte data returned!");
|
"[VECTORRENDERMODULE]: OpenJpeg Encode Failed. Exception {0}{1}",
|
||||||
|
e.Message, e.StackTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_textureManager.ReturnData(id, imageJ2000);
|
m_textureManager.ReturnData(id, imageJ2000);
|
||||||
|
|
|
@ -2628,7 +2628,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void SendAppearanceToAllOtherAgents()
|
public void SendAppearanceToAllOtherAgents()
|
||||||
{
|
{
|
||||||
//m_log.DebugFormat("[SCENE PRESENCE] SendAppearanceToAllOtherAgents: {0} ({1})", Name, UUID);
|
// m_log.DebugFormat("[SCENE PRESENCE] SendAppearanceToAllOtherAgents: {0} {1}", Name, UUID);
|
||||||
|
|
||||||
// only send update from root agents to other clients; children are only "listening posts"
|
// only send update from root agents to other clients; children are only "listening posts"
|
||||||
if (IsChildAgent)
|
if (IsChildAgent)
|
||||||
{
|
{
|
||||||
|
@ -2656,7 +2657,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void SendOtherAgentsAppearanceToMe()
|
public void SendOtherAgentsAppearanceToMe()
|
||||||
{
|
{
|
||||||
//m_log.DebugFormat("[SCENE PRESENCE] SendOtherAgentsAppearanceToMe: {0} ({1})", Name, UUID);
|
// m_log.DebugFormat("[SCENE PRESENCE] SendOtherAgentsAppearanceToMe: {0} {1}", Name, UUID);
|
||||||
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
m_scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence)
|
m_scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence)
|
||||||
|
|
|
@ -1958,6 +1958,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
return end;
|
return end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected LSL_Vector GetSetPosTarget(SceneObjectPart part, LSL_Vector targetPos, LSL_Vector fromPos)
|
||||||
|
{
|
||||||
|
if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
|
||||||
|
return fromPos;
|
||||||
|
|
||||||
|
// Capped movemment if distance > 10m (http://wiki.secondlife.com/wiki/LlSetPos)
|
||||||
|
|
||||||
|
|
||||||
|
float ground = World.GetGroundHeight((float)targetPos.x, (float)targetPos.y);
|
||||||
|
bool disable_underground_movement = m_ScriptEngine.Config.GetBoolean("DisableUndergroundMovement", true);
|
||||||
|
|
||||||
|
if (part.ParentGroup.RootPart == part)
|
||||||
|
{
|
||||||
|
if ((targetPos.z < ground) && disable_underground_movement && m_host.ParentGroup.AttachmentPoint == 0)
|
||||||
|
targetPos.z = ground;
|
||||||
|
}
|
||||||
|
LSL_Vector real_vec = SetPosAdjust(fromPos, targetPos);
|
||||||
|
|
||||||
|
return real_vec;
|
||||||
|
}
|
||||||
|
|
||||||
protected void SetPos(SceneObjectPart part, LSL_Vector targetPos)
|
protected void SetPos(SceneObjectPart part, LSL_Vector targetPos)
|
||||||
{
|
{
|
||||||
// Capped movemment if distance > 10m (http://wiki.secondlife.com/wiki/LlSetPos)
|
// Capped movemment if distance > 10m (http://wiki.secondlife.com/wiki/LlSetPos)
|
||||||
|
@ -7040,380 +7061,406 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
|
|
||||||
while (idx < rules.Length)
|
bool positionChanged = false;
|
||||||
|
LSL_Vector currentPosition = GetPartLocalPos(part);
|
||||||
|
|
||||||
|
try
|
||||||
{
|
{
|
||||||
int code = rules.GetLSLIntegerItem(idx++);
|
while (idx < rules.Length)
|
||||||
|
|
||||||
int remain = rules.Length - idx;
|
|
||||||
|
|
||||||
int face;
|
|
||||||
LSL_Vector v;
|
|
||||||
|
|
||||||
switch (code)
|
|
||||||
{
|
{
|
||||||
case (int)ScriptBaseClass.PRIM_POSITION:
|
int code = rules.GetLSLIntegerItem(idx++);
|
||||||
if (remain < 1)
|
|
||||||
return;
|
int remain = rules.Length - idx;
|
||||||
|
|
||||||
v=rules.GetVector3Item(idx++);
|
int face;
|
||||||
SetPos(part, v);
|
LSL_Vector v;
|
||||||
|
|
||||||
break;
|
switch (code)
|
||||||
case (int)ScriptBaseClass.PRIM_SIZE:
|
{
|
||||||
if (remain < 1)
|
case (int)ScriptBaseClass.PRIM_POSITION:
|
||||||
return;
|
if (remain < 1)
|
||||||
|
return;
|
||||||
v=rules.GetVector3Item(idx++);
|
|
||||||
SetScale(part, v);
|
v=rules.GetVector3Item(idx++);
|
||||||
|
positionChanged = true;
|
||||||
break;
|
currentPosition = GetSetPosTarget(part, v, currentPosition);
|
||||||
case (int)ScriptBaseClass.PRIM_ROTATION:
|
|
||||||
if (remain < 1)
|
break;
|
||||||
return;
|
case (int)ScriptBaseClass.PRIM_SIZE:
|
||||||
|
if (remain < 1)
|
||||||
LSL_Rotation q = rules.GetQuaternionItem(idx++);
|
return;
|
||||||
// try to let this work as in SL...
|
|
||||||
if (part.ParentID == 0)
|
v=rules.GetVector3Item(idx++);
|
||||||
{
|
SetScale(part, v);
|
||||||
// special case: If we are root, rotate complete SOG to new rotation
|
|
||||||
SetRot(part, Rot2Quaternion(q));
|
break;
|
||||||
}
|
case (int)ScriptBaseClass.PRIM_ROTATION:
|
||||||
else
|
if (remain < 1)
|
||||||
{
|
return;
|
||||||
// we are a child. The rotation values will be set to the one of root modified by rot, as in SL. Don't ask.
|
|
||||||
SceneObjectPart rootPart = part.ParentGroup.RootPart;
|
LSL_Rotation q = rules.GetQuaternionItem(idx++);
|
||||||
SetRot(part, rootPart.RotationOffset * Rot2Quaternion(q));
|
// try to let this work as in SL...
|
||||||
}
|
if (part.ParentID == 0)
|
||||||
|
{
|
||||||
break;
|
// special case: If we are root, rotate complete SOG to new rotation
|
||||||
|
SetRot(part, Rot2Quaternion(q));
|
||||||
case (int)ScriptBaseClass.PRIM_TYPE:
|
}
|
||||||
if (remain < 3)
|
else
|
||||||
return;
|
{
|
||||||
|
// we are a child. The rotation values will be set to the one of root modified by rot, as in SL. Don't ask.
|
||||||
code = (int)rules.GetLSLIntegerItem(idx++);
|
SceneObjectPart rootPart = part.ParentGroup.RootPart;
|
||||||
|
SetRot(part, rootPart.RotationOffset * Rot2Quaternion(q));
|
||||||
remain = rules.Length - idx;
|
}
|
||||||
float hollow;
|
|
||||||
LSL_Vector twist;
|
break;
|
||||||
LSL_Vector taper_b;
|
|
||||||
LSL_Vector topshear;
|
case (int)ScriptBaseClass.PRIM_TYPE:
|
||||||
float revolutions;
|
if (remain < 3)
|
||||||
float radiusoffset;
|
return;
|
||||||
float skew;
|
|
||||||
LSL_Vector holesize;
|
code = (int)rules.GetLSLIntegerItem(idx++);
|
||||||
LSL_Vector profilecut;
|
|
||||||
|
remain = rules.Length - idx;
|
||||||
switch (code)
|
float hollow;
|
||||||
{
|
LSL_Vector twist;
|
||||||
case (int)ScriptBaseClass.PRIM_TYPE_BOX:
|
LSL_Vector taper_b;
|
||||||
if (remain < 6)
|
LSL_Vector topshear;
|
||||||
return;
|
float revolutions;
|
||||||
|
float radiusoffset;
|
||||||
face = (int)rules.GetLSLIntegerItem(idx++);
|
float skew;
|
||||||
v = rules.GetVector3Item(idx++); // cut
|
LSL_Vector holesize;
|
||||||
hollow = (float)rules.GetLSLFloatItem(idx++);
|
LSL_Vector profilecut;
|
||||||
twist = rules.GetVector3Item(idx++);
|
|
||||||
taper_b = rules.GetVector3Item(idx++);
|
switch (code)
|
||||||
topshear = rules.GetVector3Item(idx++);
|
{
|
||||||
|
case (int)ScriptBaseClass.PRIM_TYPE_BOX:
|
||||||
SetPrimitiveShapeParams(part, face, v, hollow, twist, taper_b, topshear,
|
if (remain < 6)
|
||||||
(byte)ProfileShape.Square, (byte)Extrusion.Straight);
|
return;
|
||||||
break;
|
|
||||||
|
face = (int)rules.GetLSLIntegerItem(idx++);
|
||||||
case (int)ScriptBaseClass.PRIM_TYPE_CYLINDER:
|
v = rules.GetVector3Item(idx++); // cut
|
||||||
if (remain < 6)
|
hollow = (float)rules.GetLSLFloatItem(idx++);
|
||||||
return;
|
twist = rules.GetVector3Item(idx++);
|
||||||
|
taper_b = rules.GetVector3Item(idx++);
|
||||||
face = (int)rules.GetLSLIntegerItem(idx++); // holeshape
|
topshear = rules.GetVector3Item(idx++);
|
||||||
v = rules.GetVector3Item(idx++); // cut
|
|
||||||
hollow = (float)rules.GetLSLFloatItem(idx++);
|
SetPrimitiveShapeParams(part, face, v, hollow, twist, taper_b, topshear,
|
||||||
twist = rules.GetVector3Item(idx++);
|
(byte)ProfileShape.Square, (byte)Extrusion.Straight);
|
||||||
taper_b = rules.GetVector3Item(idx++);
|
break;
|
||||||
topshear = rules.GetVector3Item(idx++);
|
|
||||||
SetPrimitiveShapeParams(part, face, v, hollow, twist, taper_b, topshear,
|
case (int)ScriptBaseClass.PRIM_TYPE_CYLINDER:
|
||||||
(byte)ProfileShape.Circle, (byte)Extrusion.Straight);
|
if (remain < 6)
|
||||||
break;
|
return;
|
||||||
|
|
||||||
case (int)ScriptBaseClass.PRIM_TYPE_PRISM:
|
face = (int)rules.GetLSLIntegerItem(idx++); // holeshape
|
||||||
if (remain < 6)
|
v = rules.GetVector3Item(idx++); // cut
|
||||||
return;
|
hollow = (float)rules.GetLSLFloatItem(idx++);
|
||||||
|
twist = rules.GetVector3Item(idx++);
|
||||||
face = (int)rules.GetLSLIntegerItem(idx++); // holeshape
|
taper_b = rules.GetVector3Item(idx++);
|
||||||
v = rules.GetVector3Item(idx++); //cut
|
topshear = rules.GetVector3Item(idx++);
|
||||||
hollow = (float)rules.GetLSLFloatItem(idx++);
|
SetPrimitiveShapeParams(part, face, v, hollow, twist, taper_b, topshear,
|
||||||
twist = rules.GetVector3Item(idx++);
|
(byte)ProfileShape.Circle, (byte)Extrusion.Straight);
|
||||||
taper_b = rules.GetVector3Item(idx++);
|
break;
|
||||||
topshear = rules.GetVector3Item(idx++);
|
|
||||||
SetPrimitiveShapeParams(part, face, v, hollow, twist, taper_b, topshear,
|
case (int)ScriptBaseClass.PRIM_TYPE_PRISM:
|
||||||
(byte)ProfileShape.EquilateralTriangle, (byte)Extrusion.Straight);
|
if (remain < 6)
|
||||||
break;
|
return;
|
||||||
|
|
||||||
case (int)ScriptBaseClass.PRIM_TYPE_SPHERE:
|
face = (int)rules.GetLSLIntegerItem(idx++); // holeshape
|
||||||
if (remain < 5)
|
v = rules.GetVector3Item(idx++); //cut
|
||||||
return;
|
hollow = (float)rules.GetLSLFloatItem(idx++);
|
||||||
|
twist = rules.GetVector3Item(idx++);
|
||||||
face = (int)rules.GetLSLIntegerItem(idx++); // holeshape
|
taper_b = rules.GetVector3Item(idx++);
|
||||||
v = rules.GetVector3Item(idx++); // cut
|
topshear = rules.GetVector3Item(idx++);
|
||||||
hollow = (float)rules.GetLSLFloatItem(idx++);
|
SetPrimitiveShapeParams(part, face, v, hollow, twist, taper_b, topshear,
|
||||||
twist = rules.GetVector3Item(idx++);
|
(byte)ProfileShape.EquilateralTriangle, (byte)Extrusion.Straight);
|
||||||
taper_b = rules.GetVector3Item(idx++); // dimple
|
break;
|
||||||
SetPrimitiveShapeParams(part, face, v, hollow, twist, taper_b,
|
|
||||||
(byte)ProfileShape.HalfCircle, (byte)Extrusion.Curve1);
|
case (int)ScriptBaseClass.PRIM_TYPE_SPHERE:
|
||||||
break;
|
if (remain < 5)
|
||||||
|
return;
|
||||||
case (int)ScriptBaseClass.PRIM_TYPE_TORUS:
|
|
||||||
if (remain < 11)
|
face = (int)rules.GetLSLIntegerItem(idx++); // holeshape
|
||||||
return;
|
v = rules.GetVector3Item(idx++); // cut
|
||||||
|
hollow = (float)rules.GetLSLFloatItem(idx++);
|
||||||
face = (int)rules.GetLSLIntegerItem(idx++); // holeshape
|
twist = rules.GetVector3Item(idx++);
|
||||||
v = rules.GetVector3Item(idx++); //cut
|
taper_b = rules.GetVector3Item(idx++); // dimple
|
||||||
hollow = (float)rules.GetLSLFloatItem(idx++);
|
SetPrimitiveShapeParams(part, face, v, hollow, twist, taper_b,
|
||||||
twist = rules.GetVector3Item(idx++);
|
(byte)ProfileShape.HalfCircle, (byte)Extrusion.Curve1);
|
||||||
holesize = rules.GetVector3Item(idx++);
|
break;
|
||||||
topshear = rules.GetVector3Item(idx++);
|
|
||||||
profilecut = rules.GetVector3Item(idx++);
|
case (int)ScriptBaseClass.PRIM_TYPE_TORUS:
|
||||||
taper_b = rules.GetVector3Item(idx++); // taper_a
|
if (remain < 11)
|
||||||
revolutions = (float)rules.GetLSLFloatItem(idx++);
|
return;
|
||||||
radiusoffset = (float)rules.GetLSLFloatItem(idx++);
|
|
||||||
skew = (float)rules.GetLSLFloatItem(idx++);
|
face = (int)rules.GetLSLIntegerItem(idx++); // holeshape
|
||||||
SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b,
|
v = rules.GetVector3Item(idx++); //cut
|
||||||
revolutions, radiusoffset, skew, (byte)ProfileShape.Circle, (byte)Extrusion.Curve1);
|
hollow = (float)rules.GetLSLFloatItem(idx++);
|
||||||
break;
|
twist = rules.GetVector3Item(idx++);
|
||||||
|
holesize = rules.GetVector3Item(idx++);
|
||||||
case (int)ScriptBaseClass.PRIM_TYPE_TUBE:
|
topshear = rules.GetVector3Item(idx++);
|
||||||
if (remain < 11)
|
profilecut = rules.GetVector3Item(idx++);
|
||||||
return;
|
taper_b = rules.GetVector3Item(idx++); // taper_a
|
||||||
|
revolutions = (float)rules.GetLSLFloatItem(idx++);
|
||||||
face = (int)rules.GetLSLIntegerItem(idx++); // holeshape
|
radiusoffset = (float)rules.GetLSLFloatItem(idx++);
|
||||||
v = rules.GetVector3Item(idx++); //cut
|
skew = (float)rules.GetLSLFloatItem(idx++);
|
||||||
hollow = (float)rules.GetLSLFloatItem(idx++);
|
SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b,
|
||||||
twist = rules.GetVector3Item(idx++);
|
revolutions, radiusoffset, skew, (byte)ProfileShape.Circle, (byte)Extrusion.Curve1);
|
||||||
holesize = rules.GetVector3Item(idx++);
|
break;
|
||||||
topshear = rules.GetVector3Item(idx++);
|
|
||||||
profilecut = rules.GetVector3Item(idx++);
|
case (int)ScriptBaseClass.PRIM_TYPE_TUBE:
|
||||||
taper_b = rules.GetVector3Item(idx++); // taper_a
|
if (remain < 11)
|
||||||
revolutions = (float)rules.GetLSLFloatItem(idx++);
|
return;
|
||||||
radiusoffset = (float)rules.GetLSLFloatItem(idx++);
|
|
||||||
skew = (float)rules.GetLSLFloatItem(idx++);
|
face = (int)rules.GetLSLIntegerItem(idx++); // holeshape
|
||||||
SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b,
|
v = rules.GetVector3Item(idx++); //cut
|
||||||
revolutions, radiusoffset, skew, (byte)ProfileShape.Square, (byte)Extrusion.Curve1);
|
hollow = (float)rules.GetLSLFloatItem(idx++);
|
||||||
break;
|
twist = rules.GetVector3Item(idx++);
|
||||||
|
holesize = rules.GetVector3Item(idx++);
|
||||||
case (int)ScriptBaseClass.PRIM_TYPE_RING:
|
topshear = rules.GetVector3Item(idx++);
|
||||||
if (remain < 11)
|
profilecut = rules.GetVector3Item(idx++);
|
||||||
return;
|
taper_b = rules.GetVector3Item(idx++); // taper_a
|
||||||
|
revolutions = (float)rules.GetLSLFloatItem(idx++);
|
||||||
face = (int)rules.GetLSLIntegerItem(idx++); // holeshape
|
radiusoffset = (float)rules.GetLSLFloatItem(idx++);
|
||||||
v = rules.GetVector3Item(idx++); //cut
|
skew = (float)rules.GetLSLFloatItem(idx++);
|
||||||
hollow = (float)rules.GetLSLFloatItem(idx++);
|
SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b,
|
||||||
twist = rules.GetVector3Item(idx++);
|
revolutions, radiusoffset, skew, (byte)ProfileShape.Square, (byte)Extrusion.Curve1);
|
||||||
holesize = rules.GetVector3Item(idx++);
|
break;
|
||||||
topshear = rules.GetVector3Item(idx++);
|
|
||||||
profilecut = rules.GetVector3Item(idx++);
|
case (int)ScriptBaseClass.PRIM_TYPE_RING:
|
||||||
taper_b = rules.GetVector3Item(idx++); // taper_a
|
if (remain < 11)
|
||||||
revolutions = (float)rules.GetLSLFloatItem(idx++);
|
return;
|
||||||
radiusoffset = (float)rules.GetLSLFloatItem(idx++);
|
|
||||||
skew = (float)rules.GetLSLFloatItem(idx++);
|
face = (int)rules.GetLSLIntegerItem(idx++); // holeshape
|
||||||
SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b,
|
v = rules.GetVector3Item(idx++); //cut
|
||||||
revolutions, radiusoffset, skew, (byte)ProfileShape.EquilateralTriangle, (byte)Extrusion.Curve1);
|
hollow = (float)rules.GetLSLFloatItem(idx++);
|
||||||
break;
|
twist = rules.GetVector3Item(idx++);
|
||||||
|
holesize = rules.GetVector3Item(idx++);
|
||||||
case (int)ScriptBaseClass.PRIM_TYPE_SCULPT:
|
topshear = rules.GetVector3Item(idx++);
|
||||||
if (remain < 2)
|
profilecut = rules.GetVector3Item(idx++);
|
||||||
return;
|
taper_b = rules.GetVector3Item(idx++); // taper_a
|
||||||
|
revolutions = (float)rules.GetLSLFloatItem(idx++);
|
||||||
string map = rules.Data[idx++].ToString();
|
radiusoffset = (float)rules.GetLSLFloatItem(idx++);
|
||||||
face = (int)rules.GetLSLIntegerItem(idx++); // type
|
skew = (float)rules.GetLSLFloatItem(idx++);
|
||||||
SetPrimitiveShapeParams(part, map, face, (byte)Extrusion.Curve1);
|
SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b,
|
||||||
break;
|
revolutions, radiusoffset, skew, (byte)ProfileShape.EquilateralTriangle, (byte)Extrusion.Curve1);
|
||||||
}
|
break;
|
||||||
|
|
||||||
break;
|
case (int)ScriptBaseClass.PRIM_TYPE_SCULPT:
|
||||||
|
if (remain < 2)
|
||||||
case (int)ScriptBaseClass.PRIM_TEXTURE:
|
return;
|
||||||
if (remain < 5)
|
|
||||||
return;
|
string map = rules.Data[idx++].ToString();
|
||||||
|
face = (int)rules.GetLSLIntegerItem(idx++); // type
|
||||||
face=(int)rules.GetLSLIntegerItem(idx++);
|
SetPrimitiveShapeParams(part, map, face, (byte)Extrusion.Curve1);
|
||||||
string tex=rules.Data[idx++].ToString();
|
break;
|
||||||
LSL_Vector repeats=rules.GetVector3Item(idx++);
|
}
|
||||||
LSL_Vector offsets=rules.GetVector3Item(idx++);
|
|
||||||
double rotation=(double)rules.GetLSLFloatItem(idx++);
|
break;
|
||||||
|
|
||||||
SetTexture(part, tex, face);
|
case (int)ScriptBaseClass.PRIM_TEXTURE:
|
||||||
ScaleTexture(part, repeats.x, repeats.y, face);
|
if (remain < 5)
|
||||||
OffsetTexture(part, offsets.x, offsets.y, face);
|
return;
|
||||||
RotateTexture(part, rotation, face);
|
|
||||||
|
face=(int)rules.GetLSLIntegerItem(idx++);
|
||||||
break;
|
string tex=rules.Data[idx++].ToString();
|
||||||
|
LSL_Vector repeats=rules.GetVector3Item(idx++);
|
||||||
case (int)ScriptBaseClass.PRIM_COLOR:
|
LSL_Vector offsets=rules.GetVector3Item(idx++);
|
||||||
if (remain < 3)
|
double rotation=(double)rules.GetLSLFloatItem(idx++);
|
||||||
return;
|
|
||||||
|
SetTexture(part, tex, face);
|
||||||
face=(int)rules.GetLSLIntegerItem(idx++);
|
ScaleTexture(part, repeats.x, repeats.y, face);
|
||||||
LSL_Vector color=rules.GetVector3Item(idx++);
|
OffsetTexture(part, offsets.x, offsets.y, face);
|
||||||
double alpha=(double)rules.GetLSLFloatItem(idx++);
|
RotateTexture(part, rotation, face);
|
||||||
|
|
||||||
part.SetFaceColor(new Vector3((float)color.x, (float)color.y, (float)color.z), face);
|
break;
|
||||||
SetAlpha(part, alpha, face);
|
|
||||||
|
case (int)ScriptBaseClass.PRIM_COLOR:
|
||||||
break;
|
if (remain < 3)
|
||||||
|
return;
|
||||||
case (int)ScriptBaseClass.PRIM_FLEXIBLE:
|
|
||||||
if (remain < 7)
|
face=(int)rules.GetLSLIntegerItem(idx++);
|
||||||
return;
|
LSL_Vector color=rules.GetVector3Item(idx++);
|
||||||
|
double alpha=(double)rules.GetLSLFloatItem(idx++);
|
||||||
bool flexi = rules.GetLSLIntegerItem(idx++);
|
|
||||||
int softness = rules.GetLSLIntegerItem(idx++);
|
part.SetFaceColor(new Vector3((float)color.x, (float)color.y, (float)color.z), face);
|
||||||
float gravity = (float)rules.GetLSLFloatItem(idx++);
|
SetAlpha(part, alpha, face);
|
||||||
float friction = (float)rules.GetLSLFloatItem(idx++);
|
|
||||||
float wind = (float)rules.GetLSLFloatItem(idx++);
|
break;
|
||||||
float tension = (float)rules.GetLSLFloatItem(idx++);
|
|
||||||
LSL_Vector force = rules.GetVector3Item(idx++);
|
case (int)ScriptBaseClass.PRIM_FLEXIBLE:
|
||||||
|
if (remain < 7)
|
||||||
SetFlexi(part, flexi, softness, gravity, friction, wind, tension, force);
|
return;
|
||||||
|
|
||||||
break;
|
bool flexi = rules.GetLSLIntegerItem(idx++);
|
||||||
|
int softness = rules.GetLSLIntegerItem(idx++);
|
||||||
case (int)ScriptBaseClass.PRIM_POINT_LIGHT:
|
float gravity = (float)rules.GetLSLFloatItem(idx++);
|
||||||
if (remain < 5)
|
float friction = (float)rules.GetLSLFloatItem(idx++);
|
||||||
return;
|
float wind = (float)rules.GetLSLFloatItem(idx++);
|
||||||
bool light = rules.GetLSLIntegerItem(idx++);
|
float tension = (float)rules.GetLSLFloatItem(idx++);
|
||||||
LSL_Vector lightcolor = rules.GetVector3Item(idx++);
|
LSL_Vector force = rules.GetVector3Item(idx++);
|
||||||
float intensity = (float)rules.GetLSLFloatItem(idx++);
|
|
||||||
float radius = (float)rules.GetLSLFloatItem(idx++);
|
SetFlexi(part, flexi, softness, gravity, friction, wind, tension, force);
|
||||||
float falloff = (float)rules.GetLSLFloatItem(idx++);
|
|
||||||
|
break;
|
||||||
SetPointLight(part, light, lightcolor, intensity, radius, falloff);
|
|
||||||
|
case (int)ScriptBaseClass.PRIM_POINT_LIGHT:
|
||||||
break;
|
if (remain < 5)
|
||||||
|
return;
|
||||||
case (int)ScriptBaseClass.PRIM_GLOW:
|
bool light = rules.GetLSLIntegerItem(idx++);
|
||||||
if (remain < 2)
|
LSL_Vector lightcolor = rules.GetVector3Item(idx++);
|
||||||
return;
|
float intensity = (float)rules.GetLSLFloatItem(idx++);
|
||||||
face = rules.GetLSLIntegerItem(idx++);
|
float radius = (float)rules.GetLSLFloatItem(idx++);
|
||||||
float glow = (float)rules.GetLSLFloatItem(idx++);
|
float falloff = (float)rules.GetLSLFloatItem(idx++);
|
||||||
|
|
||||||
SetGlow(part, face, glow);
|
SetPointLight(part, light, lightcolor, intensity, radius, falloff);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case (int)ScriptBaseClass.PRIM_BUMP_SHINY:
|
case (int)ScriptBaseClass.PRIM_GLOW:
|
||||||
if (remain < 3)
|
if (remain < 2)
|
||||||
return;
|
return;
|
||||||
face = (int)rules.GetLSLIntegerItem(idx++);
|
face = rules.GetLSLIntegerItem(idx++);
|
||||||
int shiny = (int)rules.GetLSLIntegerItem(idx++);
|
float glow = (float)rules.GetLSLFloatItem(idx++);
|
||||||
Bumpiness bump = (Bumpiness)Convert.ToByte((int)rules.GetLSLIntegerItem(idx++));
|
|
||||||
|
SetGlow(part, face, glow);
|
||||||
SetShiny(part, face, shiny, bump);
|
|
||||||
|
break;
|
||||||
break;
|
|
||||||
|
case (int)ScriptBaseClass.PRIM_BUMP_SHINY:
|
||||||
case (int)ScriptBaseClass.PRIM_FULLBRIGHT:
|
if (remain < 3)
|
||||||
if (remain < 2)
|
return;
|
||||||
return;
|
face = (int)rules.GetLSLIntegerItem(idx++);
|
||||||
face = rules.GetLSLIntegerItem(idx++);
|
int shiny = (int)rules.GetLSLIntegerItem(idx++);
|
||||||
bool st = rules.GetLSLIntegerItem(idx++);
|
Bumpiness bump = (Bumpiness)Convert.ToByte((int)rules.GetLSLIntegerItem(idx++));
|
||||||
SetFullBright(part, face , st);
|
|
||||||
break;
|
SetShiny(part, face, shiny, bump);
|
||||||
|
|
||||||
case (int)ScriptBaseClass.PRIM_MATERIAL:
|
break;
|
||||||
if (remain < 1)
|
|
||||||
return;
|
case (int)ScriptBaseClass.PRIM_FULLBRIGHT:
|
||||||
int mat = rules.GetLSLIntegerItem(idx++);
|
if (remain < 2)
|
||||||
if (mat < 0 || mat > 7)
|
return;
|
||||||
return;
|
face = rules.GetLSLIntegerItem(idx++);
|
||||||
|
bool st = rules.GetLSLIntegerItem(idx++);
|
||||||
part.Material = Convert.ToByte(mat);
|
SetFullBright(part, face , st);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case (int)ScriptBaseClass.PRIM_PHANTOM:
|
case (int)ScriptBaseClass.PRIM_MATERIAL:
|
||||||
if (remain < 1)
|
if (remain < 1)
|
||||||
return;
|
return;
|
||||||
|
int mat = rules.GetLSLIntegerItem(idx++);
|
||||||
string ph = rules.Data[idx++].ToString();
|
if (mat < 0 || mat > 7)
|
||||||
m_host.ParentGroup.ScriptSetPhantomStatus(ph.Equals("1"));
|
return;
|
||||||
|
|
||||||
break;
|
part.Material = Convert.ToByte(mat);
|
||||||
|
break;
|
||||||
case (int)ScriptBaseClass.PRIM_PHYSICS:
|
|
||||||
if (remain < 1)
|
case (int)ScriptBaseClass.PRIM_PHANTOM:
|
||||||
return;
|
if (remain < 1)
|
||||||
string phy = rules.Data[idx++].ToString();
|
return;
|
||||||
bool physics;
|
|
||||||
|
string ph = rules.Data[idx++].ToString();
|
||||||
if (phy.Equals("1"))
|
m_host.ParentGroup.ScriptSetPhantomStatus(ph.Equals("1"));
|
||||||
physics = true;
|
|
||||||
else
|
break;
|
||||||
physics = false;
|
|
||||||
|
case (int)ScriptBaseClass.PRIM_PHYSICS:
|
||||||
part.ScriptSetPhysicsStatus(physics);
|
if (remain < 1)
|
||||||
break;
|
return;
|
||||||
|
string phy = rules.Data[idx++].ToString();
|
||||||
case (int)ScriptBaseClass.PRIM_TEMP_ON_REZ:
|
bool physics;
|
||||||
if (remain < 1)
|
|
||||||
return;
|
if (phy.Equals("1"))
|
||||||
string temp = rules.Data[idx++].ToString();
|
physics = true;
|
||||||
|
else
|
||||||
m_host.ParentGroup.ScriptSetTemporaryStatus(temp.Equals("1"));
|
physics = false;
|
||||||
|
|
||||||
break;
|
part.ScriptSetPhysicsStatus(physics);
|
||||||
|
break;
|
||||||
case (int)ScriptBaseClass.PRIM_TEXGEN:
|
|
||||||
if (remain < 2)
|
case (int)ScriptBaseClass.PRIM_TEMP_ON_REZ:
|
||||||
return;
|
if (remain < 1)
|
||||||
//face,type
|
return;
|
||||||
face = rules.GetLSLIntegerItem(idx++);
|
string temp = rules.Data[idx++].ToString();
|
||||||
int style = rules.GetLSLIntegerItem(idx++);
|
|
||||||
SetTexGen(part, face, style);
|
m_host.ParentGroup.ScriptSetTemporaryStatus(temp.Equals("1"));
|
||||||
break;
|
|
||||||
case (int)ScriptBaseClass.PRIM_TEXT:
|
break;
|
||||||
if (remain < 3)
|
|
||||||
return;
|
case (int)ScriptBaseClass.PRIM_TEXGEN:
|
||||||
string primText = rules.GetLSLStringItem(idx++);
|
if (remain < 2)
|
||||||
LSL_Vector primTextColor = rules.GetVector3Item(idx++);
|
return;
|
||||||
LSL_Float primTextAlpha = rules.GetLSLFloatItem(idx++);
|
//face,type
|
||||||
Vector3 av3 = new Vector3(Util.Clip((float)primTextColor.x, 0.0f, 1.0f),
|
face = rules.GetLSLIntegerItem(idx++);
|
||||||
Util.Clip((float)primTextColor.y, 0.0f, 1.0f),
|
int style = rules.GetLSLIntegerItem(idx++);
|
||||||
Util.Clip((float)primTextColor.z, 0.0f, 1.0f));
|
SetTexGen(part, face, style);
|
||||||
part.SetText(primText, av3, Util.Clip((float)primTextAlpha, 0.0f, 1.0f));
|
break;
|
||||||
|
case (int)ScriptBaseClass.PRIM_TEXT:
|
||||||
break;
|
if (remain < 3)
|
||||||
case (int)ScriptBaseClass.PRIM_NAME:
|
return;
|
||||||
if (remain < 1)
|
string primText = rules.GetLSLStringItem(idx++);
|
||||||
return;
|
LSL_Vector primTextColor = rules.GetVector3Item(idx++);
|
||||||
string primName = rules.GetLSLStringItem(idx++);
|
LSL_Float primTextAlpha = rules.GetLSLFloatItem(idx++);
|
||||||
part.Name = primName;
|
Vector3 av3 = new Vector3(Util.Clip((float)primTextColor.x, 0.0f, 1.0f),
|
||||||
break;
|
Util.Clip((float)primTextColor.y, 0.0f, 1.0f),
|
||||||
case (int)ScriptBaseClass.PRIM_DESC:
|
Util.Clip((float)primTextColor.z, 0.0f, 1.0f));
|
||||||
if (remain < 1)
|
part.SetText(primText, av3, Util.Clip((float)primTextAlpha, 0.0f, 1.0f));
|
||||||
return;
|
|
||||||
string primDesc = rules.GetLSLStringItem(idx++);
|
break;
|
||||||
part.Description = primDesc;
|
case (int)ScriptBaseClass.PRIM_NAME:
|
||||||
break;
|
if (remain < 1)
|
||||||
case (int)ScriptBaseClass.PRIM_ROT_LOCAL:
|
return;
|
||||||
if (remain < 1)
|
string primName = rules.GetLSLStringItem(idx++);
|
||||||
return;
|
part.Name = primName;
|
||||||
LSL_Rotation lr = rules.GetQuaternionItem(idx++);
|
break;
|
||||||
SetRot(part, Rot2Quaternion(lr));
|
case (int)ScriptBaseClass.PRIM_DESC:
|
||||||
break;
|
if (remain < 1)
|
||||||
case (int)ScriptBaseClass.PRIM_OMEGA:
|
return;
|
||||||
if (remain < 3)
|
string primDesc = rules.GetLSLStringItem(idx++);
|
||||||
return;
|
part.Description = primDesc;
|
||||||
LSL_Vector axis = rules.GetVector3Item(idx++);
|
break;
|
||||||
LSL_Float spinrate = rules.GetLSLFloatItem(idx++);
|
case (int)ScriptBaseClass.PRIM_ROT_LOCAL:
|
||||||
LSL_Float gain = rules.GetLSLFloatItem(idx++);
|
if (remain < 1)
|
||||||
TargetOmega(part, axis, (double)spinrate, (double)gain);
|
return;
|
||||||
break;
|
LSL_Rotation lr = rules.GetQuaternionItem(idx++);
|
||||||
case (int)ScriptBaseClass.PRIM_LINK_TARGET:
|
SetRot(part, Rot2Quaternion(lr));
|
||||||
if (remain < 3) // setting to 3 on the basis that parsing any usage of PRIM_LINK_TARGET that has nothing following it is pointless.
|
break;
|
||||||
return;
|
case (int)ScriptBaseClass.PRIM_OMEGA:
|
||||||
LSL_Integer new_linknumber = rules.GetLSLIntegerItem(idx++);
|
if (remain < 3)
|
||||||
LSL_List new_rules = rules.GetSublist(idx, -1);
|
return;
|
||||||
setLinkPrimParams((int)new_linknumber, new_rules);
|
LSL_Vector axis = rules.GetVector3Item(idx++);
|
||||||
|
LSL_Float spinrate = rules.GetLSLFloatItem(idx++);
|
||||||
|
LSL_Float gain = rules.GetLSLFloatItem(idx++);
|
||||||
|
TargetOmega(part, axis, (double)spinrate, (double)gain);
|
||||||
|
break;
|
||||||
|
case (int)ScriptBaseClass.PRIM_LINK_TARGET:
|
||||||
|
if (remain < 3) // setting to 3 on the basis that parsing any usage of PRIM_LINK_TARGET that has nothing following it is pointless.
|
||||||
|
return;
|
||||||
|
LSL_Integer new_linknumber = rules.GetLSLIntegerItem(idx++);
|
||||||
|
LSL_List new_rules = rules.GetSublist(idx, -1);
|
||||||
|
setLinkPrimParams((int)new_linknumber, new_rules);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (positionChanged)
|
||||||
|
{
|
||||||
|
if (part.ParentGroup.RootPart == part)
|
||||||
|
{
|
||||||
|
SceneObjectGroup parent = part.ParentGroup;
|
||||||
|
parent.UpdateGroupPosition(new Vector3((float)currentPosition.x, (float)currentPosition.y, (float)currentPosition.z));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
part.OffsetPosition = new Vector3((float)currentPosition.x, (float)currentPosition.y, (float)currentPosition.z);
|
||||||
|
SceneObjectGroup parent = part.ParentGroup;
|
||||||
|
parent.HasGroupChanged = true;
|
||||||
|
parent.ScheduleGroupForTerseUpdate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -266,7 +266,14 @@ namespace OpenSim.Server.Base
|
||||||
{
|
{
|
||||||
while (m_Running)
|
while (m_Running)
|
||||||
{
|
{
|
||||||
MainConsole.Instance.Prompt();
|
try
|
||||||
|
{
|
||||||
|
MainConsole.Instance.Prompt();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
m_log.ErrorFormat("Command error: {0}", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_pidFile != String.Empty)
|
if (m_pidFile != String.Empty)
|
||||||
|
|
Loading…
Reference in New Issue