diff options
author | Teravus Ovares | 2008-09-26 17:25:22 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-09-26 17:25:22 +0000 |
commit | 16b6738cdadc70966a93b6d025ae469738955dcb (patch) | |
tree | 7a3c0075e9ee5fd04d972bc52be38aec4d51f648 /OpenSim/Region/ScriptEngine | |
parent | DNE code cleanups (diff) | |
download | opensim-SC_OLD-16b6738cdadc70966a93b6d025ae469738955dcb.zip opensim-SC_OLD-16b6738cdadc70966a93b6d025ae469738955dcb.tar.gz opensim-SC_OLD-16b6738cdadc70966a93b6d025ae469738955dcb.tar.bz2 opensim-SC_OLD-16b6738cdadc70966a93b6d025ae469738955dcb.tar.xz |
* Patch from JHurliman
* Updates to libomv r2243,
* Remove lots of unnecessary typecasts
* Improves SendWindData()
Thanks jhurliman.
* Will update OpenSim-libs in 10 minutes..
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 36 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 12 |
2 files changed, 27 insertions, 21 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 5a265d1..6215710 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -269,7 +269,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
269 | if (inv.Value.Type != type) | 269 | if (inv.Value.Type != type) |
270 | return UUID.Zero; | 270 | return UUID.Zero; |
271 | 271 | ||
272 | return inv.Value.AssetID.ToString(); | 272 | return inv.Value.AssetID; |
273 | } | 273 | } |
274 | } | 274 | } |
275 | return UUID.Zero; | 275 | return UUID.Zero; |
@@ -282,7 +282,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
282 | { | 282 | { |
283 | if (inv.Value.Name == name) | 283 | if (inv.Value.Name == name) |
284 | { | 284 | { |
285 | return inv.Value.AssetID.ToString(); | 285 | return inv.Value.AssetID; |
286 | } | 286 | } |
287 | } | 287 | } |
288 | return UUID.Zero; | 288 | return UUID.Zero; |
@@ -2766,7 +2766,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2766 | 2766 | ||
2767 | m_host.AddScriptLPS(1); | 2767 | m_host.AddScriptLPS(1); |
2768 | 2768 | ||
2769 | if (m_host.ParentGroup.RootPart.IsAttachment && agent == m_host.ParentGroup.RootPart.AttachedAvatar) | 2769 | if (m_host.ParentGroup.RootPart.IsAttachment && (UUID)agent == m_host.ParentGroup.RootPart.AttachedAvatar) |
2770 | { | 2770 | { |
2771 | // When attached, certain permissions are implicit if requested from owner | 2771 | // When attached, certain permissions are implicit if requested from owner |
2772 | int implicitPerms = ScriptBaseClass.PERMISSION_TAKE_CONTROLS | | 2772 | int implicitPerms = ScriptBaseClass.PERMISSION_TAKE_CONTROLS | |
@@ -2919,7 +2919,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2919 | return; | 2919 | return; |
2920 | } | 2920 | } |
2921 | IClientAPI client = World.GetScenePresence(m_host.TaskInventory[invItemID].PermsGranter).ControllingClient; | 2921 | IClientAPI client = World.GetScenePresence(m_host.TaskInventory[invItemID].PermsGranter).ControllingClient; |
2922 | SceneObjectPart targetPart = World.GetSceneObjectPart(target); | 2922 | SceneObjectPart targetPart = World.GetSceneObjectPart((UUID)target); |
2923 | SceneObjectGroup parentPrim = null, childPrim = null; | 2923 | SceneObjectGroup parentPrim = null, childPrim = null; |
2924 | if (targetPart != null) | 2924 | if (targetPart != null) |
2925 | { | 2925 | { |
@@ -3131,7 +3131,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3131 | if (World.GetScenePresence(destId) != null) | 3131 | if (World.GetScenePresence(destId) != null) |
3132 | { | 3132 | { |
3133 | // destination is an avatar | 3133 | // destination is an avatar |
3134 | World.MoveTaskInventoryItem(destId, null, m_host, objId); | 3134 | World.MoveTaskInventoryItem(destId, UUID.Zero, m_host, objId); |
3135 | } | 3135 | } |
3136 | else | 3136 | else |
3137 | { | 3137 | { |
@@ -3180,11 +3180,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3180 | { | 3180 | { |
3181 | m_host.AddScriptLPS(1); | 3181 | m_host.AddScriptLPS(1); |
3182 | 3182 | ||
3183 | UUID uuid = (UUID)id; | ||
3184 | |||
3183 | UserProfileData userProfile = | 3185 | UserProfileData userProfile = |
3184 | World.CommsManager.UserService.GetUserProfile(id); | 3186 | World.CommsManager.UserService.GetUserProfile(uuid); |
3185 | 3187 | ||
3186 | UserAgentData userAgent = | 3188 | UserAgentData userAgent = |
3187 | World.CommsManager.UserService.GetAgentByUUID(id); | 3189 | World.CommsManager.UserService.GetAgentByUUID(uuid); |
3188 | 3190 | ||
3189 | if (userProfile == null || userAgent == null) | 3191 | if (userProfile == null || userAgent == null) |
3190 | return UUID.Zero.ToString(); | 3192 | return UUID.Zero.ToString(); |
@@ -3503,7 +3505,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3503 | public void llPushObject(string target, LSL_Vector impulse, LSL_Vector ang_impulse, int local) | 3505 | public void llPushObject(string target, LSL_Vector impulse, LSL_Vector ang_impulse, int local) |
3504 | { | 3506 | { |
3505 | m_host.AddScriptLPS(1); | 3507 | m_host.AddScriptLPS(1); |
3506 | SceneObjectPart targ = World.GetSceneObjectPart(target); | 3508 | SceneObjectPart targ = World.GetSceneObjectPart((UUID)target); |
3507 | if (targ == null) | 3509 | if (targ == null) |
3508 | return; | 3510 | return; |
3509 | targ.ApplyImpulse(new Vector3((float)impulse.x, (float)impulse.y, (float)impulse.z), local != 0); | 3511 | targ.ApplyImpulse(new Vector3((float)impulse.x, (float)impulse.y, (float)impulse.z), local != 0); |
@@ -4683,7 +4685,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4683 | public LSL_Vector llGetAgentSize(string id) | 4685 | public LSL_Vector llGetAgentSize(string id) |
4684 | { | 4686 | { |
4685 | m_host.AddScriptLPS(1); | 4687 | m_host.AddScriptLPS(1); |
4686 | ScenePresence avatar = World.GetScenePresence(id); | 4688 | ScenePresence avatar = World.GetScenePresence((UUID)id); |
4687 | LSL_Vector agentSize; | 4689 | LSL_Vector agentSize; |
4688 | if (avatar == null) | 4690 | if (avatar == null) |
4689 | { | 4691 | { |
@@ -5164,7 +5166,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5164 | if (UUID.TryParse(avatar, out key)) | 5166 | if (UUID.TryParse(avatar, out key)) |
5165 | { | 5167 | { |
5166 | entry.AgentID = key; | 5168 | entry.AgentID = key; |
5167 | entry.Flags = ParcelManager.AccessList.Access; | 5169 | entry.Flags = AccessList.Access; |
5168 | entry.Time = DateTime.Now.AddHours(hours); | 5170 | entry.Time = DateTime.Now.AddHours(hours); |
5169 | land.ParcelAccessList.Add(entry); | 5171 | land.ParcelAccessList.Add(entry); |
5170 | } | 5172 | } |
@@ -5365,7 +5367,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5365 | { | 5367 | { |
5366 | m_host.AddScriptLPS(1); | 5368 | m_host.AddScriptLPS(1); |
5367 | IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>(); | 5369 | IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>(); |
5368 | xmlrpcMod.CloseXMLRPCChannel(channel); | 5370 | xmlrpcMod.CloseXMLRPCChannel((UUID)channel); |
5369 | // ScriptSleep(1000); | 5371 | // ScriptSleep(1000); |
5370 | } | 5372 | } |
5371 | 5373 | ||
@@ -6081,7 +6083,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6081 | m_host.AddScriptLPS(1); | 6083 | m_host.AddScriptLPS(1); |
6082 | 6084 | ||
6083 | LSL_List l = new LSL_List(); | 6085 | LSL_List l = new LSL_List(); |
6084 | ScenePresence av = World.GetScenePresence(id); | 6086 | ScenePresence av = World.GetScenePresence((UUID)id); |
6085 | if (av == null) | 6087 | if (av == null) |
6086 | return l; | 6088 | return l; |
6087 | UUID[] anims; | 6089 | UUID[] anims; |
@@ -7544,7 +7546,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7544 | if (UUID.TryParse(avatar, out key)) | 7546 | if (UUID.TryParse(avatar, out key)) |
7545 | { | 7547 | { |
7546 | entry.AgentID = key; | 7548 | entry.AgentID = key; |
7547 | entry.Flags = ParcelManager.AccessList.Ban; | 7549 | entry.Flags = AccessList.Ban; |
7548 | entry.Time = DateTime.Now.AddHours(hours); | 7550 | entry.Time = DateTime.Now.AddHours(hours); |
7549 | land.ParcelAccessList.Add(entry); | 7551 | land.ParcelAccessList.Add(entry); |
7550 | } | 7552 | } |
@@ -7563,7 +7565,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7563 | { | 7565 | { |
7564 | foreach (ParcelManager.ParcelAccessEntry entry in land.ParcelAccessList) | 7566 | foreach (ParcelManager.ParcelAccessEntry entry in land.ParcelAccessList) |
7565 | { | 7567 | { |
7566 | if (entry.AgentID == key && entry.Flags == ParcelManager.AccessList.Access) | 7568 | if (entry.AgentID == key && entry.Flags == AccessList.Access) |
7567 | { | 7569 | { |
7568 | land.ParcelAccessList.Remove(entry); | 7570 | land.ParcelAccessList.Remove(entry); |
7569 | break; | 7571 | break; |
@@ -7585,7 +7587,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7585 | { | 7587 | { |
7586 | foreach (ParcelManager.ParcelAccessEntry entry in land.ParcelAccessList) | 7588 | foreach (ParcelManager.ParcelAccessEntry entry in land.ParcelAccessList) |
7587 | { | 7589 | { |
7588 | if (entry.AgentID == key && entry.Flags == ParcelManager.AccessList.Ban) | 7590 | if (entry.AgentID == key && entry.Flags == AccessList.Ban) |
7589 | { | 7591 | { |
7590 | land.ParcelAccessList.Remove(entry); | 7592 | land.ParcelAccessList.Remove(entry); |
7591 | break; | 7593 | break; |
@@ -7795,7 +7797,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7795 | { | 7797 | { |
7796 | foreach (ParcelManager.ParcelAccessEntry entry in land.ParcelAccessList) | 7798 | foreach (ParcelManager.ParcelAccessEntry entry in land.ParcelAccessList) |
7797 | { | 7799 | { |
7798 | if (entry.Flags == ParcelManager.AccessList.Ban) | 7800 | if (entry.Flags == AccessList.Ban) |
7799 | { | 7801 | { |
7800 | land.ParcelAccessList.Remove(entry); | 7802 | land.ParcelAccessList.Remove(entry); |
7801 | } | 7803 | } |
@@ -7812,7 +7814,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7812 | { | 7814 | { |
7813 | foreach (ParcelManager.ParcelAccessEntry entry in land.ParcelAccessList) | 7815 | foreach (ParcelManager.ParcelAccessEntry entry in land.ParcelAccessList) |
7814 | { | 7816 | { |
7815 | if (entry.Flags == ParcelManager.AccessList.Access) | 7817 | if (entry.Flags == AccessList.Access) |
7816 | { | 7818 | { |
7817 | land.ParcelAccessList.Remove(entry); | 7819 | land.ParcelAccessList.Remove(entry); |
7818 | } | 7820 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 7888a63..536bdd2 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -496,10 +496,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
496 | { | 496 | { |
497 | CheckThreatLevel(ThreatLevel.VeryHigh, "osAvatarPlayAnimation"); | 497 | CheckThreatLevel(ThreatLevel.VeryHigh, "osAvatarPlayAnimation"); |
498 | 498 | ||
499 | UUID avatarID = (UUID)avatar; | ||
500 | |||
499 | m_host.AddScriptLPS(1); | 501 | m_host.AddScriptLPS(1); |
500 | if (World.Entities.ContainsKey(avatar) && World.Entities[avatar] is ScenePresence) | 502 | if (World.Entities.ContainsKey((UUID)avatar) && World.Entities[avatarID] is ScenePresence) |
501 | { | 503 | { |
502 | ScenePresence target = (ScenePresence)World.Entities[avatar]; | 504 | ScenePresence target = (ScenePresence)World.Entities[avatarID]; |
503 | target.AddAnimation(animation); | 505 | target.AddAnimation(animation); |
504 | } | 506 | } |
505 | } | 507 | } |
@@ -508,10 +510,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
508 | { | 510 | { |
509 | CheckThreatLevel(ThreatLevel.VeryHigh, "osAvatarStopAnimation"); | 511 | CheckThreatLevel(ThreatLevel.VeryHigh, "osAvatarStopAnimation"); |
510 | 512 | ||
513 | UUID avatarID = (UUID)avatar; | ||
514 | |||
511 | m_host.AddScriptLPS(1); | 515 | m_host.AddScriptLPS(1); |
512 | if (World.Entities.ContainsKey(avatar) && World.Entities[avatar] is ScenePresence) | 516 | if (World.Entities.ContainsKey(avatarID) && World.Entities[avatarID] is ScenePresence) |
513 | { | 517 | { |
514 | ScenePresence target = (ScenePresence)World.Entities[avatar]; | 518 | ScenePresence target = (ScenePresence)World.Entities[avatarID]; |
515 | target.RemoveAnimation(animation); | 519 | target.RemoveAnimation(animation); |
516 | } | 520 | } |
517 | } | 521 | } |