Merge branch 'master' into httptests

This commit is contained in:
UbitUmarov
2016-11-27 15:14:34 +00:00
47 changed files with 645 additions and 318 deletions

View File

@@ -1803,6 +1803,53 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return 0;
}
public LSL_Integer llScaleByFactor(double scaling_factor)
{
m_host.AddScriptLPS(1);
SceneObjectGroup group = m_host.ParentGroup;
if(scaling_factor < 1e-6)
return ScriptBaseClass.FALSE;
if(scaling_factor > 1e6)
return ScriptBaseClass.FALSE;
if (group == null || group.IsDeleted || group.inTransit)
return ScriptBaseClass.FALSE;
if (group.RootPart.PhysActor != null && group.RootPart.PhysActor.IsPhysical)
return ScriptBaseClass.FALSE;
if (group.RootPart.KeyframeMotion != null)
return ScriptBaseClass.FALSE;
if(group.GroupResize(scaling_factor))
return ScriptBaseClass.TRUE;
else
return ScriptBaseClass.FALSE;
}
public LSL_Float llGetMaxScaleFactor()
{
m_host.AddScriptLPS(1);
SceneObjectGroup group = m_host.ParentGroup;
if (group == null || group.IsDeleted || group.inTransit)
return 1.0f;
return (LSL_Float)group.GetMaxGroupResizeScale();
}
public LSL_Float llGetMinScaleFactor()
{
m_host.AddScriptLPS(1);
SceneObjectGroup group = m_host.ParentGroup;
if (group == null || group.IsDeleted || group.inTransit)
return 1.0f;
return (LSL_Float)group.GetMinGroupResizeScale();
}
public void llSetScale(LSL_Vector scale)
{
m_host.AddScriptLPS(1);
@@ -3049,7 +3096,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
m_host.AddScriptLPS(1);
double ScriptTime = Util.GetTimeStampMS() - m_timer;
return (ScriptTime / 1000.0);
return (float)Math.Round((ScriptTime / 1000.0), 3);
}
public void llResetTime()
@@ -3064,7 +3111,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
double now = Util.GetTimeStampMS();
double ScriptTime = now - m_timer;
m_timer = now;
return (ScriptTime / 1000.0);
return (float)Math.Round((ScriptTime / 1000.0), 3);
}
public void llSound(string sound, double volume, int queue, int loop)
@@ -3482,13 +3529,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (item == null)
{
Error("llRezAtRoot", "Can't find object '" + inventory + "'");
Error("llRez(AtRoot/Object)", "Can't find object '" + inventory + "'");
return;
}
if (item.InvType != (int)InventoryType.Object)
{
Error("llRezAtRoot", "Can't create requested object; object is missing from database");
Error("llRez(AtRoot/Object)", "Can't create requested object; object is missing from database");
return;
}
@@ -3532,7 +3579,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay)
}
}, null, "LSL_Api.llRezAtRoot");
}, null, "LSL_Api.doObjectRez");
//ScriptSleep((int)((groupmass * velmag) / 10));
ScriptSleep(m_sleepMsOnRezAtRoot);

View File

@@ -1938,8 +1938,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
taskItem.ResetIDs(m_host.UUID);
taskItem.ParentID = m_host.UUID;
taskItem.CreationDate = (uint)Util.UnixTimeSinceEpoch();
taskItem.Name = asset.Name;
taskItem.Description = asset.Description;
taskItem.Name = name;
taskItem.Description = description;
taskItem.Type = (int)AssetType.Notecard;
taskItem.InvType = (int)InventoryType.Notecard;
taskItem.OwnerID = m_host.OwnerID;
@@ -3354,8 +3354,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1);
Scene scene = m_ScriptEngine.World;
GridRegion region = scene.GridService.GetRegionByUUID(UUID.Zero, World.RegionInfo.RegionID);
return new LSL_Vector((float)region.RegionSizeX, (float)region.RegionSizeY, (float)Constants.RegionHeight);
RegionInfo reg = World.RegionInfo;
// GridRegion region = scene.GridService.GetRegionByUUID(UUID.Zero, World.RegionInfo.RegionID);
// return new LSL_Vector((float)region.RegionSizeX, (float)region.RegionSizeY, (float)Constants.RegionHeight);
return new LSL_Vector((float)reg.RegionSizeX, (float)reg.RegionSizeY, 0.0f);
}
public int osGetSimulatorMemory()

View File

@@ -326,6 +326,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
LSL_Integer llRound(double f);
LSL_Integer llSameGroup(string agent);
void llSay(int channelID, string text);
LSL_Integer llScaleByFactor(double scaling_factor);
LSL_Float llGetMaxScaleFactor();
LSL_Float llGetMinScaleFactor();
void llScaleTexture(double u, double v, int face);
LSL_Integer llScriptDanger(LSL_Vector pos);
void llScriptProfiler(LSL_Integer flag);

View File

@@ -1465,6 +1465,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
m_LSL_Functions.llSay(channelID, text);
}
public LSL_Integer llScaleByFactor(double scaling_factor)
{
return m_LSL_Functions.llScaleByFactor(scaling_factor);
}
public LSL_Float llGetMaxScaleFactor()
{
return m_LSL_Functions.llGetMaxScaleFactor();
}
public LSL_Float llGetMinScaleFactor()
{
return m_LSL_Functions.llGetMinScaleFactor();
}
public void llScaleTexture(double u, double v, int face)
{
m_LSL_Functions.llScaleTexture(u, v, face);

View File

@@ -880,7 +880,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
try
{
m_CurrentEvent = data.EventName;
m_EventStart = DateTime.Now;
m_EventStart = DateTime.UtcNow;
m_InEvent = true;
try
@@ -1033,7 +1033,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
if (!m_InEvent)
return 0;
return (DateTime.Now - m_EventStart).Seconds;
return (DateTime.UtcNow - m_EventStart).Seconds;
}
public void ResetScript(int timeout)