From 3151e302caa804222206dc85579bb4c2ed9181ac Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Sat, 8 Mar 2008 18:06:10 +0000 Subject: Thank you kindly, Ldviopeng for: Patch to implement the following LSL / OS functions llParcelPrimCount(60%) osSetParcelMediaURL --- .../ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 89 +++++++++++++++++++++- 1 file changed, 87 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs') diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 7828834..7da47d4 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -1899,6 +1899,7 @@ namespace OpenSim.Region.ScriptEngine.Common public string llGetScriptName() { m_host.AddScriptLPS(1); + return String.Empty; } @@ -2942,7 +2943,8 @@ namespace OpenSim.Region.ScriptEngine.Common public int llGetScriptState(string name) { m_host.AddScriptLPS(1); - NotImplemented("llGetScriptState"); + + //NotImplemented("llGetScriptState"); return 0; } @@ -3096,6 +3098,24 @@ namespace OpenSim.Region.ScriptEngine.Common World.SetLandMusicURL(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, url); } + public void osSetParcelMediaURL(string url) + { + m_host.AddScriptLPS(1); + LLUUID landowner = World.GetLandOwner(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); + + if(landowner.Equals(null)) + { + return; + } + + if(landowner != m_host.ObjectOwner) + { + return; + } + + World.SetLandMediaURL(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, url); + } + public LSL_Types.Vector3 llGetRootPosition() { m_host.AddScriptLPS(1); @@ -3441,6 +3461,7 @@ namespace OpenSim.Region.ScriptEngine.Common int number = 0; int digit; + int baddigit = 0; m_host.AddScriptLPS(1); @@ -4004,7 +4025,65 @@ namespace OpenSim.Region.ScriptEngine.Common public int llGetParcelPrimCount(LSL_Types.Vector3 pos, int category, int sim_wide) { m_host.AddScriptLPS(1); - NotImplemented("llGetParcelPrimCount"); + + LandData land = World.GetLandData((float)pos.x, (float)pos.y); + + if(land == null) + { + return 0; + } + + else + { + if(sim_wide == 1) + { + if (category == 0) + { + return land.simwidePrims; + } + + else + { + //public int simwideArea = 0; + return 0; + } + } + + else + { + if(category == 0)//Total Prims + { + return 0;//land. + } + + else if(category == 1)//Owner Prims + { + return land.ownerPrims; + } + + else if(category == 2)//Group Prims + { + return land.groupPrims; + } + + else if(category == 3)//Other Prims + { + return land.otherPrims; + } + + else if(category == 4)//Selected + { + return land.selectedPrims; + } + + else if(category == 5)//Temp + { + return 0;//land. + } + } + } + + //NotImplemented("llGetParcelPrimCount"); return 0; } @@ -4035,19 +4114,25 @@ namespace OpenSim.Region.ScriptEngine.Common // Alondria: This currently just is utilizing the normal grid's 0.22 prims/m2 calculation // Which probably will be irrelevent in OpenSim.... LandData land = World.GetLandData((float)pos.x, (float)pos.y); + float bonusfactor = World.RegionInfo.EstateSettings.objectBonusFactor; + if (land == null) { return 0; } + if (sim_wide == 1) { decimal v = land.simwideArea * (decimal)(0.22) * (decimal)bonusfactor; + return (int)v; } + else { decimal v = land.area * (decimal)(0.22) * (decimal)bonusfactor; + return (int)v; } -- cgit v1.1