aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
diff options
context:
space:
mode:
authorCharles Krinke2008-03-08 18:06:10 +0000
committerCharles Krinke2008-03-08 18:06:10 +0000
commit3151e302caa804222206dc85579bb4c2ed9181ac (patch)
tree239b419547331c5843b5023efbe319bb012e395e /OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
parent* Made a change to the loading mechanism to fix it's operation. (diff)
downloadopensim-SC-3151e302caa804222206dc85579bb4c2ed9181ac.zip
opensim-SC-3151e302caa804222206dc85579bb4c2ed9181ac.tar.gz
opensim-SC-3151e302caa804222206dc85579bb4c2ed9181ac.tar.bz2
opensim-SC-3151e302caa804222206dc85579bb4c2ed9181ac.tar.xz
Thank you kindly, Ldviopeng for:
Patch to implement the following LSL / OS functions llParcelPrimCount(60%) osSetParcelMediaURL
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs89
1 files changed, 87 insertions, 2 deletions
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
1899 public string llGetScriptName() 1899 public string llGetScriptName()
1900 { 1900 {
1901 m_host.AddScriptLPS(1); 1901 m_host.AddScriptLPS(1);
1902
1902 return String.Empty; 1903 return String.Empty;
1903 } 1904 }
1904 1905
@@ -2942,7 +2943,8 @@ namespace OpenSim.Region.ScriptEngine.Common
2942 public int llGetScriptState(string name) 2943 public int llGetScriptState(string name)
2943 { 2944 {
2944 m_host.AddScriptLPS(1); 2945 m_host.AddScriptLPS(1);
2945 NotImplemented("llGetScriptState"); 2946
2947 //NotImplemented("llGetScriptState");
2946 return 0; 2948 return 0;
2947 } 2949 }
2948 2950
@@ -3096,6 +3098,24 @@ namespace OpenSim.Region.ScriptEngine.Common
3096 World.SetLandMusicURL(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, url); 3098 World.SetLandMusicURL(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, url);
3097 } 3099 }
3098 3100
3101 public void osSetParcelMediaURL(string url)
3102 {
3103 m_host.AddScriptLPS(1);
3104 LLUUID landowner = World.GetLandOwner(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
3105
3106 if(landowner.Equals(null))
3107 {
3108 return;
3109 }
3110
3111 if(landowner != m_host.ObjectOwner)
3112 {
3113 return;
3114 }
3115
3116 World.SetLandMediaURL(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, url);
3117 }
3118
3099 public LSL_Types.Vector3 llGetRootPosition() 3119 public LSL_Types.Vector3 llGetRootPosition()
3100 { 3120 {
3101 m_host.AddScriptLPS(1); 3121 m_host.AddScriptLPS(1);
@@ -3441,6 +3461,7 @@ namespace OpenSim.Region.ScriptEngine.Common
3441 3461
3442 int number = 0; 3462 int number = 0;
3443 int digit; 3463 int digit;
3464 int baddigit = 0;
3444 3465
3445 m_host.AddScriptLPS(1); 3466 m_host.AddScriptLPS(1);
3446 3467
@@ -4004,7 +4025,65 @@ namespace OpenSim.Region.ScriptEngine.Common
4004 public int llGetParcelPrimCount(LSL_Types.Vector3 pos, int category, int sim_wide) 4025 public int llGetParcelPrimCount(LSL_Types.Vector3 pos, int category, int sim_wide)
4005 { 4026 {
4006 m_host.AddScriptLPS(1); 4027 m_host.AddScriptLPS(1);
4007 NotImplemented("llGetParcelPrimCount"); 4028
4029 LandData land = World.GetLandData((float)pos.x, (float)pos.y);
4030
4031 if(land == null)
4032 {
4033 return 0;
4034 }
4035
4036 else
4037 {
4038 if(sim_wide == 1)
4039 {
4040 if (category == 0)
4041 {
4042 return land.simwidePrims;
4043 }
4044
4045 else
4046 {
4047 //public int simwideArea = 0;
4048 return 0;
4049 }
4050 }
4051
4052 else
4053 {
4054 if(category == 0)//Total Prims
4055 {
4056 return 0;//land.
4057 }
4058
4059 else if(category == 1)//Owner Prims
4060 {
4061 return land.ownerPrims;
4062 }
4063
4064 else if(category == 2)//Group Prims
4065 {
4066 return land.groupPrims;
4067 }
4068
4069 else if(category == 3)//Other Prims
4070 {
4071 return land.otherPrims;
4072 }
4073
4074 else if(category == 4)//Selected
4075 {
4076 return land.selectedPrims;
4077 }
4078
4079 else if(category == 5)//Temp
4080 {
4081 return 0;//land.
4082 }
4083 }
4084 }
4085
4086 //NotImplemented("llGetParcelPrimCount");
4008 return 0; 4087 return 0;
4009 } 4088 }
4010 4089
@@ -4035,19 +4114,25 @@ namespace OpenSim.Region.ScriptEngine.Common
4035 // Alondria: This currently just is utilizing the normal grid's 0.22 prims/m2 calculation 4114 // Alondria: This currently just is utilizing the normal grid's 0.22 prims/m2 calculation
4036 // Which probably will be irrelevent in OpenSim.... 4115 // Which probably will be irrelevent in OpenSim....
4037 LandData land = World.GetLandData((float)pos.x, (float)pos.y); 4116 LandData land = World.GetLandData((float)pos.x, (float)pos.y);
4117
4038 float bonusfactor = World.RegionInfo.EstateSettings.objectBonusFactor; 4118 float bonusfactor = World.RegionInfo.EstateSettings.objectBonusFactor;
4119
4039 if (land == null) 4120 if (land == null)
4040 { 4121 {
4041 return 0; 4122 return 0;
4042 } 4123 }
4124
4043 if (sim_wide == 1) 4125 if (sim_wide == 1)
4044 { 4126 {
4045 decimal v = land.simwideArea * (decimal)(0.22) * (decimal)bonusfactor; 4127 decimal v = land.simwideArea * (decimal)(0.22) * (decimal)bonusfactor;
4128
4046 return (int)v; 4129 return (int)v;
4047 } 4130 }
4131
4048 else 4132 else
4049 { 4133 {
4050 decimal v = land.area * (decimal)(0.22) * (decimal)bonusfactor; 4134 decimal v = land.area * (decimal)(0.22) * (decimal)bonusfactor;
4135
4051 return (int)v; 4136 return (int)v;
4052 } 4137 }
4053 4138