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,6 +7061,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
|
|
||||||
|
bool positionChanged = false;
|
||||||
|
LSL_Vector currentPosition = GetPartLocalPos(part);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
while (idx < rules.Length)
|
while (idx < rules.Length)
|
||||||
{
|
{
|
||||||
int code = rules.GetLSLIntegerItem(idx++);
|
int code = rules.GetLSLIntegerItem(idx++);
|
||||||
|
@ -7056,7 +7082,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
return;
|
return;
|
||||||
|
|
||||||
v=rules.GetVector3Item(idx++);
|
v=rules.GetVector3Item(idx++);
|
||||||
SetPos(part, v);
|
positionChanged = true;
|
||||||
|
currentPosition = GetSetPosTarget(part, v, currentPosition);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case (int)ScriptBaseClass.PRIM_SIZE:
|
case (int)ScriptBaseClass.PRIM_SIZE:
|
||||||
|
@ -7413,10 +7440,30 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
LSL_Integer new_linknumber = rules.GetLSLIntegerItem(idx++);
|
LSL_Integer new_linknumber = rules.GetLSLIntegerItem(idx++);
|
||||||
LSL_List new_rules = rules.GetSublist(idx, -1);
|
LSL_List new_rules = rules.GetSublist(idx, -1);
|
||||||
setLinkPrimParams((int)new_linknumber, new_rules);
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public LSL_String llStringToBase64(string str)
|
public LSL_String llStringToBase64(string str)
|
||||||
{
|
{
|
||||||
|
|
|
@ -265,9 +265,16 @@ namespace OpenSim.Server.Base
|
||||||
public virtual int Run()
|
public virtual int Run()
|
||||||
{
|
{
|
||||||
while (m_Running)
|
while (m_Running)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
MainConsole.Instance.Prompt();
|
MainConsole.Instance.Prompt();
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
m_log.ErrorFormat("Command error: {0}", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (m_pidFile != String.Empty)
|
if (m_pidFile != String.Empty)
|
||||||
File.Delete(m_pidFile);
|
File.Delete(m_pidFile);
|
||||||
|
|
Loading…
Reference in New Issue