mantis8548: change more LSL arguments declarations to their formal form. Still a lot more to do. This is a case where coerence matters over performance, to avoid more future issues

0.9.1.0-post-fixes
UbitUmarov 2019-07-31 16:27:36 +01:00
parent 1499baf13e
commit 0bcd58fd0f
3 changed files with 108 additions and 100 deletions

View File

@ -784,25 +784,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Float llCos(double f)
{
m_host.AddScriptLPS(1);
return (double)Math.Cos(f);
return Math.Cos(f);
}
public LSL_Float llTan(double f)
{
m_host.AddScriptLPS(1);
return (double)Math.Tan(f);
return Math.Tan(f);
}
public LSL_Float llAtan2(double x, double y)
public LSL_Float llAtan2(LSL_Float x, LSL_Float y)
{
m_host.AddScriptLPS(1);
return (double)Math.Atan2(x, y);
return Math.Atan2(x, y);
}
public LSL_Float llSqrt(double f)
{
m_host.AddScriptLPS(1);
return (double)Math.Sqrt(f);
return Math.Sqrt(f);
}
public LSL_Float llPow(double fbase, double fexponent)
@ -811,7 +811,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return (double)Math.Pow(fbase, fexponent);
}
public LSL_Integer llAbs(int i)
public LSL_Integer llAbs(LSL_Integer i)
{
// changed to replicate LSL behaviour whereby minimum int value is returned untouched.
m_host.AddScriptLPS(1);
@ -3069,7 +3069,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.ParentGroup.StopMoveToTarget();
}
public void llApplyImpulse(LSL_Vector force, int local)
public void llApplyImpulse(LSL_Vector force, LSL_Integer local)
{
m_host.AddScriptLPS(1);
//No energy force yet
@ -3526,7 +3526,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return src.ToLower();
}
public LSL_Integer llGiveMoney(string destination, int amount)
public LSL_Integer llGiveMoney(LSL_Key destination, LSL_Integer amount)
{
Util.FireAndForget(x =>
{
@ -3785,7 +3785,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return 100f * llGetMass();
}
public void llCollisionFilter(string name, string id, int accept)
public void llCollisionFilter(LSL_String name, LSL_Key id, LSL_Integer accept)
{
m_host.AddScriptLPS(1);
m_host.CollisionFilter.Clear();
@ -4513,7 +4513,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
}
public void llCreateLink(LSL_String target, LSL_Integer parent)
public void llCreateLink(LSL_Key target, LSL_Integer parent)
{
m_host.AddScriptLPS(1);
@ -4847,7 +4847,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return 1.0f;
}
public void llGiveInventory(string destination, string inventory)
public void llGiveInventory(LSL_Key destination, LSL_String inventory)
{
m_host.AddScriptLPS(1);
@ -5317,7 +5317,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
}
public void llCollisionSound(string impact_sound, double impact_volume)
public void llCollisionSound(LSL_String impact_sound, LSL_Float impact_volume)
{
m_host.AddScriptLPS(1);
@ -5344,11 +5344,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.aggregateScriptEvents();
}
public LSL_String llGetAnimation(string id)
public LSL_String llGetAnimation(LSL_Key id)
{
// This should only return a value if the avatar is in the same region
m_host.AddScriptLPS(1);
UUID avatar = (UUID)id;
UUID avatar;
if(!UUID.TryParse(id, out avatar))
return "";
ScenePresence presence = World.GetScenePresence(avatar);
if (presence == null)
return "";
@ -5698,13 +5700,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return angle;
}
public LSL_Float llAcos(double val)
public LSL_Float llAcos(LSL_Float val)
{
m_host.AddScriptLPS(1);
return (double)Math.Acos(val);
}
public LSL_Float llAsin(double val)
public LSL_Float llAsin(LSL_Float val)
{
m_host.AddScriptLPS(1);
return (double)Math.Asin(val);
@ -5744,7 +5746,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return UUID.Zero.ToString();
}
public void llAllowInventoryDrop(int add)
public void llAllowInventoryDrop(LSL_Integer add)
{
m_host.AddScriptLPS(1);
@ -6639,7 +6641,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
/// AGENT_BUSY
/// Remove as they are done
/// </summary>
public LSL_Integer llGetAgentInfo(string id)
public LSL_Integer llGetAgentInfo(LSL_Key id)
{
m_host.AddScriptLPS(1);
@ -6746,7 +6748,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return flags;
}
public LSL_String llGetAgentLanguage(string id)
public LSL_String llGetAgentLanguage(LSL_Key id)
{
// This should only return a value if the avatar is in the same region, but eh. idc.
m_host.AddScriptLPS(1);
@ -6857,7 +6859,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return result;
}
public void llAdjustSoundVolume(double volume)
public void llAdjustSoundVolume(LSL_Float volume)
{
m_host.AddScriptLPS(1);
m_host.AdjustSoundGain(volume);
@ -6870,7 +6872,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.SoundRadius = radius;
}
public LSL_String llKey2Name(string id)
public LSL_String llKey2Name(LSL_Key id)
{
m_host.AddScriptLPS(1);
UUID key = new UUID();
@ -7044,22 +7046,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
/// only the height of avatars vary and that says:
/// Width (x) and depth (y) are constant. (0.45m and 0.6m respectively).
/// </summary>
public LSL_Vector llGetAgentSize(string id)
public LSL_Vector llGetAgentSize(LSL_Key id)
{
m_host.AddScriptLPS(1);
ScenePresence avatar = World.GetScenePresence((UUID)id);
LSL_Vector agentSize;
UUID avID;
if(!UUID.TryParse(id, out avID))
return ScriptBaseClass.ZERO_VECTOR;
ScenePresence avatar = World.GetScenePresence(avID);
if (avatar == null || avatar.IsChildAgent) // Fail if not in the same region
{
agentSize = ScriptBaseClass.ZERO_VECTOR;
}
else
{
return ScriptBaseClass.ZERO_VECTOR;
// agentSize = new LSL_Vector(0.45f, 0.6f, avatar.Appearance.AvatarHeight);
Vector3 s = avatar.Appearance.AvatarSize;
agentSize = new LSL_Vector(s.X, s.Y, s.Z);
}
return agentSize;
Vector3 s = avatar.Appearance.AvatarSize;
return new LSL_Vector(s.X, s.Y, s.Z);
}
public LSL_Integer llSameGroup(string id)
@ -7235,12 +7235,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return m_host.ParentGroup.AttachmentPoint;
}
public LSL_List llGetAttachedList(string id)
public LSL_List llGetAttachedList(LSL_Key id)
{
m_host.AddScriptLPS(1);
ScenePresence av = World.GetScenePresence((UUID)id);
UUID avID;
if(!UUID.TryParse(id, out avID))
return new LSL_List("NOT_FOUND");
ScenePresence av = World.GetScenePresence(avID);
if (av == null || av.IsDeleted)
return new LSL_List("NOT_FOUND");
@ -7825,7 +7828,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
}
public void llGiveInventoryList(string destination, string category, LSL_List inventory)
public void llGiveInventoryList(LSL_Key destination, LSL_String category, LSL_List inventory)
{
m_host.AddScriptLPS(1);
@ -8003,7 +8006,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
public void llAddToLandPassList(LSL_Key avatar, double hours)
public void llAddToLandPassList(LSL_Key avatar, LSL_Float hours)
{
m_host.AddScriptLPS(1);
UUID key;
@ -11075,16 +11078,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return (double)Math.Log(val);
}
public LSL_List llGetAnimationList(string id)
public LSL_List llGetAnimationList(LSL_Key id)
{
m_host.AddScriptLPS(1);
LSL_List l = new LSL_List();
ScenePresence av = World.GetScenePresence((UUID)id);
UUID avID;
if(!UUID.TryParse(id, out avID))
return new LSL_List();
ScenePresence av = World.GetScenePresence(avID);
if (av == null || av.IsChildAgent) // only if in the region
return l;
return new LSL_List();
UUID[] anims;
anims = av.Animator.GetAnimationArray();
LSL_List l = new LSL_List();
foreach (UUID foo in anims)
l.Add(new LSL_Key(foo.ToString()));
return l;
@ -13608,7 +13616,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
ScriptSleep(m_sleepMsOnMapDestination);
}
public void llAddToLandBanList(LSL_Key avatar, double hours)
public void llAddToLandBanList(LSL_Key avatar, LSL_Float hours)
{
m_host.AddScriptLPS(1);
UUID key;
@ -15048,7 +15056,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return name.Replace(" ", ".").ToLower();
}
public LSL_String llGetUsername(string id)
public LSL_String llGetUsername(LSL_Key id)
{
return Name2Username(llKey2Name(id));
}
@ -16591,7 +16599,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_SoundModule.SetSoundQueueing(m_host.UUID, queue == ScriptBaseClass.TRUE.value);
}
public void llCollisionSprite(string impact_sprite)
public void llCollisionSprite(LSL_String impact_sprite)
{
m_host.AddScriptLPS(1);
// Viewer 2.0 broke this and it's likely LL has no intention
@ -16652,7 +16660,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
new DetectParams[0]));
}
public LSL_Key llTransferLindenDollars(string destination, int amount)
public LSL_Key llTransferLindenDollars(LSL_Key destination, LSL_Integer amount)
{
UUID txn = UUID.Random();

View File

@ -41,20 +41,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
{
void state(string newState);
LSL_Integer llAbs(int val);
LSL_Float llAcos(double val);
LSL_Integer llAbs(LSL_Integer val);
LSL_Float llAcos(LSL_Float val);
//ApiDesc Sleep 0.1
void llAddToLandBanList(LSL_Key avatarId, double hours);
void llAddToLandBanList(LSL_Key avatarId, LSL_Float hours);
//ApiDesc Sleep 0.1
void llAddToLandPassList(LSL_Key avatarId, double hours);
void llAddToLandPassList(LSL_Key avatarId, LSL_Float hours);
//ApiDesc Sleep 0.1
void llAdjustSoundVolume(double volume);
void llAllowInventoryDrop(int add);
void llAdjustSoundVolume(LSL_Float volume);
void llAllowInventoryDrop(LSL_Integer add);
LSL_Float llAngleBetween(LSL_Rotation a, LSL_Rotation b);
void llApplyImpulse(LSL_Vector force, int local);
void llApplyImpulse(LSL_Vector force, LSL_Integer local);
void llApplyRotationalImpulse(LSL_Vector force, int local);
LSL_Float llAsin(double val);
LSL_Float llAtan2(double x, double y);
LSL_Float llAsin(LSL_Float val);
LSL_Float llAtan2(LSL_Float x, LSL_Float y);
void llAttachToAvatar(LSL_Integer attachment);
void llAttachToAvatarTemp(LSL_Integer attachmentPoint);
LSL_Key llAvatarOnSitTarget();
@ -74,13 +74,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
//ApiDesc Sleep 1.0
void llCloseRemoteDataChannel(string channel);
LSL_Float llCloud(LSL_Vector offset);
void llCollisionFilter(string name, string id, int accept);
void llCollisionSound(string impact_sound, double impact_volume);
void llCollisionFilter(LSL_String name, LSL_Key id, LSL_Integer accept);
void llCollisionSound(LSL_String impact_sound, LSL_Float impact_volume);
//ApiDesc Not Supported - does nothing
void llCollisionSprite(string impact_sprite);
void llCollisionSprite(LSL_String impact_sprite);
LSL_Float llCos(double f);
//ApiDesc Sleep 1.0
void llCreateLink(LSL_String targetId, LSL_Integer parent);
void llCreateLink(LSL_Key targetId, LSL_Integer parent);
LSL_List llCSV2List(string src);
LSL_List llDeleteSubList(LSL_List src, int start, int end);
LSL_String llDeleteSubString(string src, int start, int end);
@ -116,16 +116,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
LSL_Float llFrand(double mag);
LSL_Key llGenerateKey();
LSL_Vector llGetAccel();
LSL_Integer llGetAgentInfo(string id);
LSL_String llGetAgentLanguage(string id);
LSL_Integer llGetAgentInfo(LSL_Key id);
LSL_String llGetAgentLanguage(LSL_Key id);
LSL_List llGetAgentList(LSL_Integer scope, LSL_List options);
LSL_Vector llGetAgentSize(string id);
LSL_Vector llGetAgentSize(LSL_Key id);
LSL_Float llGetAlpha(int face);
LSL_Float llGetAndResetTime();
LSL_String llGetAnimation(string id);
LSL_List llGetAnimationList(string id);
LSL_String llGetAnimation(LSL_Key id);
LSL_List llGetAnimationList(LSL_Key id);
LSL_Integer llGetAttached();
LSL_List llGetAttachedList(string id);
LSL_List llGetAttachedList(LSL_Key id);
LSL_List llGetBoundingBox(string obj);
LSL_Vector llGetCameraPos();
LSL_Rotation llGetCameraRot();
@ -217,10 +217,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
LSL_Integer llGetUnixTime();
LSL_Vector llGetVel();
LSL_Float llGetWallclock();
void llGiveInventory(string destination, string inventory);
void llGiveInventoryList(string destination, string category, LSL_List inventory);
LSL_Integer llGiveMoney(string destination, int amount);
LSL_Key llTransferLindenDollars(string destination, int amount);
void llGiveInventory(LSL_Key destination, LSL_String inventory);
void llGiveInventoryList(LSL_Key destination, LSL_String category, LSL_List inventory);
LSL_Integer llGiveMoney(LSL_Key destination, LSL_Integer amount);
LSL_Key llTransferLindenDollars(LSL_Key destination, LSL_Integer amount);
void llGodLikeRezObject(string inventory, LSL_Vector pos);
LSL_Float llGround(LSL_Vector offset);
LSL_Vector llGroundContour(LSL_Vector offset);
@ -232,8 +232,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
LSL_String llInsertString(string dst, int position, string src);
void llInstantMessage(string user, string message);
LSL_String llIntegerToBase64(int number);
LSL_String llKey2Name(string id);
LSL_String llGetUsername(string id);
LSL_String llKey2Name(LSL_Key id);
LSL_String llGetUsername(LSL_Key id);
LSL_Key llRequestUsername(string id);
LSL_String llGetDisplayName(string id);
LSL_Key llRequestDisplayName(string id);

View File

@ -65,32 +65,32 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
//
// Script functions
//
public LSL_Integer llAbs(int i)
public LSL_Integer llAbs(LSL_Integer i)
{
return m_LSL_Functions.llAbs(i);
}
public LSL_Float llAcos(double val)
public LSL_Float llAcos(LSL_Float val)
{
return m_LSL_Functions.llAcos(val);
}
public void llAddToLandBanList(string avatar, double hours)
public void llAddToLandBanList(LSL_Key avatar, LSL_Float hours)
{
m_LSL_Functions.llAddToLandBanList(avatar, hours);
}
public void llAddToLandPassList(string avatar, double hours)
public void llAddToLandPassList(LSL_Key avatar, LSL_Float hours)
{
m_LSL_Functions.llAddToLandPassList(avatar, hours);
}
public void llAdjustSoundVolume(double volume)
public void llAdjustSoundVolume(LSL_Float volume)
{
m_LSL_Functions.llAdjustSoundVolume(volume);
}
public void llAllowInventoryDrop(int add)
public void llAllowInventoryDrop(LSL_Integer add)
{
m_LSL_Functions.llAllowInventoryDrop(add);
}
@ -100,7 +100,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_LSL_Functions.llAngleBetween(a, b);
}
public void llApplyImpulse(LSL_Vector force, int local)
public void llApplyImpulse(LSL_Vector force, LSL_Integer local)
{
m_LSL_Functions.llApplyImpulse(force, local);
}
@ -110,12 +110,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
m_LSL_Functions.llApplyRotationalImpulse(force, local);
}
public LSL_Float llAsin(double val)
public LSL_Float llAsin(LSL_Float val)
{
return m_LSL_Functions.llAsin(val);
}
public LSL_Float llAtan2(double x, double y)
public LSL_Float llAtan2(LSL_Float x, LSL_Float y)
{
return m_LSL_Functions.llAtan2(x, y);
}
@ -190,17 +190,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_LSL_Functions.llCloud(offset);
}
public void llCollisionFilter(string name, string id, int accept)
public void llCollisionFilter(LSL_String name, LSL_Key id, LSL_Integer accept)
{
m_LSL_Functions.llCollisionFilter(name, id, accept);
}
public void llCollisionSound(string impact_sound, double impact_volume)
public void llCollisionSound(LSL_String impact_sound, LSL_Float impact_volume)
{
m_LSL_Functions.llCollisionSound(impact_sound, impact_volume);
}
public void llCollisionSprite(string impact_sprite)
public void llCollisionSprite(LSL_String impact_sprite)
{
m_LSL_Functions.llCollisionSprite(impact_sprite);
}
@ -210,7 +210,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_LSL_Functions.llCos(f);
}
public void llCreateLink(LSL_String target, LSL_Integer parent)
public void llCreateLink(LSL_Key target, LSL_Integer parent)
{
m_LSL_Functions.llCreateLink(target, parent);
}
@ -386,12 +386,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_LSL_Functions.llGetAccel();
}
public LSL_Integer llGetAgentInfo(string id)
public LSL_Integer llGetAgentInfo(LSL_Key id)
{
return m_LSL_Functions.llGetAgentInfo(id);
}
public LSL_String llGetAgentLanguage(string id)
public LSL_String llGetAgentLanguage(LSL_Key id)
{
return m_LSL_Functions.llGetAgentLanguage(id);
}
@ -401,7 +401,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_LSL_Functions.llGetAgentList(scope, options);
}
public LSL_Vector llGetAgentSize(string id)
public LSL_Vector llGetAgentSize(LSL_Key id)
{
return m_LSL_Functions.llGetAgentSize(id);
}
@ -416,12 +416,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_LSL_Functions.llGetAndResetTime();
}
public LSL_String llGetAnimation(string id)
public LSL_String llGetAnimation(LSL_Key id)
{
return m_LSL_Functions.llGetAnimation(id);
}
public LSL_List llGetAnimationList(string id)
public LSL_List llGetAnimationList(LSL_Key id)
{
return m_LSL_Functions.llGetAnimationList(id);
}
@ -431,7 +431,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_LSL_Functions.llGetAttached();
}
public LSL_List llGetAttachedList(string id)
public LSL_List llGetAttachedList(LSL_Key id)
{
return m_LSL_Functions.llGetAttachedList(id);
}
@ -881,27 +881,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_LSL_Functions.llGetWallclock();
}
public void llGiveInventory(string destination, string inventory)
public void llGiveInventory(LSL_Key destination, LSL_String inventory)
{
m_LSL_Functions.llGiveInventory(destination, inventory);
}
public void llGiveInventoryList(string destination, string category, LSL_List inventory)
public void llGiveInventoryList(LSL_Key destination, LSL_String category, LSL_List inventory)
{
m_LSL_Functions.llGiveInventoryList(destination, category, inventory);
}
public LSL_Integer llGiveMoney(string destination, int amount)
public LSL_Integer llGiveMoney(LSL_Key destination, LSL_Integer amount)
{
return m_LSL_Functions.llGiveMoney(destination, amount);
}
public LSL_Key llTransferLindenDollars(string destination, int amount)
public LSL_Key llTransferLindenDollars(LSL_Key destination, LSL_Integer amount)
{
return m_LSL_Functions.llTransferLindenDollars(destination, amount);
}
public void llGodLikeRezObject(string inventory, LSL_Vector pos)
public void llGodLikeRezObject(LSL_String inventory, LSL_Vector pos)
{
m_LSL_Functions.llGodLikeRezObject(inventory, pos);
}
@ -931,22 +931,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_LSL_Functions.llGroundSlope(offset);
}
public LSL_Key llHTTPRequest(string url, LSL_List parameters, string body)
public LSL_Key llHTTPRequest(LSL_String url, LSL_List parameters, LSL_String body)
{
return m_LSL_Functions.llHTTPRequest(url, parameters, body);
}
public void llHTTPResponse(LSL_Key id, int status, string body)
public void llHTTPResponse(LSL_Key id, int status, LSL_String body)
{
m_LSL_Functions.llHTTPResponse(id, status, body);
}
public LSL_String llInsertString(string dst, int position, string src)
public LSL_String llInsertString(LSL_String dst, int position, LSL_String src)
{
return m_LSL_Functions.llInsertString(dst, position, src);
}
public void llInstantMessage(string user, string message)
public void llInstantMessage(LSL_String user, LSL_String message)
{
m_LSL_Functions.llInstantMessage(user, message);
}
@ -956,12 +956,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_LSL_Functions.llIntegerToBase64(number);
}
public LSL_String llKey2Name(string id)
public LSL_String llKey2Name(LSL_Key id)
{
return m_LSL_Functions.llKey2Name(id);
}
public LSL_String llGetUsername(string id)
public LSL_String llGetUsername(LSL_Key id)
{
return m_LSL_Functions.llGetUsername(id);
}