aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs8
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs559
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs31
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs14
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Listener.cs6
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs50
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs12
7 files changed, 339 insertions, 341 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs
index fcd1df8..93a1a80 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs
@@ -29,7 +29,7 @@ using System;
29using System.Collections; 29using System.Collections;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Threading; 31using System.Threading;
32using libsecondlife; 32using OpenMetaverse;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Region.Environment.Interfaces; 34using OpenSim.Region.Environment.Interfaces;
35using OpenSim.Region.ScriptEngine.Interfaces; 35using OpenSim.Region.ScriptEngine.Interfaces;
@@ -192,7 +192,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
192 /// </summary> 192 /// </summary>
193 /// <param name="localID"></param> 193 /// <param name="localID"></param>
194 /// <param name="itemID"></param> 194 /// <param name="itemID"></param>
195 public void RemoveScript(uint localID, LLUUID itemID) 195 public void RemoveScript(uint localID, UUID itemID)
196 { 196 {
197 // Remove a specific script 197 // Remove a specific script
198 198
@@ -219,7 +219,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
219 219
220 } 220 }
221 221
222 public Object[] GetSerializationData(LLUUID itemID) 222 public Object[] GetSerializationData(UUID itemID)
223 { 223 {
224 List<Object> data = new List<Object>(); 224 List<Object> data = new List<Object>();
225 225
@@ -250,7 +250,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
250 return data.ToArray(); 250 return data.ToArray();
251 } 251 }
252 252
253 public void CreateFromData(uint localID, LLUUID itemID, LLUUID hostID, 253 public void CreateFromData(uint localID, UUID itemID, UUID hostID,
254 Object[] data) 254 Object[] data)
255 { 255 {
256 int idx = 0; 256 int idx = 0;
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 93dfeea..b2be0df 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -32,9 +32,8 @@ using System.Runtime.Remoting.Lifetime;
32using System.Text; 32using System.Text;
33using System.Threading; 33using System.Threading;
34using Nini.Config; 34using Nini.Config;
35using Axiom.Math; 35using OpenMetaverse;
36using libsecondlife; 36using OpenMetaverse.Packets;
37using libsecondlife.Packets;
38using OpenSim; 37using OpenSim;
39using OpenSim.Framework; 38using OpenSim.Framework;
40using OpenSim.Framework.Communications.Cache; 39using OpenSim.Framework.Communications.Cache;
@@ -63,13 +62,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
63 internal IScriptEngine m_ScriptEngine; 62 internal IScriptEngine m_ScriptEngine;
64 internal SceneObjectPart m_host; 63 internal SceneObjectPart m_host;
65 internal uint m_localID; 64 internal uint m_localID;
66 internal LLUUID m_itemID; 65 internal UUID m_itemID;
67 internal bool throwErrorOnNotImplemented = true; 66 internal bool throwErrorOnNotImplemented = true;
68 internal AsyncCommandManager AsyncCommands = null; 67 internal AsyncCommandManager AsyncCommands = null;
69 internal float m_ScriptDelayFactor = 1.0f; 68 internal float m_ScriptDelayFactor = 1.0f;
70 internal float m_ScriptDistanceFactor = 1.0f; 69 internal float m_ScriptDistanceFactor = 1.0f;
71 70
72 public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, LLUUID itemID) 71 public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID)
73 { 72 {
74 m_ScriptEngine = ScriptEngine; 73 m_ScriptEngine = ScriptEngine;
75 m_host = host; 74 m_host = host;
@@ -129,11 +128,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
129 return World.GetCommander(name); 128 return World.GetCommander(name);
130 } 129 }
131 130
132 private LLUUID InventorySelf() 131 private UUID InventorySelf()
133 { 132 {
134 LLUUID invItemID = new LLUUID(); 133 UUID invItemID = new UUID();
135 134
136 foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) 135 foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
137 { 136 {
138 if (inv.Value.Type == 10 && inv.Value.ItemID == m_itemID) 137 if (inv.Value.Type == 10 && inv.Value.ItemID == m_itemID)
139 { 138 {
@@ -145,54 +144,54 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
145 return invItemID; 144 return invItemID;
146 } 145 }
147 146
148 private LLUUID InventoryKey(string name, int type) 147 private UUID InventoryKey(string name, int type)
149 { 148 {
150 m_host.AddScriptLPS(1); 149 m_host.AddScriptLPS(1);
151 foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) 150 foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
152 { 151 {
153 if (inv.Value.Name == name) 152 if (inv.Value.Name == name)
154 { 153 {
155 if (inv.Value.Type != type) 154 if (inv.Value.Type != type)
156 return LLUUID.Zero; 155 return UUID.Zero;
157 156
158 return inv.Value.AssetID.ToString(); 157 return inv.Value.AssetID.ToString();
159 } 158 }
160 } 159 }
161 return LLUUID.Zero; 160 return UUID.Zero;
162 } 161 }
163 162
164 private LLUUID InventoryKey(string name) 163 private UUID InventoryKey(string name)
165 { 164 {
166 m_host.AddScriptLPS(1); 165 m_host.AddScriptLPS(1);
167 foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) 166 foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
168 { 167 {
169 if (inv.Value.Name == name) 168 if (inv.Value.Name == name)
170 { 169 {
171 return inv.Value.AssetID.ToString(); 170 return inv.Value.AssetID.ToString();
172 } 171 }
173 } 172 }
174 return LLUUID.Zero; 173 return UUID.Zero;
175 } 174 }
176 175
177 176
178 /// <summary> 177 /// <summary>
179 /// accepts a valid LLUUID, -or- a name of an inventory item. 178 /// accepts a valid UUID, -or- a name of an inventory item.
180 /// Returns a valid LLUUID or LLUUID.Zero if key invalid and item not found 179 /// Returns a valid UUID or UUID.Zero if key invalid and item not found
181 /// in prim inventory. 180 /// in prim inventory.
182 /// </summary> 181 /// </summary>
183 /// <param name="k"></param> 182 /// <param name="k"></param>
184 /// <returns></returns> 183 /// <returns></returns>
185 private LLUUID KeyOrName(string k) 184 private UUID KeyOrName(string k)
186 { 185 {
187 LLUUID key = LLUUID.Zero; 186 UUID key = UUID.Zero;
188 187
189 // if we can parse the string as a key, use it. 188 // if we can parse the string as a key, use it.
190 if (LLUUID.TryParse(k, out key)) 189 if (UUID.TryParse(k, out key))
191 { 190 {
192 return key; 191 return key;
193 } 192 }
194 // else try to locate the name in inventory of object. found returns key, 193 // else try to locate the name in inventory of object. found returns key,
195 // not found returns LLUUID.Zero which will translate to the default particle texture 194 // not found returns UUID.Zero which will translate to the default particle texture
196 else 195 else
197 { 196 {
198 return InventoryKey(k); 197 return InventoryKey(k);
@@ -551,7 +550,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
551 if (text.Length > 1023) 550 if (text.Length > 1023)
552 text = text.Substring(0, 1023); 551 text = text.Substring(0, 1023);
553 552
554 World.SimChat(Helpers.StringToField(text), 553 World.SimChat(Utils.StringToBytes(text),
555 ChatTypeEnum.Whisper, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false); 554 ChatTypeEnum.Whisper, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false);
556 555
557 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 556 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
@@ -565,7 +564,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
565 if (text.Length > 1023) 564 if (text.Length > 1023)
566 text = text.Substring(0, 1023); 565 text = text.Substring(0, 1023);
567 566
568 World.SimChat(Helpers.StringToField(text), 567 World.SimChat(Utils.StringToBytes(text),
569 ChatTypeEnum.Say, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false); 568 ChatTypeEnum.Say, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false);
570 569
571 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 570 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
@@ -579,7 +578,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
579 if (text.Length > 1023) 578 if (text.Length > 1023)
580 text = text.Substring(0, 1023); 579 text = text.Substring(0, 1023);
581 580
582 World.SimChat(Helpers.StringToField(text), 581 World.SimChat(Utils.StringToBytes(text),
583 ChatTypeEnum.Shout, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, true); 582 ChatTypeEnum.Shout, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, true);
584 583
585 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 584 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
@@ -606,8 +605,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
606 public LSL_Types.LSLInteger llListen(int channelID, string name, string ID, string msg) 605 public LSL_Types.LSLInteger llListen(int channelID, string name, string ID, string msg)
607 { 606 {
608 m_host.AddScriptLPS(1); 607 m_host.AddScriptLPS(1);
609 LLUUID keyID; 608 UUID keyID;
610 LLUUID.TryParse(ID, out keyID); 609 UUID.TryParse(ID, out keyID);
611 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 610 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
612 return wComm.Listen(m_localID, m_itemID, m_host.UUID, channelID, name, keyID, msg); 611 return wComm.Listen(m_localID, m_itemID, m_host.UUID, channelID, name, keyID, msg);
613 } 612 }
@@ -629,8 +628,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
629 public void llSensor(string name, string id, int type, double range, double arc) 628 public void llSensor(string name, string id, int type, double range, double arc)
630 { 629 {
631 m_host.AddScriptLPS(1); 630 m_host.AddScriptLPS(1);
632 LLUUID keyID = LLUUID.Zero; 631 UUID keyID = UUID.Zero;
633 LLUUID.TryParse(id, out keyID); 632 UUID.TryParse(id, out keyID);
634 633
635 AsyncCommands.SensorRepeatPlugin.SenseOnce(m_localID, m_itemID, name, keyID, type, range, arc, m_host); 634 AsyncCommands.SensorRepeatPlugin.SenseOnce(m_localID, m_itemID, name, keyID, type, range, arc, m_host);
636 } 635 }
@@ -638,8 +637,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
638 public void llSensorRepeat(string name, string id, int type, double range, double arc, double rate) 637 public void llSensorRepeat(string name, string id, int type, double range, double arc, double rate)
639 { 638 {
640 m_host.AddScriptLPS(1); 639 m_host.AddScriptLPS(1);
641 LLUUID keyID = LLUUID.Zero; 640 UUID keyID = UUID.Zero;
642 LLUUID.TryParse(id, out keyID); 641 UUID.TryParse(id, out keyID);
643 642
644 AsyncCommands.SensorRepeatPlugin.SetSenseRepeatEvent(m_localID, m_itemID, name, keyID, type, range, arc, rate, m_host); 643 AsyncCommands.SensorRepeatPlugin.SetSenseRepeatEvent(m_localID, m_itemID, name, keyID, type, range, arc, rate, m_host);
645 } 644 }
@@ -650,7 +649,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
650 AsyncCommands.SensorRepeatPlugin.UnSetSenseRepeaterEvents(m_localID, m_itemID); 649 AsyncCommands.SensorRepeatPlugin.UnSetSenseRepeaterEvents(m_localID, m_itemID);
651 } 650 }
652 651
653 public string resolveName(LLUUID objecUUID) 652 public string resolveName(UUID objecUUID)
654 { 653 {
655 // try avatar username surname 654 // try avatar username surname
656 CachedUserInfo profile = World.CommsManager.UserProfileCacheService.GetUserDetails(objecUUID); 655 CachedUserInfo profile = World.CommsManager.UserProfileCacheService.GetUserDetails(objecUUID);
@@ -841,7 +840,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
841 840
842 if ((status & ScriptBaseClass.STATUS_CAST_SHADOWS) == ScriptBaseClass.STATUS_CAST_SHADOWS) 841 if ((status & ScriptBaseClass.STATUS_CAST_SHADOWS) == ScriptBaseClass.STATUS_CAST_SHADOWS)
843 { 842 {
844 m_host.AddFlag(LLObject.ObjectFlags.CastShadows); 843 m_host.AddFlag(PrimFlags.CastShadows);
845 } 844 }
846 845
847 if ((status & ScriptBaseClass.STATUS_ROTATE_X) == ScriptBaseClass.STATUS_ROTATE_X) 846 if ((status & ScriptBaseClass.STATUS_ROTATE_X) == ScriptBaseClass.STATUS_ROTATE_X)
@@ -891,25 +890,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
891 public LSL_Types.LSLInteger llGetStatus(int status) 890 public LSL_Types.LSLInteger llGetStatus(int status)
892 { 891 {
893 m_host.AddScriptLPS(1); 892 m_host.AddScriptLPS(1);
894 // Console.WriteLine(m_host.UUID.ToString() + " status is " + m_host.GetEffectiveObjectFlags().ToString()); 893 // Console.WriteLine(m_host.ToString() + " status is " + m_host.GetEffectiveObjectFlags().ToString());
895 switch (status) 894 switch (status)
896 { 895 {
897 case ScriptBaseClass.STATUS_PHYSICS: 896 case ScriptBaseClass.STATUS_PHYSICS:
898 if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Physics) == (uint)LLObject.ObjectFlags.Physics) 897 if ((m_host.GetEffectiveObjectFlags() & (uint)PrimFlags.Physics) == (uint)PrimFlags.Physics)
899 { 898 {
900 return 1; 899 return 1;
901 } 900 }
902 return 0; 901 return 0;
903 902
904 case ScriptBaseClass.STATUS_PHANTOM: 903 case ScriptBaseClass.STATUS_PHANTOM:
905 if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Phantom) == (uint)LLObject.ObjectFlags.Phantom) 904 if ((m_host.GetEffectiveObjectFlags() & (uint)PrimFlags.Phantom) == (uint)PrimFlags.Phantom)
906 { 905 {
907 return 1; 906 return 1;
908 } 907 }
909 return 0; 908 return 0;
910 909
911 case ScriptBaseClass.STATUS_CAST_SHADOWS: 910 case ScriptBaseClass.STATUS_CAST_SHADOWS:
912 if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.CastShadows) == (uint)LLObject.ObjectFlags.CastShadows) 911 if ((m_host.GetEffectiveObjectFlags() & (uint)PrimFlags.CastShadows) == (uint)PrimFlags.CastShadows)
913 { 912 {
914 return 1; 913 return 1;
915 } 914 }
@@ -976,7 +975,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
976 scale.y = World.m_maxNonphys; 975 scale.y = World.m_maxNonphys;
977 if (scale.z > World.m_maxNonphys) 976 if (scale.z > World.m_maxNonphys)
978 scale.z = World.m_maxNonphys; 977 scale.z = World.m_maxNonphys;
979 LLVector3 tmp = part.Scale; 978 Vector3 tmp = part.Scale;
980 tmp.X = (float)scale.x; 979 tmp.X = (float)scale.x;
981 tmp.Y = (float)scale.y; 980 tmp.Y = (float)scale.y;
982 tmp.Z = (float)scale.z; 981 tmp.Z = (float)scale.z;
@@ -999,8 +998,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
999 998
1000 private void SetColor(SceneObjectPart part, LSL_Types.Vector3 color, int face) 999 private void SetColor(SceneObjectPart part, LSL_Types.Vector3 color, int face)
1001 { 1000 {
1002 LLObject.TextureEntry tex = part.Shape.Textures; 1001 Primitive.TextureEntry tex = part.Shape.Textures;
1003 LLColor texcolor; 1002 Color4 texcolor;
1004 if (face > -1) 1003 if (face > -1)
1005 { 1004 {
1006 texcolor = tex.CreateFace((uint)face).RGBA; 1005 texcolor = tex.CreateFace((uint)face).RGBA;
@@ -1036,7 +1035,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1036 1035
1037 public void SetGlow(SceneObjectPart part, int face, float glow) 1036 public void SetGlow(SceneObjectPart part, int face, float glow)
1038 { 1037 {
1039 LLObject.TextureEntry tex = part.Shape.Textures; 1038 Primitive.TextureEntry tex = part.Shape.Textures;
1040 if (face > -1) 1039 if (face > -1)
1041 { 1040 {
1042 tex.CreateFace((uint) face); 1041 tex.CreateFace((uint) face);
@@ -1083,7 +1082,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1083 break; 1082 break;
1084 } 1083 }
1085 1084
1086 LLObject.TextureEntry tex = part.Shape.Textures; 1085 Primitive.TextureEntry tex = part.Shape.Textures;
1087 if (face > -1) 1086 if (face > -1)
1088 { 1087 {
1089 tex.CreateFace((uint) face); 1088 tex.CreateFace((uint) face);
@@ -1111,7 +1110,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1111 1110
1112 public void SetFullBright(SceneObjectPart part, int face, bool bright) 1111 public void SetFullBright(SceneObjectPart part, int face, bool bright)
1113 { 1112 {
1114 LLObject.TextureEntry tex = part.Shape.Textures; 1113 Primitive.TextureEntry tex = part.Shape.Textures;
1115 if (face > -1) 1114 if (face > -1)
1116 { 1115 {
1117 tex.CreateFace((uint) face); 1116 tex.CreateFace((uint) face);
@@ -1137,7 +1136,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1137 public double llGetAlpha(int face) 1136 public double llGetAlpha(int face)
1138 { 1137 {
1139 m_host.AddScriptLPS(1); 1138 m_host.AddScriptLPS(1);
1140 LLObject.TextureEntry tex = m_host.Shape.Textures; 1139 Primitive.TextureEntry tex = m_host.Shape.Textures;
1141 if (face == -1) // TMP: Until we can determine number of sides, ALL_SIDES (-1) will return default color 1140 if (face == -1) // TMP: Until we can determine number of sides, ALL_SIDES (-1) will return default color
1142 { 1141 {
1143 return (double)((tex.DefaultTexture.RGBA.A * 255) / 255); 1142 return (double)((tex.DefaultTexture.RGBA.A * 255) / 255);
@@ -1158,8 +1157,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1158 1157
1159 private void SetAlpha(SceneObjectPart part, double alpha, int face) 1158 private void SetAlpha(SceneObjectPart part, double alpha, int face)
1160 { 1159 {
1161 LLObject.TextureEntry tex = part.Shape.Textures; 1160 Primitive.TextureEntry tex = part.Shape.Textures;
1162 LLColor texcolor; 1161 Color4 texcolor;
1163 if (face > -1) 1162 if (face > -1)
1164 { 1163 {
1165 texcolor = tex.CreateFace((uint)face).RGBA; 1164 texcolor = tex.CreateFace((uint)face).RGBA;
@@ -1286,8 +1285,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1286 public LSL_Types.Vector3 llGetColor(int face) 1285 public LSL_Types.Vector3 llGetColor(int face)
1287 { 1286 {
1288 m_host.AddScriptLPS(1); 1287 m_host.AddScriptLPS(1);
1289 LLObject.TextureEntry tex = m_host.Shape.Textures; 1288 Primitive.TextureEntry tex = m_host.Shape.Textures;
1290 LLColor texcolor; 1289 Color4 texcolor;
1291 LSL_Types.Vector3 rgb; 1290 LSL_Types.Vector3 rgb;
1292 if (face == -1) // TMP: Until we can determine number of sides, ALL_SIDES (-1) will return default color 1291 if (face == -1) // TMP: Until we can determine number of sides, ALL_SIDES (-1) will return default color
1293 { 1292 {
@@ -1320,21 +1319,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1320 1319
1321 private void SetTexture(SceneObjectPart part, string texture, int face) 1320 private void SetTexture(SceneObjectPart part, string texture, int face)
1322 { 1321 {
1323 LLUUID textureID=new LLUUID(); 1322 UUID textureID=new UUID();
1324 1323
1325 if (!LLUUID.TryParse(texture, out textureID)) 1324 if (!UUID.TryParse(texture, out textureID))
1326 { 1325 {
1327 textureID=InventoryKey(texture, (int)AssetType.Texture); 1326 textureID=InventoryKey(texture, (int)AssetType.Texture);
1328 } 1327 }
1329 1328
1330 if (textureID == LLUUID.Zero) 1329 if (textureID == UUID.Zero)
1331 return; 1330 return;
1332 1331
1333 LLObject.TextureEntry tex = part.Shape.Textures; 1332 Primitive.TextureEntry tex = part.Shape.Textures;
1334 1333
1335 if (face > -1) 1334 if (face > -1)
1336 { 1335 {
1337 LLObject.TextureEntryFace texface = tex.CreateFace((uint)face); 1336 Primitive.TextureEntryFace texface = tex.CreateFace((uint)face);
1338 texface.TextureID = textureID; 1337 texface.TextureID = textureID;
1339 tex.FaceTextures[face] = texface; 1338 tex.FaceTextures[face] = texface;
1340 part.UpdateTexture(tex); 1339 part.UpdateTexture(tex);
@@ -1365,10 +1364,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1365 1364
1366 private void ScaleTexture(SceneObjectPart part, double u, double v, int face) 1365 private void ScaleTexture(SceneObjectPart part, double u, double v, int face)
1367 { 1366 {
1368 LLObject.TextureEntry tex = part.Shape.Textures; 1367 Primitive.TextureEntry tex = part.Shape.Textures;
1369 if (face > -1) 1368 if (face > -1)
1370 { 1369 {
1371 LLObject.TextureEntryFace texface = tex.CreateFace((uint)face); 1370 Primitive.TextureEntryFace texface = tex.CreateFace((uint)face);
1372 texface.RepeatU = (float)u; 1371 texface.RepeatU = (float)u;
1373 texface.RepeatV = (float)v; 1372 texface.RepeatV = (float)v;
1374 tex.FaceTextures[face] = texface; 1373 tex.FaceTextures[face] = texface;
@@ -1401,10 +1400,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1401 1400
1402 private void OffsetTexture(SceneObjectPart part, double u, double v, int face) 1401 private void OffsetTexture(SceneObjectPart part, double u, double v, int face)
1403 { 1402 {
1404 LLObject.TextureEntry tex = part.Shape.Textures; 1403 Primitive.TextureEntry tex = part.Shape.Textures;
1405 if (face > -1) 1404 if (face > -1)
1406 { 1405 {
1407 LLObject.TextureEntryFace texface = tex.CreateFace((uint)face); 1406 Primitive.TextureEntryFace texface = tex.CreateFace((uint)face);
1408 texface.OffsetU = (float)u; 1407 texface.OffsetU = (float)u;
1409 texface.OffsetV = (float)v; 1408 texface.OffsetV = (float)v;
1410 tex.FaceTextures[face] = texface; 1409 tex.FaceTextures[face] = texface;
@@ -1437,10 +1436,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1437 1436
1438 private void RotateTexture(SceneObjectPart part, double rotation, int face) 1437 private void RotateTexture(SceneObjectPart part, double rotation, int face)
1439 { 1438 {
1440 LLObject.TextureEntry tex = part.Shape.Textures; 1439 Primitive.TextureEntry tex = part.Shape.Textures;
1441 if (face > -1) 1440 if (face > -1)
1442 { 1441 {
1443 LLObject.TextureEntryFace texface = tex.CreateFace((uint)face); 1442 Primitive.TextureEntryFace texface = tex.CreateFace((uint)face);
1444 texface.Rotation = (float)rotation; 1443 texface.Rotation = (float)rotation;
1445 tex.FaceTextures[face] = texface; 1444 tex.FaceTextures[face] = texface;
1446 part.UpdateTexture(tex); 1445 part.UpdateTexture(tex);
@@ -1464,14 +1463,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1464 public string llGetTexture(int face) 1463 public string llGetTexture(int face)
1465 { 1464 {
1466 m_host.AddScriptLPS(1); 1465 m_host.AddScriptLPS(1);
1467 LLObject.TextureEntry tex = m_host.Shape.Textures; 1466 Primitive.TextureEntry tex = m_host.Shape.Textures;
1468 if (face == -1) 1467 if (face == -1)
1469 { 1468 {
1470 face = 0; 1469 face = 0;
1471 } 1470 }
1472 if (face > -1) 1471 if (face > -1)
1473 { 1472 {
1474 LLObject.TextureEntryFace texface; 1473 Primitive.TextureEntryFace texface;
1475 texface = tex.GetFace((uint)face); 1474 texface = tex.GetFace((uint)face);
1476 return texface.TextureID.ToString(); 1475 return texface.TextureID.ToString();
1477 } 1476 }
@@ -1501,11 +1500,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1501 1500
1502 if (part.ParentID != 0) 1501 if (part.ParentID != 0)
1503 { 1502 {
1504 part.UpdateOffSet(new LLVector3((float)targetPos.x, (float)targetPos.y, (float)targetPos.z)); 1503 part.UpdateOffSet(new Vector3((float)targetPos.x, (float)targetPos.y, (float)targetPos.z));
1505 } 1504 }
1506 else 1505 else
1507 { 1506 {
1508 part.UpdateGroupPosition(new LLVector3((float)targetPos.x, (float)targetPos.y, (float)targetPos.z)); 1507 part.UpdateGroupPosition(new Vector3((float)targetPos.x, (float)targetPos.y, (float)targetPos.z));
1509 } 1508 }
1510 } 1509 }
1511 1510
@@ -1545,7 +1544,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1545 1544
1546 private void SetRot(SceneObjectPart part, LSL_Types.Quaternion rot) 1545 private void SetRot(SceneObjectPart part, LSL_Types.Quaternion rot)
1547 { 1546 {
1548 part.UpdateRotation(new LLQuaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s)); 1547 part.UpdateRotation(new Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s));
1549 // Update rotation does not move the object in the physics scene if it's a linkset. 1548 // Update rotation does not move the object in the physics scene if it's a linkset.
1550 part.ParentGroup.AbsolutePosition = part.ParentGroup.AbsolutePosition; 1549 part.ParentGroup.AbsolutePosition = part.ParentGroup.AbsolutePosition;
1551 } 1550 }
@@ -1553,7 +1552,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1553 public LSL_Types.Quaternion llGetRot() 1552 public LSL_Types.Quaternion llGetRot()
1554 { 1553 {
1555 m_host.AddScriptLPS(1); 1554 m_host.AddScriptLPS(1);
1556 LLQuaternion q = m_host.RotationOffset; 1555 Quaternion q = m_host.RotationOffset;
1557 return new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W); 1556 return new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W);
1558 } 1557 }
1559 1558
@@ -1605,7 +1604,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1605 public LSL_Types.LSLInteger llTarget(LSL_Types.Vector3 position, double range) 1604 public LSL_Types.LSLInteger llTarget(LSL_Types.Vector3 position, double range)
1606 { 1605 {
1607 m_host.AddScriptLPS(1); 1606 m_host.AddScriptLPS(1);
1608 return m_host.registerTargetWaypoint(new LLVector3((float)position.x, (float)position.y, (float)position.z), (float)range); 1607 return m_host.registerTargetWaypoint(new Vector3((float)position.x, (float)position.y, (float)position.z), (float)range);
1609 1608
1610 } 1609 }
1611 1610
@@ -1631,7 +1630,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1631 public void llMoveToTarget(LSL_Types.Vector3 target, double tau) 1630 public void llMoveToTarget(LSL_Types.Vector3 target, double tau)
1632 { 1631 {
1633 m_host.AddScriptLPS(1); 1632 m_host.AddScriptLPS(1);
1634 m_host.MoveToTarget(new LLVector3((float)target.x, (float)target.y, (float)target.z), (float)tau); 1633 m_host.MoveToTarget(new Vector3((float)target.x, (float)target.y, (float)target.z), (float)tau);
1635 } 1634 }
1636 1635
1637 public void llStopMoveToTarget() 1636 public void llStopMoveToTarget()
@@ -1652,7 +1651,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1652 if (force.z > 20000) 1651 if (force.z > 20000)
1653 force.z = 20000; 1652 force.z = 20000;
1654 1653
1655 m_host.ApplyImpulse(new LLVector3((float)force.x, (float)force.y, (float)force.z), local != 0); 1654 m_host.ApplyImpulse(new Vector3((float)force.x, (float)force.y, (float)force.z), local != 0);
1656 } 1655 }
1657 1656
1658 public void llApplyRotationalImpulse(LSL_Types.Vector3 force, int local) 1657 public void llApplyRotationalImpulse(LSL_Types.Vector3 force, int local)
@@ -1761,7 +1760,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1761 { 1760 {
1762 m_host.AddScriptLPS(1); 1761 m_host.AddScriptLPS(1);
1763 1762
1764 if (m_host.Sound != LLUUID.Zero) 1763 if (m_host.Sound != UUID.Zero)
1765 llStopSound(); 1764 llStopSound();
1766 1765
1767 m_host.Sound = KeyOrName(sound); 1766 m_host.Sound = KeyOrName(sound);
@@ -1803,7 +1802,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1803 { 1802 {
1804 m_host.AddScriptLPS(1); 1803 m_host.AddScriptLPS(1);
1805 1804
1806 m_host.Sound = LLUUID.Zero; 1805 m_host.Sound = UUID.Zero;
1807 m_host.SoundGain = 0; 1806 m_host.SoundGain = 0;
1808 m_host.SoundFlags = 0; 1807 m_host.SoundFlags = 0;
1809 m_host.SoundRadius = 0; 1808 m_host.SoundRadius = 0;
@@ -1811,7 +1810,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1811 m_host.ScheduleFullUpdate(); 1810 m_host.ScheduleFullUpdate();
1812 m_host.SendFullUpdateToAllClients(); 1811 m_host.SendFullUpdateToAllClients();
1813 1812
1814 // m_host.SendSound(LLUUID.Zero.ToString(), 1.0, false, 2); 1813 // m_host.SendSound(UUID.Zero.ToString(), 1.0, false, 2);
1815 } 1814 }
1816 1815
1817 public void llPreloadSound(string sound) 1816 public void llPreloadSound(string sound)
@@ -2059,13 +2058,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2059 2058
2060 public LSL_Types.LSLInteger llGiveMoney(string destination, int amount) 2059 public LSL_Types.LSLInteger llGiveMoney(string destination, int amount)
2061 { 2060 {
2062 LLUUID invItemID=InventorySelf(); 2061 UUID invItemID=InventorySelf();
2063 if (invItemID == LLUUID.Zero) 2062 if (invItemID == UUID.Zero)
2064 return 0; 2063 return 0;
2065 2064
2066 m_host.AddScriptLPS(1); 2065 m_host.AddScriptLPS(1);
2067 2066
2068 if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) 2067 if (m_host.TaskInventory[invItemID].PermsGranter == UUID.Zero)
2069 return 0; 2068 return 0;
2070 2069
2071 if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_DEBIT) == 0) 2070 if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_DEBIT) == 0)
@@ -2074,9 +2073,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2074 return 0; 2073 return 0;
2075 } 2074 }
2076 2075
2077 LLUUID toID=new LLUUID(); 2076 UUID toID=new UUID();
2078 2077
2079 if (!LLUUID.TryParse(destination, out toID)) 2078 if (!UUID.TryParse(destination, out toID))
2080 { 2079 {
2081 LSLError("Bad key in llGiveMoney"); 2080 LSLError("Bad key in llGiveMoney");
2082 return 0; 2081 return 0;
@@ -2140,7 +2139,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2140 // it's possible to have two items with the same task inventory name. 2139 // it's possible to have two items with the same task inventory name.
2141 // this is an easter egg of sorts. 2140 // this is an easter egg of sorts.
2142 2141
2143 foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) 2142 foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
2144 { 2143 {
2145 if (inv.Value.Name == inventory) 2144 if (inv.Value.Name == inventory)
2146 { 2145 {
@@ -2151,18 +2150,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2151 continue; 2150 continue;
2152 } 2151 }
2153 2152
2154 LLVector3 llpos = new LLVector3((float)pos.x, (float)pos.y, (float)pos.z); 2153 Vector3 llpos = new Vector3((float)pos.x, (float)pos.y, (float)pos.z);
2155 2154
2156 // test if we're further away then 10m 2155 // test if we're further away then 10m
2157 if (Util.GetDistanceTo(llpos, m_host.AbsolutePosition) > 10) 2156 if (Util.GetDistanceTo(llpos, m_host.AbsolutePosition) > 10)
2158 return; // wiki says, if it's further away then 10m, silently fail. 2157 return; // wiki says, if it's further away then 10m, silently fail.
2159 2158
2160 LLVector3 llvel = new LLVector3((float)vel.x, (float)vel.y, (float)vel.z); 2159 Vector3 llvel = new Vector3((float)vel.x, (float)vel.y, (float)vel.z);
2161 2160
2162 // need the magnitude later 2161 // need the magnitude later
2163 float velmag = (float)Util.GetMagnitude(llvel); 2162 float velmag = (float)Util.GetMagnitude(llvel);
2164 2163
2165 SceneObjectGroup new_group = World.RezObject(m_host, inv.Value, llpos, new LLQuaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s), llvel, param); 2164 SceneObjectGroup new_group = World.RezObject(m_host, inv.Value, llpos, new Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s), llvel, param);
2166 2165
2167 // If either of these are null, then there was an unknown error. 2166 // If either of these are null, then there was an unknown error.
2168 if (new_group == null) 2167 if (new_group == null)
@@ -2176,7 +2175,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2176 m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams( 2175 m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams(
2177 "object_rez", new Object[] { 2176 "object_rez", new Object[] {
2178 new LSL_Types.LSLString( 2177 new LSL_Types.LSLString(
2179 new_group.RootPart.UUID.ToString()) }, 2178 new_group.RootPart.ToString()) },
2180 new DetectParams[0])); 2179 new DetectParams[0]));
2181 2180
2182 float groupmass = new_group.GetMass(); 2181 float groupmass = new_group.GetMass();
@@ -2243,7 +2242,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2243 return; 2242 return;
2244 } 2243 }
2245 2244
2246 if (m_host.TaskInventory[InventorySelf()].PermsGranter != LLUUID.Zero) 2245 if (m_host.TaskInventory[InventorySelf()].PermsGranter != UUID.Zero)
2247 { 2246 {
2248 ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[InventorySelf()].PermsGranter); 2247 ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[InventorySelf()].PermsGranter);
2249 2248
@@ -2270,7 +2269,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2270 return; 2269 return;
2271 } 2270 }
2272 2271
2273 if (m_host.TaskInventory[InventorySelf()].PermsGranter != LLUUID.Zero) 2272 if (m_host.TaskInventory[InventorySelf()].PermsGranter != UUID.Zero)
2274 { 2273 {
2275 ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[InventorySelf()].PermsGranter); 2274 ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[InventorySelf()].PermsGranter);
2276 2275
@@ -2331,14 +2330,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2331 2330
2332 // TODO: figure out values for client, fromSession, and imSessionID 2331 // TODO: figure out values for client, fromSession, and imSessionID
2333 // client.SendInstantMessage(m_host.UUID, fromSession, message, user, imSessionID, m_host.Name, AgentManager.InstantMessageDialog.MessageFromAgent, (uint)Util.UnixTimeSinceEpoch()); 2332 // client.SendInstantMessage(m_host.UUID, fromSession, message, user, imSessionID, m_host.Name, AgentManager.InstantMessageDialog.MessageFromAgent, (uint)Util.UnixTimeSinceEpoch());
2334 LLUUID friendTransactionID = LLUUID.Random(); 2333 UUID friendTransactionID = UUID.Random();
2335 2334
2336 //m_pendingFriendRequests.Add(friendTransactionID, fromAgentID); 2335 //m_pendingFriendRequests.Add(friendTransactionID, fromAgentID);
2337 2336
2338 GridInstantMessage msg = new GridInstantMessage(); 2337 GridInstantMessage msg = new GridInstantMessage();
2339 msg.fromAgentID = new Guid(m_host.UUID.ToString()); // fromAgentID.UUID; 2338 msg.fromAgentID = new Guid(m_host.ToString()); // fromAgentID.Guid;
2340 msg.fromAgentSession = new Guid(friendTransactionID.ToString());// fromAgentSession.UUID; 2339 msg.fromAgentSession = new Guid(friendTransactionID.ToString());// fromAgentSession.UUID;
2341 msg.toAgentID = new Guid(user); // toAgentID.UUID; 2340 msg.toAgentID = new Guid(user); // toAgentID.Guid;
2342 msg.imSessionID = new Guid(friendTransactionID.ToString()); // This is the item we're mucking with here 2341 msg.imSessionID = new Guid(friendTransactionID.ToString()); // This is the item we're mucking with here
2343// Console.WriteLine("[Scripting IM]: From:" + msg.fromAgentID.ToString() + " To: " + msg.toAgentID.ToString() + " Session:" + msg.imSessionID.ToString() + " Message:" + message); 2342// Console.WriteLine("[Scripting IM]: From:" + msg.fromAgentID.ToString() + " To: " + msg.toAgentID.ToString() + " Session:" + msg.imSessionID.ToString() + " Message:" + message);
2344// Console.WriteLine("[Scripting IM]: Filling Session: " + msg.imSessionID.ToString()); 2343// Console.WriteLine("[Scripting IM]: Filling Session: " + msg.imSessionID.ToString());
@@ -2356,8 +2355,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2356 msg.fromGroup = false;// fromGroup; 2355 msg.fromGroup = false;// fromGroup;
2357 msg.offline = (byte)0; //offline; 2356 msg.offline = (byte)0; //offline;
2358 msg.ParentEstateID = 0; //ParentEstateID; 2357 msg.ParentEstateID = 0; //ParentEstateID;
2359 msg.Position = new sLLVector3();// new sLLVector3(m_host.AbsolutePosition); 2358 msg.Position = Vector3.Zero;// new Vector3(m_host.AbsolutePosition);
2360 msg.RegionID = World.RegionInfo.RegionID.UUID;//RegionID.UUID; 2359 msg.RegionID = World.RegionInfo.RegionID.Guid;//RegionID.Guid;
2361 msg.binaryBucket = new byte[0];// binaryBucket; 2360 msg.binaryBucket = new byte[0];// binaryBucket;
2362 World.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule); 2361 World.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule);
2363 // ScriptSleep(2000); 2362 // ScriptSleep(2000);
@@ -2404,7 +2403,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2404 public string llGetKey() 2403 public string llGetKey()
2405 { 2404 {
2406 m_host.AddScriptLPS(1); 2405 m_host.AddScriptLPS(1);
2407 return m_host.UUID.ToString(); 2406 return m_host.ToString();
2408 } 2407 }
2409 2408
2410 public void llSetBuoyancy(double buoyancy) 2409 public void llSetBuoyancy(double buoyancy)
@@ -2468,11 +2467,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2468 { 2467 {
2469 m_host.AddScriptLPS(1); 2468 m_host.AddScriptLPS(1);
2470 2469
2471 LLUUID invItemID=InventorySelf(); 2470 UUID invItemID=InventorySelf();
2472 if (invItemID == LLUUID.Zero) 2471 if (invItemID == UUID.Zero)
2473 return; 2472 return;
2474 2473
2475 if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) 2474 if (m_host.TaskInventory[invItemID].PermsGranter == UUID.Zero)
2476 return; 2475 return;
2477 2476
2478 if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION) != 0) 2477 if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION) != 0)
@@ -2481,9 +2480,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2481 2480
2482 if (presence != null) 2481 if (presence != null)
2483 { 2482 {
2484 // Do NOT try to parse LLUUID, animations cannot be triggered by ID 2483 // Do NOT try to parse UUID, animations cannot be triggered by ID
2485 LLUUID animID=InventoryKey(anim, (int)AssetType.Animation); 2484 UUID animID=InventoryKey(anim, (int)AssetType.Animation);
2486 if (animID == LLUUID.Zero) 2485 if (animID == UUID.Zero)
2487 presence.AddAnimation(anim); 2486 presence.AddAnimation(anim);
2488 else 2487 else
2489 presence.AddAnimation(animID); 2488 presence.AddAnimation(animID);
@@ -2495,30 +2494,30 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2495 { 2494 {
2496 m_host.AddScriptLPS(1); 2495 m_host.AddScriptLPS(1);
2497 2496
2498 LLUUID invItemID=InventorySelf(); 2497 UUID invItemID=InventorySelf();
2499 if (invItemID == LLUUID.Zero) 2498 if (invItemID == UUID.Zero)
2500 return; 2499 return;
2501 2500
2502 if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) 2501 if (m_host.TaskInventory[invItemID].PermsGranter == UUID.Zero)
2503 return; 2502 return;
2504 2503
2505 if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION) != 0) 2504 if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION) != 0)
2506 { 2505 {
2507 LLUUID animID = new LLUUID(); 2506 UUID animID = new UUID();
2508 2507
2509 if (!LLUUID.TryParse(anim, out animID)) 2508 if (!UUID.TryParse(anim, out animID))
2510 { 2509 {
2511 animID=InventoryKey(anim); 2510 animID=InventoryKey(anim);
2512 } 2511 }
2513 2512
2514 if (animID == LLUUID.Zero) 2513 if (animID == UUID.Zero)
2515 return; 2514 return;
2516 2515
2517 ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[invItemID].PermsGranter); 2516 ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[invItemID].PermsGranter);
2518 2517
2519 if (presence != null) 2518 if (presence != null)
2520 { 2519 {
2521 if (animID == LLUUID.Zero) 2520 if (animID == UUID.Zero)
2522 presence.RemoveAnimation(anim); 2521 presence.RemoveAnimation(anim);
2523 else 2522 else
2524 presence.RemoveAnimation(animID); 2523 presence.RemoveAnimation(animID);
@@ -2541,8 +2540,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2541 public void llTargetOmega(LSL_Types.Vector3 axis, double spinrate, double gain) 2540 public void llTargetOmega(LSL_Types.Vector3 axis, double spinrate, double gain)
2542 { 2541 {
2543 m_host.AddScriptLPS(1); 2542 m_host.AddScriptLPS(1);
2544 m_host.RotationalVelocity = new LLVector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate)); 2543 m_host.RotationalVelocity = new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate));
2545 m_host.AngularVelocity = new LLVector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate)); 2544 m_host.AngularVelocity = new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate));
2546 m_host.ScheduleTerseUpdate(); 2545 m_host.ScheduleTerseUpdate();
2547 m_host.SendTerseUpdateToAllClients(); 2546 m_host.SendTerseUpdateToAllClients();
2548 } 2547 }
@@ -2561,19 +2560,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2561 2560
2562 public void llRequestPermissions(string agent, int perm) 2561 public void llRequestPermissions(string agent, int perm)
2563 { 2562 {
2564 LLUUID agentID=new LLUUID(); 2563 UUID agentID=new UUID();
2565 2564
2566 if (!LLUUID.TryParse(agent, out agentID)) 2565 if (!UUID.TryParse(agent, out agentID))
2567 return; 2566 return;
2568 2567
2569 LLUUID invItemID=InventorySelf(); 2568 UUID invItemID=InventorySelf();
2570 2569
2571 if (invItemID == LLUUID.Zero) 2570 if (invItemID == UUID.Zero)
2572 return; // Not in a prim? How?? 2571 return; // Not in a prim? How??
2573 2572
2574 if (agentID == LLUUID.Zero || perm == 0) // Releasing permissions 2573 if (agentID == UUID.Zero || perm == 0) // Releasing permissions
2575 { 2574 {
2576 m_host.TaskInventory[invItemID].PermsGranter=LLUUID.Zero; 2575 m_host.TaskInventory[invItemID].PermsGranter=UUID.Zero;
2577 m_host.TaskInventory[invItemID].PermsMask=0; 2576 m_host.TaskInventory[invItemID].PermsMask=0;
2578 2577
2579 m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams( 2578 m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams(
@@ -2655,14 +2654,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2655 new DetectParams[0])); 2654 new DetectParams[0]));
2656 } 2655 }
2657 2656
2658 void handleScriptAnswer(IClientAPI client, LLUUID taskID, LLUUID itemID, int answer) 2657 void handleScriptAnswer(IClientAPI client, UUID taskID, UUID itemID, int answer)
2659 { 2658 {
2660 if (taskID != m_host.UUID) 2659 if (taskID != m_host.UUID)
2661 return; 2660 return;
2662 2661
2663 LLUUID invItemID=InventorySelf(); 2662 UUID invItemID=InventorySelf();
2664 2663
2665 if (invItemID == LLUUID.Zero) 2664 if (invItemID == UUID.Zero)
2666 return; 2665 return;
2667 2666
2668 client.OnScriptAnswer-=handleScriptAnswer; 2667 client.OnScriptAnswer-=handleScriptAnswer;
@@ -2687,7 +2686,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2687 } 2686 }
2688 } 2687 }
2689 2688
2690 return LLUUID.Zero.ToString(); 2689 return UUID.Zero.ToString();
2691 } 2690 }
2692 2691
2693 public LSL_Types.LSLInteger llGetPermissions() 2692 public LSL_Types.LSLInteger llGetPermissions()
@@ -2725,8 +2724,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2725 SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknumber); 2724 SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknumber);
2726 if (linknumber > -1) 2725 if (linknumber > -1)
2727 { 2726 {
2728 LLObject.TextureEntry tex = part.Shape.Textures; 2727 Primitive.TextureEntry tex = part.Shape.Textures;
2729 LLColor texcolor; 2728 Color4 texcolor;
2730 if (face > -1) 2729 if (face > -1)
2731 { 2730 {
2732 texcolor = tex.CreateFace((uint)face).RGBA; 2731 texcolor = tex.CreateFace((uint)face).RGBA;
@@ -2772,8 +2771,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2772 { 2771 {
2773 linknumber = w; 2772 linknumber = w;
2774 part = m_host.ParentGroup.GetLinkNumPart(linknumber); 2773 part = m_host.ParentGroup.GetLinkNumPart(linknumber);
2775 LLObject.TextureEntry tex = part.Shape.Textures; 2774 Primitive.TextureEntry tex = part.Shape.Textures;
2776 LLColor texcolor; 2775 Color4 texcolor;
2777 if (face > -1) 2776 if (face > -1)
2778 { 2777 {
2779 texcolor = tex.CreateFace((uint)face).RGBA; 2778 texcolor = tex.CreateFace((uint)face).RGBA;
@@ -2816,7 +2815,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2816 public void llCreateLink(string target, int parent) 2815 public void llCreateLink(string target, int parent)
2817 { 2816 {
2818 m_host.AddScriptLPS(1); 2817 m_host.AddScriptLPS(1);
2819 LLUUID invItemID = InventorySelf(); 2818 UUID invItemID = InventorySelf();
2820 if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CHANGE_LINKS) == 0) { 2819 if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CHANGE_LINKS) == 0) {
2821 ShoutError("Script trying to link but PERMISSION_CHANGE_LINKS permission not set!"); 2820 ShoutError("Script trying to link but PERMISSION_CHANGE_LINKS permission not set!");
2822 return; 2821 return;
@@ -2841,7 +2840,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2841 childPrim.RootPart.UpdateFlag = uf; 2840 childPrim.RootPart.UpdateFlag = uf;
2842 } 2841 }
2843 parentPrim.TriggerScriptChangedEvent(Changed.LINK); 2842 parentPrim.TriggerScriptChangedEvent(Changed.LINK);
2844 parentPrim.RootPart.AddFlag(LLObject.ObjectFlags.CreateSelected); 2843 parentPrim.RootPart.AddFlag(PrimFlags.CreateSelected);
2845 parentPrim.GetProperties(client); 2844 parentPrim.GetProperties(client);
2846 2845
2847 ScriptSleep(1000); 2846 ScriptSleep(1000);
@@ -2865,11 +2864,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2865 SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknum); 2864 SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknum);
2866 if (part != null) 2865 if (part != null)
2867 { 2866 {
2868 return part.UUID.ToString(); 2867 return part.ToString();
2869 } 2868 }
2870 else 2869 else
2871 { 2870 {
2872 return LLUUID.Zero.ToString(); 2871 return UUID.Zero.ToString();
2873 } 2872 }
2874 } 2873 }
2875 2874
@@ -2891,7 +2890,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2891 { 2890 {
2892 m_host.AddScriptLPS(1); 2891 m_host.AddScriptLPS(1);
2893 int count = 0; 2892 int count = 0;
2894 foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) 2893 foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
2895 { 2894 {
2896 if (inv.Value.Type == type || type == -1) 2895 if (inv.Value.Type == type || type == -1)
2897 { 2896 {
@@ -2905,7 +2904,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2905 { 2904 {
2906 m_host.AddScriptLPS(1); 2905 m_host.AddScriptLPS(1);
2907 ArrayList keys = new ArrayList(); 2906 ArrayList keys = new ArrayList();
2908 foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) 2907 foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
2909 { 2908 {
2910 if (inv.Value.Type == type || type == -1) 2909 if (inv.Value.Type == type || type == -1)
2911 { 2910 {
@@ -2926,14 +2925,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2926 2925
2927 public void llSetScriptState(string name, int run) 2926 public void llSetScriptState(string name, int run)
2928 { 2927 {
2929 LLUUID item; 2928 UUID item;
2930 2929
2931 m_host.AddScriptLPS(1); 2930 m_host.AddScriptLPS(1);
2932 2931
2933 // These functions are supposed to be robust, 2932 // These functions are supposed to be robust,
2934 // so get the state one step at a time. 2933 // so get the state one step at a time.
2935 2934
2936 if ((item = ScriptByName(name)) != LLUUID.Zero) 2935 if ((item = ScriptByName(name)) != UUID.Zero)
2937 { 2936 {
2938 m_ScriptEngine.SetScriptState(item, run == 0 ? false : true); 2937 m_ScriptEngine.SetScriptState(item, run == 0 ? false : true);
2939 } 2938 }
@@ -2954,17 +2953,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2954 { 2953 {
2955 m_host.AddScriptLPS(1); 2954 m_host.AddScriptLPS(1);
2956 bool found = false; 2955 bool found = false;
2957 LLUUID destId = LLUUID.Zero; 2956 UUID destId = UUID.Zero;
2958 LLUUID objId = LLUUID.Zero; 2957 UUID objId = UUID.Zero;
2959 2958
2960 if (!LLUUID.TryParse(destination, out destId)) 2959 if (!UUID.TryParse(destination, out destId))
2961 { 2960 {
2962 llSay(0, "Could not parse key " + destination); 2961 llSay(0, "Could not parse key " + destination);
2963 return; 2962 return;
2964 } 2963 }
2965 2964
2966 // move the first object found with this inventory name 2965 // move the first object found with this inventory name
2967 foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) 2966 foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
2968 { 2967 {
2969 if (inv.Value.Name == inventory) 2968 if (inv.Value.Name == inventory)
2970 { 2969 {
@@ -3037,7 +3036,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3037 World.CommsManager.UserService.GetAgentByUUID(id); 3036 World.CommsManager.UserService.GetAgentByUUID(id);
3038 3037
3039 if (userProfile == null || userAgent == null) 3038 if (userProfile == null || userAgent == null)
3040 return LLUUID.Zero.ToString(); 3039 return UUID.Zero.ToString();
3041 3040
3042 string reply = String.Empty; 3041 string reply = String.Empty;
3043 3042
@@ -3065,12 +3064,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3065 reply = "0"; 3064 reply = "0";
3066 break; 3065 break;
3067 default: 3066 default:
3068 return LLUUID.Zero.ToString(); // Raise no event 3067 return UUID.Zero.ToString(); // Raise no event
3069 } 3068 }
3070 3069
3071 LLUUID rq = LLUUID.Random(); 3070 UUID rq = UUID.Random();
3072 3071
3073 LLUUID tid = AsyncCommands. 3072 UUID tid = AsyncCommands.
3074 DataserverPlugin.RegisterRequest(m_localID, 3073 DataserverPlugin.RegisterRequest(m_localID,
3075 m_itemID, rq.ToString()); 3074 m_itemID, rq.ToString());
3076 3075
@@ -3089,23 +3088,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3089 { 3088 {
3090 if (item.Type == 3 && item.Name == name) 3089 if (item.Type == 3 && item.Name == name)
3091 { 3090 {
3092 LLUUID tid = AsyncCommands. 3091 UUID tid = AsyncCommands.
3093 DataserverPlugin.RegisterRequest(m_localID, 3092 DataserverPlugin.RegisterRequest(m_localID,
3094 m_itemID, item.AssetID.ToString()); 3093 m_itemID, item.AssetID.ToString());
3095 3094
3096 LLVector3 region = new LLVector3( 3095 Vector3 region = new Vector3(
3097 World.RegionInfo.RegionLocX * Constants.RegionSize, 3096 World.RegionInfo.RegionLocX * Constants.RegionSize,
3098 World.RegionInfo.RegionLocY * Constants.RegionSize, 3097 World.RegionInfo.RegionLocY * Constants.RegionSize,
3099 0); 3098 0);
3100 3099
3101 World.AssetCache.GetAsset(item.AssetID, 3100 World.AssetCache.GetAsset(item.AssetID,
3102 delegate(LLUUID i, AssetBase a) 3101 delegate(UUID i, AssetBase a)
3103 { 3102 {
3104 AssetLandmark lm = new AssetLandmark(a); 3103 AssetLandmark lm = new AssetLandmark(a);
3105 3104
3106 float rx = (uint)(lm.RegionHandle >> 32); 3105 float rx = (uint)(lm.RegionHandle >> 32);
3107 float ry = (uint)lm.RegionHandle; 3106 float ry = (uint)lm.RegionHandle;
3108 region = lm.Position + new LLVector3(rx, ry, 0) - region; 3107 region = lm.Position + new Vector3(rx, ry, 0) - region;
3109 3108
3110 string reply = region.ToString(); 3109 string reply = region.ToString();
3111 AsyncCommands. 3110 AsyncCommands.
@@ -3130,8 +3129,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3130 public void llTeleportAgentHome(string agent) 3129 public void llTeleportAgentHome(string agent)
3131 { 3130 {
3132 m_host.AddScriptLPS(1); 3131 m_host.AddScriptLPS(1);
3133 LLUUID agentId = new LLUUID(); 3132 UUID agentId = new UUID();
3134 if (LLUUID.TryParse(agent, out agentId)) 3133 if (UUID.TryParse(agent, out agentId))
3135 { 3134 {
3136 ScenePresence presence = World.GetScenePresence(agentId); 3135 ScenePresence presence = World.GetScenePresence(agentId);
3137 if (presence != null) 3136 if (presence != null)
@@ -3147,7 +3146,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3147 public void llModifyLand(int action, int brush) 3146 public void llModifyLand(int action, int brush)
3148 { 3147 {
3149 m_host.AddScriptLPS(1); 3148 m_host.AddScriptLPS(1);
3150 World.ExternalChecks.ExternalChecksCanTerraformLand(m_host.OwnerID, new LLVector3(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, 0)); 3149 World.ExternalChecks.ExternalChecksCanTerraformLand(m_host.OwnerID, new Vector3(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, 0));
3151 } 3150 }
3152 3151
3153 public void llCollisionSound(string impact_sound, double impact_volume) 3152 public void llCollisionSound(string impact_sound, double impact_volume)
@@ -3182,7 +3181,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3182 m_host.AddScriptLPS(1); 3181 m_host.AddScriptLPS(1);
3183 3182
3184 // uint partLocalID; 3183 // uint partLocalID;
3185 LLUUID partItemID; 3184 UUID partItemID;
3186 3185
3187 switch ((int)linknum) 3186 switch ((int)linknum)
3188 { 3187 {
@@ -3357,7 +3356,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3357 SceneObjectPart targ = World.GetSceneObjectPart(target); 3356 SceneObjectPart targ = World.GetSceneObjectPart(target);
3358 if (targ == null) 3357 if (targ == null)
3359 return; 3358 return;
3360 targ.ApplyImpulse(new LLVector3((float)impulse.x, (float)impulse.y, (float)impulse.z), local != 0); 3359 targ.ApplyImpulse(new Vector3((float)impulse.x, (float)impulse.y, (float)impulse.z), local != 0);
3361 } 3360 }
3362 3361
3363 public void llPassCollisions(int pass) 3362 public void llPassCollisions(int pass)
@@ -3636,7 +3635,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3636 public string llGetInventoryKey(string name) 3635 public string llGetInventoryKey(string name)
3637 { 3636 {
3638 m_host.AddScriptLPS(1); 3637 m_host.AddScriptLPS(1);
3639 foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) 3638 foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
3640 { 3639 {
3641 if (inv.Value.Name == name) 3640 if (inv.Value.Name == name)
3642 { 3641 {
@@ -3646,11 +3645,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3646 } 3645 }
3647 else 3646 else
3648 { 3647 {
3649 return LLUUID.Zero.ToString(); 3648 return UUID.Zero.ToString();
3650 } 3649 }
3651 } 3650 }
3652 } 3651 }
3653 return LLUUID.Zero.ToString(); 3652 return UUID.Zero.ToString();
3654 } 3653 }
3655 3654
3656 public void llAllowInventoryDrop(int add) 3655 public void llAllowInventoryDrop(int add)
@@ -3668,10 +3667,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3668 m_host.AddScriptLPS(1); 3667 m_host.AddScriptLPS(1);
3669 3668
3670 LSL_Types.Vector3 SunDoubleVector3; 3669 LSL_Types.Vector3 SunDoubleVector3;
3671 LLVector3 SunFloatVector3; 3670 Vector3 SunFloatVector3;
3672 3671
3673 // sunPosition estate setting is set in OpenSim.Region.Environment.Modules.SunModule 3672 // sunPosition estate setting is set in OpenSim.Region.Environment.Modules.SunModule
3674 // have to convert from LLVector3 (float) to LSL_Types.Vector3 (double) 3673 // have to convert from Vector3 (float) to LSL_Types.Vector3 (double)
3675 SunFloatVector3 = World.RegionInfo.RegionSettings.SunVector; 3674 SunFloatVector3 = World.RegionInfo.RegionSettings.SunVector;
3676 SunDoubleVector3.x = (double)SunFloatVector3.X; 3675 SunDoubleVector3.x = (double)SunFloatVector3.X;
3677 SunDoubleVector3.y = (double)SunFloatVector3.Y; 3676 SunDoubleVector3.y = (double)SunFloatVector3.Y;
@@ -3683,7 +3682,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3683 public LSL_Types.Vector3 llGetTextureOffset(int face) 3682 public LSL_Types.Vector3 llGetTextureOffset(int face)
3684 { 3683 {
3685 m_host.AddScriptLPS(1); 3684 m_host.AddScriptLPS(1);
3686 LLObject.TextureEntry tex = m_host.Shape.Textures; 3685 Primitive.TextureEntry tex = m_host.Shape.Textures;
3687 LSL_Types.Vector3 offset; 3686 LSL_Types.Vector3 offset;
3688 if (face == -1) 3687 if (face == -1)
3689 { 3688 {
@@ -3698,7 +3697,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3698 public LSL_Types.Vector3 llGetTextureScale(int side) 3697 public LSL_Types.Vector3 llGetTextureScale(int side)
3699 { 3698 {
3700 m_host.AddScriptLPS(1); 3699 m_host.AddScriptLPS(1);
3701 LLObject.TextureEntry tex = m_host.Shape.Textures; 3700 Primitive.TextureEntry tex = m_host.Shape.Textures;
3702 LSL_Types.Vector3 scale; 3701 LSL_Types.Vector3 scale;
3703 if (side == -1) 3702 if (side == -1)
3704 { 3703 {
@@ -3713,7 +3712,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3713 public double llGetTextureRot(int face) 3712 public double llGetTextureRot(int face)
3714 { 3713 {
3715 m_host.AddScriptLPS(1); 3714 m_host.AddScriptLPS(1);
3716 LLObject.TextureEntry tex = m_host.Shape.Textures; 3715 Primitive.TextureEntry tex = m_host.Shape.Textures;
3717 if (face == -1) 3716 if (face == -1)
3718 { 3717 {
3719 face = 0; 3718 face = 0;
@@ -3730,14 +3729,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3730 public string llGetOwnerKey(string id) 3729 public string llGetOwnerKey(string id)
3731 { 3730 {
3732 m_host.AddScriptLPS(1); 3731 m_host.AddScriptLPS(1);
3733 LLUUID key = new LLUUID(); 3732 UUID key = new UUID();
3734 if (LLUUID.TryParse(id, out key)) 3733 if (UUID.TryParse(id, out key))
3735 { 3734 {
3736 return World.GetSceneObjectPart(World.Entities[key].LocalId).OwnerID.ToString(); 3735 return World.GetSceneObjectPart(World.Entities[key].LocalId).OwnerID.ToString();
3737 } 3736 }
3738 else 3737 else
3739 { 3738 {
3740 return LLUUID.Zero.ToString(); 3739 return UUID.Zero.ToString();
3741 } 3740 }
3742 } 3741 }
3743 3742
@@ -3946,8 +3945,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3946 return 2; 3945 return 2;
3947 if (src.Data[index] is String) 3946 if (src.Data[index] is String)
3948 { 3947 {
3949 LLUUID tuuid; 3948 UUID tuuid;
3950 if (LLUUID.TryParse(src.Data[index].ToString(), out tuuid)) 3949 if (UUID.TryParse(src.Data[index].ToString(), out tuuid))
3951 { 3950 {
3952 return 3; 3951 return 3;
3953 } 3952 }
@@ -4359,8 +4358,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4359 public string llKey2Name(string id) 4358 public string llKey2Name(string id)
4360 { 4359 {
4361 m_host.AddScriptLPS(1); 4360 m_host.AddScriptLPS(1);
4362 LLUUID key = new LLUUID(); 4361 UUID key = new UUID();
4363 if (LLUUID.TryParse(id,out key)) 4362 if (UUID.TryParse(id,out key))
4364 { 4363 {
4365 ScenePresence presence = World.GetScenePresence(key); 4364 ScenePresence presence = World.GetScenePresence(key);
4366 4365
@@ -4384,7 +4383,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4384 { 4383 {
4385 m_host.AddScriptLPS(1); 4384 m_host.AddScriptLPS(1);
4386 Primitive.TextureAnimation pTexAnim = new Primitive.TextureAnimation(); 4385 Primitive.TextureAnimation pTexAnim = new Primitive.TextureAnimation();
4387 pTexAnim.Flags =(uint) mode; 4386 pTexAnim.Flags = (Primitive.TextureAnimMode)mode;
4388 4387
4389 //ALL_SIDES 4388 //ALL_SIDES
4390 if (face == -1) 4389 if (face == -1)
@@ -4473,8 +4472,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4473 public LSL_Types.LSLInteger llOverMyLand(string id) 4472 public LSL_Types.LSLInteger llOverMyLand(string id)
4474 { 4473 {
4475 m_host.AddScriptLPS(1); 4474 m_host.AddScriptLPS(1);
4476 LLUUID key = new LLUUID(); 4475 UUID key = new UUID();
4477 if (LLUUID.TryParse(id,out key)) 4476 if (UUID.TryParse(id,out key))
4478 { 4477 {
4479 ScenePresence presence = World.GetScenePresence(key); 4478 ScenePresence presence = World.GetScenePresence(key);
4480 if (presence != null) // object is an avatar 4479 if (presence != null) // object is an avatar
@@ -4517,8 +4516,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4517 { 4516 {
4518 m_host.AddScriptLPS(1); 4517 m_host.AddScriptLPS(1);
4519 4518
4520 LLUUID key = new LLUUID(); 4519 UUID key = new UUID();
4521 if (LLUUID.TryParse(id, out key)) 4520 if (UUID.TryParse(id, out key))
4522 { 4521 {
4523 ScenePresence av = World.GetScenePresence(key); 4522 ScenePresence av = World.GetScenePresence(key);
4524 4523
@@ -4656,8 +4655,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4656 Primitive.ParticleSystem ps = new Primitive.ParticleSystem(); 4655 Primitive.ParticleSystem ps = new Primitive.ParticleSystem();
4657 4656
4658 // TODO find out about the other defaults and add them here 4657 // TODO find out about the other defaults and add them here
4659 ps.PartStartColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); 4658 ps.PartStartColor = new Color4(1.0f, 1.0f, 1.0f, 1.0f);
4660 ps.PartEndColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); 4659 ps.PartEndColor = new Color4(1.0f, 1.0f, 1.0f, 1.0f);
4661 ps.PartStartScaleX = 1.0f; 4660 ps.PartStartScaleX = 1.0f;
4662 ps.PartStartScaleY = 1.0f; 4661 ps.PartStartScaleY = 1.0f;
4663 ps.PartEndScaleX = 1.0f; 4662 ps.PartEndScaleX = 1.0f;
@@ -4705,7 +4704,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4705 4704
4706 case (int)ScriptBaseClass.PSYS_PART_END_COLOR: 4705 case (int)ScriptBaseClass.PSYS_PART_END_COLOR:
4707 tempv = (LSL_Types.Vector3)rules.Data[i + 1]; 4706 tempv = (LSL_Types.Vector3)rules.Data[i + 1];
4708 //prules.PartEndColor = new LLColor(tempv.x,tempv.y,tempv.z,1); 4707 //prules.PartEndColor = new Color4(tempv.x,tempv.y,tempv.z,1);
4709 4708
4710 prules.PartEndColor.R = (float)tempv.x; 4709 prules.PartEndColor.R = (float)tempv.x;
4711 prules.PartEndColor.G = (float)tempv.y; 4710 prules.PartEndColor.G = (float)tempv.y;
@@ -4784,8 +4783,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4784 break; 4783 break;
4785 4784
4786 case (int)ScriptBaseClass.PSYS_SRC_TARGET_KEY: 4785 case (int)ScriptBaseClass.PSYS_SRC_TARGET_KEY:
4787 LLUUID key = LLUUID.Zero; 4786 UUID key = UUID.Zero;
4788 if (LLUUID.TryParse(rules.Data[i + 1].ToString(), out key)) 4787 if (UUID.TryParse(rules.Data[i + 1].ToString(), out key))
4789 { 4788 {
4790 prules.Target = key; 4789 prules.Target = key;
4791 } 4790 }
@@ -4829,37 +4828,37 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4829 NotImplemented("llGroundRepel"); 4828 NotImplemented("llGroundRepel");
4830 } 4829 }
4831 4830
4832 private LLUUID GetTaskInventoryItem(string name) 4831 private UUID GetTaskInventoryItem(string name)
4833 { 4832 {
4834 foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) 4833 foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
4835 { 4834 {
4836 if (inv.Value.Name == name) 4835 if (inv.Value.Name == name)
4837 return inv.Key; 4836 return inv.Key;
4838 } 4837 }
4839 return LLUUID.Zero; 4838 return UUID.Zero;
4840 } 4839 }
4841 4840
4842 public void llGiveInventoryList(string destination, string category, LSL_Types.list inventory) 4841 public void llGiveInventoryList(string destination, string category, LSL_Types.list inventory)
4843 { 4842 {
4844 m_host.AddScriptLPS(1); 4843 m_host.AddScriptLPS(1);
4845 4844
4846 LLUUID destID; 4845 UUID destID;
4847 if (!LLUUID.TryParse(destination, out destID)) 4846 if (!UUID.TryParse(destination, out destID))
4848 return; 4847 return;
4849 4848
4850 List<LLUUID> itemList = new List<LLUUID>(); 4849 List<UUID> itemList = new List<UUID>();
4851 4850
4852 foreach (Object item in inventory.Data) 4851 foreach (Object item in inventory.Data)
4853 { 4852 {
4854 LLUUID itemID; 4853 UUID itemID;
4855 if (LLUUID.TryParse(item.ToString(), out itemID)) 4854 if (UUID.TryParse(item.ToString(), out itemID))
4856 { 4855 {
4857 itemList.Add(itemID); 4856 itemList.Add(itemID);
4858 } 4857 }
4859 else 4858 else
4860 { 4859 {
4861 itemID = GetTaskInventoryItem(item.ToString()); 4860 itemID = GetTaskInventoryItem(item.ToString());
4862 if (itemID != LLUUID.Zero) 4861 if (itemID != UUID.Zero)
4863 itemList.Add(itemID); 4862 itemList.Add(itemID);
4864 } 4863 }
4865 } 4864 }
@@ -4920,7 +4919,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4920 rot.z = 1; // ZERO_ROTATION = 0,0,0,1 4919 rot.z = 1; // ZERO_ROTATION = 0,0,0,1
4921 4920
4922 m_host.SitTargetPosition = new Vector3((float)offset.x, (float)offset.y, (float)offset.z); 4921 m_host.SitTargetPosition = new Vector3((float)offset.x, (float)offset.y, (float)offset.z);
4923 m_host.SitTargetOrientation = new Quaternion((float)rot.s, (float)rot.x, (float)rot.y, (float)rot.z); 4922 m_host.SitTargetOrientation = new Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s);
4924 } 4923 }
4925 4924
4926 public string llAvatarOnSitTarget() 4925 public string llAvatarOnSitTarget()
@@ -4932,12 +4931,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4932 public void llAddToLandPassList(string avatar, double hours) 4931 public void llAddToLandPassList(string avatar, double hours)
4933 { 4932 {
4934 m_host.AddScriptLPS(1); 4933 m_host.AddScriptLPS(1);
4935 LLUUID key; 4934 UUID key;
4936 LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData; 4935 LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData;
4937 if (land.OwnerID == m_host.OwnerID) 4936 if (land.OwnerID == m_host.OwnerID)
4938 { 4937 {
4939 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); 4938 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
4940 if (LLUUID.TryParse(avatar, out key)) 4939 if (UUID.TryParse(avatar, out key))
4941 { 4940 {
4942 entry.AgentID = key; 4941 entry.AgentID = key;
4943 entry.Flags = ParcelManager.AccessList.Access; 4942 entry.Flags = ParcelManager.AccessList.Access;
@@ -4963,13 +4962,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4963 public void llSetCameraEyeOffset(LSL_Types.Vector3 offset) 4962 public void llSetCameraEyeOffset(LSL_Types.Vector3 offset)
4964 { 4963 {
4965 m_host.AddScriptLPS(1); 4964 m_host.AddScriptLPS(1);
4966 m_host.SetCameraEyeOffset(new LLVector3((float)offset.x, (float)offset.y, (float)offset.z)); 4965 m_host.SetCameraEyeOffset(new Vector3((float)offset.x, (float)offset.y, (float)offset.z));
4967 } 4966 }
4968 4967
4969 public void llSetCameraAtOffset(LSL_Types.Vector3 offset) 4968 public void llSetCameraAtOffset(LSL_Types.Vector3 offset)
4970 { 4969 {
4971 m_host.AddScriptLPS(1); 4970 m_host.AddScriptLPS(1);
4972 m_host.SetCameraAtOffset(new LLVector3((float)offset.x, (float)offset.y, (float)offset.z)); 4971 m_host.SetCameraAtOffset(new Vector3((float)offset.x, (float)offset.y, (float)offset.z));
4973 } 4972 }
4974 4973
4975 public string llDumpList2String(LSL_Types.list src, string seperator) 4974 public string llDumpList2String(LSL_Types.list src, string seperator)
@@ -4991,7 +4990,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4991 public LSL_Types.LSLInteger llScriptDanger(LSL_Types.Vector3 pos) 4990 public LSL_Types.LSLInteger llScriptDanger(LSL_Types.Vector3 pos)
4992 { 4991 {
4993 m_host.AddScriptLPS(1); 4992 m_host.AddScriptLPS(1);
4994 bool result = World.scriptDanger(m_host.LocalId, new LLVector3((float)pos.x, (float)pos.y, (float)pos.z)); 4993 bool result = World.scriptDanger(m_host.LocalId, new Vector3((float)pos.x, (float)pos.y, (float)pos.z));
4995 if (result) 4994 if (result)
4996 { 4995 {
4997 return 1; 4996 return 1;
@@ -5006,8 +5005,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5006 public void llDialog(string avatar, string message, LSL_Types.list buttons, int chat_channel) 5005 public void llDialog(string avatar, string message, LSL_Types.list buttons, int chat_channel)
5007 { 5006 {
5008 m_host.AddScriptLPS(1); 5007 m_host.AddScriptLPS(1);
5009 LLUUID av = new LLUUID(); 5008 UUID av = new UUID();
5010 if (!LLUUID.TryParse(avatar,out av)) 5009 if (!UUID.TryParse(avatar,out av))
5011 { 5010 {
5012 LSLError("First parameter to llDialog needs to be a key"); 5011 LSLError("First parameter to llDialog needs to be a key");
5013 return; 5012 return;
@@ -5032,7 +5031,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5032 } 5031 }
5033 buts[i] = buttons.Data[i].ToString(); 5032 buts[i] = buttons.Data[i].ToString();
5034 } 5033 }
5035 World.SendDialogToUser(av, m_host.Name, m_host.UUID, m_host.OwnerID, message, new LLUUID("00000000-0000-2222-3333-100000001000"), chat_channel, buts); 5034 World.SendDialogToUser(av, m_host.Name, m_host.UUID, m_host.OwnerID, message, new UUID("00000000-0000-2222-3333-100000001000"), chat_channel, buts);
5036 // ScriptSleep(1000); 5035 // ScriptSleep(1000);
5037 } 5036 }
5038 5037
@@ -5049,11 +5048,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5049 5048
5050 public void llResetOtherScript(string name) 5049 public void llResetOtherScript(string name)
5051 { 5050 {
5052 LLUUID item; 5051 UUID item;
5053 5052
5054 m_host.AddScriptLPS(1); 5053 m_host.AddScriptLPS(1);
5055 5054
5056 if ((item = ScriptByName(name)) != LLUUID.Zero) 5055 if ((item = ScriptByName(name)) != UUID.Zero)
5057 m_ScriptEngine.ResetScript(item); 5056 m_ScriptEngine.ResetScript(item);
5058 else 5057 else
5059 ShoutError("llResetOtherScript: script "+name+" not found"); 5058 ShoutError("llResetOtherScript: script "+name+" not found");
@@ -5061,11 +5060,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5061 5060
5062 public LSL_Types.LSLInteger llGetScriptState(string name) 5061 public LSL_Types.LSLInteger llGetScriptState(string name)
5063 { 5062 {
5064 LLUUID item; 5063 UUID item;
5065 5064
5066 m_host.AddScriptLPS(1); 5065 m_host.AddScriptLPS(1);
5067 5066
5068 if ((item = ScriptByName(name)) != LLUUID.Zero) 5067 if ((item = ScriptByName(name)) != UUID.Zero)
5069 { 5068 {
5070 return m_ScriptEngine.GetScriptState(item) ?1:0; 5069 return m_ScriptEngine.GetScriptState(item) ?1:0;
5071 } 5070 }
@@ -5095,10 +5094,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5095 { 5094 {
5096 m_host.AddScriptLPS(1); 5095 m_host.AddScriptLPS(1);
5097 bool found = false; 5096 bool found = false;
5098 LLUUID destId = LLUUID.Zero; 5097 UUID destId = UUID.Zero;
5099 LLUUID srcId = LLUUID.Zero; 5098 UUID srcId = UUID.Zero;
5100 5099
5101 if (!LLUUID.TryParse(target, out destId)) 5100 if (!UUID.TryParse(target, out destId))
5102 { 5101 {
5103 llSay(0, "Could not parse key " + target); 5102 llSay(0, "Could not parse key " + target);
5104 return; 5103 return;
@@ -5111,7 +5110,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5111 } 5110 }
5112 5111
5113 // copy the first script found with this inventory name 5112 // copy the first script found with this inventory name
5114 foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) 5113 foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
5115 { 5114 {
5116 if (inv.Value.Name == name) 5115 if (inv.Value.Name == name)
5117 { 5116 {
@@ -5143,8 +5142,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5143 IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>(); 5142 IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>();
5144 if (xmlrpcMod.IsEnabled()) 5143 if (xmlrpcMod.IsEnabled())
5145 { 5144 {
5146 LLUUID channelID = xmlrpcMod.OpenXMLRPCChannel(m_localID, m_itemID, LLUUID.Zero); 5145 UUID channelID = xmlrpcMod.OpenXMLRPCChannel(m_localID, m_itemID, UUID.Zero);
5147 object[] resobj = new object[] { new LSL_Types.LSLInteger(1), new LSL_Types.LSLString(channelID.ToString()), new LSL_Types.LSLString(LLUUID.Zero.ToString()), new LSL_Types.LSLString(String.Empty), new LSL_Types.LSLInteger(0), new LSL_Types.LSLString(String.Empty) }; 5146 object[] resobj = new object[] { new LSL_Types.LSLInteger(1), new LSL_Types.LSLString(channelID.ToString()), new LSL_Types.LSLString(UUID.Zero.ToString()), new LSL_Types.LSLString(String.Empty), new LSL_Types.LSLInteger(0), new LSL_Types.LSLString(String.Empty) };
5148 m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams( 5147 m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams(
5149 "remote_data", resobj, 5148 "remote_data", resobj,
5150 new DetectParams[0])); 5149 new DetectParams[0]));
@@ -5464,9 +5463,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5464 private void SetPrimitiveShapeParams(SceneObjectPart part, string map, int type) 5463 private void SetPrimitiveShapeParams(SceneObjectPart part, string map, int type)
5465 { 5464 {
5466 ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); 5465 ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock();
5467 LLUUID sculptId; 5466 UUID sculptId;
5468 5467
5469 if (!LLUUID.TryParse(map, out sculptId)) 5468 if (!UUID.TryParse(map, out sculptId))
5470 { 5469 {
5471 llSay(0, "Could not parse key " + map); 5470 llSay(0, "Could not parse key " + map);
5472 return; 5471 return;
@@ -5896,9 +5895,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5896 ScenePresence av = World.GetScenePresence(id); 5895 ScenePresence av = World.GetScenePresence(id);
5897 if (av == null) 5896 if (av == null)
5898 return l; 5897 return l;
5899 LLUUID[] anims; 5898 UUID[] anims;
5900 anims = av.GetAnimationArray(); 5899 anims = av.GetAnimationArray();
5901 foreach (LLUUID foo in anims) 5900 foreach (UUID foo in anims)
5902 l.Add(foo.ToString()); 5901 l.Add(foo.ToString());
5903 return l; 5902 return l;
5904 } 5903 }
@@ -5906,8 +5905,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5906 public void llSetParcelMusicURL(string url) 5905 public void llSetParcelMusicURL(string url)
5907 { 5906 {
5908 m_host.AddScriptLPS(1); 5907 m_host.AddScriptLPS(1);
5909 LLUUID landowner = World.GetLandOwner(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); 5908 UUID landowner = World.GetLandOwner(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
5910 if (landowner == LLUUID.Zero) 5909 if (landowner == UUID.Zero)
5911 { 5910 {
5912 return; 5911 return;
5913 } 5912 }
@@ -5922,9 +5921,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5922 public void osSetParcelMediaURL(string url) 5921 public void osSetParcelMediaURL(string url)
5923 { 5922 {
5924 m_host.AddScriptLPS(1); 5923 m_host.AddScriptLPS(1);
5925 LLUUID landowner = World.GetLandOwner(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); 5924 UUID landowner = World.GetLandOwner(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
5926 5925
5927 if (landowner == LLUUID.Zero) 5926 if (landowner == UUID.Zero)
5928 { 5927 {
5929 return; 5928 return;
5930 } 5929 }
@@ -5978,8 +5977,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5978 SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknumber); 5977 SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknumber);
5979 if (linknumber > -1) 5978 if (linknumber > -1)
5980 { 5979 {
5981 LLObject.TextureEntry tex = part.Shape.Textures; 5980 Primitive.TextureEntry tex = part.Shape.Textures;
5982 LLColor texcolor; 5981 Color4 texcolor;
5983 if (face > -1) 5982 if (face > -1)
5984 { 5983 {
5985 texcolor = tex.CreateFace((uint)face).RGBA; 5984 texcolor = tex.CreateFace((uint)face).RGBA;
@@ -6017,8 +6016,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6017 { 6016 {
6018 linknumber = w; 6017 linknumber = w;
6019 part = m_host.ParentGroup.GetLinkNumPart(linknumber); 6018 part = m_host.ParentGroup.GetLinkNumPart(linknumber);
6020 LLObject.TextureEntry tex = part.Shape.Textures; 6019 Primitive.TextureEntry tex = part.Shape.Textures;
6021 LLColor texcolor; 6020 Color4 texcolor;
6022 if (face > -1) 6021 if (face > -1)
6023 { 6022 {
6024 texcolor = tex.CreateFace((uint)face).RGBA; 6023 texcolor = tex.CreateFace((uint)face).RGBA;
@@ -6086,21 +6085,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6086 break; 6085 break;
6087 6086
6088 case (int)ScriptBaseClass.PRIM_PHYSICS: 6087 case (int)ScriptBaseClass.PRIM_PHYSICS:
6089 if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Physics) != 0) 6088 if ((m_host.GetEffectiveObjectFlags() & (uint)PrimFlags.Physics) != 0)
6090 res.Add(new LSL_Types.LSLInteger(1)); 6089 res.Add(new LSL_Types.LSLInteger(1));
6091 else 6090 else
6092 res.Add(new LSL_Types.LSLInteger(0)); 6091 res.Add(new LSL_Types.LSLInteger(0));
6093 break; 6092 break;
6094 6093
6095 case (int)ScriptBaseClass.PRIM_TEMP_ON_REZ: 6094 case (int)ScriptBaseClass.PRIM_TEMP_ON_REZ:
6096 if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.TemporaryOnRez) != 0) 6095 if ((m_host.GetEffectiveObjectFlags() & (uint)PrimFlags.TemporaryOnRez) != 0)
6097 res.Add(new LSL_Types.LSLInteger(1)); 6096 res.Add(new LSL_Types.LSLInteger(1));
6098 else 6097 else
6099 res.Add(new LSL_Types.LSLInteger(0)); 6098 res.Add(new LSL_Types.LSLInteger(0));
6100 break; 6099 break;
6101 6100
6102 case (int)ScriptBaseClass.PRIM_PHANTOM: 6101 case (int)ScriptBaseClass.PRIM_PHANTOM:
6103 if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Phantom) != 0) 6102 if ((m_host.GetEffectiveObjectFlags() & (uint)PrimFlags.Phantom) != 0)
6104 res.Add(new LSL_Types.LSLInteger(1)); 6103 res.Add(new LSL_Types.LSLInteger(1));
6105 else 6104 else
6106 res.Add(new LSL_Types.LSLInteger(0)); 6105 res.Add(new LSL_Types.LSLInteger(0));
@@ -6205,8 +6204,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6205 if (face == -1) 6204 if (face == -1)
6206 face = 0; 6205 face = 0;
6207 6206
6208 LLObject.TextureEntry tex = m_host.Shape.Textures; 6207 Primitive.TextureEntry tex = m_host.Shape.Textures;
6209 LLObject.TextureEntryFace texface = tex.GetFace((uint)face); 6208 Primitive.TextureEntryFace texface = tex.GetFace((uint)face);
6210 6209
6211 res.Add(new LSL_Types.LSLString(texface.TextureID.ToString())); 6210 res.Add(new LSL_Types.LSLString(texface.TextureID.ToString()));
6212 res.Add(new LSL_Types.Vector3(texface.RepeatU, 6211 res.Add(new LSL_Types.Vector3(texface.RepeatU,
@@ -6225,7 +6224,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6225 face=Convert.ToInt32(rules.Data[idx++].ToString()); 6224 face=Convert.ToInt32(rules.Data[idx++].ToString());
6226 6225
6227 tex = m_host.Shape.Textures; 6226 tex = m_host.Shape.Textures;
6228 LLColor texcolor; 6227 Color4 texcolor;
6229 if (face == -1) // TMP: Until we can determine number of sides, ALL_SIDES (-1) will return default color 6228 if (face == -1) // TMP: Until we can determine number of sides, ALL_SIDES (-1) will return default color
6230 texcolor = tex.DefaultTexture.RGBA; 6229 texcolor = tex.DefaultTexture.RGBA;
6231 else 6230 else
@@ -6579,7 +6578,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6579 public void llSetLocalRot(LSL_Types.Quaternion rot) 6578 public void llSetLocalRot(LSL_Types.Quaternion rot)
6580 { 6579 {
6581 m_host.AddScriptLPS(1); 6580 m_host.AddScriptLPS(1);
6582 m_host.RotationOffset = new LLQuaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s); 6581 m_host.RotationOffset = new Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s);
6583 // ScriptSleep(200); 6582 // ScriptSleep(200);
6584 } 6583 }
6585 6584
@@ -6835,7 +6834,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6835 public LSL_Types.LSLInteger llGetInventoryPermMask(string item, int mask) 6834 public LSL_Types.LSLInteger llGetInventoryPermMask(string item, int mask)
6836 { 6835 {
6837 m_host.AddScriptLPS(1); 6836 m_host.AddScriptLPS(1);
6838 foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) 6837 foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
6839 { 6838 {
6840 if (inv.Value.Name == item) 6839 if (inv.Value.Name == item)
6841 { 6840 {
@@ -6866,7 +6865,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6866 public string llGetInventoryCreator(string item) 6865 public string llGetInventoryCreator(string item)
6867 { 6866 {
6868 m_host.AddScriptLPS(1); 6867 m_host.AddScriptLPS(1);
6869 foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) 6868 foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
6870 { 6869 {
6871 if (inv.Value.Name == item) 6870 if (inv.Value.Name == item)
6872 { 6871 {
@@ -6881,7 +6880,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6881 { 6880 {
6882 m_host.AddScriptLPS(1); 6881 m_host.AddScriptLPS(1);
6883 6882
6884 World.SimChatBroadcast(Helpers.StringToField(msg), ChatTypeEnum.Owner, 0, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false); 6883 World.SimChatBroadcast(Utils.StringToBytes(msg), ChatTypeEnum.Owner, 0, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false);
6885// IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 6884// IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
6886// wComm.DeliverMessage(ChatTypeEnum.Owner, 0, m_host.Name, m_host.UUID, msg); 6885// wComm.DeliverMessage(ChatTypeEnum.Owner, 0, m_host.Name, m_host.UUID, msg);
6887 } 6886 }
@@ -6902,7 +6901,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6902 if (info == null) 6901 if (info == null)
6903 { 6902 {
6904 // ScriptSleep(1000); 6903 // ScriptSleep(1000);
6905 return LLUUID.Zero.ToString(); 6904 return UUID.Zero.ToString();
6906 } 6905 }
6907 reply = new LSL_Types.Vector3( 6906 reply = new LSL_Types.Vector3(
6908 info.RegionLocX * Constants.RegionSize, 6907 info.RegionLocX * Constants.RegionSize,
@@ -6919,7 +6918,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6919 if (info == null) 6918 if (info == null)
6920 { 6919 {
6921 // ScriptSleep(1000); 6920 // ScriptSleep(1000);
6922 return LLUUID.Zero.ToString(); 6921 return UUID.Zero.ToString();
6923 } 6922 }
6924 int access = info.RegionSettings.Maturity; 6923 int access = info.RegionSettings.Maturity;
6925 if (access == 0) 6924 if (access == 0)
@@ -6934,11 +6933,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6934 break; 6933 break;
6935 default: 6934 default:
6936 // ScriptSleep(1000); 6935 // ScriptSleep(1000);
6937 return LLUUID.Zero.ToString(); // Raise no event 6936 return UUID.Zero.ToString(); // Raise no event
6938 } 6937 }
6939 LLUUID rq = LLUUID.Random(); 6938 UUID rq = UUID.Random();
6940 6939
6941 LLUUID tid = AsyncCommands. 6940 UUID tid = AsyncCommands.
6942 DataserverPlugin.RegisterRequest(m_localID, m_itemID, rq.ToString()); 6941 DataserverPlugin.RegisterRequest(m_localID, m_itemID, rq.ToString());
6943 6942
6944 AsyncCommands. 6943 AsyncCommands.
@@ -6950,7 +6949,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6950 catch(Exception e) 6949 catch(Exception e)
6951 { 6950 {
6952 Console.WriteLine(e.ToString()); 6951 Console.WriteLine(e.ToString());
6953 return LLUUID.Zero.ToString(); 6952 return UUID.Zero.ToString();
6954 } 6953 }
6955 } 6954 }
6956 6955
@@ -6963,8 +6962,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6963 public double llGetObjectMass(string id) 6962 public double llGetObjectMass(string id)
6964 { 6963 {
6965 m_host.AddScriptLPS(1); 6964 m_host.AddScriptLPS(1);
6966 LLUUID key = new LLUUID(); 6965 UUID key = new UUID();
6967 if (LLUUID.TryParse(id,out key)) 6966 if (UUID.TryParse(id,out key))
6968 { 6967 {
6969 return (double)World.GetSceneObjectPart(World.Entities[key].LocalId).GetMass(); 6968 return (double)World.GetSceneObjectPart(World.Entities[key].LocalId).GetMass();
6970 } 6969 }
@@ -7056,7 +7055,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7056 public void llLoadURL(string avatar_id, string message, string url) 7055 public void llLoadURL(string avatar_id, string message, string url)
7057 { 7056 {
7058 m_host.AddScriptLPS(1); 7057 m_host.AddScriptLPS(1);
7059 LLUUID avatarId = new LLUUID(avatar_id); 7058 UUID avatarId = new UUID(avatar_id);
7060 m_ScriptEngine.World.SendUrlToUser(avatarId, m_host.Name, m_host.UUID, m_host.ObjectOwner, false, message, 7059 m_ScriptEngine.World.SendUrlToUser(avatarId, m_host.Name, m_host.UUID, m_host.ObjectOwner, false, message,
7061 url); 7060 url);
7062 // ScriptSleep(10000); 7061 // ScriptSleep(10000);
@@ -7202,7 +7201,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7202 public LSL_Types.LSLInteger llGetInventoryType(string name) 7201 public LSL_Types.LSLInteger llGetInventoryType(string name)
7203 { 7202 {
7204 m_host.AddScriptLPS(1); 7203 m_host.AddScriptLPS(1);
7205 foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) 7204 foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
7206 { 7205 {
7207 if (inv.Value.Name == name) 7206 if (inv.Value.Name == name)
7208 { 7207 {
@@ -7231,10 +7230,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7231 public LSL_Types.Vector3 llGetCameraPos() 7230 public LSL_Types.Vector3 llGetCameraPos()
7232 { 7231 {
7233 m_host.AddScriptLPS(1); 7232 m_host.AddScriptLPS(1);
7234 LLUUID invItemID=InventorySelf(); 7233 UUID invItemID=InventorySelf();
7235 if (invItemID == LLUUID.Zero) 7234 if (invItemID == UUID.Zero)
7236 return new LSL_Types.Vector3(); 7235 return new LSL_Types.Vector3();
7237 if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) 7236 if (m_host.TaskInventory[invItemID].PermsGranter == UUID.Zero)
7238 return new LSL_Types.Vector3(); 7237 return new LSL_Types.Vector3();
7239 if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_TRACK_CAMERA) == 0) 7238 if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_TRACK_CAMERA) == 0)
7240 { 7239 {
@@ -7244,7 +7243,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7244 ScenePresence presence = World.GetScenePresence(m_host.OwnerID); 7243 ScenePresence presence = World.GetScenePresence(m_host.OwnerID);
7245 if (presence != null) 7244 if (presence != null)
7246 { 7245 {
7247 LSL_Types.Vector3 pos = new LSL_Types.Vector3(presence.CameraPosition.x,presence.CameraPosition.y,presence.CameraPosition.z); 7246 LSL_Types.Vector3 pos = new LSL_Types.Vector3(presence.CameraPosition.X, presence.CameraPosition.Y, presence.CameraPosition.Z);
7248 return pos; 7247 return pos;
7249 } 7248 }
7250 return new LSL_Types.Vector3(); 7249 return new LSL_Types.Vector3();
@@ -7307,12 +7306,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7307 public void llAddToLandBanList(string avatar, double hours) 7306 public void llAddToLandBanList(string avatar, double hours)
7308 { 7307 {
7309 m_host.AddScriptLPS(1); 7308 m_host.AddScriptLPS(1);
7310 LLUUID key; 7309 UUID key;
7311 LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData; 7310 LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData;
7312 if (land.OwnerID == m_host.OwnerID) 7311 if (land.OwnerID == m_host.OwnerID)
7313 { 7312 {
7314 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); 7313 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
7315 if (LLUUID.TryParse(avatar, out key)) 7314 if (UUID.TryParse(avatar, out key))
7316 { 7315 {
7317 entry.AgentID = key; 7316 entry.AgentID = key;
7318 entry.Flags = ParcelManager.AccessList.Ban; 7317 entry.Flags = ParcelManager.AccessList.Ban;
@@ -7326,11 +7325,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7326 public void llRemoveFromLandPassList(string avatar) 7325 public void llRemoveFromLandPassList(string avatar)
7327 { 7326 {
7328 m_host.AddScriptLPS(1); 7327 m_host.AddScriptLPS(1);
7329 LLUUID key; 7328 UUID key;
7330 LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData; 7329 LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData;
7331 if (land.OwnerID == m_host.OwnerID) 7330 if (land.OwnerID == m_host.OwnerID)
7332 { 7331 {
7333 if (LLUUID.TryParse(avatar, out key)) 7332 if (UUID.TryParse(avatar, out key))
7334 { 7333 {
7335 foreach (ParcelManager.ParcelAccessEntry entry in land.ParcelAccessList) 7334 foreach (ParcelManager.ParcelAccessEntry entry in land.ParcelAccessList)
7336 { 7335 {
@@ -7348,11 +7347,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7348 public void llRemoveFromLandBanList(string avatar) 7347 public void llRemoveFromLandBanList(string avatar)
7349 { 7348 {
7350 m_host.AddScriptLPS(1); 7349 m_host.AddScriptLPS(1);
7351 LLUUID key; 7350 UUID key;
7352 LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData; 7351 LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData;
7353 if (land.OwnerID == m_host.OwnerID) 7352 if (land.OwnerID == m_host.OwnerID)
7354 { 7353 {
7355 if (LLUUID.TryParse(avatar, out key)) 7354 if (UUID.TryParse(avatar, out key))
7356 { 7355 {
7357 foreach (ParcelManager.ParcelAccessEntry entry in land.ParcelAccessList) 7356 foreach (ParcelManager.ParcelAccessEntry entry in land.ParcelAccessList)
7358 { 7357 {
@@ -7372,16 +7371,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7372 m_host.AddScriptLPS(1); 7371 m_host.AddScriptLPS(1);
7373 7372
7374 // our key in the object we are in 7373 // our key in the object we are in
7375 LLUUID invItemID=InventorySelf(); 7374 UUID invItemID=InventorySelf();
7376 if (invItemID == LLUUID.Zero) return; 7375 if (invItemID == UUID.Zero) return;
7377 7376
7378 // the object we are in 7377 // the object we are in
7379 LLUUID objectID = m_host.ParentUUID; 7378 UUID objectID = m_host.ParentUUID;
7380 if (objectID == LLUUID.Zero) return; 7379 if(objectID == UUID.Zero) return;
7381 7380
7382 // we need the permission first, to know which avatar we want to set the camera for 7381 // we need the permission first, to know which avatar we want to set the camera for
7383 LLUUID agentID = m_host.TaskInventory[invItemID].PermsGranter; 7382 UUID agentID = m_host.TaskInventory[invItemID].PermsGranter;
7384 if (agentID == LLUUID.Zero) return; 7383 if (agentID == UUID.Zero) return;
7385 if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; 7384 if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return;
7386 7385
7387 ScenePresence presence = World.GetScenePresence(agentID); 7386 ScenePresence presence = World.GetScenePresence(agentID);
@@ -7423,16 +7422,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7423 m_host.AddScriptLPS(1); 7422 m_host.AddScriptLPS(1);
7424 7423
7425 // our key in the object we are in 7424 // our key in the object we are in
7426 LLUUID invItemID=InventorySelf(); 7425 UUID invItemID=InventorySelf();
7427 if (invItemID == LLUUID.Zero) return; 7426 if (invItemID == UUID.Zero) return;
7428 7427
7429 // the object we are in 7428 // the object we are in
7430 LLUUID objectID = m_host.ParentUUID; 7429 UUID objectID = m_host.ParentUUID;
7431 if (objectID == LLUUID.Zero) return; 7430 if(objectID == UUID.Zero) return;
7432 7431
7433 // we need the permission first, to know which avatar we want to clear the camera for 7432 // we need the permission first, to know which avatar we want to clear the camera for
7434 LLUUID agentID = m_host.TaskInventory[invItemID].PermsGranter; 7433 UUID agentID = m_host.TaskInventory[invItemID].PermsGranter;
7435 if (agentID == LLUUID.Zero) return; 7434 if (agentID == UUID.Zero) return;
7436 if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; 7435 if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return;
7437 7436
7438 ScenePresence presence = World.GetScenePresence(agentID); 7437 ScenePresence presence = World.GetScenePresence(agentID);
@@ -7531,9 +7530,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7531 param.Add(o.ToString()); 7530 param.Add(o.ToString());
7532 } 7531 }
7533 7532
7534 LLVector3 position = m_host.AbsolutePosition; 7533 Vector3 position = m_host.AbsolutePosition;
7535 LLVector3 velocity = m_host.Velocity; 7534 Vector3 velocity = m_host.Velocity;
7536 LLQuaternion rotation = m_host.RotationOffset; 7535 Quaternion rotation = m_host.RotationOffset;
7537 ScenePresence scenePresence = World.GetScenePresence(m_host.ObjectOwner); 7536 ScenePresence scenePresence = World.GetScenePresence(m_host.ObjectOwner);
7538 RegionInfo regionInfo = World.RegionInfo; 7537 RegionInfo regionInfo = World.RegionInfo;
7539 7538
@@ -7549,10 +7548,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7549 httpHeaders["X-SecondLife-Owner-Name"] = scenePresence == null ? string.Empty : scenePresence.ControllingClient.Name; 7548 httpHeaders["X-SecondLife-Owner-Name"] = scenePresence == null ? string.Empty : scenePresence.ControllingClient.Name;
7550 httpHeaders["X-SecondLife-Owner-Key"] = m_host.ObjectOwner.ToString(); 7549 httpHeaders["X-SecondLife-Owner-Key"] = m_host.ObjectOwner.ToString();
7551 7550
7552 LLUUID reqID = httpScriptMod. 7551 UUID reqID = httpScriptMod.
7553 StartHttpRequest(m_localID, m_itemID, url, param, httpHeaders, body); 7552 StartHttpRequest(m_localID, m_itemID, url, param, httpHeaders, body);
7554 7553
7555 if (reqID != LLUUID.Zero) 7554 if (reqID != UUID.Zero)
7556 return reqID.ToString(); 7555 return reqID.ToString();
7557 else 7556 else
7558 return null; 7557 return null;
@@ -7662,7 +7661,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7662 LSL_Types.list ret = new LSL_Types.list(); 7661 LSL_Types.list ret = new LSL_Types.list();
7663 if (land != null) 7662 if (land != null)
7664 { 7663 {
7665 foreach (KeyValuePair<LLUUID, int> d in land.getLandObjectOwners()) 7664 foreach (KeyValuePair<UUID, int> d in land.getLandObjectOwners())
7666 { 7665 {
7667 ret.Add(d.Key.ToString()); 7666 ret.Add(d.Key.ToString());
7668 ret.Add(d.Value); 7667 ret.Add(d.Value);
@@ -7675,7 +7674,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7675 public LSL_Types.LSLInteger llGetObjectPrimCount(string object_id) 7674 public LSL_Types.LSLInteger llGetObjectPrimCount(string object_id)
7676 { 7675 {
7677 m_host.AddScriptLPS(1); 7676 m_host.AddScriptLPS(1);
7678 SceneObjectPart part = World.GetSceneObjectPart(new LLUUID(object_id)); 7677 SceneObjectPart part = World.GetSceneObjectPart(new UUID(object_id));
7679 if (part == null) 7678 if (part == null)
7680 { 7679 {
7681 return 0; 7680 return 0;
@@ -7781,8 +7780,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7781 { 7780 {
7782 m_host.AddScriptLPS(1); 7781 m_host.AddScriptLPS(1);
7783 LSL_Types.list ret = new LSL_Types.list(); 7782 LSL_Types.list ret = new LSL_Types.list();
7784 LLUUID key = new LLUUID(); 7783 UUID key = new UUID();
7785 if (LLUUID.TryParse(id, out key)) 7784 if (UUID.TryParse(id, out key))
7786 { 7785 {
7787 ScenePresence av = World.GetScenePresence(key); 7786 ScenePresence av = World.GetScenePresence(key);
7788 7787
@@ -7802,19 +7801,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7802 ret.Add(new LSL_Types.Vector3((double)av.AbsolutePosition.X, (double)av.AbsolutePosition.Y, (double)av.AbsolutePosition.Z)); 7801 ret.Add(new LSL_Types.Vector3((double)av.AbsolutePosition.X, (double)av.AbsolutePosition.Y, (double)av.AbsolutePosition.Z));
7803 break; 7802 break;
7804 case "4": 7803 case "4":
7805 ret.Add(new LSL_Types.Quaternion((double)av.Rotation.x, (double)av.Rotation.y, (double)av.Rotation.z, (double)av.Rotation.w)); 7804 ret.Add(new LSL_Types.Quaternion((double)av.Rotation.X, (double)av.Rotation.Y, (double)av.Rotation.Z, (double)av.Rotation.W));
7806 break; 7805 break;
7807 case "5": 7806 case "5":
7808 ret.Add(new LSL_Types.Vector3(av.Velocity.X,av.Velocity.Y,av.Velocity.Z)); 7807 ret.Add(new LSL_Types.Vector3(av.Velocity.X, av.Velocity.Y, av.Velocity.Z));
7809 break; 7808 break;
7810 case "6": 7809 case "6":
7811 ret.Add(id); 7810 ret.Add(id);
7812 break; 7811 break;
7813 case "7": 7812 case "7":
7814 ret.Add(LLUUID.Zero.ToString()); 7813 ret.Add(UUID.Zero.ToString());
7815 break; 7814 break;
7816 case "8": 7815 case "8":
7817 ret.Add(LLUUID.Zero.ToString()); 7816 ret.Add(UUID.Zero.ToString());
7818 break; 7817 break;
7819 } 7818 }
7820 } 7819 }
@@ -7834,7 +7833,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7834 ret.Add(obj.Description); 7833 ret.Add(obj.Description);
7835 break; 7834 break;
7836 case "3": 7835 case "3":
7837 ret.Add(new LSL_Types.Vector3(obj.AbsolutePosition.X,obj.AbsolutePosition.Y,obj.AbsolutePosition.Z)); 7836 ret.Add(new LSL_Types.Vector3(obj.AbsolutePosition.X, obj.AbsolutePosition.Y, obj.AbsolutePosition.Z));
7838 break; 7837 break;
7839 case "4": 7838 case "4":
7840 ret.Add(new LSL_Types.Quaternion(obj.RotationOffset.X, obj.RotationOffset.Y, obj.RotationOffset.Z, obj.RotationOffset.W)); 7839 ret.Add(new LSL_Types.Quaternion(obj.RotationOffset.X, obj.RotationOffset.Y, obj.RotationOffset.Z, obj.RotationOffset.W));
@@ -7860,14 +7859,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7860 } 7859 }
7861 7860
7862 7861
7863 internal LLUUID ScriptByName(string name) 7862 internal UUID ScriptByName(string name)
7864 { 7863 {
7865 foreach (TaskInventoryItem item in m_host.TaskInventory.Values) 7864 foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
7866 { 7865 {
7867 if (item.Type == 10 && item.Name == name) 7866 if (item.Type == 10 && item.Name == name)
7868 return item.ItemID; 7867 return item.ItemID;
7869 } 7868 }
7870 return LLUUID.Zero; 7869 return UUID.Zero;
7871 } 7870 }
7872 7871
7873 internal void ShoutError(string msg) 7872 internal void ShoutError(string msg)
@@ -7893,10 +7892,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7893 throw new Exception("LSL Runtime Error: " + msg); 7892 throw new Exception("LSL Runtime Error: " + msg);
7894 } 7893 }
7895 7894
7896 public delegate void AssetRequestCallback(LLUUID assetID, AssetBase asset); 7895 public delegate void AssetRequestCallback(UUID assetID, AssetBase asset);
7897 private void WithNotecard(LLUUID assetID, AssetRequestCallback cb) 7896 private void WithNotecard(UUID assetID, AssetRequestCallback cb)
7898 { 7897 {
7899 World.AssetCache.GetAsset(assetID, delegate(LLUUID i, AssetBase a) { cb(i, a); }, false); 7898 World.AssetCache.GetAsset(assetID, delegate(UUID i, AssetBase a) { cb(i, a); }, false);
7900 } 7899 }
7901 7900
7902 public string llGetNumberOfNotecardLines(string name) 7901 public string llGetNumberOfNotecardLines(string name)
@@ -7907,7 +7906,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7907 { 7906 {
7908 if (item.Type == 7 && item.Name == name) 7907 if (item.Type == 7 && item.Name == name)
7909 { 7908 {
7910 LLUUID tid = AsyncCommands. 7909 UUID tid = AsyncCommands.
7911 DataserverPlugin.RegisterRequest(m_localID, 7910 DataserverPlugin.RegisterRequest(m_localID,
7912 m_itemID, item.AssetID.ToString()); 7911 m_itemID, item.AssetID.ToString());
7913 if (NotecardCache.IsCached(item.AssetID)) 7912 if (NotecardCache.IsCached(item.AssetID))
@@ -7918,7 +7917,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7918 // ScriptSleep(100); 7917 // ScriptSleep(100);
7919 return tid.ToString(); 7918 return tid.ToString();
7920 } 7919 }
7921 WithNotecard(item.AssetID, delegate (LLUUID id, AssetBase a) 7920 WithNotecard(item.AssetID, delegate (UUID id, AssetBase a)
7922 { 7921 {
7923 System.Text.ASCIIEncoding enc = 7922 System.Text.ASCIIEncoding enc =
7924 new System.Text.ASCIIEncoding(); 7923 new System.Text.ASCIIEncoding();
@@ -7934,7 +7933,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7934 } 7933 }
7935 } 7934 }
7936 // ScriptSleep(100); 7935 // ScriptSleep(100);
7937 return LLUUID.Zero.ToString(); 7936 return UUID.Zero.ToString();
7938 } 7937 }
7939 7938
7940 public string llGetNotecardLine(string name, int line) 7939 public string llGetNotecardLine(string name, int line)
@@ -7945,7 +7944,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7945 { 7944 {
7946 if (item.Type == 7 && item.Name == name) 7945 if (item.Type == 7 && item.Name == name)
7947 { 7946 {
7948 LLUUID tid = AsyncCommands. 7947 UUID tid = AsyncCommands.
7949 DataserverPlugin.RegisterRequest(m_localID, 7948 DataserverPlugin.RegisterRequest(m_localID,
7950 m_itemID, item.AssetID.ToString()); 7949 m_itemID, item.AssetID.ToString());
7951 if (NotecardCache.IsCached(item.AssetID)) 7950 if (NotecardCache.IsCached(item.AssetID))
@@ -7956,7 +7955,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7956 // ScriptSleep(100); 7955 // ScriptSleep(100);
7957 return tid.ToString(); 7956 return tid.ToString();
7958 } 7957 }
7959 WithNotecard(item.AssetID, delegate (LLUUID id, AssetBase a) 7958 WithNotecard(item.AssetID, delegate (UUID id, AssetBase a)
7960 { 7959 {
7961 System.Text.ASCIIEncoding enc = 7960 System.Text.ASCIIEncoding enc =
7962 new System.Text.ASCIIEncoding(); 7961 new System.Text.ASCIIEncoding();
@@ -7987,10 +7986,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7987 public DateTime lastRef; 7986 public DateTime lastRef;
7988 } 7987 }
7989 7988
7990 private static Dictionary<LLUUID, Notecard> m_Notecards = 7989 private static Dictionary<UUID, Notecard> m_Notecards =
7991 new Dictionary<LLUUID, Notecard>(); 7990 new Dictionary<UUID, Notecard>();
7992 7991
7993 public static void Cache(LLUUID assetID, string text) 7992 public static void Cache(UUID assetID, string text)
7994 { 7993 {
7995 CacheCheck(); 7994 CacheCheck();
7996 7995
@@ -8081,7 +8080,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8081 return output.ToArray(); 8080 return output.ToArray();
8082 } 8081 }
8083 8082
8084 public static bool IsCached(LLUUID assetID) 8083 public static bool IsCached(UUID assetID)
8085 { 8084 {
8086 lock (m_Notecards) 8085 lock (m_Notecards)
8087 { 8086 {
@@ -8089,7 +8088,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8089 } 8088 }
8090 } 8089 }
8091 8090
8092 public static int GetLines(LLUUID assetID) 8091 public static int GetLines(UUID assetID)
8093 { 8092 {
8094 if (!IsCached(assetID)) 8093 if (!IsCached(assetID))
8095 return -1; 8094 return -1;
@@ -8101,7 +8100,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8101 } 8100 }
8102 } 8101 }
8103 8102
8104 public static string GetLine(LLUUID assetID, int line) 8103 public static string GetLine(UUID assetID, int line)
8105 { 8104 {
8106 if (line < 0) 8105 if (line < 0)
8107 return ""; 8106 return "";
@@ -8128,7 +8127,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8128 8127
8129 public static void CacheCheck() 8128 public static void CacheCheck()
8130 { 8129 {
8131 foreach (LLUUID key in new List<LLUUID>(m_Notecards.Keys)) 8130 foreach (UUID key in new List<UUID>(m_Notecards.Keys))
8132 { 8131 {
8133 Notecard nc = m_Notecards[key]; 8132 Notecard nc = m_Notecards[key];
8134 if (nc.lastRef.AddSeconds(30) < DateTime.Now) 8133 if (nc.lastRef.AddSeconds(30) < DateTime.Now)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 257b17b..0f598ea 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -26,8 +26,7 @@
26 */ 26 */
27using System; 27using System;
28using System.Runtime.Remoting.Lifetime; 28using System.Runtime.Remoting.Lifetime;
29using Axiom.Math; 29using OpenMetaverse;
30using libsecondlife;
31using Nini.Config; 30using Nini.Config;
32using OpenSim.Framework.Console; 31using OpenSim.Framework.Console;
33using OpenSim.Region.Environment.Interfaces; 32using OpenSim.Region.Environment.Interfaces;
@@ -46,9 +45,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
46 internal IScriptEngine m_ScriptEngine; 45 internal IScriptEngine m_ScriptEngine;
47 internal SceneObjectPart m_host; 46 internal SceneObjectPart m_host;
48 internal uint m_localID; 47 internal uint m_localID;
49 internal LLUUID m_itemID; 48 internal UUID m_itemID;
50 49
51 public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, LLUUID itemID) 50 public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID)
52 { 51 {
53 m_ScriptEngine = ScriptEngine; 52 m_ScriptEngine = ScriptEngine;
54 m_host = host; 53 m_host = host;
@@ -86,7 +85,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
86 if (x > 255 || x < 0 || y > 255 || y < 0) 85 if (x > 255 || x < 0 || y > 255 || y < 0)
87 OSSLError("osTerrainSetHeight: Coordinate out of bounds"); 86 OSSLError("osTerrainSetHeight: Coordinate out of bounds");
88 87
89 if (World.ExternalChecks.ExternalChecksCanTerraformLand(m_host.OwnerID, new LLVector3(x, y, 0))) 88 if (World.ExternalChecks.ExternalChecksCanTerraformLand(m_host.OwnerID, new Vector3(x, y, 0)))
90 { 89 {
91 World.Heightmap[x, y] = val; 90 World.Heightmap[x, y] = val;
92 return 1; 91 return 1;
@@ -144,7 +143,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
144 World.SendGeneralAlert(msg); 143 World.SendGeneralAlert(msg);
145 } 144 }
146 145
147 public void osSetRot(LLUUID target, Quaternion rotation) 146 public void osSetRot(UUID target, Quaternion rotation)
148 { 147 {
149 if (!m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false)) 148 if (!m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
150 { 149 {
@@ -176,7 +175,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
176 if (dynamicID == String.Empty) 175 if (dynamicID == String.Empty)
177 { 176 {
178 IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>(); 177 IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>();
179 LLUUID createdTexture = 178 UUID createdTexture =
180 textureManager.AddDynamicTextureURL(World.RegionInfo.RegionID, m_host.UUID, contentType, url, 179 textureManager.AddDynamicTextureURL(World.RegionInfo.RegionID, m_host.UUID, contentType, url,
181 extraParams, timer); 180 extraParams, timer);
182 return createdTexture.ToString(); 181 return createdTexture.ToString();
@@ -186,7 +185,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
186 //TODO update existing dynamic textures 185 //TODO update existing dynamic textures
187 } 186 }
188 187
189 return LLUUID.Zero.ToString(); 188 return UUID.Zero.ToString();
190 } 189 }
191 190
192 public string osSetDynamicTextureURLBlend(string dynamicID, string contentType, string url, string extraParams, 191 public string osSetDynamicTextureURLBlend(string dynamicID, string contentType, string url, string extraParams,
@@ -202,7 +201,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
202 if (dynamicID == String.Empty) 201 if (dynamicID == String.Empty)
203 { 202 {
204 IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>(); 203 IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>();
205 LLUUID createdTexture = 204 UUID createdTexture =
206 textureManager.AddDynamicTextureURL(World.RegionInfo.RegionID, m_host.UUID, contentType, url, 205 textureManager.AddDynamicTextureURL(World.RegionInfo.RegionID, m_host.UUID, contentType, url,
207 extraParams, timer, true, (byte) alpha); 206 extraParams, timer, true, (byte) alpha);
208 return createdTexture.ToString(); 207 return createdTexture.ToString();
@@ -212,7 +211,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
212 //TODO update existing dynamic textures 211 //TODO update existing dynamic textures
213 } 212 }
214 213
215 return LLUUID.Zero.ToString(); 214 return UUID.Zero.ToString();
216 } 215 }
217 216
218 public string osSetDynamicTextureData(string dynamicID, string contentType, string data, string extraParams, 217 public string osSetDynamicTextureData(string dynamicID, string contentType, string data, string extraParams,
@@ -230,7 +229,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
230 IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>(); 229 IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>();
231 if (textureManager != null) 230 if (textureManager != null)
232 { 231 {
233 LLUUID createdTexture = 232 UUID createdTexture =
234 textureManager.AddDynamicTextureData(World.RegionInfo.RegionID, m_host.UUID, contentType, data, 233 textureManager.AddDynamicTextureData(World.RegionInfo.RegionID, m_host.UUID, contentType, data,
235 extraParams, timer); 234 extraParams, timer);
236 return createdTexture.ToString(); 235 return createdTexture.ToString();
@@ -241,7 +240,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
241 //TODO update existing dynamic textures 240 //TODO update existing dynamic textures
242 } 241 }
243 242
244 return LLUUID.Zero.ToString(); 243 return UUID.Zero.ToString();
245 } 244 }
246 245
247 public string osSetDynamicTextureDataBlend(string dynamicID, string contentType, string data, string extraParams, 246 public string osSetDynamicTextureDataBlend(string dynamicID, string contentType, string data, string extraParams,
@@ -259,7 +258,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
259 IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>(); 258 IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>();
260 if (textureManager != null) 259 if (textureManager != null)
261 { 260 {
262 LLUUID createdTexture = 261 UUID createdTexture =
263 textureManager.AddDynamicTextureData(World.RegionInfo.RegionID, m_host.UUID, contentType, data, 262 textureManager.AddDynamicTextureData(World.RegionInfo.RegionID, m_host.UUID, contentType, data,
264 extraParams, timer, true, (byte) alpha); 263 extraParams, timer, true, (byte) alpha);
265 return createdTexture.ToString(); 264 return createdTexture.ToString();
@@ -270,7 +269,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
270 //TODO update existing dynamic textures 269 //TODO update existing dynamic textures
271 } 270 }
272 271
273 return LLUUID.Zero.ToString(); 272 return UUID.Zero.ToString();
274 } 273 }
275 274
276 public bool osConsoleCommand(string command) 275 public bool osConsoleCommand(string command)
@@ -539,9 +538,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
539 } 538 }
540 539
541 m_host.AddScriptLPS(1); 540 m_host.AddScriptLPS(1);
542 LLUUID landowner = World.GetLandOwner(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); 541 UUID landowner = World.GetLandOwner(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
543 542
544 if (landowner == LLUUID.Zero) 543 if (landowner == UUID.Zero)
545 { 544 {
546 return; 545 return;
547 } 546 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs
index 52d277e..7300f10 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs
@@ -28,7 +28,7 @@
28using System; 28using System;
29using System.Collections; 29using System.Collections;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using libsecondlife; 31using OpenMetaverse;
32using OpenSim.Region.ScriptEngine.Shared; 32using OpenSim.Region.ScriptEngine.Shared;
33using OpenSim.Region.ScriptEngine.Shared.Api; 33using OpenSim.Region.ScriptEngine.Shared.Api;
34 34
@@ -49,28 +49,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
49 private class DataserverRequest 49 private class DataserverRequest
50 { 50 {
51 public uint localID; 51 public uint localID;
52 public LLUUID itemID; 52 public UUID itemID;
53 53
54 public LLUUID ID; 54 public UUID ID;
55 public string handle; 55 public string handle;
56 56
57 public DateTime startTime; 57 public DateTime startTime;
58 } 58 }
59 59
60 public LLUUID RegisterRequest(uint localID, LLUUID itemID, 60 public UUID RegisterRequest(uint localID, UUID itemID,
61 string identifier) 61 string identifier)
62 { 62 {
63 lock (DataserverRequests) 63 lock (DataserverRequests)
64 { 64 {
65 if (DataserverRequests.ContainsKey(identifier)) 65 if (DataserverRequests.ContainsKey(identifier))
66 return LLUUID.Zero; 66 return UUID.Zero;
67 67
68 DataserverRequest ds = new DataserverRequest(); 68 DataserverRequest ds = new DataserverRequest();
69 69
70 ds.localID = localID; 70 ds.localID = localID;
71 ds.itemID = itemID; 71 ds.itemID = itemID;
72 72
73 ds.ID = LLUUID.Random(); 73 ds.ID = UUID.Random();
74 ds.handle = identifier; 74 ds.handle = identifier;
75 75
76 ds.startTime = DateTime.Now; 76 ds.startTime = DateTime.Now;
@@ -101,7 +101,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
101 new DetectParams[0])); 101 new DetectParams[0]));
102 } 102 }
103 103
104 public void RemoveEvents(uint localID, LLUUID itemID) 104 public void RemoveEvents(uint localID, UUID itemID)
105 { 105 {
106 lock (DataserverRequests) 106 lock (DataserverRequests)
107 { 107 {
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Listener.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Listener.cs
index 11b45b1..b353cba 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Listener.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Listener.cs
@@ -26,7 +26,7 @@
26 */ 26 */
27 27
28using System; 28using System;
29using libsecondlife; 29using OpenMetaverse;
30using OpenSim.Region.Environment.Interfaces; 30using OpenSim.Region.Environment.Interfaces;
31using OpenSim.Region.Environment.Modules.Scripting.WorldComm; 31using OpenSim.Region.Environment.Modules.Scripting.WorldComm;
32using OpenSim.Region.ScriptEngine.Shared; 32using OpenSim.Region.ScriptEngine.Shared;
@@ -74,14 +74,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
74 } 74 }
75 } 75 }
76 76
77 public Object[] GetSerializationData(LLUUID itemID) 77 public Object[] GetSerializationData(UUID itemID)
78 { 78 {
79 IWorldComm comms = m_CmdManager.m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 79 IWorldComm comms = m_CmdManager.m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
80 80
81 return comms.GetSerializationData(itemID); 81 return comms.GetSerializationData(itemID);
82 } 82 }
83 83
84 public void CreateFromData(uint localID, LLUUID itemID, LLUUID hostID, 84 public void CreateFromData(uint localID, UUID itemID, UUID hostID,
85 Object[] data) 85 Object[] data)
86 { 86 {
87 IWorldComm comms = m_CmdManager.m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 87 IWorldComm comms = m_CmdManager.m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
index eaf4bd0..d1e3921 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
@@ -27,7 +27,7 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using libsecondlife; 30using OpenMetaverse;
31using OpenSim.Framework; 31using OpenSim.Framework;
32using OpenSim.Framework.Communications.Cache; 32using OpenSim.Framework.Communications.Cache;
33using OpenSim.Region.Environment.Scenes; 33using OpenSim.Region.Environment.Scenes;
@@ -45,8 +45,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
45 m_CmdManager = CmdManager; 45 m_CmdManager = CmdManager;
46 } 46 }
47 47
48 public Dictionary<uint, Dictionary<LLUUID, LSL_Types.list>> SenseEvents = 48 public Dictionary<uint, Dictionary<UUID, LSL_Types.list>> SenseEvents =
49 new Dictionary<uint, Dictionary<LLUUID, LSL_Types.list>>(); 49 new Dictionary<uint, Dictionary<UUID, LSL_Types.list>>();
50 private Object SenseLock = new Object(); 50 private Object SenseLock = new Object();
51 51
52 // 52 //
@@ -55,12 +55,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
55 private class SenseRepeatClass 55 private class SenseRepeatClass
56 { 56 {
57 public uint localID; 57 public uint localID;
58 public LLUUID itemID; 58 public UUID itemID;
59 public double interval; 59 public double interval;
60 public DateTime next; 60 public DateTime next;
61 61
62 public string name; 62 public string name;
63 public LLUUID keyID; 63 public UUID keyID;
64 public int type; 64 public int type;
65 public double range; 65 public double range;
66 public double arc; 66 public double arc;
@@ -70,8 +70,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
70 private List<SenseRepeatClass> SenseRepeaters = new List<SenseRepeatClass>(); 70 private List<SenseRepeatClass> SenseRepeaters = new List<SenseRepeatClass>();
71 private object SenseRepeatListLock = new object(); 71 private object SenseRepeatListLock = new object();
72 72
73 public void SetSenseRepeatEvent(uint m_localID, LLUUID m_itemID, 73 public void SetSenseRepeatEvent(uint m_localID, UUID m_itemID,
74 string name, LLUUID keyID, int type, double range, 74 string name, UUID keyID, int type, double range,
75 double arc, double sec, SceneObjectPart host) 75 double arc, double sec, SceneObjectPart host)
76 { 76 {
77 // Always remove first, in case this is a re-set 77 // Always remove first, in case this is a re-set
@@ -98,7 +98,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
98 } 98 }
99 } 99 }
100 100
101 public void UnSetSenseRepeaterEvents(uint m_localID, LLUUID m_itemID) 101 public void UnSetSenseRepeaterEvents(uint m_localID, UUID m_itemID)
102 { 102 {
103 // Remove from timer 103 // Remove from timer
104 lock (SenseRepeatListLock) 104 lock (SenseRepeatListLock)
@@ -138,8 +138,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
138 } // lock 138 } // lock
139 } 139 }
140 140
141 public void SenseOnce(uint m_localID, LLUUID m_itemID, 141 public void SenseOnce(uint m_localID, UUID m_itemID,
142 string name, LLUUID keyID, int type, 142 string name, UUID keyID, int type,
143 double range, double arc, SceneObjectPart host) 143 double range, double arc, SceneObjectPart host)
144 { 144 {
145 // Add to timer 145 // Add to timer
@@ -156,11 +156,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
156 SensorSweep(ts); 156 SensorSweep(ts);
157 } 157 }
158 158
159 public LSL_Types.list GetSensorList(uint m_localID, LLUUID m_itemID) 159 public LSL_Types.list GetSensorList(uint m_localID, UUID m_itemID)
160 { 160 {
161 lock (SenseLock) 161 lock (SenseLock)
162 { 162 {
163 Dictionary<LLUUID, LSL_Types.list> Obj = null; 163 Dictionary<UUID, LSL_Types.list> Obj = null;
164 if (!SenseEvents.TryGetValue(m_localID, out Obj)) 164 if (!SenseEvents.TryGetValue(m_localID, out Obj))
165 { 165 {
166 return null; 166 return null;
@@ -187,11 +187,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
187 return; 187 return;
188 } 188 }
189 189
190 LLVector3 sensorPos = SensePoint.AbsolutePosition; 190 Vector3 sensorPos = SensePoint.AbsolutePosition;
191 LLVector3 regionPos = new LLVector3(m_CmdManager.m_ScriptEngine.World.RegionInfo.RegionLocX * Constants.RegionSize, m_CmdManager.m_ScriptEngine.World.RegionInfo.RegionLocY * Constants.RegionSize, 0); 191 Vector3 regionPos = new Vector3(m_CmdManager.m_ScriptEngine.World.RegionInfo.RegionLocX * Constants.RegionSize, m_CmdManager.m_ScriptEngine.World.RegionInfo.RegionLocY * Constants.RegionSize, 0);
192 LLVector3 fromRegionPos = sensorPos + regionPos; 192 Vector3 fromRegionPos = sensorPos + regionPos;
193 193
194 LLQuaternion q = SensePoint.RotationOffset; 194 Quaternion q = SensePoint.RotationOffset;
195 LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W); 195 LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W);
196 LSL_Types.Vector3 forward_dir = (new LSL_Types.Vector3(1, 0, 0) * r); 196 LSL_Types.Vector3 forward_dir = (new LSL_Types.Vector3(1, 0, 0) * r);
197 double mag_fwd = LSL_Types.Vector3.Mag(forward_dir); 197 double mag_fwd = LSL_Types.Vector3.Mag(forward_dir);
@@ -203,7 +203,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
203 203
204 foreach (EntityBase ent in m_CmdManager.m_ScriptEngine.World.Entities.Values) 204 foreach (EntityBase ent in m_CmdManager.m_ScriptEngine.World.Entities.Values)
205 { 205 {
206 LLVector3 toRegionPos = ent.AbsolutePosition + regionPos; 206 Vector3 toRegionPos = ent.AbsolutePosition + regionPos;
207 double dis = Math.Abs((double)Util.GetDistanceTo(toRegionPos, fromRegionPos)); 207 double dis = Math.Abs((double)Util.GetDistanceTo(toRegionPos, fromRegionPos));
208 if (dis <= ts.range) 208 if (dis <= ts.range)
209 { 209 {
@@ -239,7 +239,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
239 double ang_obj = 0; 239 double ang_obj = 0;
240 try 240 try
241 { 241 {
242 LLVector3 diff = toRegionPos - fromRegionPos; 242 Vector3 diff = toRegionPos - fromRegionPos;
243 LSL_Types.Vector3 obj_dir = new LSL_Types.Vector3(diff.X, diff.Y, diff.Z); 243 LSL_Types.Vector3 obj_dir = new LSL_Types.Vector3(diff.X, diff.Y, diff.Z);
244 double dot = LSL_Types.Vector3.Dot(forward_dir, obj_dir); 244 double dot = LSL_Types.Vector3.Dot(forward_dir, obj_dir);
245 double mag_obj = LSL_Types.Vector3.Mag(obj_dir); 245 double mag_obj = LSL_Types.Vector3.Mag(obj_dir);
@@ -252,7 +252,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
252 if (ang_obj > ts.arc) keep = false; 252 if (ang_obj > ts.arc) keep = false;
253 } 253 }
254 254
255 if (keep && (ts.keyID != LLUUID.Zero) && (ts.keyID != ent.UUID)) 255 if (keep && (ts.keyID != UUID.Zero) && (ts.keyID != ent.UUID))
256 { 256 {
257 keep = false; 257 keep = false;
258 } 258 }
@@ -292,10 +292,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
292 // Create object if it doesn't exist 292 // Create object if it doesn't exist
293 if (SenseEvents.ContainsKey(ts.localID) == false) 293 if (SenseEvents.ContainsKey(ts.localID) == false)
294 { 294 {
295 SenseEvents.Add(ts.localID, new Dictionary<LLUUID, LSL_Types.list>()); 295 SenseEvents.Add(ts.localID, new Dictionary<UUID, LSL_Types.list>());
296 } 296 }
297 // clear if previous traces exist 297 // clear if previous traces exist
298 Dictionary<LLUUID, LSL_Types.list> Obj; 298 Dictionary<UUID, LSL_Types.list> Obj;
299 SenseEvents.TryGetValue(ts.localID, out Obj); 299 SenseEvents.TryGetValue(ts.localID, out Obj);
300 if (Obj.ContainsKey(ts.itemID) == true) 300 if (Obj.ContainsKey(ts.itemID) == true)
301 Obj.Remove(ts.itemID); 301 Obj.Remove(ts.itemID);
@@ -320,7 +320,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
320 for (idx = 0; idx < SensedObjects.Length; idx++) 320 for (idx = 0; idx < SensedObjects.Length; idx++)
321 { 321 {
322 detect[idx] = new DetectParams(); 322 detect[idx] = new DetectParams();
323 detect[idx].Key=(LLUUID)(SensedObjects.Data[idx]); 323 detect[idx].Key=(UUID)(SensedObjects.Data[idx]);
324 detect[idx].Populate(m_CmdManager.m_ScriptEngine.World); 324 detect[idx].Populate(m_CmdManager.m_ScriptEngine.World);
325 } 325 }
326 326
@@ -333,7 +333,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
333 } 333 }
334 } 334 }
335 335
336 public Object[] GetSerializationData(LLUUID itemID) 336 public Object[] GetSerializationData(UUID itemID)
337 { 337 {
338 List<Object> data = new List<Object>(); 338 List<Object> data = new List<Object>();
339 339
@@ -352,7 +352,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
352 return data.ToArray(); 352 return data.ToArray();
353 } 353 }
354 354
355 public void CreateFromData(uint localID, LLUUID itemID, LLUUID objectID, 355 public void CreateFromData(uint localID, UUID itemID, UUID objectID,
356 Object[] data) 356 Object[] data)
357 { 357 {
358 SceneObjectPart part = 358 SceneObjectPart part =
@@ -373,7 +373,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
373 373
374 ts.interval = (double)data[idx]; 374 ts.interval = (double)data[idx];
375 ts.name = (string)data[idx+1]; 375 ts.name = (string)data[idx+1];
376 ts.keyID = (LLUUID)data[idx+2]; 376 ts.keyID = (UUID)data[idx+2];
377 ts.type = (int)data[idx+3]; 377 ts.type = (int)data[idx+3];
378 ts.range = (double)data[idx+4]; 378 ts.range = (double)data[idx+4];
379 ts.arc = (double)data[idx+5]; 379 ts.arc = (double)data[idx+5];
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs
index 36e992b..ec7cd35 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs
@@ -28,7 +28,7 @@
28using System; 28using System;
29using System.Collections; 29using System.Collections;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using libsecondlife; 31using OpenMetaverse;
32using OpenSim.Region.ScriptEngine.Shared.Api; 32using OpenSim.Region.ScriptEngine.Shared.Api;
33 33
34namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins 34namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
@@ -48,7 +48,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
48 private class TimerClass 48 private class TimerClass
49 { 49 {
50 public uint localID; 50 public uint localID;
51 public LLUUID itemID; 51 public UUID itemID;
52 //public double interval; 52 //public double interval;
53 public long interval; 53 public long interval;
54 //public DateTime next; 54 //public DateTime next;
@@ -58,7 +58,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
58 private List<TimerClass> Timers = new List<TimerClass>(); 58 private List<TimerClass> Timers = new List<TimerClass>();
59 private object TimerListLock = new object(); 59 private object TimerListLock = new object();
60 60
61 public void SetTimerEvent(uint m_localID, LLUUID m_itemID, double sec) 61 public void SetTimerEvent(uint m_localID, UUID m_itemID, double sec)
62 { 62 {
63 // Always remove first, in case this is a re-set 63 // Always remove first, in case this is a re-set
64 UnSetTimerEvents(m_localID, m_itemID); 64 UnSetTimerEvents(m_localID, m_itemID);
@@ -81,7 +81,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
81 } 81 }
82 } 82 }
83 83
84 public void UnSetTimerEvents(uint m_localID, LLUUID m_itemID) 84 public void UnSetTimerEvents(uint m_localID, UUID m_itemID)
85 { 85 {
86 // Remove from timer 86 // Remove from timer
87 lock (TimerListLock) 87 lock (TimerListLock)
@@ -122,7 +122,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
122 } 122 }
123 } 123 }
124 124
125 public Object[] GetSerializationData(LLUUID itemID) 125 public Object[] GetSerializationData(UUID itemID)
126 { 126 {
127 List<Object> data = new List<Object>(); 127 List<Object> data = new List<Object>();
128 128
@@ -140,7 +140,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
140 return data.ToArray(); 140 return data.ToArray();
141 } 141 }
142 142
143 public void CreateFromData(uint localID, LLUUID itemID, LLUUID objectID, 143 public void CreateFromData(uint localID, UUID itemID, UUID objectID,
144 Object[] data) 144 Object[] data)
145 { 145 {
146 int idx = 0; 146 int idx = 0;