mirror of
https://github.com/opensim/opensim.git
synced 2026-06-06 02:55:47 +08:00
Merge branch 'avination' into careminster
Conflicts: OpenSim/Data/MySQL/MySQLSimulationData.cs
This commit is contained in:
@@ -113,8 +113,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
new Dictionary<UUID, UserInfoCacheEntry>();
|
||||
protected int EMAIL_PAUSE_TIME = 20; // documented delay value for smtp.
|
||||
|
||||
protected Timer m_ShoutSayTimer;
|
||||
// protected Timer m_ShoutSayTimer;
|
||||
protected int m_SayShoutCount = 0;
|
||||
DateTime m_lastSayShoutCheck;
|
||||
|
||||
private Dictionary<string, string> MovementAnimationsForLSL =
|
||||
new Dictionary<string, string> {
|
||||
@@ -140,10 +141,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, TaskInventoryItem item)
|
||||
{
|
||||
/*
|
||||
m_ShoutSayTimer = new Timer(1000);
|
||||
m_ShoutSayTimer.Elapsed += SayShoutTimerElapsed;
|
||||
m_ShoutSayTimer.AutoReset = true;
|
||||
m_ShoutSayTimer.Start();
|
||||
*/
|
||||
m_lastSayShoutCheck = DateTime.UtcNow;
|
||||
|
||||
m_ScriptEngine = ScriptEngine;
|
||||
m_host = host;
|
||||
@@ -858,12 +862,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
wComm.DeliverMessage(ChatTypeEnum.Whisper, channelID, m_host.Name, m_host.UUID, text);
|
||||
}
|
||||
|
||||
private void CheckSayShoutTime()
|
||||
{
|
||||
DateTime now = DateTime.UtcNow;
|
||||
if ((now - m_lastSayShoutCheck).Ticks > 10000000) // 1sec
|
||||
{
|
||||
m_lastSayShoutCheck = now;
|
||||
m_SayShoutCount = 0;
|
||||
}
|
||||
else
|
||||
m_SayShoutCount++;
|
||||
}
|
||||
|
||||
public void llSay(int channelID, string text)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
if (channelID == 0)
|
||||
m_SayShoutCount++;
|
||||
// m_SayShoutCount++;
|
||||
CheckSayShoutTime();
|
||||
|
||||
if (m_SayShoutCount >= 11)
|
||||
ScriptSleep(2000);
|
||||
@@ -891,7 +908,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
if (channelID == 0)
|
||||
m_SayShoutCount++;
|
||||
// m_SayShoutCount++;
|
||||
CheckSayShoutTime();
|
||||
|
||||
if (m_SayShoutCount >= 11)
|
||||
ScriptSleep(2000);
|
||||
@@ -2556,12 +2574,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
return new LSL_Vector(m_host.Acceleration.X, m_host.Acceleration.Y, m_host.Acceleration.Z);
|
||||
}
|
||||
|
||||
|
||||
public void llSetAngularVelocity(LSL_Vector avel, int local)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
// Still not done !!!!
|
||||
// m_host.SetAngularVelocity(new Vector3((float)avel.x, (float)avel.y, (float)avel.z), local != 0);
|
||||
m_host.SetAngularVelocity(new Vector3((float)avel.x, (float)avel.y, (float)avel.z), local != 0);
|
||||
}
|
||||
|
||||
public LSL_Vector llGetOmega()
|
||||
@@ -3671,6 +3687,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
protected void TargetOmega(SceneObjectPart part, LSL_Vector axis, double spinrate, double gain)
|
||||
{
|
||||
spinrate *= gain;
|
||||
part.UpdateAngularVelocity(new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate)));
|
||||
}
|
||||
|
||||
@@ -12044,12 +12061,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
return rq.ToString();
|
||||
}
|
||||
|
||||
/*
|
||||
private void SayShoutTimerElapsed(Object sender, ElapsedEventArgs args)
|
||||
{
|
||||
m_SayShoutCount = 0;
|
||||
}
|
||||
|
||||
*/
|
||||
private struct Tri
|
||||
{
|
||||
public Vector3 p1;
|
||||
|
||||
@@ -636,7 +636,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
if (!m_Enabled)
|
||||
return;
|
||||
lockScriptsForRead(true);
|
||||
foreach (IScriptInstance instance in m_Scripts.Values)
|
||||
|
||||
List<IScriptInstance> instancesToDel = new List<IScriptInstance>(m_Scripts.Values);
|
||||
|
||||
// foreach (IScriptInstance instance in m_Scripts.Values)
|
||||
foreach (IScriptInstance instance in instancesToDel)
|
||||
{
|
||||
// Force a final state save
|
||||
//
|
||||
@@ -659,7 +663,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
// Must be done explicitly because they have infinite
|
||||
// lifetime
|
||||
//
|
||||
if (!m_SimulatorShuttingDown)
|
||||
// if (!m_SimulatorShuttingDown)
|
||||
{
|
||||
m_DomainScripts[instance.AppDomain].Remove(instance.ItemID);
|
||||
if (m_DomainScripts[instance.AppDomain].Count == 0)
|
||||
@@ -669,10 +673,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
}
|
||||
}
|
||||
|
||||
m_Scripts.Clear();
|
||||
m_PrimObjects.Clear();
|
||||
m_Assemblies.Clear();
|
||||
m_DomainScripts.Clear();
|
||||
// m_Scripts.Clear();
|
||||
// m_PrimObjects.Clear();
|
||||
// m_Assemblies.Clear();
|
||||
// m_DomainScripts.Clear();
|
||||
}
|
||||
lockScriptsForRead(false);
|
||||
lockScriptsForWrite(true);
|
||||
|
||||
Reference in New Issue
Block a user