diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 257 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs | 8 |
2 files changed, 210 insertions, 55 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index a1db77e..eab4754 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -1181,7 +1181,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1181 | 1181 | ||
1182 | if ((status & ScriptBaseClass.STATUS_BLOCK_GRAB) == ScriptBaseClass.STATUS_BLOCK_GRAB) | 1182 | if ((status & ScriptBaseClass.STATUS_BLOCK_GRAB) == ScriptBaseClass.STATUS_BLOCK_GRAB) |
1183 | { | 1183 | { |
1184 | NotImplemented("llSetStatus - STATUS_BLOCK_GRAB"); | 1184 | if (value != 0) |
1185 | m_host.SetBlockGrab(true); | ||
1186 | else | ||
1187 | m_host.SetBlockGrab(false); | ||
1185 | } | 1188 | } |
1186 | 1189 | ||
1187 | if ((status & ScriptBaseClass.STATUS_DIE_AT_EDGE) == ScriptBaseClass.STATUS_DIE_AT_EDGE) | 1190 | if ((status & ScriptBaseClass.STATUS_DIE_AT_EDGE) == ScriptBaseClass.STATUS_DIE_AT_EDGE) |
@@ -1194,12 +1197,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1194 | 1197 | ||
1195 | if ((status & ScriptBaseClass.STATUS_RETURN_AT_EDGE) == ScriptBaseClass.STATUS_RETURN_AT_EDGE) | 1198 | if ((status & ScriptBaseClass.STATUS_RETURN_AT_EDGE) == ScriptBaseClass.STATUS_RETURN_AT_EDGE) |
1196 | { | 1199 | { |
1197 | NotImplemented("llSetStatus - STATUS_RETURN_AT_EDGE"); | 1200 | if (value != 0) |
1201 | m_host.SetReturnAtEdge(true); | ||
1202 | else | ||
1203 | m_host.SetReturnAtEdge(false); | ||
1198 | } | 1204 | } |
1199 | 1205 | ||
1200 | if ((status & ScriptBaseClass.STATUS_SANDBOX) == ScriptBaseClass.STATUS_SANDBOX) | 1206 | if ((status & ScriptBaseClass.STATUS_SANDBOX) == ScriptBaseClass.STATUS_SANDBOX) |
1201 | { | 1207 | { |
1202 | NotImplemented("llSetStatus - STATUS_SANDBOX"); | 1208 | if (value != 0) |
1209 | m_host.SetStatusSandbox(true); | ||
1210 | else | ||
1211 | m_host.SetStatusSandbox(false); | ||
1203 | } | 1212 | } |
1204 | 1213 | ||
1205 | if (statusrotationaxis != 0) | 1214 | if (statusrotationaxis != 0) |
@@ -1236,8 +1245,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1236 | return 0; | 1245 | return 0; |
1237 | 1246 | ||
1238 | case ScriptBaseClass.STATUS_BLOCK_GRAB: | 1247 | case ScriptBaseClass.STATUS_BLOCK_GRAB: |
1239 | NotImplemented("llGetStatus - STATUS_BLOCK_GRAB"); | 1248 | if (m_host.GetBlockGrab()) |
1240 | return 0; | 1249 | return 1; |
1250 | else | ||
1251 | return 0; | ||
1241 | 1252 | ||
1242 | case ScriptBaseClass.STATUS_DIE_AT_EDGE: | 1253 | case ScriptBaseClass.STATUS_DIE_AT_EDGE: |
1243 | if (m_host.GetDieAtEdge()) | 1254 | if (m_host.GetDieAtEdge()) |
@@ -1246,24 +1257,34 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1246 | return 0; | 1257 | return 0; |
1247 | 1258 | ||
1248 | case ScriptBaseClass.STATUS_RETURN_AT_EDGE: | 1259 | case ScriptBaseClass.STATUS_RETURN_AT_EDGE: |
1249 | NotImplemented("llGetStatus - STATUS_RETURN_AT_EDGE"); | 1260 | if (m_host.GetReturnAtEdge()) |
1250 | return 0; | 1261 | return 1; |
1262 | else | ||
1263 | return 0; | ||
1251 | 1264 | ||
1252 | case ScriptBaseClass.STATUS_ROTATE_X: | 1265 | case ScriptBaseClass.STATUS_ROTATE_X: |
1253 | NotImplemented("llGetStatus - STATUS_ROTATE_X"); | 1266 | if (m_host.GetAxisRotation(2) == 2) |
1254 | return 0; | 1267 | return 1; |
1268 | else | ||
1269 | return 0; | ||
1255 | 1270 | ||
1256 | case ScriptBaseClass.STATUS_ROTATE_Y: | 1271 | case ScriptBaseClass.STATUS_ROTATE_Y: |
1257 | NotImplemented("llGetStatus - STATUS_ROTATE_Y"); | 1272 | if (m_host.GetAxisRotation(4) == 4) |
1258 | return 0; | 1273 | return 1; |
1274 | else | ||
1275 | return 0; | ||
1259 | 1276 | ||
1260 | case ScriptBaseClass.STATUS_ROTATE_Z: | 1277 | case ScriptBaseClass.STATUS_ROTATE_Z: |
1261 | NotImplemented("llGetStatus - STATUS_ROTATE_Z"); | 1278 | if (m_host.GetAxisRotation(8) == 8) |
1262 | return 0; | 1279 | return 1; |
1280 | else | ||
1281 | return 0; | ||
1263 | 1282 | ||
1264 | case ScriptBaseClass.STATUS_SANDBOX: | 1283 | case ScriptBaseClass.STATUS_SANDBOX: |
1265 | NotImplemented("llGetStatus - STATUS_SANDBOX"); | 1284 | if (m_host.GetStatusSandbox()) |
1266 | return 0; | 1285 | return 1; |
1286 | else | ||
1287 | return 0; | ||
1267 | } | 1288 | } |
1268 | return 0; | 1289 | return 0; |
1269 | } | 1290 | } |
@@ -2201,7 +2222,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2201 | m_host.AddScriptLPS(1); | 2222 | m_host.AddScriptLPS(1); |
2202 | 2223 | ||
2203 | // send the sound, once, to all clients in range | 2224 | // send the sound, once, to all clients in range |
2204 | m_host.SendSound(KeyOrName(sound).ToString(), volume, false, 0); | 2225 | m_host.SendSound(KeyOrName(sound).ToString(), volume, false, 0, 0, false, false); |
2205 | } | 2226 | } |
2206 | 2227 | ||
2207 | // Xantor 20080528 we should do this differently. | 2228 | // Xantor 20080528 we should do this differently. |
@@ -2231,42 +2252,98 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2231 | public void llLoopSoundMaster(string sound, double volume) | 2252 | public void llLoopSoundMaster(string sound, double volume) |
2232 | { | 2253 | { |
2233 | m_host.AddScriptLPS(1); | 2254 | m_host.AddScriptLPS(1); |
2234 | NotImplemented("llLoopSoundMaster"); | 2255 | m_host.ParentGroup.LoopSoundMasterPrim = m_host; |
2256 | lock (m_host.ParentGroup.LoopSoundSlavePrims) | ||
2257 | { | ||
2258 | foreach (SceneObjectPart prim in m_host.ParentGroup.LoopSoundSlavePrims) | ||
2259 | { | ||
2260 | if (prim.Sound != UUID.Zero) | ||
2261 | llStopSound(); | ||
2262 | |||
2263 | prim.Sound = KeyOrName(sound); | ||
2264 | prim.SoundGain = volume; | ||
2265 | prim.SoundFlags = 1; // looping | ||
2266 | prim.SoundRadius = 20; // Magic number, 20 seems reasonable. Make configurable? | ||
2267 | |||
2268 | prim.ScheduleFullUpdate(); | ||
2269 | prim.SendFullUpdateToAllClients(); | ||
2270 | } | ||
2271 | } | ||
2272 | if (m_host.Sound != UUID.Zero) | ||
2273 | llStopSound(); | ||
2274 | |||
2275 | m_host.Sound = KeyOrName(sound); | ||
2276 | m_host.SoundGain = volume; | ||
2277 | m_host.SoundFlags = 1; // looping | ||
2278 | m_host.SoundRadius = 20; // Magic number, 20 seems reasonable. Make configurable? | ||
2279 | |||
2280 | m_host.ScheduleFullUpdate(); | ||
2281 | m_host.SendFullUpdateToAllClients(); | ||
2235 | } | 2282 | } |
2236 | 2283 | ||
2237 | public void llLoopSoundSlave(string sound, double volume) | 2284 | public void llLoopSoundSlave(string sound, double volume) |
2238 | { | 2285 | { |
2239 | m_host.AddScriptLPS(1); | 2286 | m_host.AddScriptLPS(1); |
2240 | NotImplemented("llLoopSoundSlave"); | 2287 | lock (m_host.ParentGroup.LoopSoundSlavePrims) |
2288 | { | ||
2289 | m_host.ParentGroup.LoopSoundSlavePrims.Add(m_host); | ||
2290 | } | ||
2241 | } | 2291 | } |
2242 | 2292 | ||
2243 | public void llPlaySoundSlave(string sound, double volume) | 2293 | public void llPlaySoundSlave(string sound, double volume) |
2244 | { | 2294 | { |
2245 | m_host.AddScriptLPS(1); | 2295 | m_host.AddScriptLPS(1); |
2246 | NotImplemented("llPlaySoundSlave"); | 2296 | |
2297 | // send the sound, once, to all clients in range | ||
2298 | m_host.SendSound(KeyOrName(sound).ToString(), volume, false, 0, 0, true, false); | ||
2247 | } | 2299 | } |
2248 | 2300 | ||
2249 | public void llTriggerSound(string sound, double volume) | 2301 | public void llTriggerSound(string sound, double volume) |
2250 | { | 2302 | { |
2251 | m_host.AddScriptLPS(1); | 2303 | m_host.AddScriptLPS(1); |
2252 | // send the sound, once, to all clients in range | 2304 | // send the sound, once, to all clients in range |
2253 | m_host.SendSound(KeyOrName(sound).ToString(), volume, true, 0); | 2305 | m_host.SendSound(KeyOrName(sound).ToString(), volume, true, 0, 0, false, false); |
2254 | } | 2306 | } |
2255 | 2307 | ||
2256 | // Xantor 20080528: Clear prim data of sound instead | 2308 | // Xantor 20080528: Clear prim data of sound instead |
2257 | public void llStopSound() | 2309 | public void llStopSound() |
2258 | { | 2310 | { |
2259 | m_host.AddScriptLPS(1); | 2311 | m_host.AddScriptLPS(1); |
2260 | 2312 | if (m_host.ParentGroup.LoopSoundSlavePrims.Contains(m_host)) | |
2261 | m_host.Sound = UUID.Zero; | 2313 | { |
2262 | m_host.SoundGain = 0; | 2314 | if (m_host.ParentGroup.LoopSoundMasterPrim == m_host) |
2263 | m_host.SoundFlags = 0; | 2315 | { |
2264 | m_host.SoundRadius = 0; | 2316 | foreach (SceneObjectPart part in m_host.ParentGroup.LoopSoundSlavePrims) |
2265 | 2317 | { | |
2266 | m_host.ScheduleFullUpdate(); | 2318 | part.Sound = UUID.Zero; |
2267 | m_host.SendFullUpdateToAllClients(); | 2319 | part.SoundGain = 0; |
2268 | 2320 | part.SoundFlags = 0; | |
2269 | // m_host.SendSound(UUID.Zero.ToString(), 1.0, false, 2); | 2321 | part.SoundRadius = 0; |
2322 | part.ScheduleFullUpdate(); | ||
2323 | part.SendFullUpdateToAllClients(); | ||
2324 | } | ||
2325 | m_host.ParentGroup.LoopSoundMasterPrim = null; | ||
2326 | m_host.ParentGroup.LoopSoundSlavePrims.Clear(); | ||
2327 | } | ||
2328 | else | ||
2329 | { | ||
2330 | m_host.Sound = UUID.Zero; | ||
2331 | m_host.SoundGain = 0; | ||
2332 | m_host.SoundFlags = 0; | ||
2333 | m_host.SoundRadius = 0; | ||
2334 | m_host.ScheduleFullUpdate(); | ||
2335 | m_host.SendFullUpdateToAllClients(); | ||
2336 | } | ||
2337 | } | ||
2338 | else | ||
2339 | { | ||
2340 | m_host.Sound = UUID.Zero; | ||
2341 | m_host.SoundGain = 0; | ||
2342 | m_host.SoundFlags = 0; | ||
2343 | m_host.SoundRadius = 0; | ||
2344 | m_host.ScheduleFullUpdate(); | ||
2345 | m_host.SendFullUpdateToAllClients(); | ||
2346 | } | ||
2270 | } | 2347 | } |
2271 | 2348 | ||
2272 | public void llPreloadSound(string sound) | 2349 | public void llPreloadSound(string sound) |
@@ -2660,8 +2737,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2660 | 2737 | ||
2661 | public void llLookAt(LSL_Vector target, double strength, double damping) | 2738 | public void llLookAt(LSL_Vector target, double strength, double damping) |
2662 | { | 2739 | { |
2663 | // partial implementation, rotates objects correctly but does not apply strength or damping attributes | ||
2664 | |||
2665 | m_host.AddScriptLPS(1); | 2740 | m_host.AddScriptLPS(1); |
2666 | // Determine where we are looking from | 2741 | // Determine where we are looking from |
2667 | LSL_Vector from = llGetPos(); | 2742 | LSL_Vector from = llGetPos(); |
@@ -2681,9 +2756,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2681 | // the angles of rotation in radians into rotation value | 2756 | // the angles of rotation in radians into rotation value |
2682 | 2757 | ||
2683 | LSL_Types.Quaternion rot = llEuler2Rot(angle); | 2758 | LSL_Types.Quaternion rot = llEuler2Rot(angle); |
2684 | 2759 | Quaternion rotation = new Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s); | |
2760 | m_host.startLookAt(rotation, (float)damping, (float)strength); | ||
2685 | // Orient the object to the angle calculated | 2761 | // Orient the object to the angle calculated |
2686 | llSetRot(rot); | 2762 | //llSetRot(rot); |
2687 | } | 2763 | } |
2688 | 2764 | ||
2689 | public void llStopLookAt() | 2765 | public void llStopLookAt() |
@@ -3045,8 +3121,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3045 | public void llRotLookAt(LSL_Rotation target, double strength, double damping) | 3121 | public void llRotLookAt(LSL_Rotation target, double strength, double damping) |
3046 | { | 3122 | { |
3047 | m_host.AddScriptLPS(1); | 3123 | m_host.AddScriptLPS(1); |
3048 | // NotImplemented("llRotLookAt"); | 3124 | Quaternion rot = new Quaternion((float)target.x, (float)target.y, (float)target.z, (float)target.s); |
3049 | m_host.RotLookAt(Rot2Quaternion(target), (float)strength, (float)damping); | 3125 | m_host.RotLookAt(rot, (float)strength, (float)damping); |
3050 | } | 3126 | } |
3051 | 3127 | ||
3052 | public LSL_Integer llStringLength(string str) | 3128 | public LSL_Integer llStringLength(string str) |
@@ -3144,13 +3220,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3144 | public void llPointAt(LSL_Vector pos) | 3220 | public void llPointAt(LSL_Vector pos) |
3145 | { | 3221 | { |
3146 | m_host.AddScriptLPS(1); | 3222 | m_host.AddScriptLPS(1); |
3147 | NotImplemented("llPointAt"); | 3223 | ScenePresence Owner = World.GetScenePresence(m_host.UUID); |
3224 | LSL_Rotation rot = llEuler2Rot(pos); | ||
3225 | Owner.PreviousRotation = Owner.Rotation; | ||
3226 | Owner.Rotation = (new Quaternion((float)rot.x,(float)rot.y,(float)rot.z,(float)rot.s)); | ||
3148 | } | 3227 | } |
3149 | 3228 | ||
3150 | public void llStopPointAt() | 3229 | public void llStopPointAt() |
3151 | { | 3230 | { |
3152 | m_host.AddScriptLPS(1); | 3231 | m_host.AddScriptLPS(1); |
3153 | NotImplemented("llStopPointAt"); | 3232 | ScenePresence Owner = m_host.ParentGroup.Scene.GetScenePresence(m_host.OwnerID); |
3233 | Owner.Rotation = Owner.PreviousRotation; | ||
3154 | } | 3234 | } |
3155 | 3235 | ||
3156 | public void llTargetOmega(LSL_Vector axis, double spinrate, double gain) | 3236 | public void llTargetOmega(LSL_Vector axis, double spinrate, double gain) |
@@ -3946,8 +4026,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3946 | public void llCollisionSound(string impact_sound, double impact_volume) | 4026 | public void llCollisionSound(string impact_sound, double impact_volume) |
3947 | { | 4027 | { |
3948 | m_host.AddScriptLPS(1); | 4028 | m_host.AddScriptLPS(1); |
3949 | //NotImplemented("llCollisionSound"); | ||
3950 | |||
3951 | // TODO: Parameter check logic required. | 4029 | // TODO: Parameter check logic required. |
3952 | UUID soundId = UUID.Zero; | 4030 | UUID soundId = UUID.Zero; |
3953 | if (!UUID.TryParse(impact_sound, out soundId)) | 4031 | if (!UUID.TryParse(impact_sound, out soundId)) |
@@ -4535,8 +4613,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4535 | public LSL_Vector llGetCenterOfMass() | 4613 | public LSL_Vector llGetCenterOfMass() |
4536 | { | 4614 | { |
4537 | m_host.AddScriptLPS(1); | 4615 | m_host.AddScriptLPS(1); |
4538 | NotImplemented("llGetCenterOfMass"); | 4616 | Vector3 center = m_host.GetGeometricCenter(); |
4539 | return new LSL_Vector(); | 4617 | return new LSL_Vector(center.X,center.Y,center.Z); |
4540 | } | 4618 | } |
4541 | 4619 | ||
4542 | public LSL_List llListSort(LSL_List src, int stride, int ascending) | 4620 | public LSL_List llListSort(LSL_List src, int stride, int ascending) |
@@ -5269,8 +5347,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5269 | flags |= ScriptBaseClass.AGENT_SITTING; | 5347 | flags |= ScriptBaseClass.AGENT_SITTING; |
5270 | } | 5348 | } |
5271 | 5349 | ||
5272 | //NotImplemented("llGetAgentInfo"); | ||
5273 | |||
5274 | return flags; | 5350 | return flags; |
5275 | } | 5351 | } |
5276 | 5352 | ||
@@ -5353,7 +5429,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5353 | LSL_Vector bottom_south_west) | 5429 | LSL_Vector bottom_south_west) |
5354 | { | 5430 | { |
5355 | m_host.AddScriptLPS(1); | 5431 | m_host.AddScriptLPS(1); |
5356 | NotImplemented("llTriggerSoundLimited"); | 5432 | float radius1 = (float)llVecDist(llGetPos(), top_north_east); |
5433 | float radius2 = (float)llVecDist(llGetPos(), bottom_south_west); | ||
5434 | float radius = Math.Abs(radius1 - radius2); | ||
5435 | m_host.SendSound(KeyOrName(sound).ToString(), volume, true, 0, radius, false, false); | ||
5357 | } | 5436 | } |
5358 | 5437 | ||
5359 | public void llEjectFromLand(string pest) | 5438 | public void llEjectFromLand(string pest) |
@@ -5892,7 +5971,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5892 | public void llGroundRepel(double height, int water, double tau) | 5971 | public void llGroundRepel(double height, int water, double tau) |
5893 | { | 5972 | { |
5894 | m_host.AddScriptLPS(1); | 5973 | m_host.AddScriptLPS(1); |
5895 | NotImplemented("llGroundRepel"); | 5974 | if (m_host.PhysActor != null) |
5975 | { | ||
5976 | float ground = (float)llGround(new LSL_Types.Vector3(0, 0, 0)); | ||
5977 | float waterLevel = (float)llWater(new LSL_Types.Vector3(0, 0, 0)); | ||
5978 | PIDHoverType hoverType = PIDHoverType.Ground; | ||
5979 | if (water != 0) | ||
5980 | { | ||
5981 | hoverType = PIDHoverType.GroundAndWater; | ||
5982 | if (ground < waterLevel) | ||
5983 | height += waterLevel; | ||
5984 | else | ||
5985 | height += ground; | ||
5986 | } | ||
5987 | else | ||
5988 | { | ||
5989 | height += ground; | ||
5990 | } | ||
5991 | |||
5992 | m_host.SetHoverHeight((float)height, hoverType, (float)tau); | ||
5993 | } | ||
5896 | } | 5994 | } |
5897 | 5995 | ||
5898 | protected UUID GetTaskInventoryItem(string name) | 5996 | protected UUID GetTaskInventoryItem(string name) |
@@ -6021,13 +6119,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6021 | public void llSetVehicleFlags(int flags) | 6119 | public void llSetVehicleFlags(int flags) |
6022 | { | 6120 | { |
6023 | m_host.AddScriptLPS(1); | 6121 | m_host.AddScriptLPS(1); |
6024 | NotImplemented("llSetVehicleFlags"); | 6122 | if (m_host.ParentGroup != null) |
6123 | { | ||
6124 | if (!m_host.ParentGroup.IsDeleted) | ||
6125 | { | ||
6126 | m_host.ParentGroup.RootPart.SetVehicleFlags(flags, false); | ||
6127 | } | ||
6128 | } | ||
6025 | } | 6129 | } |
6026 | 6130 | ||
6027 | public void llRemoveVehicleFlags(int flags) | 6131 | public void llRemoveVehicleFlags(int flags) |
6028 | { | 6132 | { |
6029 | m_host.AddScriptLPS(1); | 6133 | m_host.AddScriptLPS(1); |
6030 | NotImplemented("llRemoveVehicleFlags"); | 6134 | if (m_host.ParentGroup != null) |
6135 | { | ||
6136 | if (!m_host.ParentGroup.IsDeleted) | ||
6137 | { | ||
6138 | m_host.ParentGroup.RootPart.SetVehicleFlags(flags, true); | ||
6139 | } | ||
6140 | } | ||
6031 | } | 6141 | } |
6032 | 6142 | ||
6033 | public void llSitTarget(LSL_Vector offset, LSL_Rotation rot) | 6143 | public void llSitTarget(LSL_Vector offset, LSL_Rotation rot) |
@@ -7049,7 +7159,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7049 | public void llRemoteDataSetRegion() | 7159 | public void llRemoteDataSetRegion() |
7050 | { | 7160 | { |
7051 | m_host.AddScriptLPS(1); | 7161 | m_host.AddScriptLPS(1); |
7052 | NotImplemented("llRemoteDataSetRegion"); | 7162 | Deprecated("llRemoteDataSetRegion"); |
7053 | } | 7163 | } |
7054 | 7164 | ||
7055 | public LSL_Float llLog10(double val) | 7165 | public LSL_Float llLog10(double val) |
@@ -8081,7 +8191,39 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8081 | public void llSetInventoryPermMask(string item, int mask, int value) | 8191 | public void llSetInventoryPermMask(string item, int mask, int value) |
8082 | { | 8192 | { |
8083 | m_host.AddScriptLPS(1); | 8193 | m_host.AddScriptLPS(1); |
8084 | NotImplemented("llSetInventoryPermMask"); | 8194 | if (m_ScriptEngine.Config.GetBoolean("AllowGodFunctions", false)) |
8195 | { | ||
8196 | if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) | ||
8197 | { | ||
8198 | lock (m_host.TaskInventory) | ||
8199 | { | ||
8200 | foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory) | ||
8201 | { | ||
8202 | if (inv.Value.Name == item) | ||
8203 | { | ||
8204 | switch (mask) | ||
8205 | { | ||
8206 | case 0: | ||
8207 | inv.Value.BasePermissions = (uint)value; | ||
8208 | break; | ||
8209 | case 1: | ||
8210 | inv.Value.CurrentPermissions = (uint)value; | ||
8211 | break; | ||
8212 | case 2: | ||
8213 | inv.Value.GroupPermissions = (uint)value; | ||
8214 | break; | ||
8215 | case 3: | ||
8216 | inv.Value.EveryonePermissions = (uint)value; | ||
8217 | break; | ||
8218 | case 4: | ||
8219 | inv.Value.NextPermissions = (uint)value; | ||
8220 | break; | ||
8221 | } | ||
8222 | } | ||
8223 | } | ||
8224 | } | ||
8225 | } | ||
8226 | } | ||
8085 | } | 8227 | } |
8086 | 8228 | ||
8087 | public LSL_String llGetInventoryCreator(string item) | 8229 | public LSL_String llGetInventoryCreator(string item) |
@@ -8515,6 +8657,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8515 | // we send to all | 8657 | // we send to all |
8516 | landData.MediaID = new UUID(texture); | 8658 | landData.MediaID = new UUID(texture); |
8517 | landData.MediaAutoScale = autoAlign ? (byte)1 : (byte)0; | 8659 | landData.MediaAutoScale = autoAlign ? (byte)1 : (byte)0; |
8660 | landData.MediaSize[0] = width; | ||
8661 | landData.MediaSize[1] = height; | ||
8662 | landData.MediaType = mediaType; | ||
8518 | 8663 | ||
8519 | // do that one last, it will cause a ParcelPropertiesUpdate | 8664 | // do that one last, it will cause a ParcelPropertiesUpdate |
8520 | landObject.SetMediaUrl(url); | 8665 | landObject.SetMediaUrl(url); |
@@ -8574,11 +8719,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8574 | m_host.AddScriptLPS(1); | 8719 | m_host.AddScriptLPS(1); |
8575 | LSL_List list = new LSL_List(); | 8720 | LSL_List list = new LSL_List(); |
8576 | //TO DO: make the implementation for the missing commands | 8721 | //TO DO: make the implementation for the missing commands |
8577 | //PARCEL_MEDIA_COMMAND_TEXTURE key uuid Use this to get or set the parcel's media texture. | ||
8578 | //PARCEL_MEDIA_COMMAND_URL string url Used to get or set the parcel's media url. | ||
8579 | //PARCEL_MEDIA_COMMAND_TYPE string mime_type Use this to get or set the parcel media MIME type (e.g. "text/html"). (1.19.1 RC0 or later) | ||
8580 | //PARCEL_MEDIA_COMMAND_SIZE integer x, integer y Use this to get or set the parcel media pixel resolution. (1.19.1 RC0 or later) | ||
8581 | //PARCEL_MEDIA_COMMAND_DESC string desc Use this to get or set the parcel media description. (1.19.1 RC0 or later) | ||
8582 | //PARCEL_MEDIA_COMMAND_LOOP_SET float loop Use this to get or set the parcel's media loop duration. (1.19.1 RC0 or later) | 8722 | //PARCEL_MEDIA_COMMAND_LOOP_SET float loop Use this to get or set the parcel's media loop duration. (1.19.1 RC0 or later) |
8583 | for (int i = 0; i < aList.Data.Length; i++) | 8723 | for (int i = 0; i < aList.Data.Length; i++) |
8584 | { | 8724 | { |
@@ -8596,6 +8736,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8596 | case ParcelMediaCommandEnum.Texture: | 8736 | case ParcelMediaCommandEnum.Texture: |
8597 | list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaID.ToString())); | 8737 | list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaID.ToString())); |
8598 | break; | 8738 | break; |
8739 | case ParcelMediaCommandEnum.Type: | ||
8740 | list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaType)); | ||
8741 | break; | ||
8742 | case ParcelMediaCommandEnum.Size: | ||
8743 | list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaSize[0])); | ||
8744 | list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaSize[1])); | ||
8745 | break; | ||
8599 | default: | 8746 | default: |
8600 | ParcelMediaCommandEnum mediaCommandEnum = ParcelMediaCommandEnum.Url; | 8747 | ParcelMediaCommandEnum mediaCommandEnum = ParcelMediaCommandEnum.Url; |
8601 | NotImplemented("llParcelMediaQuery parameter do not supported yet: " + Enum.Parse(mediaCommandEnum.GetType() , aList.Data[i].ToString()).ToString()); | 8748 | NotImplemented("llParcelMediaQuery parameter do not supported yet: " + Enum.Parse(mediaCommandEnum.GetType() , aList.Data[i].ToString()).ToString()); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index 13b855f..7cf82b2 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs | |||
@@ -160,6 +160,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
160 | public const int VEHICLE_BANKING_MIX = 39; | 160 | public const int VEHICLE_BANKING_MIX = 39; |
161 | public const int VEHICLE_BANKING_TIMESCALE = 40; | 161 | public const int VEHICLE_BANKING_TIMESCALE = 40; |
162 | public const int VEHICLE_REFERENCE_FRAME = 44; | 162 | public const int VEHICLE_REFERENCE_FRAME = 44; |
163 | public const int VEHICLE_RANGE_BLOCK = 45; | ||
164 | public const int VEHICLE_ROLL_FRAME = 46; | ||
163 | public const int VEHICLE_FLAG_NO_DEFLECTION_UP = 1; | 165 | public const int VEHICLE_FLAG_NO_DEFLECTION_UP = 1; |
164 | public const int VEHICLE_FLAG_LIMIT_ROLL_ONLY = 2; | 166 | public const int VEHICLE_FLAG_LIMIT_ROLL_ONLY = 2; |
165 | public const int VEHICLE_FLAG_HOVER_WATER_ONLY = 4; | 167 | public const int VEHICLE_FLAG_HOVER_WATER_ONLY = 4; |
@@ -170,6 +172,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
170 | public const int VEHICLE_FLAG_MOUSELOOK_STEER = 128; | 172 | public const int VEHICLE_FLAG_MOUSELOOK_STEER = 128; |
171 | public const int VEHICLE_FLAG_MOUSELOOK_BANK = 256; | 173 | public const int VEHICLE_FLAG_MOUSELOOK_BANK = 256; |
172 | public const int VEHICLE_FLAG_CAMERA_DECOUPLED = 512; | 174 | public const int VEHICLE_FLAG_CAMERA_DECOUPLED = 512; |
175 | public const int VEHICLE_FLAG_NO_X = 1024; | ||
176 | public const int VEHICLE_FLAG_NO_Y = 2048; | ||
177 | public const int VEHICLE_FLAG_NO_Z = 4096; | ||
178 | public const int VEHICLE_FLAG_LOCK_HOVER_HEIGHT = 8192; | ||
179 | public const int VEHICLE_FLAG_NO_DEFLECTION = 16392; | ||
180 | public const int VEHICLE_FLAG_LOCK_ROTATION = 32784; | ||
173 | 181 | ||
174 | public const int INVENTORY_ALL = -1; | 182 | public const int INVENTORY_ALL = -1; |
175 | public const int INVENTORY_NONE = -1; | 183 | public const int INVENTORY_NONE = -1; |