mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 03:06:05 +08:00
Merge branch 'opensim:master' into master
This commit is contained in:
@@ -8401,6 +8401,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
{ PacketType.GroupNoticesListRequest, new(HandleGroupNoticesListRequest, true) },
|
||||
{ PacketType.GroupNoticeRequest, new(HandleGroupNoticeRequest, true) },
|
||||
|
||||
{ PacketType.GroupRoleUpdate, new(HandleGroupRoleUpdate, true) },
|
||||
{ PacketType.GroupRoleChanges, new(HandleGroupRoleChanges, true) },
|
||||
|
||||
{ PacketType.JoinGroupRequest, new(HandleJoinGroupRequest, true) },
|
||||
|
||||
@@ -1772,7 +1772,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
// on to en-US to avoid number parsing issues
|
||||
Culture.SetCurrentCulture();
|
||||
|
||||
while (IsRunningInbound)
|
||||
while (m_IsRunningInbound)
|
||||
{
|
||||
Scene.ThreadAlive(1);
|
||||
try
|
||||
@@ -1818,7 +1818,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
// Action generic every round
|
||||
Action<IClientAPI> clientPacketHandler = ClientOutgoingPacketHandler;
|
||||
|
||||
while (base.IsRunningOutbound)
|
||||
while (m_IsRunningOutbound)
|
||||
{
|
||||
Scene.ThreadAlive(2);
|
||||
|
||||
|
||||
@@ -32,6 +32,8 @@ using log4net;
|
||||
using OpenSim.Framework;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.Packets;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
{
|
||||
@@ -71,11 +73,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
public static int m_udpBuffersPoolPtr = -1;
|
||||
|
||||
/// <summary>Returns true if the server is currently listening for inbound packets, otherwise false</summary>
|
||||
public bool IsRunningInbound { get; private set; }
|
||||
internal bool m_IsRunningInbound;
|
||||
public bool IsRunningInbound
|
||||
{
|
||||
get { return m_IsRunningInbound; }
|
||||
private set { m_IsRunningInbound = value; }
|
||||
}
|
||||
|
||||
public CancellationTokenSource InboundCancellationSource = new();
|
||||
|
||||
|
||||
/// <summary>Returns true if the server is currently sending outbound packets, otherwise false</summary>
|
||||
/// <remarks>If IsRunningOut = false, then any request to send a packet is simply dropped.</remarks>
|
||||
public bool IsRunningOutbound { get; private set; }
|
||||
internal bool m_IsRunningOutbound;
|
||||
public bool IsRunningOutbound
|
||||
{
|
||||
get { return m_IsRunningOutbound; }
|
||||
private set { m_IsRunningOutbound = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Number of UDP receives.
|
||||
@@ -175,19 +190,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
/// the UDP socket. This value is passed up to the operating system
|
||||
/// and used in the system networking stack. Use zero to leave this
|
||||
/// value as the default</param>
|
||||
/// <param name="asyncPacketHandling">Set this to true to start
|
||||
/// receiving more packets while current packet handler callbacks are
|
||||
/// still running. Setting this to false will complete each packet
|
||||
/// callback before the next packet is processed</param>
|
||||
/// <remarks>This method will attempt to set the SIO_UDP_CONNRESET flag
|
||||
/// on the socket to get newer versions of Windows to behave in a sane
|
||||
/// manner (not throwing an exception when the remote side resets the
|
||||
/// connection). This call is ignored on Mono where the flag is not
|
||||
/// necessary</remarks>
|
||||
|
||||
|
||||
public virtual void StartInbound(int recvBufferSize)
|
||||
{
|
||||
if (!IsRunningInbound)
|
||||
if (!m_IsRunningInbound)
|
||||
{
|
||||
m_log.DebugFormat("[UDPBASE]: Starting inbound UDP loop");
|
||||
|
||||
@@ -238,12 +245,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
if (m_udpPort == 0)
|
||||
m_udpPort = ((IPEndPoint)m_udpSocket.LocalEndPoint).Port;
|
||||
|
||||
IsRunningInbound = true;
|
||||
m_IsRunningInbound = true;
|
||||
|
||||
// kick off an async receive. The Start() method will return, the
|
||||
// actual receives will occur asynchronously and will be caught in
|
||||
// AsyncEndRecieve().
|
||||
AsyncBeginReceive();
|
||||
// kick start the receiver tasks dance.
|
||||
Task.Run(AsyncBeginReceive).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -254,16 +259,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
{
|
||||
m_log.DebugFormat("[UDPBASE]: Starting outbound UDP loop");
|
||||
|
||||
IsRunningOutbound = true;
|
||||
m_IsRunningOutbound = true;
|
||||
}
|
||||
|
||||
public virtual void StopInbound()
|
||||
{
|
||||
if (IsRunningInbound)
|
||||
if (m_IsRunningInbound)
|
||||
{
|
||||
m_log.DebugFormat("[UDPBASE]: Stopping inbound UDP loop");
|
||||
|
||||
IsRunningInbound = false;
|
||||
m_IsRunningInbound = false;
|
||||
InboundCancellationSource.Cancel();
|
||||
m_udpSocket.Close();
|
||||
m_udpSocket = null;
|
||||
}
|
||||
@@ -273,122 +279,58 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
{
|
||||
m_log.DebugFormat("[UDPBASE]: Stopping outbound UDP loop");
|
||||
|
||||
IsRunningOutbound = false;
|
||||
m_IsRunningOutbound = false;
|
||||
}
|
||||
|
||||
private void AsyncBeginReceive()
|
||||
private async void AsyncBeginReceive()
|
||||
{
|
||||
while (IsRunningInbound)
|
||||
SocketAddress workSktAddress = new(m_udpSocket.AddressFamily);
|
||||
while (m_IsRunningInbound)
|
||||
{
|
||||
UDPPacketBuffer buf = GetNewUDPBuffer(new IPEndPoint(IPAddress.Any, 0)); // we need a fresh one here, for now at least
|
||||
UDPPacketBuffer buf = GetNewUDPBuffer(null); // we need a fresh one here, for now at least
|
||||
try
|
||||
{
|
||||
// kick off an async read
|
||||
IAsyncResult iar = m_udpSocket.BeginReceiveFrom(
|
||||
buf.Data,
|
||||
0,
|
||||
buf.Data.Length,
|
||||
SocketFlags.None,
|
||||
ref buf.RemoteEndPoint,
|
||||
AsyncEndReceive,
|
||||
buf);
|
||||
|
||||
if (!iar.CompletedSynchronously)
|
||||
int nbytes =
|
||||
await m_udpSocket.ReceiveFromAsync(buf.Data.AsMemory(), SocketFlags.None, workSktAddress, InboundCancellationSource.Token).ConfigureAwait(false);
|
||||
if (!m_IsRunningInbound || InboundCancellationSource.IsCancellationRequested)
|
||||
{
|
||||
FreeUDPBuffer(buf);
|
||||
return;
|
||||
}
|
||||
catch (SocketException e)
|
||||
{
|
||||
if (e.SocketErrorCode == SocketError.ConnectionReset)
|
||||
{
|
||||
m_log.Warn("[UDPBASE]: SIO_UDP_CONNRESET was ignored, attempting to salvage the UDP listener on port " + m_udpPort);
|
||||
{
|
||||
try
|
||||
{
|
||||
IAsyncResult iar = m_udpSocket.BeginReceiveFrom(
|
||||
buf.Data,
|
||||
0,
|
||||
buf.Data.Length,
|
||||
SocketFlags.None,
|
||||
ref buf.RemoteEndPoint,
|
||||
AsyncEndReceive,
|
||||
buf);
|
||||
|
||||
if (!iar.CompletedSynchronously)
|
||||
return;
|
||||
}
|
||||
catch (SocketException) { }
|
||||
catch (ObjectDisposedException) { return; }
|
||||
}
|
||||
m_log.Warn("[UDPBASE]: Salvaged the UDP listener on port " + m_udpPort);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error(
|
||||
string.Format("[UDPBASE]: Error processing UDP begin receive {0}. Exception ", UdpReceives), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void AsyncEndReceive(IAsyncResult iar)
|
||||
{
|
||||
if (IsRunningInbound)
|
||||
{
|
||||
bool sync = iar.CompletedSynchronously;
|
||||
try
|
||||
{
|
||||
// get the buffer that was created in AsyncBeginReceive
|
||||
// this is the received data
|
||||
UDPPacketBuffer buffer = (UDPPacketBuffer)iar.AsyncState;
|
||||
|
||||
int startTick = Util.EnvironmentTickCount();
|
||||
|
||||
// get the length of data actually read from the socket, store it with the
|
||||
// buffer
|
||||
buffer.DataLength = m_udpSocket.EndReceiveFrom(iar, ref buffer.RemoteEndPoint);
|
||||
|
||||
|
||||
UdpReceives++;
|
||||
|
||||
// call the abstract method PacketReceived(), passing the buffer that
|
||||
// has just been filled from the socket read.
|
||||
PacketReceived(buffer);
|
||||
|
||||
// If more than one thread can be calling AsyncEndReceive() at once (e.g. if m_asyncPacketHandler)
|
||||
// then a particular stat may be inaccurate due to a race condition. We won't worry about this
|
||||
// since this should be rare and won't cause a runtime problem.
|
||||
if (m_currentReceiveTimeSamples >= s_receiveTimeSamples)
|
||||
if (nbytes > 0)
|
||||
{
|
||||
AverageReceiveTicksForLastSamplePeriod
|
||||
= (float)m_receiveTicksInCurrentSamplePeriod / s_receiveTimeSamples;
|
||||
int startTick = Util.EnvironmentTickCount();
|
||||
|
||||
m_receiveTicksInCurrentSamplePeriod = 0;
|
||||
m_currentReceiveTimeSamples = 0;
|
||||
buf.RemoteEndPoint = Util.GetEndPoint(workSktAddress);
|
||||
buf.DataLength = nbytes;
|
||||
UdpReceives++;
|
||||
|
||||
PacketReceived(buf);
|
||||
|
||||
if (m_currentReceiveTimeSamples >= s_receiveTimeSamples)
|
||||
{
|
||||
AverageReceiveTicksForLastSamplePeriod
|
||||
= (float)m_receiveTicksInCurrentSamplePeriod / s_receiveTimeSamples;
|
||||
|
||||
m_receiveTicksInCurrentSamplePeriod = 0;
|
||||
m_currentReceiveTimeSamples = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_receiveTicksInCurrentSamplePeriod += Util.EnvironmentTickCountSubtract(startTick);
|
||||
m_currentReceiveTimeSamples++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_receiveTicksInCurrentSamplePeriod += Util.EnvironmentTickCountSubtract(startTick);
|
||||
m_currentReceiveTimeSamples++;
|
||||
}
|
||||
FreeUDPBuffer(buf);
|
||||
}
|
||||
catch (SocketException se)
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
m_log.Error(
|
||||
string.Format(
|
||||
"[UDPBASE]: Error processing UDP end receive {0}, socket error code {1}. Exception ",
|
||||
UdpReceives, se.ErrorCode),
|
||||
se);
|
||||
}
|
||||
catch(ObjectDisposedException) { }
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error(
|
||||
string.Format("[UDPBASE]: Error processing UDP end receive {0}. Exception ", UdpReceives), e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (IsRunningInbound && !sync)
|
||||
AsyncBeginReceive();
|
||||
m_log.Error($"[UDPBASE]: Error processing UDP receiveFrom. Exception ", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -349,7 +349,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
get { return m_dripRate; }
|
||||
set
|
||||
{
|
||||
m_dripRate = OpenSim.Framework.Util.Clamp<float>(value, m_minimumFlow, MaxDripRate);
|
||||
m_dripRate = Math.Clamp(value, m_minimumFlow, MaxDripRate);
|
||||
|
||||
if (m_parent != null)
|
||||
m_parent.RegisterRequest(this, m_dripRate);
|
||||
|
||||
@@ -101,9 +101,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
|
||||
public virtual void PostInitialise()
|
||||
{
|
||||
if (!m_Enabled)
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
public virtual void RegionLoaded(Scene scene)
|
||||
|
||||
@@ -152,7 +152,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
return;
|
||||
}
|
||||
//pass this in as degrees now, convert to radians later during actual work phase
|
||||
rotation = Util.Clamp<float>(rotation, -359f, 359f);
|
||||
rotation = Math.Clamp(rotation, -359f, 359f);
|
||||
});
|
||||
options.Add("rotation-center=", delegate(string v)
|
||||
{
|
||||
|
||||
@@ -229,7 +229,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
public void setEstateTerrainBaseTexture(int level, UUID texture)
|
||||
{
|
||||
SetEstateTerrainBaseTexture(null, level, texture);
|
||||
sendRegionHandshakeToAll();
|
||||
}
|
||||
|
||||
public void setEstateTerrainTextureHeights(int corner, float lowValue, float highValue)
|
||||
@@ -556,11 +555,13 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
case 3:
|
||||
Scene.RegionInfo.RegionSettings.TerrainTexture4 = texture;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
Scene.RegionInfo.RegionSettings.Save();
|
||||
TriggerRegionInfoChange();
|
||||
SendRegionInfoPacketToAll();
|
||||
sendRegionHandshakeToAll();
|
||||
}
|
||||
|
||||
public void SetEstateTerrainTextureHeights(IClientAPI client, int corner, float lowValue, float highValue)
|
||||
@@ -583,12 +584,13 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
Scene.RegionInfo.RegionSettings.Elevation1NE = lowValue;
|
||||
Scene.RegionInfo.RegionSettings.Elevation2NE = highValue;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
Scene.RegionInfo.RegionSettings.Save();
|
||||
TriggerRegionInfoChange();
|
||||
sendRegionHandshakeToAll();
|
||||
// sendRegionInfoPacketToAll();
|
||||
}
|
||||
|
||||
private void HandleCommitEstateTerrainTextureRequest(IClientAPI remoteClient)
|
||||
|
||||
@@ -232,9 +232,9 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
|
||||
detailTexture[t].UnlockBits(bmdata);
|
||||
detailTexture[t].Dispose();
|
||||
|
||||
mapColorsRed[t] = (byte)Util.Clamp(cR / npixeis, 0 , 255);
|
||||
mapColorsGreen[t] = (byte)Util.Clamp(cG / npixeis, 0 , 255);
|
||||
mapColorsBlue[t] = (byte)Util.Clamp(cB / npixeis, 0 , 255);
|
||||
mapColorsRed[t] = (byte)Math.Clamp(cR / npixeis, 0 , 255);
|
||||
mapColorsGreen[t] = (byte)Math.Clamp(cG / npixeis, 0 , 255);
|
||||
mapColorsBlue[t] = (byte)Math.Clamp(cB / npixeis, 0 , 255);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1875,7 +1875,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
nowMS = Util.GetTimeStampMS();
|
||||
sleepMS = (float)(nowMS - lastMS);
|
||||
sleepError = sleepMS - frameMS;
|
||||
Util.Clamp(sleepError, 0.0f, 20f);
|
||||
sleepError = Math.Clamp(sleepError, 0.0f, 20f);
|
||||
frameMS = (float)(nowMS - framestart);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Frozen;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
@@ -434,7 +435,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
|
||||
#region manual serialization
|
||||
|
||||
private static readonly Dictionary<string, Action<SceneObjectPart, XmlReader>> m_SOPXmlProcessors = new()
|
||||
private static readonly FrozenDictionary<string, Action<SceneObjectPart, XmlReader>> m_SOPXmlProcessors = new Dictionary<string, Action<SceneObjectPart, XmlReader>>()
|
||||
{
|
||||
{"AllowedDrop", ProcessAllowedDrop },
|
||||
{"CreatorID", ProcessCreatorID },
|
||||
@@ -526,9 +527,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
{"SOPAnims", ProcessSOPAnims },
|
||||
|
||||
{"SitActRange", ProcessSitActRange }
|
||||
};
|
||||
}.ToFrozenDictionary();
|
||||
|
||||
private static readonly Dictionary<string, Action<TaskInventoryItem, XmlReader>> m_TaskInventoryXmlProcessors = new()
|
||||
private static readonly FrozenDictionary<string, Action<TaskInventoryItem, XmlReader>> m_TaskInventoryXmlProcessors = new Dictionary<string, Action<TaskInventoryItem, XmlReader>>()
|
||||
{
|
||||
{"AssetID", ProcessTIAssetID },
|
||||
{"BasePermissions", ProcessTIBasePermissions },
|
||||
@@ -554,9 +555,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
{"PermsMask", ProcessTIPermsMask },
|
||||
{"Type", ProcessTIType },
|
||||
{"OwnerChanged", ProcessTIOwnerChanged }
|
||||
};
|
||||
}.ToFrozenDictionary();
|
||||
|
||||
private static readonly Dictionary<string, Action<PrimitiveBaseShape, XmlReader>> m_ShapeXmlProcessors = new()
|
||||
private static readonly FrozenDictionary<string, Action<PrimitiveBaseShape, XmlReader>> m_ShapeXmlProcessors = new Dictionary<string, Action<PrimitiveBaseShape, XmlReader>>()
|
||||
{
|
||||
{"ProfileCurve", ProcessShpProfileCurve },
|
||||
{"TextureEntry", ProcessShpTextureEntry },
|
||||
@@ -608,7 +609,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
{"SculptEntry", ProcessShpSculptEntry },
|
||||
{"Media", ProcessShpMedia },
|
||||
{"MatOvrd", ProcessShpMatOvrd }
|
||||
};
|
||||
}.ToFrozenDictionary();
|
||||
|
||||
#region SOPXmlProcessors
|
||||
private static void ProcessAllowedDrop(SceneObjectPart obj, XmlReader reader)
|
||||
@@ -1518,6 +1519,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
writer.WriteEndElement();
|
||||
}
|
||||
|
||||
sog.LinksetData?.ToXML(writer);
|
||||
|
||||
writer.WriteEndElement();
|
||||
}
|
||||
|
||||
@@ -408,7 +408,7 @@ namespace OpenSim.Region.PhysicsModule.BulletS
|
||||
get { return base.Efficiency; }
|
||||
set
|
||||
{
|
||||
base.Efficiency = Util.Clamp(value, 0f, 1f);
|
||||
base.Efficiency = Math.Clamp(value, 0f, 1f);
|
||||
|
||||
// Compute factors based on efficiency.
|
||||
// If efficiency is high (1f), use a factor value that moves the error value to zero with little overshoot.
|
||||
|
||||
@@ -1606,7 +1606,7 @@ namespace OpenSim.Region.PhysicsModule.BulletS
|
||||
|
||||
returnMass = Density * BSParam.DensityScaleFactor * volume;
|
||||
|
||||
returnMass = Util.Clamp(returnMass, BSParam.MinimumObjectMass, BSParam.MaximumObjectMass);
|
||||
returnMass = Math.Clamp(returnMass, BSParam.MinimumObjectMass, BSParam.MaximumObjectMass);
|
||||
// DetailLog("{0},BSPrim.CalculateMass,den={1},vol={2},mass={3}", LocalID, Density, volume, returnMass);
|
||||
DetailLog("{0},BSPrim.CalculateMass,den={1},vol={2},mass={3},pathB={4},pathE={5},profB={6},profE={7},siz={8}",
|
||||
LocalID, Density, volume, returnMass, pathBegin, pathEnd, profileBegin, profileEnd, _size);
|
||||
|
||||
@@ -363,8 +363,8 @@ namespace OpenSim.Region.PhysicsModule.BulletS
|
||||
// First, base addresses are never negative so correct for that possible problem.
|
||||
if (ret.X < 0f || ret.Y < 0f)
|
||||
{
|
||||
ret.X = Util.Clamp<float>(ret.X, 0f, 1000000f);
|
||||
ret.Y = Util.Clamp<float>(ret.Y, 0f, 1000000f);
|
||||
ret.X = Math.Clamp(ret.X, 0f, 1000000f);
|
||||
ret.Y = Math.Clamp(ret.Y, 0f, 1000000f);
|
||||
DetailLog("{0},BSTerrainManager.ClampPositionToKnownTerrain,zeroingNegXorY,oldPos={1},newPos={2}",
|
||||
BSScene.DetailLogZero, pPos, ret);
|
||||
}
|
||||
@@ -510,8 +510,8 @@ namespace OpenSim.Region.PhysicsModule.BulletS
|
||||
return ret;
|
||||
|
||||
// Just some sanity
|
||||
ret.X = Util.Clamp<float>(ret.X, 0f, 1000000f);
|
||||
ret.Y = Util.Clamp<float>(ret.Y, 0f, 1000000f);
|
||||
ret.X = Math.Clamp(ret.X, 0f, 1000000f);
|
||||
ret.Y = Math.Clamp(ret.Y, 0f, 1000000f);
|
||||
ret.Z = 0f;
|
||||
|
||||
lock (m_terrains)
|
||||
|
||||
@@ -2068,7 +2068,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
return GetColor(m_host, face);
|
||||
}
|
||||
|
||||
protected static LSL_Vector GetColor(SceneObjectPart part, int face)
|
||||
public LSL_Vector GetColor(SceneObjectPart part, int face)
|
||||
{
|
||||
Primitive.TextureEntry tex = part.Shape.Textures;
|
||||
Color4 texcolor;
|
||||
@@ -4642,24 +4642,33 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
public LSL_Key llRequestAgentData(string id, int data)
|
||||
{
|
||||
if(data < 1 || data > ScriptBaseClass.DATA_PAYINFO)
|
||||
return string.Empty;
|
||||
|
||||
if (UUID.TryParse(id, out UUID uuid) && uuid.IsNotZero())
|
||||
{
|
||||
//pre process fast local avatars
|
||||
switch(data)
|
||||
{
|
||||
case ScriptBaseClass.DATA_RATING:
|
||||
case ScriptBaseClass.DATA_NAME: // DATA_NAME (First Last)
|
||||
case ScriptBaseClass.DATA_ONLINE:
|
||||
World.TryGetScenePresence(uuid, out ScenePresence sp);
|
||||
if (sp != null)
|
||||
{
|
||||
string reply = data switch
|
||||
{
|
||||
ScriptBaseClass.DATA_RATING => "0,0,0,0,0,0",
|
||||
ScriptBaseClass.DATA_NAME => sp.Firstname + " " + sp.Lastname,
|
||||
_ => "1"
|
||||
};
|
||||
string ftid = m_AsyncCommands.DataserverPlugin.RequestWithImediatePost(m_host.LocalId,
|
||||
m_item.ItemID, "1");
|
||||
m_item.ItemID, reply);
|
||||
ScriptSleep(m_sleepMsOnRequestAgentData);
|
||||
return ftid;
|
||||
}
|
||||
break;
|
||||
case ScriptBaseClass.DATA_NAME: // DATA_NAME (First Last)
|
||||
case ScriptBaseClass.DATA_BORN: // DATA_BORN (YYYY-MM-DD)
|
||||
case ScriptBaseClass.DATA_RATING: // DATA_RATING (0,0,0,0,0,0)
|
||||
case 7: // DATA_USERLEVEL (integer). This is not available in LL and so has no constant.
|
||||
case ScriptBaseClass.DATA_PAYINFO: // DATA_PAYINFO (0|1|2|3)
|
||||
break;
|
||||
@@ -4669,63 +4678,68 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
void act(string eventID)
|
||||
{
|
||||
UserAccount account = null;
|
||||
string reply;
|
||||
IUserManagement umm = World.RequestModuleInterface<IUserManagement>();
|
||||
if(umm == null)
|
||||
return;
|
||||
|
||||
if (data == ScriptBaseClass.DATA_ONLINE)
|
||||
UserData udt = umm.GetUserData(uuid);
|
||||
if (udt == null || udt.IsUnknownUser)
|
||||
return;
|
||||
|
||||
string reply = null;
|
||||
switch(data)
|
||||
{
|
||||
World.TryGetScenePresence(uuid, out ScenePresence sp);
|
||||
if (sp != null)
|
||||
reply = "1";
|
||||
else
|
||||
{
|
||||
account = m_userAccountService.GetUserAccount(RegionScopeID, uuid);
|
||||
if (account == null)
|
||||
reply = "0";
|
||||
else
|
||||
case ScriptBaseClass.DATA_ONLINE:
|
||||
if (!m_PresenceInfoCache.TryGetValue(uuid, out PresenceInfo pinfo))
|
||||
{
|
||||
if (!m_PresenceInfoCache.TryGetValue(uuid, out PresenceInfo pinfo))
|
||||
PresenceInfo[] pinfos = World.PresenceService.GetAgents([uuid.ToString()]);
|
||||
if (pinfos != null && pinfos.Length > 0)
|
||||
{
|
||||
PresenceInfo[] pinfos = World.PresenceService.GetAgents(new string[] { uuid.ToString() });
|
||||
if (pinfos != null && pinfos.Length > 0)
|
||||
foreach (PresenceInfo p in pinfos)
|
||||
{
|
||||
foreach (PresenceInfo p in pinfos)
|
||||
if (!p.RegionID.IsZero())
|
||||
{
|
||||
if (!p.RegionID.IsZero())
|
||||
{
|
||||
pinfo = p;
|
||||
}
|
||||
pinfo = p;
|
||||
}
|
||||
}
|
||||
m_PresenceInfoCache.AddOrUpdate(uuid, pinfo, m_llRequestAgentDataCacheTimeout);
|
||||
}
|
||||
reply = pinfo == null ? "0" : "1";
|
||||
m_PresenceInfoCache.AddOrUpdate(uuid, pinfo, m_llRequestAgentDataCacheTimeout);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
account ??= m_userAccountService.GetUserAccount(RegionScopeID, uuid);
|
||||
|
||||
if (account is null)
|
||||
reply = "0";
|
||||
else
|
||||
reply = data switch
|
||||
reply = pinfo == null ? "0" : "1";
|
||||
break;
|
||||
case ScriptBaseClass.DATA_NAME:
|
||||
reply = udt.FirstName + " " + udt.LastName;
|
||||
break;
|
||||
case ScriptBaseClass.DATA_RATING:
|
||||
reply = "0,0,0,0,0,0";
|
||||
break;
|
||||
case 7:
|
||||
case ScriptBaseClass.DATA_BORN:
|
||||
case ScriptBaseClass.DATA_PAYINFO:
|
||||
if (udt.IsLocal)
|
||||
{
|
||||
// DATA_NAME (First Last)
|
||||
ScriptBaseClass.DATA_NAME => account.FirstName + " " + account.LastName,
|
||||
// DATA_BORN (YYYY-MM-DD)
|
||||
ScriptBaseClass.DATA_BORN => Util.ToDateTime(account.Created).ToString("yyyy-MM-dd"),
|
||||
// DATA_RATING (0,0,0,0,0,0)
|
||||
ScriptBaseClass.DATA_RATING => "0,0,0,0,0,0",
|
||||
// DATA_USERLEVEL (integer). This is not available in LL and so has no constant.
|
||||
7 => account.UserLevel.ToString(),
|
||||
// DATA_PAYINFO (0|1|2|3)
|
||||
ScriptBaseClass.DATA_PAYINFO => "0",
|
||||
_ => "0",// Raise no event
|
||||
};
|
||||
UserAccount account = m_userAccountService.GetUserAccount(RegionScopeID, uuid);
|
||||
if (account is not null)
|
||||
{
|
||||
reply = data switch
|
||||
{
|
||||
7 => account.UserLevel.ToString(),
|
||||
ScriptBaseClass.DATA_BORN => Util.ToDateTime(account.Created).ToString("yyyy-MM-dd"),
|
||||
_ => ((account.UserFlags >> 2) & 0x03).ToString()
|
||||
};
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (data == 7)
|
||||
reply = "0";
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
m_AsyncCommands.DataserverPlugin.DataserverReply(eventID, reply);
|
||||
if(reply != null)
|
||||
m_AsyncCommands.DataserverPlugin.DataserverReply(eventID, reply);
|
||||
}
|
||||
|
||||
UUID tid = m_AsyncCommands.DataserverPlugin.RegisterRequest(m_host.LocalId,
|
||||
@@ -6223,8 +6237,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
float rsy = World.RegionInfo.RegionSizeY;
|
||||
|
||||
// can understand what sl does if position is not in region, so do something :)
|
||||
float px = (float)Util.Clamp(pos.x, 0.5, rsx - 0.5);
|
||||
float py = (float)Util.Clamp(pos.y, 0.5, rsy - 0.5);
|
||||
float px = Math.Clamp((float)pos.x, 0.5f, rsx - 0.5f);
|
||||
float py = Math.Clamp((float)pos.y, 0.5f, rsy - 0.5f);
|
||||
|
||||
float ex, ey;
|
||||
|
||||
@@ -10233,10 +10247,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
return new LSL_List();
|
||||
}
|
||||
|
||||
float repeatX = (float)Util.Clamp(mnrepeat.x,-100.0, 100.0);
|
||||
float repeatY = (float)Util.Clamp(mnrepeat.y,-100.0, 100.0);
|
||||
float offsetX = (float)Util.Clamp(mnoffset.x, 0, 1.0);
|
||||
float offsetY = (float)Util.Clamp(mnoffset.y, 0, 1.0);
|
||||
float repeatX = Math.Clamp((float)mnrepeat.x,-100.0f, 100.0f);
|
||||
float repeatY = Math.Clamp((float)mnrepeat.y,-100.0f, 100.0f);
|
||||
float offsetX = Math.Clamp((float)mnoffset.x, 0f, 1.0f);
|
||||
float offsetY = Math.Clamp((float)mnoffset.y, 0f, 1.0f);
|
||||
|
||||
materialChanged |= SetMaterialNormalMap(part, face, mapID, repeatX, repeatY, offsetX, offsetY, mnrot);
|
||||
break;
|
||||
@@ -10335,15 +10349,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
return new LSL_List();
|
||||
}
|
||||
|
||||
float srepeatX = (float)Util.Clamp(msrepeat.x, -100.0, 100.0);
|
||||
float srepeatY = (float)Util.Clamp(msrepeat.y, -100.0, 100.0);
|
||||
float soffsetX = (float)Util.Clamp(msoffset.x, -1.0, 1.0);
|
||||
float soffsetY = (float)Util.Clamp(msoffset.y, -1.0, 1.0);
|
||||
byte colorR = (byte)(255.0 * Util.Clamp(mscolor.x, 0, 1.0) + 0.5);
|
||||
byte colorG = (byte)(255.0 * Util.Clamp(mscolor.y, 0, 1.0) + 0.5);
|
||||
byte colorB = (byte)(255.0 * Util.Clamp(mscolor.z, 0, 1.0) + 0.5);
|
||||
byte gloss = (byte)Util.Clamp((int)msgloss, 0, 255);
|
||||
byte env = (byte)Util.Clamp((int)msenv, 0, 255);
|
||||
float srepeatX = Math.Clamp((float)msrepeat.x, -100.0f, 100.0f);
|
||||
float srepeatY = Math.Clamp((float)msrepeat.y, -100.0f, 100.0f);
|
||||
float soffsetX = Math.Clamp((float)msoffset.x, -1.0f, 1.0f);
|
||||
float soffsetY = Math.Clamp((float)msoffset.y, -1.0f, 1.0f);
|
||||
byte colorR = (byte)(255.0f * Math.Clamp((float)mscolor.x, 0f, 1.0f) + 0.5f);
|
||||
byte colorG = (byte)(255.0f * Math.Clamp((float)mscolor.y, 0f, 1.0f) + 0.5f);
|
||||
byte colorB = (byte)(255.0f * Math.Clamp((float)mscolor.z, 0f, 1.0f) + 0.5f);
|
||||
byte gloss = (byte)Math.Clamp((int)msgloss, 0, 255);
|
||||
byte env = (byte)Math.Clamp((int)msenv, 0, 255);
|
||||
|
||||
materialChanged |= SetMaterialSpecMap(part, face, smapID, srepeatX, srepeatY, soffsetX, soffsetY,
|
||||
msrot, colorR, colorG, colorB, gloss, env);
|
||||
@@ -10412,9 +10426,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
{
|
||||
part.Shape.ProjectionEntry = true;
|
||||
part.Shape.ProjectionTextureUUID = stexID;
|
||||
part.Shape.ProjectionFOV = Util.Clamp(fov, 0, 3.0f);
|
||||
part.Shape.ProjectionFocus = Util.Clamp(focus, -20.0f, 20.0f);
|
||||
part.Shape.ProjectionAmbiance = Util.Clamp(amb, 0, 1.0f);
|
||||
part.Shape.ProjectionFOV = Math.Clamp(fov, 0, 3.0f);
|
||||
part.Shape.ProjectionFocus = Math.Clamp(focus, -20.0f, 20.0f);
|
||||
part.Shape.ProjectionAmbiance = Math.Clamp(amb, 0, 1.0f);
|
||||
|
||||
part.ParentGroup.HasGroupChanged = true;
|
||||
part.ScheduleFullUpdate();
|
||||
@@ -12047,8 +12061,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
// redundancy).
|
||||
// </para>
|
||||
// <para>
|
||||
// LSL requires a base64 string to be 8
|
||||
// characters in length. LSL also uses '/'
|
||||
// LSL also uses '/'
|
||||
// rather than '-' (MIME compliant).
|
||||
// </para>
|
||||
// <para>
|
||||
@@ -12193,7 +12206,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
// be returned.
|
||||
// If fewer than 6 characters are supplied, then
|
||||
// the answer will reflect a partial
|
||||
// accumulation.
|
||||
// accumulation of full bytes
|
||||
// <para>
|
||||
// The 6-bit segments are
|
||||
// extracted left-to-right in big-endian mode,
|
||||
@@ -12213,59 +12226,53 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
public LSL_Integer llBase64ToInteger(string str)
|
||||
{
|
||||
int number = 0;
|
||||
int digit;
|
||||
|
||||
|
||||
// Require a well-fromed base64 string
|
||||
|
||||
if (str.Length > 8)
|
||||
if (str is null || str.Length < 2 || str.Length > 8)
|
||||
return 0;
|
||||
|
||||
// The loop is unrolled in the interests
|
||||
// of performance and simple necessity.
|
||||
//
|
||||
// MUST find 6 digits to be well formed
|
||||
// -1 == invalid
|
||||
// 0 == padding
|
||||
|
||||
int digit;
|
||||
if ((digit = c2itable[str[0]]) <= 0)
|
||||
{
|
||||
return digit < 0 ? (int)0 : number;
|
||||
}
|
||||
number += --digit<<26;
|
||||
return 0;
|
||||
|
||||
int number = --digit << 26;
|
||||
|
||||
if ((digit = c2itable[str[1]]) <= 0)
|
||||
{
|
||||
return digit < 0 ? (int)0 : number;
|
||||
}
|
||||
number += --digit<<20;
|
||||
return 0;
|
||||
|
||||
if (str.Length == 2)
|
||||
return number | (--digit & 0x30) << 20;
|
||||
|
||||
int next = --digit << 20;
|
||||
|
||||
if ((digit = c2itable[str[2]]) <= 0)
|
||||
{
|
||||
return digit < 0 ? (int)0 : number;
|
||||
}
|
||||
number += --digit<<14;
|
||||
return number;
|
||||
|
||||
number |= next;
|
||||
if (str.Length == 3)
|
||||
return number | (--digit & 0x3C) << 14;
|
||||
|
||||
next = --digit << 14;
|
||||
|
||||
if ((digit = c2itable[str[3]]) <= 0)
|
||||
{
|
||||
return digit < 0 ? (int)0 : number;
|
||||
}
|
||||
number += --digit<<8;
|
||||
return number;
|
||||
|
||||
number |= next;
|
||||
number |= --digit << 8;
|
||||
if (str.Length == 4)
|
||||
return number;
|
||||
|
||||
if ((digit = c2itable[str[4]]) <= 0)
|
||||
{
|
||||
return digit < 0 ? (int)0 : number;
|
||||
}
|
||||
number += --digit<<2;
|
||||
return number;
|
||||
|
||||
if (str.Length == 5)
|
||||
return number;
|
||||
|
||||
next = --digit << 2;
|
||||
|
||||
if ((digit = c2itable[str[5]]) <= 0)
|
||||
{
|
||||
return digit < 0 ? (int)0 : number;
|
||||
}
|
||||
number += --digit>>4;
|
||||
return number;
|
||||
|
||||
// ignore trailing padding
|
||||
number |= next;
|
||||
number |= --digit >> 4;
|
||||
|
||||
return number;
|
||||
}
|
||||
@@ -16579,32 +16586,32 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
int yInt = (int)yPos;
|
||||
|
||||
// Corner 1 of 1x1 rectangle
|
||||
int x = Util.Clamp<int>(xInt+1, 0, World.Heightmap.Width - 1);
|
||||
int y = Util.Clamp<int>(yInt+1, 0, World.Heightmap.Height - 1);
|
||||
int x = Math.Clamp(xInt+1, 0, World.Heightmap.Width - 1);
|
||||
int y = Math.Clamp(yInt+1, 0, World.Heightmap.Height - 1);
|
||||
Vector3 pos1 = new(x, y, (float)World.Heightmap[x, y]);
|
||||
// Adjust bounding box
|
||||
zLower = Math.Min(zLower, pos1.Z);
|
||||
zUpper = Math.Max(zUpper, pos1.Z);
|
||||
|
||||
// Corner 2 of 1x1 rectangle
|
||||
x = Util.Clamp<int>(xInt, 0, World.Heightmap.Width - 1);
|
||||
y = Util.Clamp<int>(yInt+1, 0, World.Heightmap.Height - 1);
|
||||
x = Math.Clamp(xInt, 0, World.Heightmap.Width - 1);
|
||||
y = Math.Clamp(yInt+1, 0, World.Heightmap.Height - 1);
|
||||
Vector3 pos2 = new(x, y, (float)World.Heightmap[x, y]);
|
||||
// Adjust bounding box
|
||||
zLower = Math.Min(zLower, pos2.Z);
|
||||
zUpper = Math.Max(zUpper, pos2.Z);
|
||||
|
||||
// Corner 3 of 1x1 rectangle
|
||||
x = Util.Clamp<int>(xInt, 0, World.Heightmap.Width - 1);
|
||||
y = Util.Clamp<int>(yInt, 0, World.Heightmap.Height - 1);
|
||||
x = Math.Clamp(xInt, 0, World.Heightmap.Width - 1);
|
||||
y = Math.Clamp(yInt, 0, World.Heightmap.Height - 1);
|
||||
Vector3 pos3 = new(x, y, (float)World.Heightmap[x, y]);
|
||||
// Adjust bounding box
|
||||
zLower = Math.Min(zLower, pos3.Z);
|
||||
zUpper = Math.Max(zUpper, pos3.Z);
|
||||
|
||||
// Corner 4 of 1x1 rectangle
|
||||
x = Util.Clamp<int>(xInt+1, 0, World.Heightmap.Width - 1);
|
||||
y = Util.Clamp<int>(yInt, 0, World.Heightmap.Height - 1);
|
||||
x = Math.Clamp(xInt+1, 0, World.Heightmap.Width - 1);
|
||||
y = Math.Clamp(yInt, 0, World.Heightmap.Height - 1);
|
||||
Vector3 pos4 = new(x, y, (float)World.Heightmap[x, y]);
|
||||
// Adjust bounding box
|
||||
zLower = Math.Min(zLower, pos4.Z);
|
||||
|
||||
@@ -3983,9 +3983,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
obj.Shape.ProjectionEntry = true;
|
||||
obj.Shape.ProjectionTextureUUID = texID;
|
||||
obj.Shape.ProjectionFOV = Util.Clamp((float)fov, 0, 3.0f);
|
||||
obj.Shape.ProjectionFocus = Util.Clamp((float)focus, -20.0f, 20.0f);
|
||||
obj.Shape.ProjectionAmbiance = Util.Clamp((float)amb, 0, 1.0f);
|
||||
obj.Shape.ProjectionFOV = Math.Clamp((float)fov, 0, 3.0f);
|
||||
obj.Shape.ProjectionFocus = Math.Clamp((float)focus, -20.0f, 20.0f);
|
||||
obj.Shape.ProjectionAmbiance = Math.Clamp((float)amb, 0, 1.0f);
|
||||
|
||||
obj.ParentGroup.HasGroupChanged = true;
|
||||
obj.ScheduleFullUpdate();
|
||||
@@ -6608,5 +6608,57 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
return ret.ToString();
|
||||
}
|
||||
|
||||
public LSL_Vector osGetLinkColor(LSL_Integer link, LSL_Integer face)
|
||||
{
|
||||
SceneObjectPart linkedPart = link.value switch
|
||||
{
|
||||
ScriptBaseClass.LINK_ROOT => m_host.ParentGroup.RootPart,
|
||||
ScriptBaseClass.LINK_THIS => m_host,
|
||||
_ => m_host.ParentGroup.GetLinkNumPart(link.value)
|
||||
};
|
||||
|
||||
if (linkedPart != null)
|
||||
{
|
||||
InitLSL();
|
||||
return m_LSL_Api.GetColor(linkedPart, face.value);
|
||||
}
|
||||
|
||||
return LSL_Vector.Zero;
|
||||
}
|
||||
|
||||
public LSL_Vector osTemperature2sRGB(LSL_Float dtemp)
|
||||
{
|
||||
float temp = (float)dtemp.value;
|
||||
if (temp <= 1000f)
|
||||
return new LSL_Vector(1.0, 0.0401, 0);
|
||||
else if (temp >= 40000f)
|
||||
return new LSL_Vector(0.3277, 0.5022, 1.0);
|
||||
|
||||
float green;
|
||||
if (temp < 6600f)
|
||||
{
|
||||
green = temp - 1000f;
|
||||
green = ((((-7.87308e-13f * green) - 7.10085e-9f) * green) + 0.00022693f) * green + 0.0374249f;
|
||||
green = Math.Clamp(green, 0, 1.0f);
|
||||
|
||||
if (temp <= 19.0f)
|
||||
return new LSL_Vector(1.0, green, 0);
|
||||
|
||||
float blue = temp - 1900f;
|
||||
blue = ((((-5.97E-12f * blue) + 5.49E-08f) * blue) + 8.85465E-05f) * blue - 0.0058959f;
|
||||
blue = Math.Clamp(blue, 0f, 1.0f);
|
||||
|
||||
return new LSL_Vector(1.0, green, blue);
|
||||
}
|
||||
|
||||
temp = 0.01f * (temp - 6000f);
|
||||
float red = 1.897315f * MathF.Pow(temp, -0.346837f) + 0.0622044f;
|
||||
red = Math.Clamp(red, 0, 1.0f);
|
||||
|
||||
green = 1.261989f * MathF.Pow(temp, -0.251708f) + 0.200836f;
|
||||
green = Math.Clamp(green, 0, 1.0f);
|
||||
return new LSL_Vector(red, green, 1.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -627,5 +627,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||
LSL_String osAESEncryptTo(string secret, string plainText, string ivString);
|
||||
LSL_String osAESDecrypt(string secret, string encryptedText);
|
||||
LSL_String osAESDecryptFrom(string secret, string encryptedText, string ivString);
|
||||
vector osGetLinkColor(LSL_Integer linknum, LSL_Integer face);
|
||||
vector osTemperature2sRGB(LSL_Float dtemp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
public partial class ScriptBaseClass
|
||||
{
|
||||
// SCRIPTS CONSTANTS
|
||||
public static readonly LSLInteger OS_APIVERSION = 22;
|
||||
public static readonly LSLInteger OS_APIVERSION = 23;
|
||||
|
||||
public static readonly LSLInteger TRUE = 1;
|
||||
public static readonly LSLInteger FALSE = 0;
|
||||
|
||||
@@ -1808,5 +1808,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
return m_OSSL_Functions.osAESDecryptFrom(secret, encryptedText, ivString);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public vector osGetLinkColor(LSL_Integer link, LSL_Integer face)
|
||||
{
|
||||
return m_OSSL_Functions.osGetLinkColor(link, face);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public vector osTemperature2sRBG(LSL_Float dtemp)
|
||||
{
|
||||
return m_OSSL_Functions.osTemperature2sRGB(dtemp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,14 +25,11 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using OpenSim.Region.ScriptEngine.Shared.ScriptBase;
|
||||
using OpenSim.Region.ScriptEngine.Yengine;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Text;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text.RegularExpressions;
|
||||
using OpenSim.Region.ScriptEngine.Shared;
|
||||
|
||||
@@ -83,48 +80,48 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
private static TokenTypeStr tokenTypeStr = new TokenTypeStr(null);
|
||||
private static TokenTypeVec tokenTypeVec = new TokenTypeVec(null);
|
||||
|
||||
private static MethodInfo stringAddStringMethInfo = ScriptCodeGen.GetStaticMethod(typeof(string), "Concat", new Type[] { typeof(string), typeof(string) });
|
||||
private static MethodInfo stringCmpStringMethInfo = ScriptCodeGen.GetStaticMethod(typeof(string), "Compare", new Type[] { typeof(string), typeof(string), typeof(StringComparison) });
|
||||
private static MethodInfo stringAddStringMethInfo = GetBinOpsMethod("StringConcat", [typeof(string), typeof(string)]);
|
||||
private static MethodInfo stringCmpStringMethInfo = GetBinOpsMethod("StringCompareOrdinal", [typeof(string), typeof(string)]);
|
||||
|
||||
private static MethodInfo infoMethListAddFloat = GetBinOpsMethod("MethListAddFloat", new Type[] { typeof(LSL_List), typeof(double) });
|
||||
private static MethodInfo infoMethListAddInt = GetBinOpsMethod("MethListAddInt", new Type[] { typeof(LSL_List), typeof(int) });
|
||||
private static MethodInfo infoMethListAddKey = GetBinOpsMethod("MethListAddKey", new Type[] { typeof(LSL_List), typeof(string) });
|
||||
private static MethodInfo infoMethListAddRot = GetBinOpsMethod("MethListAddRot", new Type[] { typeof(LSL_List), typeof(LSL_Rotation) });
|
||||
private static MethodInfo infoMethListAddStr = GetBinOpsMethod("MethListAddStr", new Type[] { typeof(LSL_List), typeof(string) });
|
||||
private static MethodInfo infoMethListAddVec = GetBinOpsMethod("MethListAddVec", new Type[] { typeof(LSL_List), typeof(LSL_Vector) });
|
||||
private static MethodInfo infoMethListAddList = GetBinOpsMethod("MethListAddList", new Type[] { typeof(LSL_List), typeof(LSL_List) });
|
||||
private static MethodInfo infoMethFloatAddList = GetBinOpsMethod("MethFloatAddList", new Type[] { typeof(double), typeof(LSL_List) });
|
||||
private static MethodInfo infoMethIntAddList = GetBinOpsMethod("MethIntAddList", new Type[] { typeof(int), typeof(LSL_List) });
|
||||
private static MethodInfo infoMethKeyAddList = GetBinOpsMethod("MethKeyAddList", new Type[] { typeof(string), typeof(LSL_List) });
|
||||
private static MethodInfo infoMethRotAddList = GetBinOpsMethod("MethRotAddList", new Type[] { typeof(LSL_Rotation), typeof(LSL_List) });
|
||||
private static MethodInfo infoMethStrAddList = GetBinOpsMethod("MethStrAddList", new Type[] { typeof(string), typeof(LSL_List) });
|
||||
private static MethodInfo infoMethVecAddList = GetBinOpsMethod("MethVecAddList", new Type[] { typeof(LSL_Vector), typeof(LSL_List) });
|
||||
private static MethodInfo infoMethListEqList = GetBinOpsMethod("MethListEqList", new Type[] { typeof(LSL_List), typeof(LSL_List) });
|
||||
private static MethodInfo infoMethListNeList = GetBinOpsMethod("MethListNeList", new Type[] { typeof(LSL_List), typeof(LSL_List) });
|
||||
private static MethodInfo infoMethRotEqRot = GetBinOpsMethod("MethRotEqRot", new Type[] { typeof(LSL_Rotation), typeof(LSL_Rotation) });
|
||||
private static MethodInfo infoMethRotNeRot = GetBinOpsMethod("MethRotNeRot", new Type[] { typeof(LSL_Rotation), typeof(LSL_Rotation) });
|
||||
private static MethodInfo infoMethRotAddRot = GetBinOpsMethod("MethRotAddRot", new Type[] { typeof(LSL_Rotation), typeof(LSL_Rotation) });
|
||||
private static MethodInfo infoMethRotSubRot = GetBinOpsMethod("MethRotSubRot", new Type[] { typeof(LSL_Rotation), typeof(LSL_Rotation) });
|
||||
private static MethodInfo infoMethRotMulRot = GetBinOpsMethod("MethRotMulRot", new Type[] { typeof(LSL_Rotation), typeof(LSL_Rotation) });
|
||||
private static MethodInfo infoMethRotDivRot = GetBinOpsMethod("MethRotDivRot", new Type[] { typeof(LSL_Rotation), typeof(LSL_Rotation) });
|
||||
private static MethodInfo infoMethVecEqVec = GetBinOpsMethod("MethVecEqVec", new Type[] { typeof(LSL_Vector), typeof(LSL_Vector) });
|
||||
private static MethodInfo infoMethVecNeVec = GetBinOpsMethod("MethVecNeVec", new Type[] { typeof(LSL_Vector), typeof(LSL_Vector) });
|
||||
private static MethodInfo infoMethVecAddVec = GetBinOpsMethod("MethVecAddVec", new Type[] { typeof(LSL_Vector), typeof(LSL_Vector) });
|
||||
private static MethodInfo infoMethVecSubVec = GetBinOpsMethod("MethVecSubVec", new Type[] { typeof(LSL_Vector), typeof(LSL_Vector) });
|
||||
private static MethodInfo infoMethVecMulVec = GetBinOpsMethod("MethVecMulVec", new Type[] { typeof(LSL_Vector), typeof(LSL_Vector) });
|
||||
private static MethodInfo infoMethVecModVec = GetBinOpsMethod("MethVecModVec", new Type[] { typeof(LSL_Vector), typeof(LSL_Vector) });
|
||||
private static MethodInfo infoMethVecMulFloat = GetBinOpsMethod("MethVecMulFloat", new Type[] { typeof(LSL_Vector), typeof(double) });
|
||||
private static MethodInfo infoMethFloatMulVec = GetBinOpsMethod("MethFloatMulVec", new Type[] { typeof(double), typeof(LSL_Vector) });
|
||||
private static MethodInfo infoMethVecDivFloat = GetBinOpsMethod("MethVecDivFloat", new Type[] { typeof(LSL_Vector), typeof(double) });
|
||||
private static MethodInfo infoMethVecMulInt = GetBinOpsMethod("MethVecMulInt", new Type[] { typeof(LSL_Vector), typeof(int) });
|
||||
private static MethodInfo infoMethIntMulVec = GetBinOpsMethod("MethIntMulVec", new Type[] { typeof(int), typeof(LSL_Vector) });
|
||||
private static MethodInfo infoMethVecDivInt = GetBinOpsMethod("MethVecDivInt", new Type[] { typeof(LSL_Vector), typeof(int) });
|
||||
private static MethodInfo infoMethVecMulRot = GetBinOpsMethod("MethVecMulRot", new Type[] { typeof(LSL_Vector), typeof(LSL_Rotation) });
|
||||
private static MethodInfo infoMethVecDivRot = GetBinOpsMethod("MethVecDivRot", new Type[] { typeof(LSL_Vector), typeof(LSL_Rotation) });
|
||||
private static MethodInfo infoMethDoubleDivDouble = GetBinOpsMethod("MethDoubleDivDouble", new Type[] { typeof(Double), typeof(Double) });
|
||||
private static MethodInfo infoMethLongDivLong = GetBinOpsMethod("MethLongDivLong", new Type[] { typeof(long), typeof(long) });
|
||||
private static MethodInfo infoMethDoubleModDouble = GetBinOpsMethod("MethDoubleModDouble", new Type[] { typeof(Double), typeof(Double) });
|
||||
private static MethodInfo infoMethLongModLong = GetBinOpsMethod("MethLongModLong", new Type[] { typeof(long), typeof(long) });
|
||||
private static MethodInfo infoMethListAddFloat = GetBinOpsMethod("MethListAddFloat", [typeof(LSL_List), typeof(double)]);
|
||||
private static MethodInfo infoMethListAddInt = GetBinOpsMethod("MethListAddInt", [typeof(LSL_List), typeof(int)]);
|
||||
private static MethodInfo infoMethListAddKey = GetBinOpsMethod("MethListAddKey", [typeof(LSL_List), typeof(string)]);
|
||||
private static MethodInfo infoMethListAddRot = GetBinOpsMethod("MethListAddRot", [typeof(LSL_List), typeof(LSL_Rotation)]);
|
||||
private static MethodInfo infoMethListAddStr = GetBinOpsMethod("MethListAddStr", [typeof(LSL_List), typeof(string)]);
|
||||
private static MethodInfo infoMethListAddVec = GetBinOpsMethod("MethListAddVec", [typeof(LSL_List), typeof(LSL_Vector)]);
|
||||
private static MethodInfo infoMethListAddList = GetBinOpsMethod("MethListAddList", [typeof(LSL_List), typeof(LSL_List)]);
|
||||
private static MethodInfo infoMethFloatAddList = GetBinOpsMethod("MethFloatAddList", [typeof(double), typeof(LSL_List)]);
|
||||
private static MethodInfo infoMethIntAddList = GetBinOpsMethod("MethIntAddList", [typeof(int), typeof(LSL_List)]);
|
||||
private static MethodInfo infoMethKeyAddList = GetBinOpsMethod("MethKeyAddList", [typeof(string), typeof(LSL_List)]);
|
||||
private static MethodInfo infoMethRotAddList = GetBinOpsMethod("MethRotAddList", [typeof(LSL_Rotation), typeof(LSL_List)]);
|
||||
private static MethodInfo infoMethStrAddList = GetBinOpsMethod("MethStrAddList", [typeof(string), typeof(LSL_List)]);
|
||||
private static MethodInfo infoMethVecAddList = GetBinOpsMethod("MethVecAddList", [typeof(LSL_Vector), typeof(LSL_List)]);
|
||||
private static MethodInfo infoMethListEqList = GetBinOpsMethod("MethListEqList", [typeof(LSL_List), typeof(LSL_List)]);
|
||||
private static MethodInfo infoMethListNeList = GetBinOpsMethod("MethListNeList", [typeof(LSL_List), typeof(LSL_List)]);
|
||||
private static MethodInfo infoMethRotEqRot = GetBinOpsMethod("MethRotEqRot", [typeof(LSL_Rotation), typeof(LSL_Rotation)]);
|
||||
private static MethodInfo infoMethRotNeRot = GetBinOpsMethod("MethRotNeRot", [typeof(LSL_Rotation), typeof(LSL_Rotation)]);
|
||||
private static MethodInfo infoMethRotAddRot = GetBinOpsMethod("MethRotAddRot", [typeof(LSL_Rotation), typeof(LSL_Rotation)]);
|
||||
private static MethodInfo infoMethRotSubRot = GetBinOpsMethod("MethRotSubRot", [typeof(LSL_Rotation), typeof(LSL_Rotation)]);
|
||||
private static MethodInfo infoMethRotMulRot = GetBinOpsMethod("MethRotMulRot", [typeof(LSL_Rotation), typeof(LSL_Rotation)]);
|
||||
private static MethodInfo infoMethRotDivRot = GetBinOpsMethod("MethRotDivRot", [typeof(LSL_Rotation), typeof(LSL_Rotation)]);
|
||||
private static MethodInfo infoMethVecEqVec = GetBinOpsMethod("MethVecEqVec", [typeof(LSL_Vector), typeof(LSL_Vector)]);
|
||||
private static MethodInfo infoMethVecNeVec = GetBinOpsMethod("MethVecNeVec", [typeof(LSL_Vector), typeof(LSL_Vector)]);
|
||||
private static MethodInfo infoMethVecAddVec = GetBinOpsMethod("MethVecAddVec", [typeof(LSL_Vector), typeof(LSL_Vector)]);
|
||||
private static MethodInfo infoMethVecSubVec = GetBinOpsMethod("MethVecSubVec", [typeof(LSL_Vector), typeof(LSL_Vector)]);
|
||||
private static MethodInfo infoMethVecMulVec = GetBinOpsMethod("MethVecMulVec", [typeof(LSL_Vector), typeof(LSL_Vector)]);
|
||||
private static MethodInfo infoMethVecModVec = GetBinOpsMethod("MethVecModVec", [typeof(LSL_Vector), typeof(LSL_Vector)]);
|
||||
private static MethodInfo infoMethVecMulFloat = GetBinOpsMethod("MethVecMulFloat", [typeof(LSL_Vector), typeof(double)]);
|
||||
private static MethodInfo infoMethFloatMulVec = GetBinOpsMethod("MethFloatMulVec", [typeof(double), typeof(LSL_Vector)]);
|
||||
private static MethodInfo infoMethVecDivFloat = GetBinOpsMethod("MethVecDivFloat", [typeof(LSL_Vector), typeof(double)]);
|
||||
private static MethodInfo infoMethVecMulInt = GetBinOpsMethod("MethVecMulInt", [typeof(LSL_Vector), typeof(int)]);
|
||||
private static MethodInfo infoMethIntMulVec = GetBinOpsMethod("MethIntMulVec", [typeof(int), typeof(LSL_Vector)]);
|
||||
private static MethodInfo infoMethVecDivInt = GetBinOpsMethod("MethVecDivInt", [typeof(LSL_Vector), typeof(int)]);
|
||||
private static MethodInfo infoMethVecMulRot = GetBinOpsMethod("MethVecMulRot", [typeof(LSL_Vector), typeof(LSL_Rotation)]);
|
||||
private static MethodInfo infoMethVecDivRot = GetBinOpsMethod("MethVecDivRot", [typeof(LSL_Vector), typeof(LSL_Rotation)]);
|
||||
private static MethodInfo infoMethDoubleDivDouble = GetBinOpsMethod("MethDoubleDivDouble", [typeof(double), typeof(double)]);
|
||||
private static MethodInfo infoMethLongDivLong = GetBinOpsMethod("MethLongDivLong", [typeof(long), typeof(long)]);
|
||||
private static MethodInfo infoMethDoubleModDouble = GetBinOpsMethod("MethDoubleModDouble", [typeof(double), typeof(double)]);
|
||||
private static MethodInfo infoMethLongModLong = GetBinOpsMethod("MethLongModLong", [typeof(long), typeof(long)]);
|
||||
|
||||
private static MethodInfo GetBinOpsMethod(string name, Type[] types)
|
||||
{
|
||||
@@ -144,7 +141,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
{
|
||||
Dictionary<string, BinOpStr> bos = new Dictionary<string, BinOpStr>();
|
||||
|
||||
string[] booltypes = new string[] { "bool", "char", "float", "integer", "key", "list", "string" };
|
||||
string[] booltypes = ["bool", "char", "float", "integer", "key", "list", "string"];
|
||||
|
||||
/*
|
||||
* Get the && and || all out of the way...
|
||||
@@ -154,10 +151,8 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
{
|
||||
for(int j = 0; j < booltypes.Length; j++)
|
||||
{
|
||||
bos.Add(booltypes[i] + "&&" + booltypes[j],
|
||||
new BinOpStr(typeof(bool), BinOpStrAndAnd));
|
||||
bos.Add(booltypes[i] + "||" + booltypes[j],
|
||||
new BinOpStr(typeof(bool), BinOpStrOrOr));
|
||||
bos.Add(booltypes[i] + "&&" + booltypes[j], new BinOpStr(typeof(bool), BinOpStrAndAnd));
|
||||
bos.Add(booltypes[i] + "||" + booltypes[j], new BinOpStr(typeof(bool), BinOpStrOrOr));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -970,7 +965,6 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
result.PopPre(scg, errorAt);
|
||||
left.PushVal(scg, errorAt, tokenTypeStr);
|
||||
right.PushVal(scg, errorAt, tokenTypeStr);
|
||||
scg.ilGen.Emit(errorAt, OpCodes.Ldc_I4, (int)StringComparison.Ordinal);
|
||||
scg.ilGen.Emit(errorAt, OpCodes.Call, stringCmpStringMethInfo);
|
||||
scg.ilGen.Emit(errorAt, OpCodes.Ldc_I4_0);
|
||||
scg.ilGen.Emit(errorAt, OpCodes.Ceq);
|
||||
@@ -982,7 +976,6 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
result.PopPre(scg, errorAt);
|
||||
left.PushVal(scg, errorAt, tokenTypeStr);
|
||||
right.PushVal(scg, errorAt, tokenTypeStr);
|
||||
scg.ilGen.Emit(errorAt, OpCodes.Ldc_I4, (int)StringComparison.Ordinal);
|
||||
scg.ilGen.Emit(errorAt, OpCodes.Call, stringCmpStringMethInfo);
|
||||
scg.ilGen.Emit(errorAt, OpCodes.Ldc_I4_0);
|
||||
scg.ilGen.Emit(errorAt, OpCodes.Ceq);
|
||||
@@ -1185,7 +1178,6 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
result.PopPre(scg, errorAt);
|
||||
left.PushVal(scg, errorAt, tokenTypeStr);
|
||||
right.PushVal(scg, errorAt, tokenTypeStr);
|
||||
scg.ilGen.Emit(errorAt, OpCodes.Ldc_I4, (int)StringComparison.Ordinal);
|
||||
scg.ilGen.Emit(errorAt, OpCodes.Call, stringCmpStringMethInfo);
|
||||
scg.ilGen.Emit(errorAt, OpCodes.Ldc_I4_0);
|
||||
scg.ilGen.Emit(errorAt, OpCodes.Ceq);
|
||||
@@ -1197,7 +1189,6 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
result.PopPre(scg, errorAt);
|
||||
left.PushVal(scg, errorAt, tokenTypeStr);
|
||||
right.PushVal(scg, errorAt, tokenTypeStr);
|
||||
scg.ilGen.Emit(errorAt, OpCodes.Ldc_I4, (int)StringComparison.Ordinal);
|
||||
scg.ilGen.Emit(errorAt, OpCodes.Call, stringCmpStringMethInfo);
|
||||
scg.ilGen.Emit(errorAt, OpCodes.Ldc_I4_0);
|
||||
scg.ilGen.Emit(errorAt, OpCodes.Ceq);
|
||||
@@ -1211,7 +1202,6 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
result.PopPre(scg, errorAt);
|
||||
left.PushVal(scg, errorAt, tokenTypeStr);
|
||||
right.PushVal(scg, errorAt, tokenTypeStr);
|
||||
scg.ilGen.Emit(errorAt, OpCodes.Ldc_I4, (int)StringComparison.Ordinal);
|
||||
scg.ilGen.Emit(errorAt, OpCodes.Call, stringCmpStringMethInfo);
|
||||
scg.ilGen.Emit(errorAt, OpCodes.Ldc_I4_0);
|
||||
scg.ilGen.Emit(errorAt, OpCodes.Clt);
|
||||
@@ -1223,7 +1213,6 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
result.PopPre(scg, errorAt);
|
||||
left.PushVal(scg, errorAt, tokenTypeStr);
|
||||
right.PushVal(scg, errorAt, tokenTypeStr);
|
||||
scg.ilGen.Emit(errorAt, OpCodes.Ldc_I4, (int)StringComparison.Ordinal);
|
||||
scg.ilGen.Emit(errorAt, OpCodes.Call, stringCmpStringMethInfo);
|
||||
scg.ilGen.Emit(errorAt, OpCodes.Ldc_I4_1);
|
||||
scg.ilGen.Emit(errorAt, OpCodes.Clt);
|
||||
@@ -1235,7 +1224,6 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
result.PopPre(scg, errorAt);
|
||||
left.PushVal(scg, errorAt, tokenTypeStr);
|
||||
right.PushVal(scg, errorAt, tokenTypeStr);
|
||||
scg.ilGen.Emit(errorAt, OpCodes.Ldc_I4, (int)StringComparison.Ordinal);
|
||||
scg.ilGen.Emit(errorAt, OpCodes.Call, stringCmpStringMethInfo);
|
||||
scg.ilGen.Emit(errorAt, OpCodes.Ldc_I4_0);
|
||||
scg.ilGen.Emit(errorAt, OpCodes.Cgt);
|
||||
@@ -1247,7 +1235,6 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
result.PopPre(scg, errorAt);
|
||||
left.PushVal(scg, errorAt, tokenTypeStr);
|
||||
right.PushVal(scg, errorAt, tokenTypeStr);
|
||||
scg.ilGen.Emit(errorAt, OpCodes.Ldc_I4, (int)StringComparison.Ordinal);
|
||||
scg.ilGen.Emit(errorAt, OpCodes.Call, stringCmpStringMethInfo);
|
||||
scg.ilGen.Emit(errorAt, OpCodes.Ldc_I4_M1);
|
||||
scg.ilGen.Emit(errorAt, OpCodes.Cgt);
|
||||
@@ -1395,26 +1382,58 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
* Needed to pick up functionality defined by overloaded operators of LSL_ types.
|
||||
* They need to be marked public or runtime says they are inaccessible.
|
||||
*/
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static string StringConcat(string str1, string str2)
|
||||
{
|
||||
return string.Concat(str1, str2);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static string StringConcat(string str1, string str2, string str3)
|
||||
{
|
||||
return string.Concat(str1, str2, str3);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static string StringConcat(string str1, string str2, string str3, string str4)
|
||||
{
|
||||
return string.Concat(str1, str2, str3, str4);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static int StringCompareOrdinal(string str1, string str2)
|
||||
{
|
||||
return string.Compare(str1, str2, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static LSL_List MethListAddFloat(LSL_List left, double right)
|
||||
{
|
||||
return MethListAddObj(left, new LSL_Float(right));
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static LSL_List MethListAddInt(LSL_List left, int right)
|
||||
{
|
||||
return MethListAddObj(left, new LSL_Integer(right));
|
||||
}
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static LSL_List MethListAddKey(LSL_List left, string right)
|
||||
{
|
||||
return MethListAddObj(left, new LSL_Key(right));
|
||||
}
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static LSL_List MethListAddRot(LSL_List left, LSL_Rotation right)
|
||||
{
|
||||
return MethListAddObj(left, right);
|
||||
}
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static LSL_List MethListAddStr(LSL_List left, string right)
|
||||
{
|
||||
return MethListAddObj(left, new LSL_String(right));
|
||||
}
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static LSL_List MethListAddVec(LSL_List left, LSL_Vector right)
|
||||
{
|
||||
return MethListAddObj(left, right);
|
||||
@@ -1438,26 +1457,32 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
return new LSL_List(newarr);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static LSL_List MethFloatAddList(double left, LSL_List right)
|
||||
{
|
||||
return MethObjAddList(new LSL_Float(left), right);
|
||||
}
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static LSL_List MethIntAddList(int left, LSL_List right)
|
||||
{
|
||||
return MethObjAddList(new LSL_Integer(left), right);
|
||||
}
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static LSL_List MethKeyAddList(string left, LSL_List right)
|
||||
{
|
||||
return MethObjAddList(new LSL_Key(left), right);
|
||||
}
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static LSL_List MethRotAddList(LSL_Rotation left, LSL_List right)
|
||||
{
|
||||
return MethObjAddList(left, right);
|
||||
}
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static LSL_List MethStrAddList(string left, LSL_List right)
|
||||
{
|
||||
return MethObjAddList(new LSL_String(left), right);
|
||||
}
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static LSL_List MethVecAddList(LSL_Vector left, LSL_List right)
|
||||
{
|
||||
return MethObjAddList(left, right);
|
||||
@@ -1471,6 +1496,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
return new LSL_List(newarr);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool MethListEqList(LSL_List left, LSL_List right)
|
||||
{
|
||||
return left == right;
|
||||
@@ -1478,6 +1504,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
|
||||
// According to http://wiki.secondlife.com/wiki/LlGetListLength
|
||||
// jackassed LSL allows 'somelist != []' to get the length of a list
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static int MethListNeList(LSL_List left, LSL_List right)
|
||||
{
|
||||
int leftlen = left.Length;
|
||||
@@ -1485,106 +1512,127 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
return leftlen - ritelen;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool MethRotEqRot(LSL_Rotation left, LSL_Rotation right)
|
||||
{
|
||||
return left == right;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool MethRotNeRot(LSL_Rotation left, LSL_Rotation right)
|
||||
{
|
||||
return left != right;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static LSL_Rotation MethRotAddRot(LSL_Rotation left, LSL_Rotation right)
|
||||
{
|
||||
return left + right;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static LSL_Rotation MethRotSubRot(LSL_Rotation left, LSL_Rotation right)
|
||||
{
|
||||
return left - right;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static LSL_Rotation MethRotMulRot(LSL_Rotation left, LSL_Rotation right)
|
||||
{
|
||||
return left * right;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static LSL_Rotation MethRotDivRot(LSL_Rotation left, LSL_Rotation right)
|
||||
{
|
||||
return left / right;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool MethVecEqVec(LSL_Vector left, LSL_Vector right)
|
||||
{
|
||||
return left == right;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool MethVecNeVec(LSL_Vector left, LSL_Vector right)
|
||||
{
|
||||
return left != right;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static LSL_Vector MethVecAddVec(LSL_Vector left, LSL_Vector right)
|
||||
{
|
||||
return left + right;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static LSL_Vector MethVecSubVec(LSL_Vector left, LSL_Vector right)
|
||||
{
|
||||
return left - right;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static double MethVecMulVec(LSL_Vector left, LSL_Vector right)
|
||||
{
|
||||
return (double)(left * right).value;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static LSL_Vector MethVecModVec(LSL_Vector left, LSL_Vector right)
|
||||
{
|
||||
return left % right;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static LSL_Vector MethVecMulFloat(LSL_Vector left, double right)
|
||||
{
|
||||
return left * right;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static LSL_Vector MethFloatMulVec(double left, LSL_Vector right)
|
||||
{
|
||||
return left * right;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static LSL_Vector MethVecDivFloat(LSL_Vector left, double right)
|
||||
{
|
||||
return left / right;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static LSL_Vector MethVecMulInt(LSL_Vector left, int right)
|
||||
{
|
||||
return left * right;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static LSL_Vector MethIntMulVec(int left, LSL_Vector right)
|
||||
{
|
||||
return left * right;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static LSL_Vector MethVecDivInt(LSL_Vector left, int right)
|
||||
{
|
||||
return left / right;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static LSL_Vector MethVecMulRot(LSL_Vector left, LSL_Rotation right)
|
||||
{
|
||||
return left * right;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static LSL_Vector MethVecDivRot(LSL_Vector left, LSL_Rotation right)
|
||||
{
|
||||
return left / right;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static double MethDoubleDivDouble(double a, double b)
|
||||
{
|
||||
double r = a / b;
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
{
|
||||
public static readonly string OBJECT_CODE_MAGIC = "YObjectCode";
|
||||
// reserve positive version values for original xmr
|
||||
public static int COMPILED_VERSION_VALUE = -9; // decremented when compiler or object file changes
|
||||
public static int COMPILED_VERSION_VALUE = -10; // decremented when compiler or object file changes
|
||||
|
||||
public static readonly int CALL_FRAME_MEMUSE = 64;
|
||||
public static readonly int STRING_LEN_TO_MEMUSE = 2;
|
||||
@@ -85,21 +85,21 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
private static readonly TokenTypeRot tokenTypeRot = new(null);
|
||||
private static readonly TokenTypeStr tokenTypeStr = new(null);
|
||||
private static readonly TokenTypeVec tokenTypeVec = new(null);
|
||||
private static readonly Type[] instanceTypeArg = new Type[] { typeof(XMRInstAbstract) };
|
||||
private static readonly string[] instanceNameArg = new string[] { "$xmrthis" };
|
||||
private static readonly Type[] instanceTypeArg = [typeof(XMRInstAbstract)];
|
||||
private static readonly string[] instanceNameArg = ["$xmrthis"];
|
||||
|
||||
private static readonly ConstructorInfo lslFloatConstructorInfo = typeof(LSL_Float).GetConstructor(new Type[] { typeof(double) });
|
||||
private static readonly ConstructorInfo lslIntegerConstructorInfo = typeof(LSL_Integer).GetConstructor(new Type[] { typeof(int) });
|
||||
private static readonly ConstructorInfo lslListConstructorInfo = typeof(LSL_List).GetConstructor(new Type[] { typeof(object[]) });
|
||||
public static readonly ConstructorInfo lslRotationConstructorInfo = typeof(LSL_Rotation).GetConstructor(new Type[] { typeof(double), typeof(double), typeof(double), typeof(double) });
|
||||
private static readonly ConstructorInfo lslStringConstructorInfo = typeof(LSL_String).GetConstructor(new Type[] { typeof(string) });
|
||||
public static readonly ConstructorInfo lslVectorConstructorInfo = typeof(LSL_Vector).GetConstructor(new Type[] { typeof(double), typeof(double), typeof(double) });
|
||||
private static readonly ConstructorInfo scriptBadCallNoExceptionConstructorInfo = typeof(ScriptBadCallNoException).GetConstructor(new Type[] { typeof(int) });
|
||||
private static readonly ConstructorInfo scriptChangeStateExceptionConstructorInfo = typeof(ScriptChangeStateException).GetConstructor(new Type[] { typeof(int) });
|
||||
private static readonly ConstructorInfo scriptRestoreCatchExceptionConstructorInfo = typeof(ScriptRestoreCatchException).GetConstructor(new Type[] { typeof(Exception) });
|
||||
private static readonly ConstructorInfo scriptUndefinedStateExceptionConstructorInfo = typeof(ScriptUndefinedStateException).GetConstructor(new Type[] { typeof(string) });
|
||||
private static readonly ConstructorInfo sdtClassConstructorInfo = typeof(XMRSDTypeClObj).GetConstructor(new Type[] { typeof(XMRInstAbstract), typeof(int) });
|
||||
private static readonly ConstructorInfo xmrArrayConstructorInfo = typeof(XMR_Array).GetConstructor(new Type[] { typeof(XMRInstAbstract) });
|
||||
private static readonly ConstructorInfo lslFloatConstructorInfo = typeof(LSL_Float).GetConstructor([typeof(double)]);
|
||||
private static readonly ConstructorInfo lslIntegerConstructorInfo = typeof(LSL_Integer).GetConstructor([typeof(int)]);
|
||||
private static readonly ConstructorInfo lslListConstructorInfo = typeof(LSL_List).GetConstructor([typeof(object[])]);
|
||||
public static readonly ConstructorInfo lslRotationConstructorInfo = typeof(LSL_Rotation).GetConstructor([typeof(double), typeof(double), typeof(double), typeof(double)]);
|
||||
private static readonly ConstructorInfo lslStringConstructorInfo = typeof(LSL_String).GetConstructor([typeof(string)]);
|
||||
public static readonly ConstructorInfo lslVectorConstructorInfo = typeof(LSL_Vector).GetConstructor([typeof(double), typeof(double), typeof(double)]);
|
||||
private static readonly ConstructorInfo scriptBadCallNoExceptionConstructorInfo = typeof(ScriptBadCallNoException).GetConstructor([typeof(int)]);
|
||||
private static readonly ConstructorInfo scriptChangeStateExceptionConstructorInfo = typeof(ScriptChangeStateException).GetConstructor([typeof(int)]);
|
||||
private static readonly ConstructorInfo scriptRestoreCatchExceptionConstructorInfo = typeof(ScriptRestoreCatchException).GetConstructor([typeof(Exception)]);
|
||||
private static readonly ConstructorInfo scriptUndefinedStateExceptionConstructorInfo = typeof(ScriptUndefinedStateException).GetConstructor([typeof(string)]);
|
||||
private static readonly ConstructorInfo sdtClassConstructorInfo = typeof(XMRSDTypeClObj).GetConstructor([typeof(XMRInstAbstract), typeof(int)]);
|
||||
private static readonly ConstructorInfo xmrArrayConstructorInfo = typeof(XMR_Array).GetConstructor([typeof(XMRInstAbstract)]);
|
||||
private static readonly FieldInfo callModeFieldInfo = typeof(XMRInstAbstract).GetField("callMode");
|
||||
private static readonly FieldInfo doGblInitFieldInfo = typeof(XMRInstAbstract).GetField("doGblInit");
|
||||
private static readonly FieldInfo ehArgsFieldInfo = typeof(XMRInstAbstract).GetField("ehArgs");
|
||||
@@ -116,29 +116,29 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
|
||||
private static readonly MethodInfo arrayClearMethodInfo = typeof(XMR_Array).GetMethod("__pub_clear", Array.Empty<Type>());
|
||||
private static readonly MethodInfo arrayCountMethodInfo = typeof(XMR_Array).GetMethod("__pub_count", Array.Empty<Type>());
|
||||
private static readonly MethodInfo arrayIndexMethodInfo = typeof(XMR_Array).GetMethod("__pub_index", new Type[] { typeof(int) });
|
||||
private static readonly MethodInfo arrayValueMethodInfo = typeof(XMR_Array).GetMethod("__pub_value", new Type[] { typeof(int) });
|
||||
private static readonly MethodInfo arrayIndexMethodInfo = typeof(XMR_Array).GetMethod("__pub_index", [typeof(int)]);
|
||||
private static readonly MethodInfo arrayValueMethodInfo = typeof(XMR_Array).GetMethod("__pub_value", [typeof(int)]);
|
||||
private static readonly MethodInfo checkRunStackMethInfo = typeof(XMRInstAbstract).GetMethod("CheckRunStack", Array.Empty<Type>());
|
||||
private static readonly MethodInfo checkRunQuickMethInfo = typeof(XMRInstAbstract).GetMethod("CheckRunQuick", Array.Empty<Type>());
|
||||
private static readonly MethodInfo ehArgUnwrapFloat = GetStaticMethod(typeof(TypeCast), "EHArgUnwrapFloat", new Type[] { typeof(object) });
|
||||
private static readonly MethodInfo ehArgUnwrapInteger = GetStaticMethod(typeof(TypeCast), "EHArgUnwrapInteger", new Type[] { typeof(object) });
|
||||
private static readonly MethodInfo ehArgUnwrapRotation = GetStaticMethod(typeof(TypeCast), "EHArgUnwrapRotation", new Type[] { typeof(object) });
|
||||
private static readonly MethodInfo ehArgUnwrapString = GetStaticMethod(typeof(TypeCast), "EHArgUnwrapString", new Type[] { typeof(object) });
|
||||
private static readonly MethodInfo ehArgUnwrapVector = GetStaticMethod(typeof(TypeCast), "EHArgUnwrapVector", new Type[] { typeof(object) });
|
||||
private static readonly MethodInfo xmrArrPubIndexMethod = typeof(XMR_Array).GetMethod("__pub_index", new Type[] { typeof(int) });
|
||||
private static readonly MethodInfo xmrArrPubValueMethod = typeof(XMR_Array).GetMethod("__pub_value", new Type[] { typeof(int) });
|
||||
private static readonly MethodInfo captureStackFrameMethodInfo = typeof(XMRInstAbstract).GetMethod("CaptureStackFrame", new Type[] { typeof(string), typeof(int), typeof(int) });
|
||||
private static readonly MethodInfo restoreStackFrameMethodInfo = typeof(XMRInstAbstract).GetMethod("RestoreStackFrame", new Type[] { typeof(string), typeof(int).MakeByRefType() });
|
||||
private static readonly MethodInfo stringCompareMethodInfo = GetStaticMethod(typeof(String), "Compare", new Type[] { typeof(string), typeof(string), typeof(StringComparison) });
|
||||
private static readonly MethodInfo stringConcat2MethodInfo = GetStaticMethod(typeof(String), "Concat", new Type[] { typeof(string), typeof(string) });
|
||||
private static readonly MethodInfo stringConcat3MethodInfo = GetStaticMethod(typeof(String), "Concat", new Type[] { typeof(string), typeof(string), typeof(string) });
|
||||
private static readonly MethodInfo stringConcat4MethodInfo = GetStaticMethod(typeof(String), "Concat", new Type[] { typeof(string), typeof(string), typeof(string), typeof(string) });
|
||||
private static readonly MethodInfo lslRotationNegateMethodInfo = GetStaticMethod(typeof(ScriptCodeGen), "LSLRotationNegate", new Type[] { typeof(LSL_Rotation) });
|
||||
private static readonly MethodInfo lslVectorNegateMethodInfo = GetStaticMethod(typeof(ScriptCodeGen), "LSLVectorNegate", new Type[] { typeof(LSL_Vector) });
|
||||
private static readonly MethodInfo scriptRestoreCatchExceptionUnwrap = GetStaticMethod(typeof(ScriptRestoreCatchException), "Unwrap", new Type[] { typeof(Exception) });
|
||||
private static readonly MethodInfo thrownExceptionWrapMethodInfo = GetStaticMethod(typeof(ScriptThrownException), "Wrap", new Type[] { typeof(object) });
|
||||
private static readonly MethodInfo catchExcToStrMethodInfo = GetStaticMethod(typeof(ScriptCodeGen), "CatchExcToStr", new Type[] { typeof(Exception) });
|
||||
private static readonly MethodInfo consoleWriteMethodInfo = GetStaticMethod(typeof(ScriptCodeGen), "ConsoleWrite", new Type[] { typeof(object) });
|
||||
private static readonly MethodInfo ehArgUnwrapFloat = GetStaticMethod(typeof(TypeCast), "EHArgUnwrapFloat", [typeof(object)]);
|
||||
private static readonly MethodInfo ehArgUnwrapInteger = GetStaticMethod(typeof(TypeCast), "EHArgUnwrapInteger", [typeof(object)]);
|
||||
private static readonly MethodInfo ehArgUnwrapRotation = GetStaticMethod(typeof(TypeCast), "EHArgUnwrapRotation", [typeof(object)]);
|
||||
private static readonly MethodInfo ehArgUnwrapString = GetStaticMethod(typeof(TypeCast), "EHArgUnwrapString", [typeof(object)]);
|
||||
private static readonly MethodInfo ehArgUnwrapVector = GetStaticMethod(typeof(TypeCast), "EHArgUnwrapVector", [typeof(object)]);
|
||||
private static readonly MethodInfo xmrArrPubIndexMethod = typeof(XMR_Array).GetMethod("__pub_index", [typeof(int)]);
|
||||
private static readonly MethodInfo xmrArrPubValueMethod = typeof(XMR_Array).GetMethod("__pub_value", [typeof(int)]);
|
||||
private static readonly MethodInfo captureStackFrameMethodInfo = typeof(XMRInstAbstract).GetMethod("CaptureStackFrame", [typeof(string), typeof(int), typeof(int)]);
|
||||
private static readonly MethodInfo restoreStackFrameMethodInfo = typeof(XMRInstAbstract).GetMethod("RestoreStackFrame", [typeof(string), typeof(int).MakeByRefType()]);
|
||||
private static readonly MethodInfo stringCompareMethodInfo = GetStaticMethod(typeof(BinOpStr), "StringCompareOrdinal", [typeof(string), typeof(string)]);
|
||||
private static readonly MethodInfo stringConcat2MethodInfo = GetStaticMethod(typeof(BinOpStr), "StringConcat", [typeof(string), typeof(string)]);
|
||||
private static readonly MethodInfo stringConcat3MethodInfo = GetStaticMethod(typeof(BinOpStr), "StringConcat", [typeof(string), typeof(string), typeof(string)]);
|
||||
private static readonly MethodInfo stringConcat4MethodInfo = GetStaticMethod(typeof(BinOpStr), "StringConcat", [typeof(string), typeof(string), typeof(string), typeof(string)]);
|
||||
private static readonly MethodInfo lslRotationNegateMethodInfo = GetStaticMethod(typeof(ScriptCodeGen), "LSLRotationNegate", [typeof(LSL_Rotation)]);
|
||||
private static readonly MethodInfo lslVectorNegateMethodInfo = GetStaticMethod(typeof(ScriptCodeGen), "LSLVectorNegate", [typeof(LSL_Vector)]);
|
||||
private static readonly MethodInfo scriptRestoreCatchExceptionUnwrap = GetStaticMethod(typeof(ScriptRestoreCatchException), "Unwrap", [typeof(Exception)]);
|
||||
private static readonly MethodInfo thrownExceptionWrapMethodInfo = GetStaticMethod(typeof(ScriptThrownException), "Wrap", [typeof(object)]);
|
||||
private static readonly MethodInfo catchExcToStrMethodInfo = GetStaticMethod(typeof(ScriptCodeGen), "CatchExcToStr", [typeof(Exception)]);
|
||||
private static readonly MethodInfo consoleWriteMethodInfo = GetStaticMethod(typeof(ScriptCodeGen), "ConsoleWrite", [typeof(object)]);
|
||||
public static void ConsoleWrite(object o)
|
||||
{
|
||||
o ??= "<<null>>";
|
||||
@@ -3005,7 +3005,6 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
{
|
||||
testRVal.PushVal(this, thisCase, tokenTypeStr);
|
||||
ilGen.Emit(thisCase, OpCodes.Ldstr, thisCase.str1);
|
||||
ilGen.Emit(thisCase, OpCodes.Ldc_I4, (int)StringComparison.Ordinal);
|
||||
ilGen.Emit(thisCase, OpCodes.Call, stringCompareMethodInfo);
|
||||
ilGen.Emit(thisCase, OpCodes.Brfalse, thisCase.label);
|
||||
ilGen.Emit(thisCase, OpCodes.Br, defaultLabel);
|
||||
@@ -3030,7 +3029,6 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
// Maybe save comparison result in a temp.
|
||||
testRVal.PushVal(this, thisCase, tokenTypeStr);
|
||||
ilGen.Emit(thisCase, OpCodes.Ldstr, thisCase.str1);
|
||||
ilGen.Emit(thisCase, OpCodes.Ldc_I4, (int)StringComparison.Ordinal);
|
||||
ilGen.Emit(thisCase, OpCodes.Call, stringCompareMethodInfo);
|
||||
if(cmpv1 != null)
|
||||
{
|
||||
@@ -3046,7 +3044,6 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
{
|
||||
testRVal.PushVal(this, thisCase, tokenTypeStr);
|
||||
ilGen.Emit(thisCase, OpCodes.Ldstr, thisCase.str2);
|
||||
ilGen.Emit(thisCase, OpCodes.Ldc_I4, (int)StringComparison.Ordinal);
|
||||
ilGen.Emit(thisCase, OpCodes.Call, stringCompareMethodInfo);
|
||||
}
|
||||
else
|
||||
@@ -4296,7 +4293,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
if((leftType is TokenTypeSDTypeClass sdtType) && right.type is not TokenTypeUndef)
|
||||
{
|
||||
TokenDeclSDTypeClass sdtDecl = sdtType.decl;
|
||||
TokenType[] argsig = new TokenType[] { right.type };
|
||||
TokenType[] argsig = [right.type];
|
||||
TokenName funcName = new (token.opcode, "$op" + opcodeIndex);
|
||||
TokenDeclVar declFunc = FindThisMember(sdtDecl, funcName, argsig);
|
||||
if(declFunc != null)
|
||||
@@ -4304,7 +4301,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
CheckAccess(declFunc, funcName);
|
||||
left = GenerateFromRVal(token.rValLeft);
|
||||
CompValu method = AccessInstanceMember(declFunc, left, token, false);
|
||||
CompValu[] argRVals = new CompValu[] { right };
|
||||
CompValu[] argRVals = [right];
|
||||
return GenerateACall(method, argRVals, token);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -532,6 +532,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
* @param args = type/location of arguments (types match function definition)
|
||||
*/
|
||||
|
||||
/*
|
||||
public class TokenDeclInline_LLAbs: TokenDeclInline
|
||||
{
|
||||
public TokenDeclInline_LLAbs(VarDict ifd)
|
||||
@@ -589,7 +590,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
result.Pop(scg, errorAt, new TokenTypeFloat(null));
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
public class TokenDeclInline_GetFreeMemory: TokenDeclInline
|
||||
{
|
||||
private static readonly MethodInfo getFreeMemMethInfo = typeof(XMRInstAbstract).GetMethod("xmrHeapLeft", new Type[] { });
|
||||
@@ -623,6 +624,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
result.Pop(scg, errorAt, new TokenTypeInt(null));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Generate code for the usual ll...() functions.
|
||||
|
||||
Reference in New Issue
Block a user