aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authorSean Dague2007-07-30 20:11:40 +0000
committerSean Dague2007-07-30 20:11:40 +0000
commit74bb5282a09ec095a7ff810c62f79cc64e187686 (patch)
treee0a9b703bfcbbab59b04351dd71508fa913e741a /OpenSim/Region/Environment
parentadded OnDisconnectUser event to required classes (diff)
downloadopensim-SC-74bb5282a09ec095a7ff810c62f79cc64e187686.zip
opensim-SC-74bb5282a09ec095a7ff810c62f79cc64e187686.tar.gz
opensim-SC-74bb5282a09ec095a7ff810c62f79cc64e187686.tar.bz2
opensim-SC-74bb5282a09ec095a7ff810c62f79cc64e187686.tar.xz
mass update of files to have native line endings
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/LandManagement/Land.cs1204
-rw-r--r--OpenSim/Region/Environment/LandManagement/LandManager.cs1234
-rw-r--r--OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs598
-rw-r--r--OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart2.cs432
-rw-r--r--OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLHandler/Common.cs168
-rw-r--r--OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLHandler/IL_common_functions.cs112
-rw-r--r--OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLHandler/LSL_BuiltIn_Commands_Interface.cs732
-rw-r--r--OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLHandler/LSL_BuiltIn_Commands_TestImplementation.cs754
-rw-r--r--OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLHandler/LSL_OPCODE_IL_processor.cs702
-rw-r--r--OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLScript.cs66
-rw-r--r--OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLScriptEngine.cs52
11 files changed, 3027 insertions, 3027 deletions
diff --git a/OpenSim/Region/Environment/LandManagement/Land.cs b/OpenSim/Region/Environment/LandManagement/Land.cs
index 625b176..97f8276 100644
--- a/OpenSim/Region/Environment/LandManagement/Land.cs
+++ b/OpenSim/Region/Environment/LandManagement/Land.cs
@@ -1,602 +1,602 @@
1using System; 1using System;
2using System.Collections.Generic; 2using System.Collections.Generic;
3using libsecondlife; 3using libsecondlife;
4using libsecondlife.Packets; 4using libsecondlife.Packets;
5using OpenSim.Framework.Interfaces; 5using OpenSim.Framework.Interfaces;
6using OpenSim.Framework.Types; 6using OpenSim.Framework.Types;
7using OpenSim.Region.Environment.Scenes; 7using OpenSim.Region.Environment.Scenes;
8 8
9namespace OpenSim.Region.Environment.LandManagement 9namespace OpenSim.Region.Environment.LandManagement
10{ 10{
11 #region Parcel Class 11 #region Parcel Class
12 /// <summary> 12 /// <summary>
13 /// Keeps track of a specific piece of land's information 13 /// Keeps track of a specific piece of land's information
14 /// </summary> 14 /// </summary>
15 public class Land 15 public class Land
16 { 16 {
17 #region Member Variables 17 #region Member Variables
18 public LandData landData = new LandData(); 18 public LandData landData = new LandData();
19 public List<SceneObject> primsOverMe = new List<SceneObject>(); 19 public List<SceneObject> primsOverMe = new List<SceneObject>();
20 20
21 public Scene m_scene; 21 public Scene m_scene;
22 22
23 private bool[,] landBitmap = new bool[64, 64]; 23 private bool[,] landBitmap = new bool[64, 64];
24 24
25 #endregion 25 #endregion
26 26
27 27
28 #region Constructors 28 #region Constructors
29 public Land(LLUUID owner_id, bool is_group_owned, Scene scene) 29 public Land(LLUUID owner_id, bool is_group_owned, Scene scene)
30 { 30 {
31 m_scene = scene; 31 m_scene = scene;
32 landData.ownerID = owner_id; 32 landData.ownerID = owner_id;
33 landData.isGroupOwned = is_group_owned; 33 landData.isGroupOwned = is_group_owned;
34 34
35 } 35 }
36 #endregion 36 #endregion
37 37
38 38
39 #region Member Functions 39 #region Member Functions
40 40
41 #region General Functions 41 #region General Functions
42 /// <summary> 42 /// <summary>
43 /// Checks to see if this land object contains a point 43 /// Checks to see if this land object contains a point
44 /// </summary> 44 /// </summary>
45 /// <param name="x"></param> 45 /// <param name="x"></param>
46 /// <param name="y"></param> 46 /// <param name="y"></param>
47 /// <returns>Returns true if the piece of land contains the specified point</returns> 47 /// <returns>Returns true if the piece of land contains the specified point</returns>
48 public bool containsPoint(int x, int y) 48 public bool containsPoint(int x, int y)
49 { 49 {
50 if (x >= 0 && y >= 0 && x <= 256 && x <= 256) 50 if (x >= 0 && y >= 0 && x <= 256 && x <= 256)
51 { 51 {
52 return (landBitmap[x / 4, y / 4] == true); 52 return (landBitmap[x / 4, y / 4] == true);
53 } 53 }
54 else 54 else
55 { 55 {
56 return false; 56 return false;
57 } 57 }
58 } 58 }
59 59
60 public Land Copy() 60 public Land Copy()
61 { 61 {
62 Land newLand = new Land(this.landData.ownerID, this.landData.isGroupOwned, m_scene); 62 Land newLand = new Land(this.landData.ownerID, this.landData.isGroupOwned, m_scene);
63 63
64 //Place all new variables here! 64 //Place all new variables here!
65 newLand.landBitmap = (bool[,])(this.landBitmap.Clone()); 65 newLand.landBitmap = (bool[,])(this.landBitmap.Clone());
66 newLand.landData = landData.Copy(); 66 newLand.landData = landData.Copy();
67 67
68 return newLand; 68 return newLand;
69 } 69 }
70 70
71 #endregion 71 #endregion
72 72
73 73
74 #region Packet Request Handling 74 #region Packet Request Handling
75 /// <summary> 75 /// <summary>
76 /// Sends land properties as requested 76 /// Sends land properties as requested
77 /// </summary> 77 /// </summary>
78 /// <param name="sequence_id">ID sent by client for them to keep track of</param> 78 /// <param name="sequence_id">ID sent by client for them to keep track of</param>
79 /// <param name="snap_selection">Bool sent by client for them to use</param> 79 /// <param name="snap_selection">Bool sent by client for them to use</param>
80 /// <param name="remote_client">Object representing the client</param> 80 /// <param name="remote_client">Object representing the client</param>
81 public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client) 81 public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client)
82 { 82 {
83 83
84 ParcelPropertiesPacket updatePacket = new ParcelPropertiesPacket(); 84 ParcelPropertiesPacket updatePacket = new ParcelPropertiesPacket();
85 updatePacket.ParcelData.AABBMax = landData.AABBMax; 85 updatePacket.ParcelData.AABBMax = landData.AABBMax;
86 updatePacket.ParcelData.AABBMin = landData.AABBMin; 86 updatePacket.ParcelData.AABBMin = landData.AABBMin;
87 updatePacket.ParcelData.Area = landData.area; 87 updatePacket.ParcelData.Area = landData.area;
88 updatePacket.ParcelData.AuctionID = landData.auctionID; 88 updatePacket.ParcelData.AuctionID = landData.auctionID;
89 updatePacket.ParcelData.AuthBuyerID = landData.authBuyerID; //unemplemented 89 updatePacket.ParcelData.AuthBuyerID = landData.authBuyerID; //unemplemented
90 90
91 updatePacket.ParcelData.Bitmap = landData.landBitmapByteArray; 91 updatePacket.ParcelData.Bitmap = landData.landBitmapByteArray;
92 92
93 updatePacket.ParcelData.Desc = Helpers.StringToField(landData.landDesc); 93 updatePacket.ParcelData.Desc = Helpers.StringToField(landData.landDesc);
94 updatePacket.ParcelData.Category = (byte)landData.category; 94 updatePacket.ParcelData.Category = (byte)landData.category;
95 updatePacket.ParcelData.ClaimDate = landData.claimDate; 95 updatePacket.ParcelData.ClaimDate = landData.claimDate;
96 updatePacket.ParcelData.ClaimPrice = landData.claimPrice; 96 updatePacket.ParcelData.ClaimPrice = landData.claimPrice;
97 updatePacket.ParcelData.GroupID = landData.groupID; 97 updatePacket.ParcelData.GroupID = landData.groupID;
98 updatePacket.ParcelData.GroupPrims = landData.groupPrims; 98 updatePacket.ParcelData.GroupPrims = landData.groupPrims;
99 updatePacket.ParcelData.IsGroupOwned = landData.isGroupOwned; 99 updatePacket.ParcelData.IsGroupOwned = landData.isGroupOwned;
100 updatePacket.ParcelData.LandingType = (byte)landData.landingType; 100 updatePacket.ParcelData.LandingType = (byte)landData.landingType;
101 updatePacket.ParcelData.LocalID = landData.localID; 101 updatePacket.ParcelData.LocalID = landData.localID;
102 if (landData.area > 0) 102 if (landData.area > 0)
103 { 103 {
104 updatePacket.ParcelData.MaxPrims = Convert.ToInt32(Math.Round((Convert.ToDecimal(landData.area) / Convert.ToDecimal(65536)) * 15000 * Convert.ToDecimal(m_scene.RegionInfo.estateSettings.objectBonusFactor))); 104 updatePacket.ParcelData.MaxPrims = Convert.ToInt32(Math.Round((Convert.ToDecimal(landData.area) / Convert.ToDecimal(65536)) * 15000 * Convert.ToDecimal(m_scene.RegionInfo.estateSettings.objectBonusFactor)));
105 } 105 }
106 else 106 else
107 { 107 {
108 updatePacket.ParcelData.MaxPrims = 0; 108 updatePacket.ParcelData.MaxPrims = 0;
109 } 109 }
110 updatePacket.ParcelData.MediaAutoScale = landData.mediaAutoScale; 110 updatePacket.ParcelData.MediaAutoScale = landData.mediaAutoScale;
111 updatePacket.ParcelData.MediaID = landData.mediaID; 111 updatePacket.ParcelData.MediaID = landData.mediaID;
112 updatePacket.ParcelData.MediaURL = Helpers.StringToField(landData.mediaURL); 112 updatePacket.ParcelData.MediaURL = Helpers.StringToField(landData.mediaURL);
113 updatePacket.ParcelData.MusicURL = Helpers.StringToField(landData.musicURL); 113 updatePacket.ParcelData.MusicURL = Helpers.StringToField(landData.musicURL);
114 updatePacket.ParcelData.Name = Helpers.StringToField(landData.landName); 114 updatePacket.ParcelData.Name = Helpers.StringToField(landData.landName);
115 updatePacket.ParcelData.OtherCleanTime = 0; //unemplemented 115 updatePacket.ParcelData.OtherCleanTime = 0; //unemplemented
116 updatePacket.ParcelData.OtherCount = 0; //unemplemented 116 updatePacket.ParcelData.OtherCount = 0; //unemplemented
117 updatePacket.ParcelData.OtherPrims = landData.otherPrims; 117 updatePacket.ParcelData.OtherPrims = landData.otherPrims;
118 updatePacket.ParcelData.OwnerID = landData.ownerID; 118 updatePacket.ParcelData.OwnerID = landData.ownerID;
119 updatePacket.ParcelData.OwnerPrims = landData.ownerPrims; 119 updatePacket.ParcelData.OwnerPrims = landData.ownerPrims;
120 updatePacket.ParcelData.ParcelFlags = landData.landFlags; 120 updatePacket.ParcelData.ParcelFlags = landData.landFlags;
121 updatePacket.ParcelData.ParcelPrimBonus = m_scene.RegionInfo.estateSettings.objectBonusFactor; 121 updatePacket.ParcelData.ParcelPrimBonus = m_scene.RegionInfo.estateSettings.objectBonusFactor;
122 updatePacket.ParcelData.PassHours = landData.passHours; 122 updatePacket.ParcelData.PassHours = landData.passHours;
123 updatePacket.ParcelData.PassPrice = landData.passPrice; 123 updatePacket.ParcelData.PassPrice = landData.passPrice;
124 updatePacket.ParcelData.PublicCount = 0; //unemplemented 124 updatePacket.ParcelData.PublicCount = 0; //unemplemented
125 125
126 uint regionFlags = (uint)m_scene.RegionInfo.estateSettings.regionFlags; 126 uint regionFlags = (uint)m_scene.RegionInfo.estateSettings.regionFlags;
127 updatePacket.ParcelData.RegionDenyAnonymous = ((regionFlags & (uint)Simulator.RegionFlags.DenyAnonymous) > 0); 127 updatePacket.ParcelData.RegionDenyAnonymous = ((regionFlags & (uint)Simulator.RegionFlags.DenyAnonymous) > 0);
128 updatePacket.ParcelData.RegionDenyIdentified = ((regionFlags & (uint)Simulator.RegionFlags.DenyIdentified) > 0); 128 updatePacket.ParcelData.RegionDenyIdentified = ((regionFlags & (uint)Simulator.RegionFlags.DenyIdentified) > 0);
129 updatePacket.ParcelData.RegionDenyTransacted = ((regionFlags & (uint)Simulator.RegionFlags.DenyTransacted) > 0); 129 updatePacket.ParcelData.RegionDenyTransacted = ((regionFlags & (uint)Simulator.RegionFlags.DenyTransacted) > 0);
130 updatePacket.ParcelData.RegionPushOverride = ((regionFlags & (uint)Simulator.RegionFlags.RestrictPushObject) > 0); 130 updatePacket.ParcelData.RegionPushOverride = ((regionFlags & (uint)Simulator.RegionFlags.RestrictPushObject) > 0);
131 131
132 updatePacket.ParcelData.RentPrice = 0; 132 updatePacket.ParcelData.RentPrice = 0;
133 updatePacket.ParcelData.RequestResult = request_result; 133 updatePacket.ParcelData.RequestResult = request_result;
134 updatePacket.ParcelData.SalePrice = landData.salePrice; 134 updatePacket.ParcelData.SalePrice = landData.salePrice;
135 updatePacket.ParcelData.SelectedPrims = landData.selectedPrims; 135 updatePacket.ParcelData.SelectedPrims = landData.selectedPrims;
136 updatePacket.ParcelData.SelfCount = 0;//unemplemented 136 updatePacket.ParcelData.SelfCount = 0;//unemplemented
137 updatePacket.ParcelData.SequenceID = sequence_id; 137 updatePacket.ParcelData.SequenceID = sequence_id;
138 if (landData.simwideArea > 0) 138 if (landData.simwideArea > 0)
139 { 139 {
140 updatePacket.ParcelData.SimWideMaxPrims = Convert.ToInt32(Math.Round((Convert.ToDecimal(landData.simwideArea) / Convert.ToDecimal(65536)) * 15000 * Convert.ToDecimal(m_scene.RegionInfo.estateSettings.objectBonusFactor))); 140 updatePacket.ParcelData.SimWideMaxPrims = Convert.ToInt32(Math.Round((Convert.ToDecimal(landData.simwideArea) / Convert.ToDecimal(65536)) * 15000 * Convert.ToDecimal(m_scene.RegionInfo.estateSettings.objectBonusFactor)));
141 } 141 }
142 else 142 else
143 { 143 {
144 updatePacket.ParcelData.SimWideMaxPrims = 0; 144 updatePacket.ParcelData.SimWideMaxPrims = 0;
145 } 145 }
146 updatePacket.ParcelData.SimWideTotalPrims = landData.simwidePrims; 146 updatePacket.ParcelData.SimWideTotalPrims = landData.simwidePrims;
147 updatePacket.ParcelData.SnapSelection = snap_selection; 147 updatePacket.ParcelData.SnapSelection = snap_selection;
148 updatePacket.ParcelData.SnapshotID = landData.snapshotID; 148 updatePacket.ParcelData.SnapshotID = landData.snapshotID;
149 updatePacket.ParcelData.Status = (byte)landData.landStatus; 149 updatePacket.ParcelData.Status = (byte)landData.landStatus;
150 updatePacket.ParcelData.TotalPrims = landData.ownerPrims + landData.groupPrims + landData.otherPrims + landData.selectedPrims; 150 updatePacket.ParcelData.TotalPrims = landData.ownerPrims + landData.groupPrims + landData.otherPrims + landData.selectedPrims;
151 updatePacket.ParcelData.UserLocation = landData.userLocation; 151 updatePacket.ParcelData.UserLocation = landData.userLocation;
152 updatePacket.ParcelData.UserLookAt = landData.userLookAt; 152 updatePacket.ParcelData.UserLookAt = landData.userLookAt;
153 remote_client.OutPacket((Packet)updatePacket); 153 remote_client.OutPacket((Packet)updatePacket);
154 } 154 }
155 155
156 public void updateLandProperties(ParcelPropertiesUpdatePacket packet, IClientAPI remote_client) 156 public void updateLandProperties(ParcelPropertiesUpdatePacket packet, IClientAPI remote_client)
157 { 157 {
158 if (remote_client.AgentId == landData.ownerID) 158 if (remote_client.AgentId == landData.ownerID)
159 { 159 {
160 //Needs later group support 160 //Needs later group support
161 landData.authBuyerID = packet.ParcelData.AuthBuyerID; 161 landData.authBuyerID = packet.ParcelData.AuthBuyerID;
162 landData.category = (libsecondlife.Parcel.ParcelCategory)packet.ParcelData.Category; 162 landData.category = (libsecondlife.Parcel.ParcelCategory)packet.ParcelData.Category;
163 landData.landDesc = Helpers.FieldToUTF8String(packet.ParcelData.Desc); 163 landData.landDesc = Helpers.FieldToUTF8String(packet.ParcelData.Desc);
164 landData.groupID = packet.ParcelData.GroupID; 164 landData.groupID = packet.ParcelData.GroupID;
165 landData.landingType = packet.ParcelData.LandingType; 165 landData.landingType = packet.ParcelData.LandingType;
166 landData.mediaAutoScale = packet.ParcelData.MediaAutoScale; 166 landData.mediaAutoScale = packet.ParcelData.MediaAutoScale;
167 landData.mediaID = packet.ParcelData.MediaID; 167 landData.mediaID = packet.ParcelData.MediaID;
168 landData.mediaURL = Helpers.FieldToUTF8String(packet.ParcelData.MediaURL); 168 landData.mediaURL = Helpers.FieldToUTF8String(packet.ParcelData.MediaURL);
169 landData.musicURL = Helpers.FieldToUTF8String(packet.ParcelData.MusicURL); 169 landData.musicURL = Helpers.FieldToUTF8String(packet.ParcelData.MusicURL);
170 landData.landName = Helpers.FieldToUTF8String(packet.ParcelData.Name); 170 landData.landName = Helpers.FieldToUTF8String(packet.ParcelData.Name);
171 landData.landFlags = packet.ParcelData.ParcelFlags; 171 landData.landFlags = packet.ParcelData.ParcelFlags;
172 landData.passHours = packet.ParcelData.PassHours; 172 landData.passHours = packet.ParcelData.PassHours;
173 landData.passPrice = packet.ParcelData.PassPrice; 173 landData.passPrice = packet.ParcelData.PassPrice;
174 landData.salePrice = packet.ParcelData.SalePrice; 174 landData.salePrice = packet.ParcelData.SalePrice;
175 landData.snapshotID = packet.ParcelData.SnapshotID; 175 landData.snapshotID = packet.ParcelData.SnapshotID;
176 landData.userLocation = packet.ParcelData.UserLocation; 176 landData.userLocation = packet.ParcelData.UserLocation;
177 landData.userLookAt = packet.ParcelData.UserLookAt; 177 landData.userLookAt = packet.ParcelData.UserLookAt;
178 sendLandUpdateToAvatarsOverMe(); 178 sendLandUpdateToAvatarsOverMe();
179 179
180 180
181 } 181 }
182 } 182 }
183 183
184 public void sendLandUpdateToAvatarsOverMe() 184 public void sendLandUpdateToAvatarsOverMe()
185 { 185 {
186 List<ScenePresence> avatars = m_scene.RequestAvatarList(); 186 List<ScenePresence> avatars = m_scene.RequestAvatarList();
187 for (int i = 0; i < avatars.Count; i++) 187 for (int i = 0; i < avatars.Count; i++)
188 { 188 {
189 Land over = m_scene.LandManager.getLandObject((int)Math.Round(avatars[i].Pos.X), (int)Math.Round(avatars[i].Pos.Y)); 189 Land over = m_scene.LandManager.getLandObject((int)Math.Round(avatars[i].Pos.X), (int)Math.Round(avatars[i].Pos.Y));
190 if (over.landData.localID == this.landData.localID) 190 if (over.landData.localID == this.landData.localID)
191 { 191 {
192 sendLandProperties(0, false, 0, avatars[i].ControllingClient); 192 sendLandProperties(0, false, 0, avatars[i].ControllingClient);
193 } 193 }
194 } 194 }
195 } 195 }
196 #endregion 196 #endregion
197 197
198 198
199 #region Update Functions 199 #region Update Functions
200 /// <summary> 200 /// <summary>
201 /// Updates the AABBMin and AABBMax values after area/shape modification of the land object 201 /// Updates the AABBMin and AABBMax values after area/shape modification of the land object
202 /// </summary> 202 /// </summary>
203 private void updateAABBAndAreaValues() 203 private void updateAABBAndAreaValues()
204 { 204 {
205 int min_x = 64; 205 int min_x = 64;
206 int min_y = 64; 206 int min_y = 64;
207 int max_x = 0; 207 int max_x = 0;
208 int max_y = 0; 208 int max_y = 0;
209 int tempArea = 0; 209 int tempArea = 0;
210 int x, y; 210 int x, y;
211 for (x = 0; x < 64; x++) 211 for (x = 0; x < 64; x++)
212 { 212 {
213 for (y = 0; y < 64; y++) 213 for (y = 0; y < 64; y++)
214 { 214 {
215 if (landBitmap[x, y] == true) 215 if (landBitmap[x, y] == true)
216 { 216 {
217 if (min_x > x) min_x = x; 217 if (min_x > x) min_x = x;
218 if (min_y > y) min_y = y; 218 if (min_y > y) min_y = y;
219 if (max_x < x) max_x = x; 219 if (max_x < x) max_x = x;
220 if (max_y < y) max_y = y; 220 if (max_y < y) max_y = y;
221 tempArea += 16; //16sqm peice of land 221 tempArea += 16; //16sqm peice of land
222 } 222 }
223 } 223 }
224 } 224 }
225 landData.AABBMin = new LLVector3((float)(min_x * 4), (float)(min_y * 4), (float)m_scene.Terrain.GetHeight((min_x * 4), (min_y * 4))); 225 landData.AABBMin = new LLVector3((float)(min_x * 4), (float)(min_y * 4), (float)m_scene.Terrain.GetHeight((min_x * 4), (min_y * 4)));
226 landData.AABBMax = new LLVector3((float)(max_x * 4), (float)(max_y * 4), (float)m_scene.Terrain.GetHeight((max_x * 4), (max_y * 4))); 226 landData.AABBMax = new LLVector3((float)(max_x * 4), (float)(max_y * 4), (float)m_scene.Terrain.GetHeight((max_x * 4), (max_y * 4)));
227 landData.area = tempArea; 227 landData.area = tempArea;
228 } 228 }
229 229
230 public void updateLandBitmapByteArray() 230 public void updateLandBitmapByteArray()
231 { 231 {
232 landData.landBitmapByteArray = convertLandBitmapToBytes(); 232 landData.landBitmapByteArray = convertLandBitmapToBytes();
233 } 233 }
234 234
235 /// <summary> 235 /// <summary>
236 /// Update all settings in land such as area, bitmap byte array, etc 236 /// Update all settings in land such as area, bitmap byte array, etc
237 /// </summary> 237 /// </summary>
238 public void forceUpdateLandInfo() 238 public void forceUpdateLandInfo()
239 { 239 {
240 this.updateAABBAndAreaValues(); 240 this.updateAABBAndAreaValues();
241 this.updateLandBitmapByteArray(); 241 this.updateLandBitmapByteArray();
242 } 242 }
243 243
244 public void setLandBitmapFromByteArray() 244 public void setLandBitmapFromByteArray()
245 { 245 {
246 landBitmap = convertBytesToLandBitmap(); 246 landBitmap = convertBytesToLandBitmap();
247 } 247 }
248 #endregion 248 #endregion
249 249
250 250
251 #region Land Bitmap Functions 251 #region Land Bitmap Functions
252 /// <summary> 252 /// <summary>
253 /// Sets the land's bitmap manually 253 /// Sets the land's bitmap manually
254 /// </summary> 254 /// </summary>
255 /// <param name="bitmap">64x64 block representing where this land is on a map</param> 255 /// <param name="bitmap">64x64 block representing where this land is on a map</param>
256 public void setLandBitmap(bool[,] bitmap) 256 public void setLandBitmap(bool[,] bitmap)
257 { 257 {
258 if (bitmap.GetLength(0) != 64 || bitmap.GetLength(1) != 64 || bitmap.Rank != 2) 258 if (bitmap.GetLength(0) != 64 || bitmap.GetLength(1) != 64 || bitmap.Rank != 2)
259 { 259 {
260 //Throw an exception - The bitmap is not 64x64 260 //Throw an exception - The bitmap is not 64x64
261 throw new Exception("Error: Invalid Parcel Bitmap"); 261 throw new Exception("Error: Invalid Parcel Bitmap");
262 } 262 }
263 else 263 else
264 { 264 {
265 //Valid: Lets set it 265 //Valid: Lets set it
266 landBitmap = bitmap; 266 landBitmap = bitmap;
267 forceUpdateLandInfo(); 267 forceUpdateLandInfo();
268 268
269 } 269 }
270 } 270 }
271 /// <summary> 271 /// <summary>
272 /// Gets the land's bitmap manually 272 /// Gets the land's bitmap manually
273 /// </summary> 273 /// </summary>
274 /// <returns></returns> 274 /// <returns></returns>
275 public bool[,] getLandBitmap() 275 public bool[,] getLandBitmap()
276 { 276 {
277 return landBitmap; 277 return landBitmap;
278 } 278 }
279 /// <summary> 279 /// <summary>
280 /// Converts the land bitmap to a packet friendly byte array 280 /// Converts the land bitmap to a packet friendly byte array
281 /// </summary> 281 /// </summary>
282 /// <returns></returns> 282 /// <returns></returns>
283 private byte[] convertLandBitmapToBytes() 283 private byte[] convertLandBitmapToBytes()
284 { 284 {
285 byte[] tempConvertArr = new byte[512]; 285 byte[] tempConvertArr = new byte[512];
286 byte tempByte = 0; 286 byte tempByte = 0;
287 int x, y, i, byteNum = 0; 287 int x, y, i, byteNum = 0;
288 i = 0; 288 i = 0;
289 for (y = 0; y < 64; y++) 289 for (y = 0; y < 64; y++)
290 { 290 {
291 for (x = 0; x < 64; x++) 291 for (x = 0; x < 64; x++)
292 { 292 {
293 tempByte = Convert.ToByte(tempByte | Convert.ToByte(landBitmap[x, y]) << (i++ % 8)); 293 tempByte = Convert.ToByte(tempByte | Convert.ToByte(landBitmap[x, y]) << (i++ % 8));
294 if (i % 8 == 0) 294 if (i % 8 == 0)
295 { 295 {
296 tempConvertArr[byteNum] = tempByte; 296 tempConvertArr[byteNum] = tempByte;
297 tempByte = (byte)0; 297 tempByte = (byte)0;
298 i = 0; 298 i = 0;
299 byteNum++; 299 byteNum++;
300 } 300 }
301 } 301 }
302 } 302 }
303 return tempConvertArr; 303 return tempConvertArr;
304 } 304 }
305 305
306 private bool[,] convertBytesToLandBitmap() 306 private bool[,] convertBytesToLandBitmap()
307 { 307 {
308 bool[,] tempConvertMap = new bool[64, 64]; 308 bool[,] tempConvertMap = new bool[64, 64];
309 tempConvertMap.Initialize(); 309 tempConvertMap.Initialize();
310 byte tempByte = 0; 310 byte tempByte = 0;
311 int x = 0, y = 0, i = 0, bitNum = 0; 311 int x = 0, y = 0, i = 0, bitNum = 0;
312 for (i = 0; i < 512; i++) 312 for (i = 0; i < 512; i++)
313 { 313 {
314 tempByte = landData.landBitmapByteArray[i]; 314 tempByte = landData.landBitmapByteArray[i];
315 for (bitNum = 0; bitNum < 8; bitNum++) 315 for (bitNum = 0; bitNum < 8; bitNum++)
316 { 316 {
317 bool bit = Convert.ToBoolean(Convert.ToByte(tempByte >> bitNum) & (byte)1); 317 bool bit = Convert.ToBoolean(Convert.ToByte(tempByte >> bitNum) & (byte)1);
318 tempConvertMap[x, y] = bit; 318 tempConvertMap[x, y] = bit;
319 x++; 319 x++;
320 if (x > 63) 320 if (x > 63)
321 { 321 {
322 x = 0; 322 x = 0;
323 y++; 323 y++;
324 } 324 }
325 325
326 } 326 }
327 327
328 } 328 }
329 return tempConvertMap; 329 return tempConvertMap;
330 } 330 }
331 /// <summary> 331 /// <summary>
332 /// Full sim land object creation 332 /// Full sim land object creation
333 /// </summary> 333 /// </summary>
334 /// <returns></returns> 334 /// <returns></returns>
335 public static bool[,] basicFullRegionLandBitmap() 335 public static bool[,] basicFullRegionLandBitmap()
336 { 336 {
337 return getSquareLandBitmap(0, 0, 256, 256); 337 return getSquareLandBitmap(0, 0, 256, 256);
338 } 338 }
339 339
340 /// <summary> 340 /// <summary>
341 /// Used to modify the bitmap between the x and y points. Points use 64 scale 341 /// Used to modify the bitmap between the x and y points. Points use 64 scale
342 /// </summary> 342 /// </summary>
343 /// <param name="start_x"></param> 343 /// <param name="start_x"></param>
344 /// <param name="start_y"></param> 344 /// <param name="start_y"></param>
345 /// <param name="end_x"></param> 345 /// <param name="end_x"></param>
346 /// <param name="end_y"></param> 346 /// <param name="end_y"></param>
347 /// <returns></returns> 347 /// <returns></returns>
348 public static bool[,] getSquareLandBitmap(int start_x, int start_y, int end_x, int end_y) 348 public static bool[,] getSquareLandBitmap(int start_x, int start_y, int end_x, int end_y)
349 { 349 {
350 350
351 bool[,] tempBitmap = new bool[64, 64]; 351 bool[,] tempBitmap = new bool[64, 64];
352 tempBitmap.Initialize(); 352 tempBitmap.Initialize();
353 353
354 tempBitmap = modifyLandBitmapSquare(tempBitmap, start_x, start_y, end_x, end_y, true); 354 tempBitmap = modifyLandBitmapSquare(tempBitmap, start_x, start_y, end_x, end_y, true);
355 return tempBitmap; 355 return tempBitmap;
356 } 356 }
357 357
358 /// <summary> 358 /// <summary>
359 /// Change a land bitmap at within a square and set those points to a specific value 359 /// Change a land bitmap at within a square and set those points to a specific value
360 /// </summary> 360 /// </summary>
361 /// <param name="land_bitmap"></param> 361 /// <param name="land_bitmap"></param>
362 /// <param name="start_x"></param> 362 /// <param name="start_x"></param>
363 /// <param name="start_y"></param> 363 /// <param name="start_y"></param>
364 /// <param name="end_x"></param> 364 /// <param name="end_x"></param>
365 /// <param name="end_y"></param> 365 /// <param name="end_y"></param>
366 /// <param name="set_value"></param> 366 /// <param name="set_value"></param>
367 /// <returns></returns> 367 /// <returns></returns>
368 public static bool[,] modifyLandBitmapSquare(bool[,] land_bitmap, int start_x, int start_y, int end_x, int end_y, bool set_value) 368 public static bool[,] modifyLandBitmapSquare(bool[,] land_bitmap, int start_x, int start_y, int end_x, int end_y, bool set_value)
369 { 369 {
370 if (land_bitmap.GetLength(0) != 64 || land_bitmap.GetLength(1) != 64 || land_bitmap.Rank != 2) 370 if (land_bitmap.GetLength(0) != 64 || land_bitmap.GetLength(1) != 64 || land_bitmap.Rank != 2)
371 { 371 {
372 //Throw an exception - The bitmap is not 64x64 372 //Throw an exception - The bitmap is not 64x64
373 throw new Exception("Error: Invalid Parcel Bitmap in modifyLandBitmapSquare()"); 373 throw new Exception("Error: Invalid Parcel Bitmap in modifyLandBitmapSquare()");
374 } 374 }
375 375
376 int x, y; 376 int x, y;
377 for (y = 0; y < 64; y++) 377 for (y = 0; y < 64; y++)
378 { 378 {
379 for (x = 0; x < 64; x++) 379 for (x = 0; x < 64; x++)
380 { 380 {
381 if (x >= start_x / 4 && x < end_x / 4 381 if (x >= start_x / 4 && x < end_x / 4
382 && y >= start_y / 4 && y < end_y / 4) 382 && y >= start_y / 4 && y < end_y / 4)
383 { 383 {
384 land_bitmap[x, y] = set_value; 384 land_bitmap[x, y] = set_value;
385 } 385 }
386 } 386 }
387 } 387 }
388 return land_bitmap; 388 return land_bitmap;
389 } 389 }
390 /// <summary> 390 /// <summary>
391 /// Join the true values of 2 bitmaps together 391 /// Join the true values of 2 bitmaps together
392 /// </summary> 392 /// </summary>
393 /// <param name="bitmap_base"></param> 393 /// <param name="bitmap_base"></param>
394 /// <param name="bitmap_add"></param> 394 /// <param name="bitmap_add"></param>
395 /// <returns></returns> 395 /// <returns></returns>
396 public static bool[,] mergeLandBitmaps(bool[,] bitmap_base, bool[,] bitmap_add) 396 public static bool[,] mergeLandBitmaps(bool[,] bitmap_base, bool[,] bitmap_add)
397 { 397 {
398 if (bitmap_base.GetLength(0) != 64 || bitmap_base.GetLength(1) != 64 || bitmap_base.Rank != 2) 398 if (bitmap_base.GetLength(0) != 64 || bitmap_base.GetLength(1) != 64 || bitmap_base.Rank != 2)
399 { 399 {
400 //Throw an exception - The bitmap is not 64x64 400 //Throw an exception - The bitmap is not 64x64
401 throw new Exception("Error: Invalid Parcel Bitmap - Bitmap_base in mergeLandBitmaps"); 401 throw new Exception("Error: Invalid Parcel Bitmap - Bitmap_base in mergeLandBitmaps");
402 } 402 }
403 if (bitmap_add.GetLength(0) != 64 || bitmap_add.GetLength(1) != 64 || bitmap_add.Rank != 2) 403 if (bitmap_add.GetLength(0) != 64 || bitmap_add.GetLength(1) != 64 || bitmap_add.Rank != 2)
404 { 404 {
405 //Throw an exception - The bitmap is not 64x64 405 //Throw an exception - The bitmap is not 64x64
406 throw new Exception("Error: Invalid Parcel Bitmap - Bitmap_add in mergeLandBitmaps"); 406 throw new Exception("Error: Invalid Parcel Bitmap - Bitmap_add in mergeLandBitmaps");
407 407
408 } 408 }
409 409
410 int x, y; 410 int x, y;
411 for (y = 0; y < 64; y++) 411 for (y = 0; y < 64; y++)
412 { 412 {
413 for (x = 0; x < 64; x++) 413 for (x = 0; x < 64; x++)
414 { 414 {
415 if (bitmap_add[x, y]) 415 if (bitmap_add[x, y])
416 { 416 {
417 bitmap_base[x, y] = true; 417 bitmap_base[x, y] = true;
418 } 418 }
419 } 419 }
420 } 420 }
421 return bitmap_base; 421 return bitmap_base;
422 } 422 }
423 #endregion 423 #endregion
424 424
425 #region Object Select and Object Owner Listing 425 #region Object Select and Object Owner Listing
426 public void sendForceObjectSelect(int local_id, int request_type, IClientAPI remote_client) 426 public void sendForceObjectSelect(int local_id, int request_type, IClientAPI remote_client)
427 { 427 {
428 List<uint> resultLocalIDs = new List<uint>(); 428 List<uint> resultLocalIDs = new List<uint>();
429 foreach (SceneObject obj in primsOverMe) 429 foreach (SceneObject obj in primsOverMe)
430 { 430 {
431 if (obj.rootLocalID > 0) 431 if (obj.rootLocalID > 0)
432 { 432 {
433 if (request_type == LandManager.LAND_SELECT_OBJECTS_OWNER && obj.rootPrimitive.OwnerID == this.landData.ownerID) 433 if (request_type == LandManager.LAND_SELECT_OBJECTS_OWNER && obj.rootPrimitive.OwnerID == this.landData.ownerID)
434 { 434 {
435 resultLocalIDs.Add(obj.rootLocalID); 435 resultLocalIDs.Add(obj.rootLocalID);
436 } 436 }
437 else if (request_type == LandManager.LAND_SELECT_OBJECTS_GROUP && false) //TODO: change false to group support! 437 else if (request_type == LandManager.LAND_SELECT_OBJECTS_GROUP && false) //TODO: change false to group support!
438 { 438 {
439 439
440 } 440 }
441 else if (request_type == LandManager.LAND_SELECT_OBJECTS_OTHER && obj.rootPrimitive.OwnerID != remote_client.AgentId) 441 else if (request_type == LandManager.LAND_SELECT_OBJECTS_OTHER && obj.rootPrimitive.OwnerID != remote_client.AgentId)
442 { 442 {
443 resultLocalIDs.Add(obj.rootLocalID); 443 resultLocalIDs.Add(obj.rootLocalID);
444 } 444 }
445 } 445 }
446 } 446 }
447 447
448 448
449 bool firstCall = true; 449 bool firstCall = true;
450 int MAX_OBJECTS_PER_PACKET = 251; 450 int MAX_OBJECTS_PER_PACKET = 251;
451 ForceObjectSelectPacket pack = new ForceObjectSelectPacket(); 451 ForceObjectSelectPacket pack = new ForceObjectSelectPacket();
452 ForceObjectSelectPacket.DataBlock[] data; 452 ForceObjectSelectPacket.DataBlock[] data;
453 while (resultLocalIDs.Count > 0) 453 while (resultLocalIDs.Count > 0)
454 { 454 {
455 if (firstCall) 455 if (firstCall)
456 { 456 {
457 pack._Header.ResetList = true; 457 pack._Header.ResetList = true;
458 firstCall = false; 458 firstCall = false;
459 } 459 }
460 else 460 else
461 { 461 {
462 pack._Header.ResetList = false; 462 pack._Header.ResetList = false;
463 } 463 }
464 464
465 if (resultLocalIDs.Count > MAX_OBJECTS_PER_PACKET) 465 if (resultLocalIDs.Count > MAX_OBJECTS_PER_PACKET)
466 { 466 {
467 data = new ForceObjectSelectPacket.DataBlock[MAX_OBJECTS_PER_PACKET]; 467 data = new ForceObjectSelectPacket.DataBlock[MAX_OBJECTS_PER_PACKET];
468 } 468 }
469 else 469 else
470 { 470 {
471 data = new ForceObjectSelectPacket.DataBlock[resultLocalIDs.Count]; 471 data = new ForceObjectSelectPacket.DataBlock[resultLocalIDs.Count];
472 } 472 }
473 473
474 int i; 474 int i;
475 for (i = 0; i < MAX_OBJECTS_PER_PACKET && resultLocalIDs.Count > 0; i++) 475 for (i = 0; i < MAX_OBJECTS_PER_PACKET && resultLocalIDs.Count > 0; i++)
476 { 476 {
477 data[i] = new ForceObjectSelectPacket.DataBlock(); 477 data[i] = new ForceObjectSelectPacket.DataBlock();
478 data[i].LocalID = Convert.ToUInt32(resultLocalIDs[0]); 478 data[i].LocalID = Convert.ToUInt32(resultLocalIDs[0]);
479 resultLocalIDs.RemoveAt(0); 479 resultLocalIDs.RemoveAt(0);
480 } 480 }
481 pack.Data = data; 481 pack.Data = data;
482 remote_client.OutPacket((Packet)pack); 482 remote_client.OutPacket((Packet)pack);
483 } 483 }
484 484
485 } 485 }
486 public void sendLandObjectOwners(IClientAPI remote_client) 486 public void sendLandObjectOwners(IClientAPI remote_client)
487 { 487 {
488 Dictionary<LLUUID, int> ownersAndCount = new Dictionary<LLUUID, int>(); 488 Dictionary<LLUUID, int> ownersAndCount = new Dictionary<LLUUID, int>();
489 foreach (SceneObject obj in primsOverMe) 489 foreach (SceneObject obj in primsOverMe)
490 { 490 {
491 if (!ownersAndCount.ContainsKey(obj.rootPrimitive.OwnerID)) 491 if (!ownersAndCount.ContainsKey(obj.rootPrimitive.OwnerID))
492 { 492 {
493 ownersAndCount.Add(obj.rootPrimitive.OwnerID, 0); 493 ownersAndCount.Add(obj.rootPrimitive.OwnerID, 0);
494 } 494 }
495 ownersAndCount[obj.rootPrimitive.OwnerID] += obj.primCount; 495 ownersAndCount[obj.rootPrimitive.OwnerID] += obj.primCount;
496 } 496 }
497 if (ownersAndCount.Count > 0) 497 if (ownersAndCount.Count > 0)
498 { 498 {
499 499
500 ParcelObjectOwnersReplyPacket.DataBlock[] dataBlock = new ParcelObjectOwnersReplyPacket.DataBlock[32]; 500 ParcelObjectOwnersReplyPacket.DataBlock[] dataBlock = new ParcelObjectOwnersReplyPacket.DataBlock[32];
501 501
502 if (ownersAndCount.Count < 32) 502 if (ownersAndCount.Count < 32)
503 { 503 {
504 dataBlock = new ParcelObjectOwnersReplyPacket.DataBlock[ownersAndCount.Count]; 504 dataBlock = new ParcelObjectOwnersReplyPacket.DataBlock[ownersAndCount.Count];
505 } 505 }
506 506
507 507
508 int num = 0; 508 int num = 0;
509 foreach (LLUUID owner in ownersAndCount.Keys) 509 foreach (LLUUID owner in ownersAndCount.Keys)
510 { 510 {
511 dataBlock[num] = new ParcelObjectOwnersReplyPacket.DataBlock(); 511 dataBlock[num] = new ParcelObjectOwnersReplyPacket.DataBlock();
512 dataBlock[num].Count = ownersAndCount[owner]; 512 dataBlock[num].Count = ownersAndCount[owner];
513 dataBlock[num].IsGroupOwned = false; //TODO: fix me when group support is added 513 dataBlock[num].IsGroupOwned = false; //TODO: fix me when group support is added
514 dataBlock[num].OnlineStatus = true; //TODO: fix me later 514 dataBlock[num].OnlineStatus = true; //TODO: fix me later
515 dataBlock[num].OwnerID = owner; 515 dataBlock[num].OwnerID = owner;
516 516
517 num++; 517 num++;
518 } 518 }
519 519
520 ParcelObjectOwnersReplyPacket pack = new ParcelObjectOwnersReplyPacket(); 520 ParcelObjectOwnersReplyPacket pack = new ParcelObjectOwnersReplyPacket();
521 pack.Data = dataBlock; 521 pack.Data = dataBlock;
522 remote_client.OutPacket(pack); 522 remote_client.OutPacket(pack);
523 } 523 }
524 } 524 }
525 #endregion 525 #endregion
526 526
527 #region Object Returning 527 #region Object Returning
528 public void returnObject(SceneObject obj) 528 public void returnObject(SceneObject obj)
529 { 529 {
530 } 530 }
531 public void returnLandObjects(int type, LLUUID owner) 531 public void returnLandObjects(int type, LLUUID owner)
532 { 532 {
533 533
534 } 534 }
535 #endregion 535 #endregion
536 536
537 #region Object Adding/Removing from Parcel 537 #region Object Adding/Removing from Parcel
538 public void resetLandPrimCounts() 538 public void resetLandPrimCounts()
539 { 539 {
540 landData.groupPrims = 0; 540 landData.groupPrims = 0;
541 landData.ownerPrims = 0; 541 landData.ownerPrims = 0;
542 landData.otherPrims = 0; 542 landData.otherPrims = 0;
543 landData.selectedPrims = 0; 543 landData.selectedPrims = 0;
544 primsOverMe.Clear(); 544 primsOverMe.Clear();
545 } 545 }
546 546
547 public void addPrimToCount(SceneObject obj) 547 public void addPrimToCount(SceneObject obj)
548 { 548 {
549 LLUUID prim_owner = obj.rootPrimitive.OwnerID; 549 LLUUID prim_owner = obj.rootPrimitive.OwnerID;
550 int prim_count = obj.primCount; 550 int prim_count = obj.primCount;
551 551
552 if (obj.isSelected) 552 if (obj.isSelected)
553 { 553 {
554 landData.selectedPrims += prim_count; 554 landData.selectedPrims += prim_count;
555 } 555 }
556 else 556 else
557 { 557 {
558 if (prim_owner == landData.ownerID) 558 if (prim_owner == landData.ownerID)
559 { 559 {
560 landData.ownerPrims += prim_count; 560 landData.ownerPrims += prim_count;
561 } 561 }
562 else 562 else
563 { 563 {
564 landData.otherPrims += prim_count; 564 landData.otherPrims += prim_count;
565 } 565 }
566 } 566 }
567 567
568 primsOverMe.Add(obj); 568 primsOverMe.Add(obj);
569 569
570 } 570 }
571 571
572 public void removePrimFromCount(SceneObject obj) 572 public void removePrimFromCount(SceneObject obj)
573 { 573 {
574 if (primsOverMe.Contains(obj)) 574 if (primsOverMe.Contains(obj))
575 { 575 {
576 LLUUID prim_owner = obj.rootPrimitive.OwnerID; 576 LLUUID prim_owner = obj.rootPrimitive.OwnerID;
577 int prim_count = obj.primCount; 577 int prim_count = obj.primCount;
578 578
579 if (prim_owner == landData.ownerID) 579 if (prim_owner == landData.ownerID)
580 { 580 {
581 landData.ownerPrims -= prim_count; 581 landData.ownerPrims -= prim_count;
582 } 582 }
583 else if (prim_owner == landData.groupID) 583 else if (prim_owner == landData.groupID)
584 { 584 {
585 landData.groupPrims -= prim_count; 585 landData.groupPrims -= prim_count;
586 } 586 }
587 else 587 else
588 { 588 {
589 landData.otherPrims -= prim_count; 589 landData.otherPrims -= prim_count;
590 } 590 }
591 591
592 primsOverMe.Remove(obj); 592 primsOverMe.Remove(obj);
593 } 593 }
594 } 594 }
595 #endregion 595 #endregion
596 596
597 #endregion 597 #endregion
598 598
599 599
600 } 600 }
601 #endregion 601 #endregion
602} 602}
diff --git a/OpenSim/Region/Environment/LandManagement/LandManager.cs b/OpenSim/Region/Environment/LandManagement/LandManager.cs
index 8c359fc..f759934 100644
--- a/OpenSim/Region/Environment/LandManagement/LandManager.cs
+++ b/OpenSim/Region/Environment/LandManagement/LandManager.cs
@@ -1,617 +1,617 @@
1/* 1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/ 2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders. 3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4* 4*
5* Redistribution and use in source and binary forms, with or without 5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met: 6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright 7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer. 8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright 9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the 10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution. 11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the 12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products 13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission. 14* derived from this software without specific prior written permission.
15* 15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY 16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using libsecondlife; 30using libsecondlife;
31using libsecondlife.Packets; 31using libsecondlife.Packets;
32using OpenSim.Framework.Interfaces; 32using OpenSim.Framework.Interfaces;
33using OpenSim.Framework.Types; 33using OpenSim.Framework.Types;
34using OpenSim.Region.Environment.Scenes; 34using OpenSim.Region.Environment.Scenes;
35 35
36namespace OpenSim.Region.Environment.LandManagement 36namespace OpenSim.Region.Environment.LandManagement
37{ 37{
38 38
39 39
40 #region LandManager Class 40 #region LandManager Class
41 /// <summary> 41 /// <summary>
42 /// Handles Land objects and operations requiring information from other Land objects (divide, join, etc) 42 /// Handles Land objects and operations requiring information from other Land objects (divide, join, etc)
43 /// </summary> 43 /// </summary>
44 public class LandManager : ILocalStorageLandObjectReceiver 44 public class LandManager : ILocalStorageLandObjectReceiver
45 { 45 {
46 46
47 #region Constants 47 #region Constants
48 //Land types set with flags in ParcelOverlay. 48 //Land types set with flags in ParcelOverlay.
49 //Only one of these can be used. 49 //Only one of these can be used.
50 public const byte LAND_TYPE_PUBLIC = (byte)0; //Equals 00000000 50 public const byte LAND_TYPE_PUBLIC = (byte)0; //Equals 00000000
51 public const byte LAND_TYPE_OWNED_BY_OTHER = (byte)1; //Equals 00000001 51 public const byte LAND_TYPE_OWNED_BY_OTHER = (byte)1; //Equals 00000001
52 public const byte LAND_TYPE_OWNED_BY_GROUP = (byte)2; //Equals 00000010 52 public const byte LAND_TYPE_OWNED_BY_GROUP = (byte)2; //Equals 00000010
53 public const byte LAND_TYPE_OWNED_BY_REQUESTER = (byte)3; //Equals 00000011 53 public const byte LAND_TYPE_OWNED_BY_REQUESTER = (byte)3; //Equals 00000011
54 public const byte LAND_TYPE_IS_FOR_SALE = (byte)4; //Equals 00000100 54 public const byte LAND_TYPE_IS_FOR_SALE = (byte)4; //Equals 00000100
55 public const byte LAND_TYPE_IS_BEING_AUCTIONED = (byte)5; //Equals 00000101 55 public const byte LAND_TYPE_IS_BEING_AUCTIONED = (byte)5; //Equals 00000101
56 56
57 57
58 //Flags that when set, a border on the given side will be placed 58 //Flags that when set, a border on the given side will be placed
59 //NOTE: North and East is assumable by the west and south sides (if land to east has a west border, then I have an east border; etc) 59 //NOTE: North and East is assumable by the west and south sides (if land to east has a west border, then I have an east border; etc)
60 //This took forever to figure out -- jeesh. /blame LL for even having to send these 60 //This took forever to figure out -- jeesh. /blame LL for even having to send these
61 public const byte LAND_FLAG_PROPERTY_BORDER_WEST = (byte)64; //Equals 01000000 61 public const byte LAND_FLAG_PROPERTY_BORDER_WEST = (byte)64; //Equals 01000000
62 public const byte LAND_FLAG_PROPERTY_BORDER_SOUTH = (byte)128; //Equals 10000000 62 public const byte LAND_FLAG_PROPERTY_BORDER_SOUTH = (byte)128; //Equals 10000000
63 63
64 //RequestResults (I think these are right, they seem to work): 64 //RequestResults (I think these are right, they seem to work):
65 public const int LAND_RESULT_SINGLE = 0; // The request they made contained only a single piece of land 65 public const int LAND_RESULT_SINGLE = 0; // The request they made contained only a single piece of land
66 public const int LAND_RESULT_MULTIPLE = 1; // The request they made contained more than a single peice of land 66 public const int LAND_RESULT_MULTIPLE = 1; // The request they made contained more than a single peice of land
67 67
68 //ParcelSelectObjects 68 //ParcelSelectObjects
69 public const int LAND_SELECT_OBJECTS_OWNER = 2; 69 public const int LAND_SELECT_OBJECTS_OWNER = 2;
70 public const int LAND_SELECT_OBJECTS_GROUP = 4; 70 public const int LAND_SELECT_OBJECTS_GROUP = 4;
71 public const int LAND_SELECT_OBJECTS_OTHER = 8; 71 public const int LAND_SELECT_OBJECTS_OTHER = 8;
72 72
73 73
74 //These are other constants. Yay! 74 //These are other constants. Yay!
75 public const int START_LAND_LOCAL_ID = 1; 75 public const int START_LAND_LOCAL_ID = 1;
76 #endregion 76 #endregion
77 77
78 #region Member Variables 78 #region Member Variables
79 public Dictionary<int, Land> landList = new Dictionary<int, Land>(); 79 public Dictionary<int, Land> landList = new Dictionary<int, Land>();
80 private int lastLandLocalID = START_LAND_LOCAL_ID - 1; 80 private int lastLandLocalID = START_LAND_LOCAL_ID - 1;
81 private int[,] landIDList = new int[64, 64]; 81 private int[,] landIDList = new int[64, 64];
82 82
83 /// <summary> 83 /// <summary>
84 /// Set to true when a prim is moved, created, added. Performs a prim count update 84 /// Set to true when a prim is moved, created, added. Performs a prim count update
85 /// </summary> 85 /// </summary>
86 public bool landPrimCountTainted = false; 86 public bool landPrimCountTainted = false;
87 87
88 private Scene m_scene; 88 private Scene m_scene;
89 private RegionInfo m_regInfo; 89 private RegionInfo m_regInfo;
90 90
91 #endregion 91 #endregion
92 92
93 #region Constructors 93 #region Constructors
94 public LandManager(Scene scene, RegionInfo reginfo) 94 public LandManager(Scene scene, RegionInfo reginfo)
95 { 95 {
96 96
97 m_scene = scene; 97 m_scene = scene;
98 m_regInfo = reginfo; 98 m_regInfo = reginfo;
99 landIDList.Initialize(); 99 landIDList.Initialize();
100 100
101 } 101 }
102 #endregion 102 #endregion
103 103
104 #region Member Functions 104 #region Member Functions
105 105
106 #region Parcel From Storage Functions 106 #region Parcel From Storage Functions
107 public void LandFromStorage(LandData data) 107 public void LandFromStorage(LandData data)
108 { 108 {
109 Land new_land = new Land(data.ownerID, data.isGroupOwned, m_scene); 109 Land new_land = new Land(data.ownerID, data.isGroupOwned, m_scene);
110 new_land.landData = data.Copy(); 110 new_land.landData = data.Copy();
111 new_land.setLandBitmapFromByteArray(); 111 new_land.setLandBitmapFromByteArray();
112 addLandObject(new_land); 112 addLandObject(new_land);
113 113
114 } 114 }
115 115
116 public void NoLandDataFromStorage() 116 public void NoLandDataFromStorage()
117 { 117 {
118 resetSimLandObjects(); 118 resetSimLandObjects();
119 } 119 }
120 #endregion 120 #endregion
121 121
122 #region Parcel Add/Remove/Get/Create 122 #region Parcel Add/Remove/Get/Create
123 /// <summary> 123 /// <summary>
124 /// Creates a basic Parcel object without an owner (a zeroed key) 124 /// Creates a basic Parcel object without an owner (a zeroed key)
125 /// </summary> 125 /// </summary>
126 /// <returns></returns> 126 /// <returns></returns>
127 public Land createBaseLand() 127 public Land createBaseLand()
128 { 128 {
129 return new Land(new LLUUID(), false, m_scene); 129 return new Land(new LLUUID(), false, m_scene);
130 } 130 }
131 131
132 /// <summary> 132 /// <summary>
133 /// Adds a land object to the stored list and adds them to the landIDList to what they own 133 /// Adds a land object to the stored list and adds them to the landIDList to what they own
134 /// </summary> 134 /// </summary>
135 /// <param name="new_land">The land object being added</param> 135 /// <param name="new_land">The land object being added</param>
136 public Land addLandObject(Land new_land) 136 public Land addLandObject(Land new_land)
137 { 137 {
138 lastLandLocalID++; 138 lastLandLocalID++;
139 new_land.landData.localID = lastLandLocalID; 139 new_land.landData.localID = lastLandLocalID;
140 landList.Add(lastLandLocalID, new_land.Copy()); 140 landList.Add(lastLandLocalID, new_land.Copy());
141 141
142 142
143 bool[,] landBitmap = new_land.getLandBitmap(); 143 bool[,] landBitmap = new_land.getLandBitmap();
144 int x, y; 144 int x, y;
145 for (x = 0; x < 64; x++) 145 for (x = 0; x < 64; x++)
146 { 146 {
147 for (y = 0; y < 64; y++) 147 for (y = 0; y < 64; y++)
148 { 148 {
149 if (landBitmap[x, y]) 149 if (landBitmap[x, y])
150 { 150 {
151 landIDList[x, y] = lastLandLocalID; 151 landIDList[x, y] = lastLandLocalID;
152 } 152 }
153 } 153 }
154 } 154 }
155 landList[lastLandLocalID].forceUpdateLandInfo(); 155 landList[lastLandLocalID].forceUpdateLandInfo();
156 156
157 return new_land; 157 return new_land;
158 158
159 } 159 }
160 /// <summary> 160 /// <summary>
161 /// Removes a land object from the list. Will not remove if local_id is still owning an area in landIDList 161 /// Removes a land object from the list. Will not remove if local_id is still owning an area in landIDList
162 /// </summary> 162 /// </summary>
163 /// <param name="local_id">Land.localID of the peice of land to remove.</param> 163 /// <param name="local_id">Land.localID of the peice of land to remove.</param>
164 public void removeLandObject(int local_id) 164 public void removeLandObject(int local_id)
165 { 165 {
166 int x, y; 166 int x, y;
167 for (x = 0; x < 64; x++) 167 for (x = 0; x < 64; x++)
168 { 168 {
169 for (y = 0; y < 64; y++) 169 for (y = 0; y < 64; y++)
170 { 170 {
171 if (landIDList[x, y] == local_id) 171 if (landIDList[x, y] == local_id)
172 { 172 {
173 throw new Exception("Could not remove land object. Still being used at " + x + ", " + y); 173 throw new Exception("Could not remove land object. Still being used at " + x + ", " + y);
174 } 174 }
175 } 175 }
176 } 176 }
177 // TODO: Put event here for storage manager to bind to. 177 // TODO: Put event here for storage manager to bind to.
178 landList.Remove(local_id); 178 landList.Remove(local_id);
179 } 179 }
180 180
181 private void performFinalLandJoin(Land master, Land slave) 181 private void performFinalLandJoin(Land master, Land slave)
182 { 182 {
183 int x, y; 183 int x, y;
184 bool[,] landBitmapSlave = slave.getLandBitmap(); 184 bool[,] landBitmapSlave = slave.getLandBitmap();
185 for (x = 0; x < 64; x++) 185 for (x = 0; x < 64; x++)
186 { 186 {
187 for (y = 0; y < 64; y++) 187 for (y = 0; y < 64; y++)
188 { 188 {
189 if (landBitmapSlave[x, y]) 189 if (landBitmapSlave[x, y])
190 { 190 {
191 landIDList[x, y] = master.landData.localID; 191 landIDList[x, y] = master.landData.localID;
192 } 192 }
193 } 193 }
194 } 194 }
195 removeLandObject(slave.landData.localID); 195 removeLandObject(slave.landData.localID);
196 } 196 }
197 /// <summary> 197 /// <summary>
198 /// Get the land object at the specified point 198 /// Get the land object at the specified point
199 /// </summary> 199 /// </summary>
200 /// <param name="x">Value between 0 - 256 on the x axis of the point</param> 200 /// <param name="x">Value between 0 - 256 on the x axis of the point</param>
201 /// <param name="y">Value between 0 - 256 on the y axis of the point</param> 201 /// <param name="y">Value between 0 - 256 on the y axis of the point</param>
202 /// <returns>Land object at the point supplied</returns> 202 /// <returns>Land object at the point supplied</returns>
203 public Land getLandObject(float x_float, float y_float) 203 public Land getLandObject(float x_float, float y_float)
204 { 204 {
205 int x = Convert.ToInt32(Math.Floor(Convert.ToDecimal(x_float) / Convert.ToDecimal(4.0))); 205 int x = Convert.ToInt32(Math.Floor(Convert.ToDecimal(x_float) / Convert.ToDecimal(4.0)));
206 int y = Convert.ToInt32(Math.Floor(Convert.ToDecimal(y_float) / Convert.ToDecimal(4.0))); 206 int y = Convert.ToInt32(Math.Floor(Convert.ToDecimal(y_float) / Convert.ToDecimal(4.0)));
207 207
208 if (x > 63 || y > 63 || x < 0 || y < 0) 208 if (x > 63 || y > 63 || x < 0 || y < 0)
209 { 209 {
210 throw new Exception("Error: Parcel not found at point " + x + ", " + y); 210 throw new Exception("Error: Parcel not found at point " + x + ", " + y);
211 } 211 }
212 else 212 else
213 { 213 {
214 // Console.WriteLine("Point (" + x + ", " + y + ") determined from point (" + x_float + ", " + y_float + ")"); 214 // Console.WriteLine("Point (" + x + ", " + y + ") determined from point (" + x_float + ", " + y_float + ")");
215 return landList[landIDList[x, y]]; 215 return landList[landIDList[x, y]];
216 } 216 }
217 } 217 }
218 218
219 public Land getLandObject(int x, int y) 219 public Land getLandObject(int x, int y)
220 { 220 {
221 if (x > 256 || y > 256 || x < 0 || y < 0) 221 if (x > 256 || y > 256 || x < 0 || y < 0)
222 { 222 {
223 throw new Exception("Error: Parcel not found at point " + x + ", " + y); 223 throw new Exception("Error: Parcel not found at point " + x + ", " + y);
224 } 224 }
225 else 225 else
226 { 226 {
227 return landList[landIDList[x / 4, y / 4]]; 227 return landList[landIDList[x / 4, y / 4]];
228 } 228 }
229 } 229 }
230 #endregion 230 #endregion
231 231
232 #region Parcel Modification 232 #region Parcel Modification
233 /// <summary> 233 /// <summary>
234 /// Subdivides a piece of land 234 /// Subdivides a piece of land
235 /// </summary> 235 /// </summary>
236 /// <param name="start_x">West Point</param> 236 /// <param name="start_x">West Point</param>
237 /// <param name="start_y">South Point</param> 237 /// <param name="start_y">South Point</param>
238 /// <param name="end_x">East Point</param> 238 /// <param name="end_x">East Point</param>
239 /// <param name="end_y">North Point</param> 239 /// <param name="end_y">North Point</param>
240 /// <param name="attempting_user_id">LLUUID of user who is trying to subdivide</param> 240 /// <param name="attempting_user_id">LLUUID of user who is trying to subdivide</param>
241 /// <returns>Returns true if successful</returns> 241 /// <returns>Returns true if successful</returns>
242 private bool subdivide(int start_x, int start_y, int end_x, int end_y, LLUUID attempting_user_id) 242 private bool subdivide(int start_x, int start_y, int end_x, int end_y, LLUUID attempting_user_id)
243 { 243 {
244 244
245 //First, lets loop through the points and make sure they are all in the same peice of land 245 //First, lets loop through the points and make sure they are all in the same peice of land
246 //Get the land object at start 246 //Get the land object at start
247 Land startLandObject = getLandObject(start_x, start_y); 247 Land startLandObject = getLandObject(start_x, start_y);
248 if (startLandObject == null) return false; //No such land object at the beginning 248 if (startLandObject == null) return false; //No such land object at the beginning
249 249
250 //Loop through the points 250 //Loop through the points
251 try 251 try
252 { 252 {
253 int totalX = end_x - start_x; 253 int totalX = end_x - start_x;
254 int totalY = end_y - start_y; 254 int totalY = end_y - start_y;
255 int x, y; 255 int x, y;
256 for (y = 0; y < totalY; y++) 256 for (y = 0; y < totalY; y++)
257 { 257 {
258 for (x = 0; x < totalX; x++) 258 for (x = 0; x < totalX; x++)
259 { 259 {
260 Land tempLandObject = getLandObject(start_x + x, start_y + y); 260 Land tempLandObject = getLandObject(start_x + x, start_y + y);
261 if (tempLandObject == null) return false; //No such land object at that point 261 if (tempLandObject == null) return false; //No such land object at that point
262 if (tempLandObject != startLandObject) return false; //Subdividing over 2 land objects; no-no 262 if (tempLandObject != startLandObject) return false; //Subdividing over 2 land objects; no-no
263 } 263 }
264 } 264 }
265 } 265 }
266 catch (Exception) 266 catch (Exception)
267 { 267 {
268 return false; //Exception. For now, lets skip subdivision 268 return false; //Exception. For now, lets skip subdivision
269 } 269 }
270 270
271 //If we are still here, then they are subdividing within one piece of land 271 //If we are still here, then they are subdividing within one piece of land
272 //Check owner 272 //Check owner
273 if (startLandObject.landData.ownerID != attempting_user_id) 273 if (startLandObject.landData.ownerID != attempting_user_id)
274 { 274 {
275 return false; //They cant do this! 275 return false; //They cant do this!
276 } 276 }
277 277
278 //Lets create a new land object with bitmap activated at that point (keeping the old land objects info) 278 //Lets create a new land object with bitmap activated at that point (keeping the old land objects info)
279 Land newLand = startLandObject.Copy(); 279 Land newLand = startLandObject.Copy();
280 newLand.landData.landName = "Subdivision of " + newLand.landData.landName; 280 newLand.landData.landName = "Subdivision of " + newLand.landData.landName;
281 newLand.landData.globalID = LLUUID.Random(); 281 newLand.landData.globalID = LLUUID.Random();
282 282
283 newLand.setLandBitmap(Land.getSquareLandBitmap(start_x, start_y, end_x, end_y)); 283 newLand.setLandBitmap(Land.getSquareLandBitmap(start_x, start_y, end_x, end_y));
284 284
285 //Now, lets set the subdivision area of the original to false 285 //Now, lets set the subdivision area of the original to false
286 int startLandObjectIndex = startLandObject.landData.localID; 286 int startLandObjectIndex = startLandObject.landData.localID;
287 landList[startLandObjectIndex].setLandBitmap(Land.modifyLandBitmapSquare(startLandObject.getLandBitmap(), start_x, start_y, end_x, end_y, false)); 287 landList[startLandObjectIndex].setLandBitmap(Land.modifyLandBitmapSquare(startLandObject.getLandBitmap(), start_x, start_y, end_x, end_y, false));
288 landList[startLandObjectIndex].forceUpdateLandInfo(); 288 landList[startLandObjectIndex].forceUpdateLandInfo();
289 289
290 290
291 this.setPrimsTainted(); 291 this.setPrimsTainted();
292 292
293 //Now add the new land object 293 //Now add the new land object
294 Land result = addLandObject(newLand); 294 Land result = addLandObject(newLand);
295 result.sendLandUpdateToAvatarsOverMe(); 295 result.sendLandUpdateToAvatarsOverMe();
296 296
297 297
298 298
299 299
300 return true; 300 return true;
301 } 301 }
302 /// <summary> 302 /// <summary>
303 /// Join 2 land objects together 303 /// Join 2 land objects together
304 /// </summary> 304 /// </summary>
305 /// <param name="start_x">x value in first piece of land</param> 305 /// <param name="start_x">x value in first piece of land</param>
306 /// <param name="start_y">y value in first piece of land</param> 306 /// <param name="start_y">y value in first piece of land</param>
307 /// <param name="end_x">x value in second peice of land</param> 307 /// <param name="end_x">x value in second peice of land</param>
308 /// <param name="end_y">y value in second peice of land</param> 308 /// <param name="end_y">y value in second peice of land</param>
309 /// <param name="attempting_user_id">LLUUID of the avatar trying to join the land objects</param> 309 /// <param name="attempting_user_id">LLUUID of the avatar trying to join the land objects</param>
310 /// <returns>Returns true if successful</returns> 310 /// <returns>Returns true if successful</returns>
311 private bool join(int start_x, int start_y, int end_x, int end_y, LLUUID attempting_user_id) 311 private bool join(int start_x, int start_y, int end_x, int end_y, LLUUID attempting_user_id)
312 { 312 {
313 end_x -= 4; 313 end_x -= 4;
314 end_y -= 4; 314 end_y -= 4;
315 315
316 List<Land> selectedLandObjects = new List<Land>(); 316 List<Land> selectedLandObjects = new List<Land>();
317 int stepXSelected = 0; 317 int stepXSelected = 0;
318 int stepYSelected = 0; 318 int stepYSelected = 0;
319 for (stepYSelected = start_y; stepYSelected <= end_y; stepYSelected += 4) 319 for (stepYSelected = start_y; stepYSelected <= end_y; stepYSelected += 4)
320 { 320 {
321 for (stepXSelected = start_x; stepXSelected <= end_x; stepXSelected += 4) 321 for (stepXSelected = start_x; stepXSelected <= end_x; stepXSelected += 4)
322 { 322 {
323 Land p = getLandObject(stepXSelected,stepYSelected); 323 Land p = getLandObject(stepXSelected,stepYSelected);
324 if (!selectedLandObjects.Contains(p)) 324 if (!selectedLandObjects.Contains(p))
325 { 325 {
326 selectedLandObjects.Add(p); 326 selectedLandObjects.Add(p);
327 } 327 }
328 } 328 }
329 } 329 }
330 Land masterLandObject = selectedLandObjects[0]; 330 Land masterLandObject = selectedLandObjects[0];
331 selectedLandObjects.RemoveAt(0); 331 selectedLandObjects.RemoveAt(0);
332 332
333 333
334 if (selectedLandObjects.Count < 1) 334 if (selectedLandObjects.Count < 1)
335 { 335 {
336 return false; //Only one piece of land selected 336 return false; //Only one piece of land selected
337 } 337 }
338 if (masterLandObject.landData.ownerID != attempting_user_id) 338 if (masterLandObject.landData.ownerID != attempting_user_id)
339 { 339 {
340 return false; //Not the same owner 340 return false; //Not the same owner
341 } 341 }
342 foreach (Land p in selectedLandObjects) 342 foreach (Land p in selectedLandObjects)
343 { 343 {
344 if (p.landData.ownerID != masterLandObject.landData.ownerID) 344 if (p.landData.ownerID != masterLandObject.landData.ownerID)
345 { 345 {
346 return false; //Over multiple users. TODO: make this just ignore this piece of land? 346 return false; //Over multiple users. TODO: make this just ignore this piece of land?
347 } 347 }
348 } 348 }
349 foreach (Land slaveLandObject in selectedLandObjects) 349 foreach (Land slaveLandObject in selectedLandObjects)
350 { 350 {
351 landList[masterLandObject.landData.localID].setLandBitmap(Land.mergeLandBitmaps(masterLandObject.getLandBitmap(), slaveLandObject.getLandBitmap())); 351 landList[masterLandObject.landData.localID].setLandBitmap(Land.mergeLandBitmaps(masterLandObject.getLandBitmap(), slaveLandObject.getLandBitmap()));
352 performFinalLandJoin(masterLandObject, slaveLandObject); 352 performFinalLandJoin(masterLandObject, slaveLandObject);
353 } 353 }
354 354
355 355
356 this.setPrimsTainted(); 356 this.setPrimsTainted();
357 357
358 masterLandObject.sendLandUpdateToAvatarsOverMe(); 358 masterLandObject.sendLandUpdateToAvatarsOverMe();
359 359
360 return true; 360 return true;
361 361
362 362
363 363
364 } 364 }
365 #endregion 365 #endregion
366 366
367 #region Parcel Updating 367 #region Parcel Updating
368 /// <summary> 368 /// <summary>
369 /// Where we send the ParcelOverlay packet to the client 369 /// Where we send the ParcelOverlay packet to the client
370 /// </summary> 370 /// </summary>
371 /// <param name="remote_client">The object representing the client</param> 371 /// <param name="remote_client">The object representing the client</param>
372 public void sendParcelOverlay(IClientAPI remote_client) 372 public void sendParcelOverlay(IClientAPI remote_client)
373 { 373 {
374 const int LAND_BLOCKS_PER_PACKET = 1024; 374 const int LAND_BLOCKS_PER_PACKET = 1024;
375 int x, y = 0; 375 int x, y = 0;
376 byte[] byteArray = new byte[LAND_BLOCKS_PER_PACKET]; 376 byte[] byteArray = new byte[LAND_BLOCKS_PER_PACKET];
377 int byteArrayCount = 0; 377 int byteArrayCount = 0;
378 int sequenceID = 0; 378 int sequenceID = 0;
379 ParcelOverlayPacket packet; 379 ParcelOverlayPacket packet;
380 380
381 for (y = 0; y < 64; y++) 381 for (y = 0; y < 64; y++)
382 { 382 {
383 for (x = 0; x < 64; x++) 383 for (x = 0; x < 64; x++)
384 { 384 {
385 byte tempByte = (byte)0; //This represents the byte for the current 4x4 385 byte tempByte = (byte)0; //This represents the byte for the current 4x4
386 Land currentParcelBlock = getLandObject(x * 4, y * 4); 386 Land currentParcelBlock = getLandObject(x * 4, y * 4);
387 387
388 if (currentParcelBlock.landData.ownerID == remote_client.AgentId) 388 if (currentParcelBlock.landData.ownerID == remote_client.AgentId)
389 { 389 {
390 //Owner Flag 390 //Owner Flag
391 tempByte = Convert.ToByte(tempByte | LAND_TYPE_OWNED_BY_REQUESTER); 391 tempByte = Convert.ToByte(tempByte | LAND_TYPE_OWNED_BY_REQUESTER);
392 } 392 }
393 else if (currentParcelBlock.landData.salePrice > 0 && (currentParcelBlock.landData.authBuyerID == LLUUID.Zero || currentParcelBlock.landData.authBuyerID == remote_client.AgentId)) 393 else if (currentParcelBlock.landData.salePrice > 0 && (currentParcelBlock.landData.authBuyerID == LLUUID.Zero || currentParcelBlock.landData.authBuyerID == remote_client.AgentId))
394 { 394 {
395 //Sale Flag 395 //Sale Flag
396 tempByte = Convert.ToByte(tempByte | LAND_TYPE_IS_FOR_SALE); 396 tempByte = Convert.ToByte(tempByte | LAND_TYPE_IS_FOR_SALE);
397 } 397 }
398 else if (currentParcelBlock.landData.ownerID == LLUUID.Zero) 398 else if (currentParcelBlock.landData.ownerID == LLUUID.Zero)
399 { 399 {
400 //Public Flag 400 //Public Flag
401 tempByte = Convert.ToByte(tempByte | LAND_TYPE_PUBLIC); 401 tempByte = Convert.ToByte(tempByte | LAND_TYPE_PUBLIC);
402 } 402 }
403 else 403 else
404 { 404 {
405 //Other Flag 405 //Other Flag
406 tempByte = Convert.ToByte(tempByte | LAND_TYPE_OWNED_BY_OTHER); 406 tempByte = Convert.ToByte(tempByte | LAND_TYPE_OWNED_BY_OTHER);
407 } 407 }
408 408
409 409
410 //Now for border control 410 //Now for border control
411 if (x == 0) 411 if (x == 0)
412 { 412 {
413 tempByte = Convert.ToByte(tempByte | LAND_FLAG_PROPERTY_BORDER_WEST); 413 tempByte = Convert.ToByte(tempByte | LAND_FLAG_PROPERTY_BORDER_WEST);
414 } 414 }
415 else if (getLandObject((x - 1) * 4, y * 4) != currentParcelBlock) 415 else if (getLandObject((x - 1) * 4, y * 4) != currentParcelBlock)
416 { 416 {
417 tempByte = Convert.ToByte(tempByte | LAND_FLAG_PROPERTY_BORDER_WEST); 417 tempByte = Convert.ToByte(tempByte | LAND_FLAG_PROPERTY_BORDER_WEST);
418 } 418 }
419 419
420 if (y == 0) 420 if (y == 0)
421 { 421 {
422 tempByte = Convert.ToByte(tempByte | LAND_FLAG_PROPERTY_BORDER_SOUTH); 422 tempByte = Convert.ToByte(tempByte | LAND_FLAG_PROPERTY_BORDER_SOUTH);
423 } 423 }
424 else if (getLandObject(x * 4, (y - 1) * 4) != currentParcelBlock) 424 else if (getLandObject(x * 4, (y - 1) * 4) != currentParcelBlock)
425 { 425 {
426 tempByte = Convert.ToByte(tempByte | LAND_FLAG_PROPERTY_BORDER_SOUTH); 426 tempByte = Convert.ToByte(tempByte | LAND_FLAG_PROPERTY_BORDER_SOUTH);
427 } 427 }
428 428
429 byteArray[byteArrayCount] = tempByte; 429 byteArray[byteArrayCount] = tempByte;
430 byteArrayCount++; 430 byteArrayCount++;
431 if (byteArrayCount >= LAND_BLOCKS_PER_PACKET) 431 if (byteArrayCount >= LAND_BLOCKS_PER_PACKET)
432 { 432 {
433 byteArrayCount = 0; 433 byteArrayCount = 0;
434 packet = new ParcelOverlayPacket(); 434 packet = new ParcelOverlayPacket();
435 packet.ParcelData.Data = byteArray; 435 packet.ParcelData.Data = byteArray;
436 packet.ParcelData.SequenceID = sequenceID; 436 packet.ParcelData.SequenceID = sequenceID;
437 remote_client.OutPacket((Packet)packet); 437 remote_client.OutPacket((Packet)packet);
438 sequenceID++; 438 sequenceID++;
439 byteArray = new byte[LAND_BLOCKS_PER_PACKET]; 439 byteArray = new byte[LAND_BLOCKS_PER_PACKET];
440 } 440 }
441 } 441 }
442 } 442 }
443 443
444 444
445 } 445 }
446 446
447 public void handleParcelPropertiesRequest(int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, IClientAPI remote_client) 447 public void handleParcelPropertiesRequest(int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, IClientAPI remote_client)
448 { 448 {
449 //Get the land objects within the bounds 449 //Get the land objects within the bounds
450 List<Land> temp = new List<Land>(); 450 List<Land> temp = new List<Land>();
451 int x, y, i; 451 int x, y, i;
452 int inc_x = end_x - start_x; 452 int inc_x = end_x - start_x;
453 int inc_y = end_y - start_y; 453 int inc_y = end_y - start_y;
454 for (x = 0; x < inc_x; x++) 454 for (x = 0; x < inc_x; x++)
455 { 455 {
456 for (y = 0; y < inc_y; y++) 456 for (y = 0; y < inc_y; y++)
457 { 457 {
458 Land currentParcel = getLandObject(start_x + x, start_y + y); 458 Land currentParcel = getLandObject(start_x + x, start_y + y);
459 if (!temp.Contains(currentParcel)) 459 if (!temp.Contains(currentParcel))
460 { 460 {
461 currentParcel.forceUpdateLandInfo(); 461 currentParcel.forceUpdateLandInfo();
462 temp.Add(currentParcel); 462 temp.Add(currentParcel);
463 } 463 }
464 } 464 }
465 } 465 }
466 466
467 int requestResult = LAND_RESULT_SINGLE; 467 int requestResult = LAND_RESULT_SINGLE;
468 if (temp.Count > 1) 468 if (temp.Count > 1)
469 { 469 {
470 requestResult = LAND_RESULT_MULTIPLE; 470 requestResult = LAND_RESULT_MULTIPLE;
471 } 471 }
472 472
473 for (i = 0; i < temp.Count; i++) 473 for (i = 0; i < temp.Count; i++)
474 { 474 {
475 temp[i].sendLandProperties(sequence_id, snap_selection, requestResult, remote_client); 475 temp[i].sendLandProperties(sequence_id, snap_selection, requestResult, remote_client);
476 } 476 }
477 477
478 478
479 sendParcelOverlay(remote_client); 479 sendParcelOverlay(remote_client);
480 } 480 }
481 481
482 public void handleParcelPropertiesUpdateRequest(ParcelPropertiesUpdatePacket packet, IClientAPI remote_client) 482 public void handleParcelPropertiesUpdateRequest(ParcelPropertiesUpdatePacket packet, IClientAPI remote_client)
483 { 483 {
484 if (landList.ContainsKey(packet.ParcelData.LocalID)) 484 if (landList.ContainsKey(packet.ParcelData.LocalID))
485 { 485 {
486 landList[packet.ParcelData.LocalID].updateLandProperties(packet, remote_client); 486 landList[packet.ParcelData.LocalID].updateLandProperties(packet, remote_client);
487 } 487 }
488 } 488 }
489 public void handleParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client) 489 public void handleParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client)
490 { 490 {
491 subdivide(west, south, east, north, remote_client.AgentId); 491 subdivide(west, south, east, north, remote_client.AgentId);
492 } 492 }
493 public void handleParcelJoinRequest(int west, int south, int east, int north, IClientAPI remote_client) 493 public void handleParcelJoinRequest(int west, int south, int east, int north, IClientAPI remote_client)
494 { 494 {
495 join(west, south, east, north, remote_client.AgentId); 495 join(west, south, east, north, remote_client.AgentId);
496 496
497 } 497 }
498 498
499 public void handleParcelSelectObjectsRequest(int local_id, int request_type, IClientAPI remote_client) 499 public void handleParcelSelectObjectsRequest(int local_id, int request_type, IClientAPI remote_client)
500 { 500 {
501 landList[local_id].sendForceObjectSelect(local_id, request_type, remote_client); 501 landList[local_id].sendForceObjectSelect(local_id, request_type, remote_client);
502 } 502 }
503 503
504 public void handleParcelObjectOwnersRequest(int local_id, IClientAPI remote_client) 504 public void handleParcelObjectOwnersRequest(int local_id, IClientAPI remote_client)
505 { 505 {
506 landList[local_id].sendLandObjectOwners(remote_client); 506 landList[local_id].sendLandObjectOwners(remote_client);
507 } 507 }
508 #endregion 508 #endregion
509 509
510 /// <summary> 510 /// <summary>
511 /// Resets the sim to the default land object (full sim piece of land owned by the default user) 511 /// Resets the sim to the default land object (full sim piece of land owned by the default user)
512 /// </summary> 512 /// </summary>
513 public void resetSimLandObjects() 513 public void resetSimLandObjects()
514 { 514 {
515 //Remove all the land objects in the sim and add a blank, full sim land object set to public 515 //Remove all the land objects in the sim and add a blank, full sim land object set to public
516 landList.Clear(); 516 landList.Clear();
517 lastLandLocalID = START_LAND_LOCAL_ID - 1; 517 lastLandLocalID = START_LAND_LOCAL_ID - 1;
518 landIDList.Initialize(); 518 landIDList.Initialize();
519 519
520 Land fullSimParcel = new Land(LLUUID.Zero, false, m_scene); 520 Land fullSimParcel = new Land(LLUUID.Zero, false, m_scene);
521 521
522 fullSimParcel.setLandBitmap(Land.getSquareLandBitmap(0, 0, 256, 256)); 522 fullSimParcel.setLandBitmap(Land.getSquareLandBitmap(0, 0, 256, 256));
523 fullSimParcel.landData.ownerID = m_regInfo.MasterAvatarAssignedUUID; 523 fullSimParcel.landData.ownerID = m_regInfo.MasterAvatarAssignedUUID;
524 524
525 addLandObject(fullSimParcel); 525 addLandObject(fullSimParcel);
526 526
527 } 527 }
528 528
529 529
530 public void handleSignificantClientMovement(IClientAPI remote_client) 530 public void handleSignificantClientMovement(IClientAPI remote_client)
531 { 531 {
532 ScenePresence clientAvatar = m_scene.RequestAvatar(remote_client.AgentId); 532 ScenePresence clientAvatar = m_scene.RequestAvatar(remote_client.AgentId);
533 if (clientAvatar != null) 533 if (clientAvatar != null)
534 { 534 {
535 Land over = getLandObject(clientAvatar.Pos.X,clientAvatar.Pos.Y); 535 Land over = getLandObject(clientAvatar.Pos.X,clientAvatar.Pos.Y);
536 if (over != null) 536 if (over != null)
537 { 537 {
538 over.sendLandProperties(0, false, 0, remote_client); 538 over.sendLandProperties(0, false, 0, remote_client);
539 } 539 }
540 } 540 }
541 } 541 }
542 542
543 public void resetAllLandPrimCounts() 543 public void resetAllLandPrimCounts()
544 { 544 {
545 foreach (Land p in landList.Values) 545 foreach (Land p in landList.Values)
546 { 546 {
547 p.resetLandPrimCounts(); 547 p.resetLandPrimCounts();
548 } 548 }
549 } 549 }
550 public void setPrimsTainted() 550 public void setPrimsTainted()
551 { 551 {
552 this.landPrimCountTainted = true; 552 this.landPrimCountTainted = true;
553 } 553 }
554 554
555 public void addPrimToLandPrimCounts(SceneObject obj) 555 public void addPrimToLandPrimCounts(SceneObject obj)
556 { 556 {
557 LLVector3 position = obj.Pos; 557 LLVector3 position = obj.Pos;
558 Land landUnderPrim = getLandObject(position.X, position.Y); 558 Land landUnderPrim = getLandObject(position.X, position.Y);
559 if (landUnderPrim != null) 559 if (landUnderPrim != null)
560 { 560 {
561 landUnderPrim.addPrimToCount(obj); 561 landUnderPrim.addPrimToCount(obj);
562 } 562 }
563 } 563 }
564 564
565 public void removePrimFromLandPrimCounts(SceneObject obj) 565 public void removePrimFromLandPrimCounts(SceneObject obj)
566 { 566 {
567 foreach (Land p in landList.Values) 567 foreach (Land p in landList.Values)
568 { 568 {
569 p.removePrimFromCount(obj); 569 p.removePrimFromCount(obj);
570 } 570 }
571 } 571 }
572 572
573 public void finalizeLandPrimCountUpdate() 573 public void finalizeLandPrimCountUpdate()
574 { 574 {
575 //Get Simwide prim count for owner 575 //Get Simwide prim count for owner
576 Dictionary<LLUUID, List<Land>> landOwnersAndParcels = new Dictionary<LLUUID,List<Land>>(); 576 Dictionary<LLUUID, List<Land>> landOwnersAndParcels = new Dictionary<LLUUID,List<Land>>();
577 foreach (Land p in landList.Values) 577 foreach (Land p in landList.Values)
578 { 578 {
579 if(!landOwnersAndParcels.ContainsKey(p.landData.ownerID)) 579 if(!landOwnersAndParcels.ContainsKey(p.landData.ownerID))
580 { 580 {
581 List<Land> tempList = new List<Land>(); 581 List<Land> tempList = new List<Land>();
582 tempList.Add(p); 582 tempList.Add(p);
583 landOwnersAndParcels.Add(p.landData.ownerID,tempList); 583 landOwnersAndParcels.Add(p.landData.ownerID,tempList);
584 } 584 }
585 else 585 else
586 { 586 {
587 landOwnersAndParcels[p.landData.ownerID].Add(p); 587 landOwnersAndParcels[p.landData.ownerID].Add(p);
588 } 588 }
589 } 589 }
590 590
591 foreach (LLUUID owner in landOwnersAndParcels.Keys) 591 foreach (LLUUID owner in landOwnersAndParcels.Keys)
592 { 592 {
593 int simArea = 0; 593 int simArea = 0;
594 int simPrims = 0; 594 int simPrims = 0;
595 foreach (Land p in landOwnersAndParcels[owner]) 595 foreach (Land p in landOwnersAndParcels[owner])
596 { 596 {
597 simArea += p.landData.area; 597 simArea += p.landData.area;
598 simPrims += p.landData.ownerPrims + p.landData.otherPrims + p.landData.groupPrims + p.landData.selectedPrims; 598 simPrims += p.landData.ownerPrims + p.landData.otherPrims + p.landData.groupPrims + p.landData.selectedPrims;
599 } 599 }
600 600
601 foreach (Land p in landOwnersAndParcels[owner]) 601 foreach (Land p in landOwnersAndParcels[owner])
602 { 602 {
603 p.landData.simwideArea = simArea; 603 p.landData.simwideArea = simArea;
604 p.landData.simwidePrims = simPrims; 604 p.landData.simwidePrims = simPrims;
605 } 605 }
606 } 606 }
607 607
608 } 608 }
609 #endregion 609 #endregion
610 } 610 }
611 #endregion 611 #endregion
612 612
613 613
614 614
615 615
616 616
617} 617}
diff --git a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs b/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs
index 4f48217..a4b3852 100644
--- a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs
+++ b/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs
@@ -1,299 +1,299 @@
1using System.Collections.Generic; 1using System.Collections.Generic;
2using System.Text; 2using System.Text;
3using Axiom.Math; 3using Axiom.Math;
4using libsecondlife; 4using libsecondlife;
5using libsecondlife.Packets; 5using libsecondlife.Packets;
6using OpenSim.Framework.Interfaces; 6using OpenSim.Framework.Interfaces;
7using OpenSim.Framework.Types; 7using OpenSim.Framework.Types;
8using OpenSim.Physics.Manager; 8using OpenSim.Physics.Manager;
9 9
10namespace OpenSim.Region.Environment.Scenes 10namespace OpenSim.Region.Environment.Scenes
11{ 11{
12 // public delegate void PrimCountTaintedDelegate(); 12 // public delegate void PrimCountTaintedDelegate();
13 13
14 public class AllNewSceneObjectGroup2 : EntityBase 14 public class AllNewSceneObjectGroup2 : EntityBase
15 { 15 {
16 private Encoding enc = Encoding.ASCII; 16 private Encoding enc = Encoding.ASCII;
17 17
18 protected AllNewSceneObjectPart2 m_rootPart; 18 protected AllNewSceneObjectPart2 m_rootPart;
19 protected Dictionary<LLUUID, AllNewSceneObjectPart2> m_parts = new Dictionary<LLUUID, AllNewSceneObjectPart2>(); 19 protected Dictionary<LLUUID, AllNewSceneObjectPart2> m_parts = new Dictionary<LLUUID, AllNewSceneObjectPart2>();
20 20
21 public event PrimCountTaintedDelegate OnPrimCountTainted; 21 public event PrimCountTaintedDelegate OnPrimCountTainted;
22 22
23 /// <summary> 23 /// <summary>
24 /// 24 ///
25 /// </summary> 25 /// </summary>
26 public int primCount 26 public int primCount
27 { 27 {
28 get 28 get
29 { 29 {
30 return 1; 30 return 1;
31 } 31 }
32 } 32 }
33 33
34 /// <summary> 34 /// <summary>
35 /// 35 ///
36 /// </summary> 36 /// </summary>
37 public LLVector3 GroupCentrePoint 37 public LLVector3 GroupCentrePoint
38 { 38 {
39 get 39 get
40 { 40 {
41 return new LLVector3(0, 0, 0); 41 return new LLVector3(0, 0, 0);
42 } 42 }
43 } 43 }
44 44
45 /// <summary> 45 /// <summary>
46 /// 46 ///
47 /// </summary> 47 /// </summary>
48 public AllNewSceneObjectGroup2() 48 public AllNewSceneObjectGroup2()
49 { 49 {
50 50
51 } 51 }
52 52
53 /// <summary> 53 /// <summary>
54 /// 54 ///
55 /// </summary> 55 /// </summary>
56 public void FlagGroupForFullUpdate() 56 public void FlagGroupForFullUpdate()
57 { 57 {
58 58
59 } 59 }
60 60
61 /// <summary> 61 /// <summary>
62 /// 62 ///
63 /// </summary> 63 /// </summary>
64 public void FlagGroupForTerseUpdate() 64 public void FlagGroupForTerseUpdate()
65 { 65 {
66 66
67 } 67 }
68 68
69 /// <summary> 69 /// <summary>
70 /// 70 ///
71 /// </summary> 71 /// </summary>
72 /// <param name="objectGroup"></param> 72 /// <param name="objectGroup"></param>
73 public void LinkToGroup(AllNewSceneObjectGroup2 objectGroup) 73 public void LinkToGroup(AllNewSceneObjectGroup2 objectGroup)
74 { 74 {
75 75
76 } 76 }
77 77
78 /// <summary> 78 /// <summary>
79 /// 79 ///
80 /// </summary> 80 /// </summary>
81 /// <param name="primID"></param> 81 /// <param name="primID"></param>
82 /// <returns></returns> 82 /// <returns></returns>
83 private AllNewSceneObjectPart2 GetChildPrim(LLUUID primID) 83 private AllNewSceneObjectPart2 GetChildPrim(LLUUID primID)
84 { 84 {
85 AllNewSceneObjectPart2 childPart = null; 85 AllNewSceneObjectPart2 childPart = null;
86 if (this.m_parts.ContainsKey(primID)) 86 if (this.m_parts.ContainsKey(primID))
87 { 87 {
88 childPart = this.m_parts[primID]; 88 childPart = this.m_parts[primID];
89 } 89 }
90 return childPart; 90 return childPart;
91 } 91 }
92 92
93 /// <summary> 93 /// <summary>
94 /// 94 ///
95 /// </summary> 95 /// </summary>
96 /// <param name="localID"></param> 96 /// <param name="localID"></param>
97 /// <returns></returns> 97 /// <returns></returns>
98 private AllNewSceneObjectPart2 GetChildPrim(uint localID) 98 private AllNewSceneObjectPart2 GetChildPrim(uint localID)
99 { 99 {
100 foreach (AllNewSceneObjectPart2 part in this.m_parts.Values) 100 foreach (AllNewSceneObjectPart2 part in this.m_parts.Values)
101 { 101 {
102 if (part.m_localID == localID) 102 if (part.m_localID == localID)
103 { 103 {
104 return part; 104 return part;
105 } 105 }
106 } 106 }
107 return null; 107 return null;
108 } 108 }
109 109
110 public void TriggerTainted() 110 public void TriggerTainted()
111 { 111 {
112 if (OnPrimCountTainted != null) 112 if (OnPrimCountTainted != null)
113 { 113 {
114 this.OnPrimCountTainted(); 114 this.OnPrimCountTainted();
115 } 115 }
116 } 116 }
117 117
118 /// <summary> 118 /// <summary>
119 /// 119 ///
120 /// </summary> 120 /// </summary>
121 /// <param name="offset"></param> 121 /// <param name="offset"></param>
122 /// <param name="pos"></param> 122 /// <param name="pos"></param>
123 /// <param name="remoteClient"></param> 123 /// <param name="remoteClient"></param>
124 public void GrapMovement(LLVector3 offset, LLVector3 pos, IClientAPI remoteClient) 124 public void GrapMovement(LLVector3 offset, LLVector3 pos, IClientAPI remoteClient)
125 { 125 {
126 this.Pos = pos; 126 this.Pos = pos;
127 } 127 }
128 128
129 /// <summary> 129 /// <summary>
130 /// 130 ///
131 /// </summary> 131 /// </summary>
132 /// <param name="client"></param> 132 /// <param name="client"></param>
133 public void GetProperites(IClientAPI client) 133 public void GetProperites(IClientAPI client)
134 { 134 {
135 ObjectPropertiesPacket proper = new ObjectPropertiesPacket(); 135 ObjectPropertiesPacket proper = new ObjectPropertiesPacket();
136 proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[1]; 136 proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[1];
137 proper.ObjectData[0] = new ObjectPropertiesPacket.ObjectDataBlock(); 137 proper.ObjectData[0] = new ObjectPropertiesPacket.ObjectDataBlock();
138 proper.ObjectData[0].ItemID = LLUUID.Zero; 138 proper.ObjectData[0].ItemID = LLUUID.Zero;
139 proper.ObjectData[0].CreationDate = (ulong)this.m_rootPart.CreationDate; 139 proper.ObjectData[0].CreationDate = (ulong)this.m_rootPart.CreationDate;
140 proper.ObjectData[0].CreatorID = this.m_rootPart.CreatorID; 140 proper.ObjectData[0].CreatorID = this.m_rootPart.CreatorID;
141 proper.ObjectData[0].FolderID = LLUUID.Zero; 141 proper.ObjectData[0].FolderID = LLUUID.Zero;
142 proper.ObjectData[0].FromTaskID = LLUUID.Zero; 142 proper.ObjectData[0].FromTaskID = LLUUID.Zero;
143 proper.ObjectData[0].GroupID = LLUUID.Zero; 143 proper.ObjectData[0].GroupID = LLUUID.Zero;
144 proper.ObjectData[0].InventorySerial = 0; 144 proper.ObjectData[0].InventorySerial = 0;
145 proper.ObjectData[0].LastOwnerID = this.m_rootPart.LastOwnerID; 145 proper.ObjectData[0].LastOwnerID = this.m_rootPart.LastOwnerID;
146 proper.ObjectData[0].ObjectID = this.m_uuid; 146 proper.ObjectData[0].ObjectID = this.m_uuid;
147 proper.ObjectData[0].OwnerID = this.m_rootPart.OwnerID; 147 proper.ObjectData[0].OwnerID = this.m_rootPart.OwnerID;
148 proper.ObjectData[0].TouchName = enc.GetBytes(this.m_rootPart.TouchName + "\0"); 148 proper.ObjectData[0].TouchName = enc.GetBytes(this.m_rootPart.TouchName + "\0");
149 proper.ObjectData[0].TextureID = new byte[0]; 149 proper.ObjectData[0].TextureID = new byte[0];
150 proper.ObjectData[0].SitName = enc.GetBytes(this.m_rootPart.SitName + "\0"); 150 proper.ObjectData[0].SitName = enc.GetBytes(this.m_rootPart.SitName + "\0");
151 proper.ObjectData[0].Name = enc.GetBytes(this.m_rootPart.Name + "\0"); 151 proper.ObjectData[0].Name = enc.GetBytes(this.m_rootPart.Name + "\0");
152 proper.ObjectData[0].Description = enc.GetBytes(this.m_rootPart.Description + "\0"); 152 proper.ObjectData[0].Description = enc.GetBytes(this.m_rootPart.Description + "\0");
153 proper.ObjectData[0].OwnerMask = this.m_rootPart.OwnerMask; 153 proper.ObjectData[0].OwnerMask = this.m_rootPart.OwnerMask;
154 proper.ObjectData[0].NextOwnerMask = this.m_rootPart.NextOwnerMask; 154 proper.ObjectData[0].NextOwnerMask = this.m_rootPart.NextOwnerMask;
155 proper.ObjectData[0].GroupMask = this.m_rootPart.GroupMask; 155 proper.ObjectData[0].GroupMask = this.m_rootPart.GroupMask;
156 proper.ObjectData[0].EveryoneMask = this.m_rootPart.EveryoneMask; 156 proper.ObjectData[0].EveryoneMask = this.m_rootPart.EveryoneMask;
157 proper.ObjectData[0].BaseMask = this.m_rootPart.BaseMask; 157 proper.ObjectData[0].BaseMask = this.m_rootPart.BaseMask;
158 158
159 client.OutPacket(proper); 159 client.OutPacket(proper);
160 } 160 }
161 161
162 #region Shape 162 #region Shape
163 /// <summary> 163 /// <summary>
164 /// 164 ///
165 /// </summary> 165 /// </summary>
166 /// <param name="shapeBlock"></param> 166 /// <param name="shapeBlock"></param>
167 public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock, uint localID) 167 public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock, uint localID)
168 { 168 {
169 AllNewSceneObjectPart2 part = this.GetChildPrim(localID); 169 AllNewSceneObjectPart2 part = this.GetChildPrim(localID);
170 if (part != null) 170 if (part != null)
171 { 171 {
172 part.UpdateShape(shapeBlock); 172 part.UpdateShape(shapeBlock);
173 } 173 }
174 } 174 }
175 #endregion 175 #endregion
176 176
177 #region Position 177 #region Position
178 public void UpdateGroupPosition(LLVector3 pos) 178 public void UpdateGroupPosition(LLVector3 pos)
179 { 179 {
180 this.m_pos = pos; 180 this.m_pos = pos;
181 } 181 }
182 182
183 public void UpdateSinglePosition(LLVector3 pos, uint localID) 183 public void UpdateSinglePosition(LLVector3 pos, uint localID)
184 { 184 {
185 AllNewSceneObjectPart2 part = this.GetChildPrim(localID); 185 AllNewSceneObjectPart2 part = this.GetChildPrim(localID);
186 if (part != null) 186 if (part != null)
187 { 187 {
188 if (part.uuid == this.m_rootPart.uuid) 188 if (part.uuid == this.m_rootPart.uuid)
189 { 189 {
190 this.UpdateRootPosition(pos); 190 this.UpdateRootPosition(pos);
191 } 191 }
192 else 192 else
193 { 193 {
194 part.UpdateOffSet(pos); 194 part.UpdateOffSet(pos);
195 } 195 }
196 } 196 }
197 } 197 }
198 198
199 private void UpdateRootPosition(LLVector3 pos) 199 private void UpdateRootPosition(LLVector3 pos)
200 { 200 {
201 LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z); 201 LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z);
202 LLVector3 oldPos = new LLVector3(this.Pos.X + this.m_rootPart.OffsetPosition.X, this.Pos.Y + this.m_rootPart.OffsetPosition.Y, this.Pos.Z + this.m_rootPart.OffsetPosition.Z); 202 LLVector3 oldPos = new LLVector3(this.Pos.X + this.m_rootPart.OffsetPosition.X, this.Pos.Y + this.m_rootPart.OffsetPosition.Y, this.Pos.Z + this.m_rootPart.OffsetPosition.Z);
203 LLVector3 diff = oldPos - newPos; 203 LLVector3 diff = oldPos - newPos;
204 Axiom.Math.Vector3 axDiff = new Vector3(diff.X, diff.Y, diff.Z); 204 Axiom.Math.Vector3 axDiff = new Vector3(diff.X, diff.Y, diff.Z);
205 Axiom.Math.Quaternion partRotation = new Quaternion(this.m_rootPart.RotationOffset.W, this.m_rootPart.RotationOffset.X, this.m_rootPart.RotationOffset.Y, this.m_rootPart.RotationOffset.Z); 205 Axiom.Math.Quaternion partRotation = new Quaternion(this.m_rootPart.RotationOffset.W, this.m_rootPart.RotationOffset.X, this.m_rootPart.RotationOffset.Y, this.m_rootPart.RotationOffset.Z);
206 axDiff = partRotation.Inverse() * axDiff; 206 axDiff = partRotation.Inverse() * axDiff;
207 diff.X = axDiff.x; 207 diff.X = axDiff.x;
208 diff.Y = axDiff.y; 208 diff.Y = axDiff.y;
209 diff.Z = axDiff.z; 209 diff.Z = axDiff.z;
210 210
211 foreach (AllNewSceneObjectPart2 obPart in this.m_parts.Values) 211 foreach (AllNewSceneObjectPart2 obPart in this.m_parts.Values)
212 { 212 {
213 if (obPart.uuid != this.m_rootPart.uuid) 213 if (obPart.uuid != this.m_rootPart.uuid)
214 { 214 {
215 obPart.OffsetPosition = obPart.OffsetPosition + diff; 215 obPart.OffsetPosition = obPart.OffsetPosition + diff;
216 } 216 }
217 } 217 }
218 this.Pos = newPos; 218 this.Pos = newPos;
219 pos.X = newPos.X; 219 pos.X = newPos.X;
220 pos.Y = newPos.Y; 220 pos.Y = newPos.Y;
221 pos.Z = newPos.Z; 221 pos.Z = newPos.Z;
222 } 222 }
223 #endregion 223 #endregion
224 224
225 #region Roation 225 #region Roation
226 public void UpdateGroupRotation(LLQuaternion rot) 226 public void UpdateGroupRotation(LLQuaternion rot)
227 { 227 {
228 this.m_rootPart.UpdateRotation(rot); 228 this.m_rootPart.UpdateRotation(rot);
229 } 229 }
230 230
231 /// <summary> 231 /// <summary>
232 /// 232 ///
233 /// </summary> 233 /// </summary>
234 /// <param name="pos"></param> 234 /// <param name="pos"></param>
235 /// <param name="rot"></param> 235 /// <param name="rot"></param>
236 public void UpdateGroupRotation(LLVector3 pos, LLQuaternion rot) 236 public void UpdateGroupRotation(LLVector3 pos, LLQuaternion rot)
237 { 237 {
238 this.m_rootPart.UpdateRotation(rot); 238 this.m_rootPart.UpdateRotation(rot);
239 this.m_pos = pos; 239 this.m_pos = pos;
240 } 240 }
241 241
242 public void UpdateSingleRotation(LLQuaternion rot, uint localID) 242 public void UpdateSingleRotation(LLQuaternion rot, uint localID)
243 { 243 {
244 AllNewSceneObjectPart2 part = this.GetChildPrim(localID); 244 AllNewSceneObjectPart2 part = this.GetChildPrim(localID);
245 if (part != null) 245 if (part != null)
246 { 246 {
247 if (part.uuid == this.m_rootPart.uuid) 247 if (part.uuid == this.m_rootPart.uuid)
248 { 248 {
249 this.UpdateRootRotation(rot); 249 this.UpdateRootRotation(rot);
250 } 250 }
251 else 251 else
252 { 252 {
253 part.UpdateRotation(rot); 253 part.UpdateRotation(rot);
254 } 254 }
255 } 255 }
256 } 256 }
257 private void UpdateRootRotation(LLQuaternion rot) 257 private void UpdateRootRotation(LLQuaternion rot)
258 { 258 {
259 this.m_rootPart.UpdateRotation(rot); 259 this.m_rootPart.UpdateRotation(rot);
260 Axiom.Math.Quaternion axRot = new Quaternion(rot.W, rot.X, rot.Y, rot.Z); 260 Axiom.Math.Quaternion axRot = new Quaternion(rot.W, rot.X, rot.Y, rot.Z);
261 Axiom.Math.Quaternion oldParentRot = new Quaternion(this.m_rootPart.RotationOffset.W, this.m_rootPart.RotationOffset.X, this.m_rootPart.RotationOffset.Y, this.m_rootPart.RotationOffset.Z); 261 Axiom.Math.Quaternion oldParentRot = new Quaternion(this.m_rootPart.RotationOffset.W, this.m_rootPart.RotationOffset.X, this.m_rootPart.RotationOffset.Y, this.m_rootPart.RotationOffset.Z);
262 262
263 foreach (AllNewSceneObjectPart2 prim in this.m_parts.Values) 263 foreach (AllNewSceneObjectPart2 prim in this.m_parts.Values)
264 { 264 {
265 if (prim.uuid != this.m_rootPart.uuid) 265 if (prim.uuid != this.m_rootPart.uuid)
266 { 266 {
267 Vector3 axPos = new Vector3(prim.OffsetPosition.X, prim.OffsetPosition.Y, prim.OffsetPosition.Z); 267 Vector3 axPos = new Vector3(prim.OffsetPosition.X, prim.OffsetPosition.Y, prim.OffsetPosition.Z);
268 axPos = oldParentRot * axPos; 268 axPos = oldParentRot * axPos;
269 axPos = axRot.Inverse() * axPos; 269 axPos = axRot.Inverse() * axPos;
270 prim.OffsetPosition = new LLVector3(axPos.x, axPos.y, axPos.z); 270 prim.OffsetPosition = new LLVector3(axPos.x, axPos.y, axPos.z);
271 Axiom.Math.Quaternion primsRot = new Quaternion(prim.RotationOffset.W, prim.RotationOffset.X, prim.RotationOffset.Y, prim.RotationOffset.Z); 271 Axiom.Math.Quaternion primsRot = new Quaternion(prim.RotationOffset.W, prim.RotationOffset.X, prim.RotationOffset.Y, prim.RotationOffset.Z);
272 Axiom.Math.Quaternion newRot = oldParentRot * primsRot; 272 Axiom.Math.Quaternion newRot = oldParentRot * primsRot;
273 newRot = axRot.Inverse() * newRot; 273 newRot = axRot.Inverse() * newRot;
274 prim.RotationOffset = new LLQuaternion(newRot.w, newRot.x, newRot.y, newRot.z); 274 prim.RotationOffset = new LLQuaternion(newRot.w, newRot.x, newRot.y, newRot.z);
275 } 275 }
276 } 276 }
277 } 277 }
278 #endregion 278 #endregion
279 /// <summary> 279 /// <summary>
280 /// 280 ///
281 /// </summary> 281 /// </summary>
282 /// <param name="part"></param> 282 /// <param name="part"></param>
283 private void SetPartAsRoot(AllNewSceneObjectPart2 part) 283 private void SetPartAsRoot(AllNewSceneObjectPart2 part)
284 { 284 {
285 this.m_rootPart = part; 285 this.m_rootPart = part;
286 this.m_uuid = part.uuid; 286 this.m_uuid = part.uuid;
287 this.m_localId = part.m_localID; 287 this.m_localId = part.m_localID;
288 } 288 }
289 289
290 /// <summary> 290 /// <summary>
291 /// 291 ///
292 /// </summary> 292 /// </summary>
293 /// <param name="part"></param> 293 /// <param name="part"></param>
294 private void SetPartAsNonRoot(AllNewSceneObjectPart2 part) 294 private void SetPartAsNonRoot(AllNewSceneObjectPart2 part)
295 { 295 {
296 296
297 } 297 }
298 } 298 }
299} 299}
diff --git a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart2.cs b/OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart2.cs
index 82d4cd0..07d1357 100644
--- a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart2.cs
+++ b/OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart2.cs
@@ -1,216 +1,216 @@
1using System.Collections.Generic; 1using System.Collections.Generic;
2using System.Text; 2using System.Text;
3using System; 3using System;
4using Axiom.Math; 4using Axiom.Math;
5using libsecondlife; 5using libsecondlife;
6using libsecondlife.Packets; 6using libsecondlife.Packets;
7using OpenSim.Framework.Interfaces; 7using OpenSim.Framework.Interfaces;
8using OpenSim.Framework.Types; 8using OpenSim.Framework.Types;
9 9
10namespace OpenSim.Region.Environment.Scenes 10namespace OpenSim.Region.Environment.Scenes
11{ 11{
12 12
13 public class AllNewSceneObjectPart2 13 public class AllNewSceneObjectPart2
14 { 14 {
15 private const uint FULL_MASK_PERMISSIONS = 2147483647; 15 private const uint FULL_MASK_PERMISSIONS = 2147483647;
16 16
17 private uint m_flags = 32 + 65536 + 131072 + 256 + 4 + 8 + 2048 + 524288 + 268435456 + 128; 17 private uint m_flags = 32 + 65536 + 131072 + 256 + 4 + 8 + 2048 + 524288 + 268435456 + 128;
18 private ulong m_regionHandle; 18 private ulong m_regionHandle;
19 19
20 public string SitName = ""; 20 public string SitName = "";
21 public string TouchName = ""; 21 public string TouchName = "";
22 public string Text = ""; 22 public string Text = "";
23 23
24 public LLUUID CreatorID; 24 public LLUUID CreatorID;
25 public LLUUID OwnerID; 25 public LLUUID OwnerID;
26 public LLUUID LastOwnerID; 26 public LLUUID LastOwnerID;
27 public Int32 CreationDate; 27 public Int32 CreationDate;
28 28
29 public LLUUID uuid; 29 public LLUUID uuid;
30 public uint m_localID; 30 public uint m_localID;
31 31
32 public uint ParentID = 0; 32 public uint ParentID = 0;
33 33
34 public uint OwnerMask = FULL_MASK_PERMISSIONS; 34 public uint OwnerMask = FULL_MASK_PERMISSIONS;
35 public uint NextOwnerMask = FULL_MASK_PERMISSIONS; 35 public uint NextOwnerMask = FULL_MASK_PERMISSIONS;
36 public uint GroupMask = FULL_MASK_PERMISSIONS; 36 public uint GroupMask = FULL_MASK_PERMISSIONS;
37 public uint EveryoneMask = FULL_MASK_PERMISSIONS; 37 public uint EveryoneMask = FULL_MASK_PERMISSIONS;
38 public uint BaseMask = FULL_MASK_PERMISSIONS; 38 public uint BaseMask = FULL_MASK_PERMISSIONS;
39 39
40 protected PrimitiveBaseShape m_Shape; 40 protected PrimitiveBaseShape m_Shape;
41 41
42 protected AllNewSceneObjectGroup2 m_parentGroup; 42 protected AllNewSceneObjectGroup2 m_parentGroup;
43 43
44 44
45 #region Properties 45 #region Properties
46 protected string m_name; 46 protected string m_name;
47 /// <summary> 47 /// <summary>
48 /// 48 ///
49 /// </summary> 49 /// </summary>
50 public virtual string Name 50 public virtual string Name
51 { 51 {
52 get { return m_name; } 52 get { return m_name; }
53 set { m_name = value; } 53 set { m_name = value; }
54 } 54 }
55 55
56 protected LLVector3 m_offset; 56 protected LLVector3 m_offset;
57 public LLVector3 OffsetPosition 57 public LLVector3 OffsetPosition
58 { 58 {
59 get 59 get
60 { 60 {
61 return m_offset; 61 return m_offset;
62 } 62 }
63 set 63 set
64 { 64 {
65 m_offset = value; 65 m_offset = value;
66 } 66 }
67 } 67 }
68 68
69 protected LLQuaternion m_rotationOffset; 69 protected LLQuaternion m_rotationOffset;
70 public LLQuaternion RotationOffset 70 public LLQuaternion RotationOffset
71 { 71 {
72 get 72 get
73 { 73 {
74 return m_rotationOffset; 74 return m_rotationOffset;
75 } 75 }
76 set 76 set
77 { 77 {
78 m_rotationOffset = value; 78 m_rotationOffset = value;
79 } 79 }
80 } 80 }
81 81
82 private string m_description = ""; 82 private string m_description = "";
83 public string Description 83 public string Description
84 { 84 {
85 get 85 get
86 { 86 {
87 return this.m_description; 87 return this.m_description;
88 } 88 }
89 set 89 set
90 { 90 {
91 this.m_description = value; 91 this.m_description = value;
92 } 92 }
93 } 93 }
94 94
95 public PrimitiveBaseShape Shape 95 public PrimitiveBaseShape Shape
96 { 96 {
97 get 97 get
98 { 98 {
99 return this.m_Shape; 99 return this.m_Shape;
100 } 100 }
101 } 101 }
102 102
103 public LLVector3 Scale 103 public LLVector3 Scale
104 { 104 {
105 set 105 set
106 { 106 {
107 this.m_Shape.Scale = value; 107 this.m_Shape.Scale = value;
108 } 108 }
109 get 109 get
110 { 110 {
111 return this.m_Shape.Scale; 111 return this.m_Shape.Scale;
112 } 112 }
113 } 113 }
114 #endregion 114 #endregion
115 115
116 #region Constructors 116 #region Constructors
117 public AllNewSceneObjectPart2(ulong regionHandle, AllNewSceneObjectGroup2 parent, LLUUID ownerID, uint localID, PrimitiveBaseShape shape, LLVector3 position) 117 public AllNewSceneObjectPart2(ulong regionHandle, AllNewSceneObjectGroup2 parent, LLUUID ownerID, uint localID, PrimitiveBaseShape shape, LLVector3 position)
118 { 118 {
119 this.m_regionHandle = regionHandle; 119 this.m_regionHandle = regionHandle;
120 this.m_parentGroup = parent; 120 this.m_parentGroup = parent;
121 121
122 this.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; 122 this.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
123 this.OwnerID = ownerID; 123 this.OwnerID = ownerID;
124 this.CreatorID = this.OwnerID; 124 this.CreatorID = this.OwnerID;
125 this.LastOwnerID = LLUUID.Zero; 125 this.LastOwnerID = LLUUID.Zero;
126 this.uuid = LLUUID.Random(); 126 this.uuid = LLUUID.Random();
127 this.m_localID = (uint)(localID); 127 this.m_localID = (uint)(localID);
128 this.m_Shape = shape; 128 this.m_Shape = shape;
129 129
130 this.OffsetPosition = position; 130 this.OffsetPosition = position;
131 131
132 //temporary code just so the m_flags field doesn't give a compiler warning 132 //temporary code just so the m_flags field doesn't give a compiler warning
133 if (m_flags == 1) 133 if (m_flags == 1)
134 { 134 {
135 135
136 } 136 }
137 } 137 }
138 #endregion 138 #endregion
139 139
140 #region Shape 140 #region Shape
141 /// <summary> 141 /// <summary>
142 /// 142 ///
143 /// </summary> 143 /// </summary>
144 /// <param name="shapeBlock"></param> 144 /// <param name="shapeBlock"></param>
145 public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock) 145 public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock)
146 { 146 {
147 this.m_Shape.PathBegin = shapeBlock.PathBegin; 147 this.m_Shape.PathBegin = shapeBlock.PathBegin;
148 this.m_Shape.PathEnd = shapeBlock.PathEnd; 148 this.m_Shape.PathEnd = shapeBlock.PathEnd;
149 this.m_Shape.PathScaleX = shapeBlock.PathScaleX; 149 this.m_Shape.PathScaleX = shapeBlock.PathScaleX;
150 this.m_Shape.PathScaleY = shapeBlock.PathScaleY; 150 this.m_Shape.PathScaleY = shapeBlock.PathScaleY;
151 this.m_Shape.PathShearX = shapeBlock.PathShearX; 151 this.m_Shape.PathShearX = shapeBlock.PathShearX;
152 this.m_Shape.PathShearY = shapeBlock.PathShearY; 152 this.m_Shape.PathShearY = shapeBlock.PathShearY;
153 this.m_Shape.PathSkew = shapeBlock.PathSkew; 153 this.m_Shape.PathSkew = shapeBlock.PathSkew;
154 this.m_Shape.ProfileBegin = shapeBlock.ProfileBegin; 154 this.m_Shape.ProfileBegin = shapeBlock.ProfileBegin;
155 this.m_Shape.ProfileEnd = shapeBlock.ProfileEnd; 155 this.m_Shape.ProfileEnd = shapeBlock.ProfileEnd;
156 this.m_Shape.PathCurve = shapeBlock.PathCurve; 156 this.m_Shape.PathCurve = shapeBlock.PathCurve;
157 this.m_Shape.ProfileCurve = shapeBlock.ProfileCurve; 157 this.m_Shape.ProfileCurve = shapeBlock.ProfileCurve;
158 this.m_Shape.ProfileHollow = shapeBlock.ProfileHollow; 158 this.m_Shape.ProfileHollow = shapeBlock.ProfileHollow;
159 this.m_Shape.PathRadiusOffset = shapeBlock.PathRadiusOffset; 159 this.m_Shape.PathRadiusOffset = shapeBlock.PathRadiusOffset;
160 this.m_Shape.PathRevolutions = shapeBlock.PathRevolutions; 160 this.m_Shape.PathRevolutions = shapeBlock.PathRevolutions;
161 this.m_Shape.PathTaperX = shapeBlock.PathTaperX; 161 this.m_Shape.PathTaperX = shapeBlock.PathTaperX;
162 this.m_Shape.PathTaperY = shapeBlock.PathTaperY; 162 this.m_Shape.PathTaperY = shapeBlock.PathTaperY;
163 this.m_Shape.PathTwist = shapeBlock.PathTwist; 163 this.m_Shape.PathTwist = shapeBlock.PathTwist;
164 this.m_Shape.PathTwistBegin = shapeBlock.PathTwistBegin; 164 this.m_Shape.PathTwistBegin = shapeBlock.PathTwistBegin;
165 } 165 }
166 #endregion 166 #endregion
167 167
168 #region Texture 168 #region Texture
169 /// <summary> 169 /// <summary>
170 /// 170 ///
171 /// </summary> 171 /// </summary>
172 /// <param name="textureEntry"></param> 172 /// <param name="textureEntry"></param>
173 public void UpdateTextureEntry(byte[] textureEntry) 173 public void UpdateTextureEntry(byte[] textureEntry)
174 { 174 {
175 this.m_Shape.TextureEntry = textureEntry; 175 this.m_Shape.TextureEntry = textureEntry;
176 } 176 }
177 #endregion 177 #endregion
178 178
179 #region Position 179 #region Position
180 /// <summary> 180 /// <summary>
181 /// 181 ///
182 /// </summary> 182 /// </summary>
183 /// <param name="pos"></param> 183 /// <param name="pos"></param>
184 public void UpdateOffSet(LLVector3 pos) 184 public void UpdateOffSet(LLVector3 pos)
185 { 185 {
186 LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z); 186 LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z);
187 this.OffsetPosition = newPos; 187 this.OffsetPosition = newPos;
188 } 188 }
189 #endregion 189 #endregion
190 190
191 #region rotation 191 #region rotation
192 public void UpdateRotation(LLQuaternion rot) 192 public void UpdateRotation(LLQuaternion rot)
193 { 193 {
194 this.RotationOffset = new LLQuaternion(rot.X, rot.Y, rot.Z, rot.W); 194 this.RotationOffset = new LLQuaternion(rot.X, rot.Y, rot.Z, rot.W);
195 } 195 }
196 #endregion 196 #endregion
197 197
198 #region Resizing/Scale 198 #region Resizing/Scale
199 /// <summary> 199 /// <summary>
200 /// 200 ///
201 /// </summary> 201 /// </summary>
202 /// <param name="scale"></param> 202 /// <param name="scale"></param>
203 public void Resize(LLVector3 scale) 203 public void Resize(LLVector3 scale)
204 { 204 {
205 LLVector3 offset = (scale - this.m_Shape.Scale); 205 LLVector3 offset = (scale - this.m_Shape.Scale);
206 offset.X /= 2; 206 offset.X /= 2;
207 offset.Y /= 2; 207 offset.Y /= 2;
208 offset.Z /= 2; 208 offset.Z /= 2;
209 209
210 this.OffsetPosition += offset; 210 this.OffsetPosition += offset;
211 this.m_Shape.Scale = scale; 211 this.m_Shape.Scale = scale;
212 } 212 }
213 #endregion 213 #endregion
214 } 214 }
215} 215}
216 216
diff --git a/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLHandler/Common.cs b/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLHandler/Common.cs
index 790871b..554ba1a 100644
--- a/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLHandler/Common.cs
+++ b/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLHandler/Common.cs
@@ -1,84 +1,84 @@
1/* 1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/ 2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders. 3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4* 4*
5* Redistribution and use in source and binary forms, with or without 5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met: 6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright 7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer. 8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright 9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the 10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution. 11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the 12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products 13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission. 14* derived from this software without specific prior written permission.
15* 15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY 16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28/* Original code: Tedd Hansen */ 28/* Original code: Tedd Hansen */
29using System; 29using System;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Text; 31using System.Text;
32 32
33namespace OpenSim.Region.Scripting.LSL 33namespace OpenSim.Region.Scripting.LSL
34{ 34{
35 public static class Common 35 public static class Common
36 { 36 {
37 static public bool Debug = true; 37 static public bool Debug = true;
38 static public bool IL_UseTryCatch = true; 38 static public bool IL_UseTryCatch = true;
39 static public bool IL_CreateConstructor = true; 39 static public bool IL_CreateConstructor = true;
40 static public bool IL_CreateFunctionList = true; 40 static public bool IL_CreateFunctionList = true;
41 static public bool IL_ProcessCodeChunks = true; 41 static public bool IL_ProcessCodeChunks = true;
42 42
43 public delegate void SendToDebugEventDelegate(string Message); 43 public delegate void SendToDebugEventDelegate(string Message);
44 public delegate void SendToLogEventDelegate(string Message); 44 public delegate void SendToLogEventDelegate(string Message);
45 static public event SendToDebugEventDelegate SendToDebugEvent; 45 static public event SendToDebugEventDelegate SendToDebugEvent;
46 static public event SendToLogEventDelegate SendToLogEvent; 46 static public event SendToLogEventDelegate SendToLogEvent;
47 47
48 static public void SendToDebug(string Message) 48 static public void SendToDebug(string Message)
49 { 49 {
50 //if (Debug == true) 50 //if (Debug == true)
51 Console.WriteLine("Debug: " + Message); 51 Console.WriteLine("Debug: " + Message);
52 SendToDebugEvent(DateTime.Now.ToString("[HH:mm:ss] ") + Message + "\r\n"); 52 SendToDebugEvent(DateTime.Now.ToString("[HH:mm:ss] ") + Message + "\r\n");
53 } 53 }
54 static public void SendToLog(string Message) 54 static public void SendToLog(string Message)
55 { 55 {
56 //if (Debug == true) 56 //if (Debug == true)
57 Console.WriteLine("LOG: " + Message); 57 Console.WriteLine("LOG: " + Message);
58 SendToLogEvent(DateTime.Now.ToString("[HH:mm:ss] ") + Message + "\r\n"); 58 SendToLogEvent(DateTime.Now.ToString("[HH:mm:ss] ") + Message + "\r\n");
59 } 59 }
60 } 60 }
61 61
62 // TEMPORARY TEST THINGIES 62 // TEMPORARY TEST THINGIES
63 public static class IL_Helper 63 public static class IL_Helper
64 { 64 {
65 public static string ReverseFormatString(string text1, string format) 65 public static string ReverseFormatString(string text1, string format)
66 { 66 {
67 Common.SendToDebug("ReverseFormatString text1: " + text1); 67 Common.SendToDebug("ReverseFormatString text1: " + text1);
68 Common.SendToDebug("ReverseFormatString format: " + format); 68 Common.SendToDebug("ReverseFormatString format: " + format);
69 return string.Format(format, text1); 69 return string.Format(format, text1);
70 } 70 }
71 public static string ReverseFormatString(string text1, UInt32 text2, string format) 71 public static string ReverseFormatString(string text1, UInt32 text2, string format)
72 { 72 {
73 Common.SendToDebug("ReverseFormatString text1: " + text1); 73 Common.SendToDebug("ReverseFormatString text1: " + text1);
74 Common.SendToDebug("ReverseFormatString text2: " + text2.ToString()); 74 Common.SendToDebug("ReverseFormatString text2: " + text2.ToString());
75 Common.SendToDebug("ReverseFormatString format: " + format); 75 Common.SendToDebug("ReverseFormatString format: " + format);
76 return string.Format(format, text1, text2.ToString()); 76 return string.Format(format, text1, text2.ToString());
77 } 77 }
78 public static string Cast_ToString(object obj) 78 public static string Cast_ToString(object obj)
79 { 79 {
80 Common.SendToDebug("OBJECT TO BE CASTED: " + obj.GetType().ToString()); 80 Common.SendToDebug("OBJECT TO BE CASTED: " + obj.GetType().ToString());
81 return "ABCDEFGIHJKLMNOPQ123"; 81 return "ABCDEFGIHJKLMNOPQ123";
82 } 82 }
83 } 83 }
84} 84}
diff --git a/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLHandler/IL_common_functions.cs b/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLHandler/IL_common_functions.cs
index cae78b7..2f23a91 100644
--- a/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLHandler/IL_common_functions.cs
+++ b/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLHandler/IL_common_functions.cs
@@ -1,56 +1,56 @@
1/* 1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/ 2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders. 3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4* 4*
5* Redistribution and use in source and binary forms, with or without 5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met: 6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright 7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer. 8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright 9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the 10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution. 11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the 12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products 13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission. 14* derived from this software without specific prior written permission.
15* 15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY 16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28/* Original code: Tedd Hansen */ 28/* Original code: Tedd Hansen */
29using System; 29using System;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Text; 31using System.Text;
32using System.Reflection; 32using System.Reflection;
33using System.Reflection.Emit; 33using System.Reflection.Emit;
34 34
35namespace OpenSim.Region.Scripting.LSL 35namespace OpenSim.Region.Scripting.LSL
36{ 36{
37 partial class LSO_Parser 37 partial class LSO_Parser
38 { 38 {
39 private static TypeBuilder CreateType(ModuleBuilder modBuilder, string typeName) 39 private static TypeBuilder CreateType(ModuleBuilder modBuilder, string typeName)
40 { 40 {
41 TypeBuilder typeBuilder = modBuilder.DefineType(typeName, 41 TypeBuilder typeBuilder = modBuilder.DefineType(typeName,
42 TypeAttributes.Public | 42 TypeAttributes.Public |
43 TypeAttributes.Class | 43 TypeAttributes.Class |
44 TypeAttributes.AutoClass | 44 TypeAttributes.AutoClass |
45 TypeAttributes.AnsiClass | 45 TypeAttributes.AnsiClass |
46 TypeAttributes.BeforeFieldInit | 46 TypeAttributes.BeforeFieldInit |
47 TypeAttributes.AutoLayout, 47 TypeAttributes.AutoLayout,
48 typeof(object), 48 typeof(object),
49 new Type[] { typeof(object) }); 49 new Type[] { typeof(object) });
50 return typeBuilder; 50 return typeBuilder;
51 51
52 } 52 }
53 53
54 54
55 } 55 }
56} 56}
diff --git a/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLHandler/LSL_BuiltIn_Commands_Interface.cs b/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLHandler/LSL_BuiltIn_Commands_Interface.cs
index cf603b0..d8a0ce3 100644
--- a/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLHandler/LSL_BuiltIn_Commands_Interface.cs
+++ b/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLHandler/LSL_BuiltIn_Commands_Interface.cs
@@ -1,366 +1,366 @@
1/* 1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/ 2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders. 3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4* 4*
5* Redistribution and use in source and binary forms, with or without 5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met: 6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright 7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer. 8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright 9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the 10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution. 11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the 12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products 13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission. 14* derived from this software without specific prior written permission.
15* 15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY 16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28/* Original code: Tedd Hansen */ 28/* Original code: Tedd Hansen */
29using System; 29using System;
30 using System.Collections.Generic; 30 using System.Collections.Generic;
31 using System.Text; 31 using System.Text;
32 32
33 namespace OpenSim.Region.Scripting.LSL 33 namespace OpenSim.Region.Scripting.LSL
34 { 34 {
35 public interface LSL_BuiltIn_Commands_Interface 35 public interface LSL_BuiltIn_Commands_Interface
36 { 36 {
37 void llSin(); 37 void llSin();
38 void llCos(); 38 void llCos();
39 void llTan(); 39 void llTan();
40 void llAtan2(); 40 void llAtan2();
41 void llSqrt(); 41 void llSqrt();
42 void llPow(); 42 void llPow();
43 void llAbs(); 43 void llAbs();
44 void llFabs(); 44 void llFabs();
45 void llFrand(); 45 void llFrand();
46 void llFloor(); 46 void llFloor();
47 void llCeil(); 47 void llCeil();
48 void llRound(); 48 void llRound();
49 void llVecMag(); 49 void llVecMag();
50 void llVecNorm(); 50 void llVecNorm();
51 void llVecDist(); 51 void llVecDist();
52 void llRot2Euler(); 52 void llRot2Euler();
53 void llEuler2Rot(); 53 void llEuler2Rot();
54 void llAxes2Rot(); 54 void llAxes2Rot();
55 void llRot2Fwd(); 55 void llRot2Fwd();
56 void llRot2Left(); 56 void llRot2Left();
57 void llRot2Up(); 57 void llRot2Up();
58 void llRotBetween(); 58 void llRotBetween();
59 void llWhisper(); 59 void llWhisper();
60 void llSay(UInt32 channelID, string text); 60 void llSay(UInt32 channelID, string text);
61 void llShout(); 61 void llShout();
62 void llListen(); 62 void llListen();
63 void llListenControl(); 63 void llListenControl();
64 void llListenRemove(); 64 void llListenRemove();
65 void llSensor(); 65 void llSensor();
66 void llSensorRepeat(); 66 void llSensorRepeat();
67 void llSensorRemove(); 67 void llSensorRemove();
68 void llDetectedName(); 68 void llDetectedName();
69 void llDetectedKey(); 69 void llDetectedKey();
70 void llDetectedOwner(); 70 void llDetectedOwner();
71 void llDetectedType(); 71 void llDetectedType();
72 void llDetectedPos(); 72 void llDetectedPos();
73 void llDetectedVel(); 73 void llDetectedVel();
74 void llDetectedGrab(); 74 void llDetectedGrab();
75 void llDetectedRot(); 75 void llDetectedRot();
76 void llDetectedGroup(); 76 void llDetectedGroup();
77 void llDetectedLinkNumber(); 77 void llDetectedLinkNumber();
78 void llDie(); 78 void llDie();
79 void llGround(); 79 void llGround();
80 void llCloud(); 80 void llCloud();
81 void llWind(); 81 void llWind();
82 void llSetStatus(); 82 void llSetStatus();
83 void llGetStatus(); 83 void llGetStatus();
84 void llSetScale(); 84 void llSetScale();
85 void llGetScale(); 85 void llGetScale();
86 void llSetColor(); 86 void llSetColor();
87 void llGetAlpha(); 87 void llGetAlpha();
88 void llSetAlpha(); 88 void llSetAlpha();
89 void llGetColor(); 89 void llGetColor();
90 void llSetTexture(); 90 void llSetTexture();
91 void llScaleTexture(); 91 void llScaleTexture();
92 void llOffsetTexture(); 92 void llOffsetTexture();
93 void llRotateTexture(); 93 void llRotateTexture();
94 void llGetTexture(); 94 void llGetTexture();
95 void llSetPos(); 95 void llSetPos();
96 void llGetPos(); 96 void llGetPos();
97 void llGetLocalPos(); 97 void llGetLocalPos();
98 void llSetRot(); 98 void llSetRot();
99 void llGetRot(); 99 void llGetRot();
100 void llGetLocalRot(); 100 void llGetLocalRot();
101 void llSetForce(); 101 void llSetForce();
102 void llGetForce(); 102 void llGetForce();
103 void llTarget(); 103 void llTarget();
104 void llTargetRemove(); 104 void llTargetRemove();
105 void llRotTarget(); 105 void llRotTarget();
106 void llRotTargetRemove(); 106 void llRotTargetRemove();
107 void llMoveToTarget(); 107 void llMoveToTarget();
108 void llStopMoveToTarget(); 108 void llStopMoveToTarget();
109 void llApplyImpulse(); 109 void llApplyImpulse();
110 void llApplyRotationalImpulse(); 110 void llApplyRotationalImpulse();
111 void llSetTorque(); 111 void llSetTorque();
112 void llGetTorque(); 112 void llGetTorque();
113 void llSetForceAndTorque(); 113 void llSetForceAndTorque();
114 void llGetVel(); 114 void llGetVel();
115 void llGetAccel(); 115 void llGetAccel();
116 void llGetOmega(); 116 void llGetOmega();
117 void llGetTimeOfDay(); 117 void llGetTimeOfDay();
118 void llGetWallclock(); 118 void llGetWallclock();
119 void llGetTime(); 119 void llGetTime();
120 void llResetTime(); 120 void llResetTime();
121 void llGetAndResetTime(); 121 void llGetAndResetTime();
122 void llSound(); 122 void llSound();
123 void llPlaySound(); 123 void llPlaySound();
124 void llLoopSound(); 124 void llLoopSound();
125 void llLoopSoundMaster(); 125 void llLoopSoundMaster();
126 void llLoopSoundSlave(); 126 void llLoopSoundSlave();
127 void llPlaySoundSlave(); 127 void llPlaySoundSlave();
128 void llTriggerSound(); 128 void llTriggerSound();
129 void llStopSound(); 129 void llStopSound();
130 void llPreloadSound(); 130 void llPreloadSound();
131 void llGetSubString(); 131 void llGetSubString();
132 void llDeleteSubString(); 132 void llDeleteSubString();
133 void llInsertString(); 133 void llInsertString();
134 void llToUpper(); 134 void llToUpper();
135 void llToLower(); 135 void llToLower();
136 void llGiveMoney(); 136 void llGiveMoney();
137 void llMakeExplosion(); 137 void llMakeExplosion();
138 void llMakeFountain(); 138 void llMakeFountain();
139 void llMakeSmoke(); 139 void llMakeSmoke();
140 void llMakeFire(); 140 void llMakeFire();
141 void llRezObject(); 141 void llRezObject();
142 void llLookAt(); 142 void llLookAt();
143 void llStopLookAt(); 143 void llStopLookAt();
144 void llSetTimerEvent(); 144 void llSetTimerEvent();
145 void llSleep(); 145 void llSleep();
146 void llGetMass(); 146 void llGetMass();
147 void llCollisionFilter(); 147 void llCollisionFilter();
148 void llTakeControls(); 148 void llTakeControls();
149 void llReleaseControls(); 149 void llReleaseControls();
150 void llAttachToAvatar(); 150 void llAttachToAvatar();
151 void llDetachFromAvatar(); 151 void llDetachFromAvatar();
152 void llTakeCamera(); 152 void llTakeCamera();
153 void llReleaseCamera(); 153 void llReleaseCamera();
154 void llGetOwner(); 154 void llGetOwner();
155 void llInstantMessage(); 155 void llInstantMessage();
156 void llEmail(); 156 void llEmail();
157 void llGetNextEmail(); 157 void llGetNextEmail();
158 void llGetKey(); 158 void llGetKey();
159 void llSetBuoyancy(); 159 void llSetBuoyancy();
160 void llSetHoverHeight(); 160 void llSetHoverHeight();
161 void llStopHover(); 161 void llStopHover();
162 void llMinEventDelay(); 162 void llMinEventDelay();
163 void llSoundPreload(); 163 void llSoundPreload();
164 void llRotLookAt(); 164 void llRotLookAt();
165 void llStringLength(); 165 void llStringLength();
166 void llStartAnimation(); 166 void llStartAnimation();
167 void llStopAnimation(); 167 void llStopAnimation();
168 void llPointAt(); 168 void llPointAt();
169 void llStopPointAt(); 169 void llStopPointAt();
170 void llTargetOmega(); 170 void llTargetOmega();
171 void llGetStartParameter(); 171 void llGetStartParameter();
172 void llGodLikeRezObject(); 172 void llGodLikeRezObject();
173 void llRequestPermissions(); 173 void llRequestPermissions();
174 void llGetPermissionsKey(); 174 void llGetPermissionsKey();
175 void llGetPermissions(); 175 void llGetPermissions();
176 void llGetLinkNumber(); 176 void llGetLinkNumber();
177 void llSetLinkColor(); 177 void llSetLinkColor();
178 void llCreateLink(); 178 void llCreateLink();
179 void llBreakLink(); 179 void llBreakLink();
180 void llBreakAllLinks(); 180 void llBreakAllLinks();
181 void llGetLinkKey(); 181 void llGetLinkKey();
182 void llGetLinkName(); 182 void llGetLinkName();
183 void llGetInventoryNumber(); 183 void llGetInventoryNumber();
184 void llGetInventoryName(); 184 void llGetInventoryName();
185 void llSetScriptState(); 185 void llSetScriptState();
186 void llGetEnergy(); 186 void llGetEnergy();
187 void llGiveInventory(); 187 void llGiveInventory();
188 void llRemoveInventory(); 188 void llRemoveInventory();
189 void llSetText(); 189 void llSetText();
190 void llWater(); 190 void llWater();
191 void llPassTouches(); 191 void llPassTouches();
192 void llRequestAgentData(); 192 void llRequestAgentData();
193 void llRequestInventoryData(); 193 void llRequestInventoryData();
194 void llSetDamage(); 194 void llSetDamage();
195 void llTeleportAgentHome(); 195 void llTeleportAgentHome();
196 void llModifyLand(); 196 void llModifyLand();
197 void llCollisionSound(); 197 void llCollisionSound();
198 void llCollisionSprite(); 198 void llCollisionSprite();
199 void llGetAnimation(); 199 void llGetAnimation();
200 void llResetScript(); 200 void llResetScript();
201 void llMessageLinked(); 201 void llMessageLinked();
202 void llPushObject(); 202 void llPushObject();
203 void llPassCollisions(); 203 void llPassCollisions();
204 void llGetScriptName(); 204 void llGetScriptName();
205 void llGetNumberOfSides(); 205 void llGetNumberOfSides();
206 void llAxisAngle2Rot(); 206 void llAxisAngle2Rot();
207 void llRot2Axis(); 207 void llRot2Axis();
208 void llRot2Angle(); 208 void llRot2Angle();
209 void llAcos(); 209 void llAcos();
210 void llAsin(); 210 void llAsin();
211 void llAngleBetween(); 211 void llAngleBetween();
212 void llGetInventoryKey(); 212 void llGetInventoryKey();
213 void llAllowInventoryDrop(); 213 void llAllowInventoryDrop();
214 void llGetSunDirection(); 214 void llGetSunDirection();
215 void llGetTextureOffset(); 215 void llGetTextureOffset();
216 void llGetTextureScale(); 216 void llGetTextureScale();
217 void llGetTextureRot(); 217 void llGetTextureRot();
218 void llSubStringIndex(); 218 void llSubStringIndex();
219 void llGetOwnerKey(); 219 void llGetOwnerKey();
220 void llGetCenterOfMass(); 220 void llGetCenterOfMass();
221 void llListSort(); 221 void llListSort();
222 void llGetListLength(); 222 void llGetListLength();
223 void llList2Integer(); 223 void llList2Integer();
224 void llList2Float(); 224 void llList2Float();
225 void llList2String(); 225 void llList2String();
226 void llList2Key(); 226 void llList2Key();
227 void llList2Vector(); 227 void llList2Vector();
228 void llList2Rot(); 228 void llList2Rot();
229 void llList2List(); 229 void llList2List();
230 void llDeleteSubList(); 230 void llDeleteSubList();
231 void llGetListEntryType(); 231 void llGetListEntryType();
232 void llList2CSV(); 232 void llList2CSV();
233 void llCSV2List(); 233 void llCSV2List();
234 void llListRandomize(); 234 void llListRandomize();
235 void llList2ListStrided(); 235 void llList2ListStrided();
236 void llGetRegionCorner(); 236 void llGetRegionCorner();
237 void llListInsertList(); 237 void llListInsertList();
238 void llListFindList(); 238 void llListFindList();
239 void llGetObjectName(); 239 void llGetObjectName();
240 void llSetObjectName(); 240 void llSetObjectName();
241 void llGetDate(); 241 void llGetDate();
242 void llEdgeOfWorld(); 242 void llEdgeOfWorld();
243 void llGetAgentInfo(); 243 void llGetAgentInfo();
244 void llAdjustSoundVolume(); 244 void llAdjustSoundVolume();
245 void llSetSoundQueueing(); 245 void llSetSoundQueueing();
246 void llSetSoundRadius(); 246 void llSetSoundRadius();
247 void llKey2Name(); 247 void llKey2Name();
248 void llSetTextureAnim(); 248 void llSetTextureAnim();
249 void llTriggerSoundLimited(); 249 void llTriggerSoundLimited();
250 void llEjectFromLand(); 250 void llEjectFromLand();
251 void llParseString2List(); 251 void llParseString2List();
252 void llOverMyLand(); 252 void llOverMyLand();
253 void llGetLandOwnerAt(); 253 void llGetLandOwnerAt();
254 void llGetNotecardLine(); 254 void llGetNotecardLine();
255 void llGetAgentSize(); 255 void llGetAgentSize();
256 void llSameGroup(); 256 void llSameGroup();
257 void llUnSit(); 257 void llUnSit();
258 void llGroundSlope(); 258 void llGroundSlope();
259 void llGroundNormal(); 259 void llGroundNormal();
260 void llGroundContour(); 260 void llGroundContour();
261 void llGetAttached(); 261 void llGetAttached();
262 void llGetFreeMemory(); 262 void llGetFreeMemory();
263 void llGetRegionName(); 263 void llGetRegionName();
264 void llGetRegionTimeDilation(); 264 void llGetRegionTimeDilation();
265 void llGetRegionFPS(); 265 void llGetRegionFPS();
266 void llParticleSystem(); 266 void llParticleSystem();
267 void llGroundRepel(); 267 void llGroundRepel();
268 void llGiveInventoryList(); 268 void llGiveInventoryList();
269 void llSetVehicleType(); 269 void llSetVehicleType();
270 void llSetVehicleFloatParam(); 270 void llSetVehicleFloatParam();
271 void llSetVehicleVectorParam(); 271 void llSetVehicleVectorParam();
272 void llSetVehicleRotationParam(); 272 void llSetVehicleRotationParam();
273 void llSetVehicleFlags(); 273 void llSetVehicleFlags();
274 void llRemoveVehicleFlags(); 274 void llRemoveVehicleFlags();
275 void llSitTarget(); 275 void llSitTarget();
276 void llAvatarOnSitTarget(); 276 void llAvatarOnSitTarget();
277 void llAddToLandPassList(); 277 void llAddToLandPassList();
278 void llSetTouchText(); 278 void llSetTouchText();
279 void llSetSitText(); 279 void llSetSitText();
280 void llSetCameraEyeOffset(); 280 void llSetCameraEyeOffset();
281 void llSetCameraAtOffset(); 281 void llSetCameraAtOffset();
282 void llDumpList2String(); 282 void llDumpList2String();
283 void llScriptDanger(); 283 void llScriptDanger();
284 void llDialog(); 284 void llDialog();
285 void llVolumeDetect(); 285 void llVolumeDetect();
286 void llResetOtherScript(); 286 void llResetOtherScript();
287 void llGetScriptState(); 287 void llGetScriptState();
288 void llRemoteLoadScript(); 288 void llRemoteLoadScript();
289 void llSetRemoteScriptAccessPin(); 289 void llSetRemoteScriptAccessPin();
290 void llRemoteLoadScriptPin(); 290 void llRemoteLoadScriptPin();
291 void llOpenRemoteDataChannel(); 291 void llOpenRemoteDataChannel();
292 void llSendRemoteData(); 292 void llSendRemoteData();
293 void llRemoteDataReply(); 293 void llRemoteDataReply();
294 void llCloseRemoteDataChannel(); 294 void llCloseRemoteDataChannel();
295 void llMD5String(); 295 void llMD5String();
296 void llSetPrimitiveParams(); 296 void llSetPrimitiveParams();
297 void llStringToBase64(); 297 void llStringToBase64();
298 void llBase64ToString(); 298 void llBase64ToString();
299 void llXorBase64Strings(); 299 void llXorBase64Strings();
300 void llRemoteDataSetRegion(); 300 void llRemoteDataSetRegion();
301 void llLog10(); 301 void llLog10();
302 void llLog(); 302 void llLog();
303 void llGetAnimationList(); 303 void llGetAnimationList();
304 void llSetParcelMusicURL(); 304 void llSetParcelMusicURL();
305 void llGetRootPosition(); 305 void llGetRootPosition();
306 void llGetRootRotation(); 306 void llGetRootRotation();
307 void llGetObjectDesc(); 307 void llGetObjectDesc();
308 void llSetObjectDesc(); 308 void llSetObjectDesc();
309 void llGetCreator(); 309 void llGetCreator();
310 void llGetTimestamp(); 310 void llGetTimestamp();
311 void llSetLinkAlpha(); 311 void llSetLinkAlpha();
312 void llGetNumberOfPrims(); 312 void llGetNumberOfPrims();
313 void llGetNumberOfNotecardLines(); 313 void llGetNumberOfNotecardLines();
314 void llGetBoundingBox(); 314 void llGetBoundingBox();
315 void llGetGeometricCenter(); 315 void llGetGeometricCenter();
316 void llGetPrimitiveParams(); 316 void llGetPrimitiveParams();
317 void llIntegerToBase64(); 317 void llIntegerToBase64();
318 void llBase64ToInteger(); 318 void llBase64ToInteger();
319 void llGetGMTclock(); 319 void llGetGMTclock();
320 void llGetSimulatorHostname(); 320 void llGetSimulatorHostname();
321 void llSetLocalRot(); 321 void llSetLocalRot();
322 void llParseStringKeepNulls(); 322 void llParseStringKeepNulls();
323 void llRezAtRoot(); 323 void llRezAtRoot();
324 void llGetObjectPermMask(); 324 void llGetObjectPermMask();
325 void llSetObjectPermMask(); 325 void llSetObjectPermMask();
326 void llGetInventoryPermMask(); 326 void llGetInventoryPermMask();
327 void llSetInventoryPermMask(); 327 void llSetInventoryPermMask();
328 void llGetInventoryCreator(); 328 void llGetInventoryCreator();
329 void llOwnerSay(); 329 void llOwnerSay();
330 void llRequestSimulatorData(); 330 void llRequestSimulatorData();
331 void llForceMouselook(); 331 void llForceMouselook();
332 void llGetObjectMass(); 332 void llGetObjectMass();
333 void llListReplaceList(); 333 void llListReplaceList();
334 void llLoadURL(); 334 void llLoadURL();
335 void llParcelMediaCommandList(); 335 void llParcelMediaCommandList();
336 void llParcelMediaQuery(); 336 void llParcelMediaQuery();
337 void llModPow(); 337 void llModPow();
338 void llGetInventoryType(); 338 void llGetInventoryType();
339 void llSetPayPrice(); 339 void llSetPayPrice();
340 void llGetCameraPos(); 340 void llGetCameraPos();
341 void llGetCameraRot(); 341 void llGetCameraRot();
342 void llSetPrimURL(); 342 void llSetPrimURL();
343 void llRefreshPrimURL(); 343 void llRefreshPrimURL();
344 void llEscapeURL(); 344 void llEscapeURL();
345 void llUnescapeURL(); 345 void llUnescapeURL();
346 void llMapDestination(); 346 void llMapDestination();
347 void llAddToLandBanList(); 347 void llAddToLandBanList();
348 void llRemoveFromLandPassList(); 348 void llRemoveFromLandPassList();
349 void llRemoveFromLandBanList(); 349 void llRemoveFromLandBanList();
350 void llSetCameraParams(); 350 void llSetCameraParams();
351 void llClearCameraParams(); 351 void llClearCameraParams();
352 void llListStatistics(); 352 void llListStatistics();
353 void llGetUnixTime(); 353 void llGetUnixTime();
354 void llGetParcelFlags(); 354 void llGetParcelFlags();
355 void llGetRegionFlags(); 355 void llGetRegionFlags();
356 void llXorBase64StringsCorrect(); 356 void llXorBase64StringsCorrect();
357 void llHTTPRequest(); 357 void llHTTPRequest();
358 void llResetLandBanList(); 358 void llResetLandBanList();
359 void llResetLandPassList(); 359 void llResetLandPassList();
360 void llGetParcelPrimCount(); 360 void llGetParcelPrimCount();
361 void llGetParcelPrimOwners(); 361 void llGetParcelPrimOwners();
362 void llGetObjectPrimCount(); 362 void llGetObjectPrimCount();
363 void llGetParcelMaxPrims(); 363 void llGetParcelMaxPrims();
364 void llGetParcelDetails(); 364 void llGetParcelDetails();
365 } 365 }
366 } 366 }
diff --git a/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLHandler/LSL_BuiltIn_Commands_TestImplementation.cs b/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLHandler/LSL_BuiltIn_Commands_TestImplementation.cs
index 08e7f95..4b0fa7e 100644
--- a/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLHandler/LSL_BuiltIn_Commands_TestImplementation.cs
+++ b/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLHandler/LSL_BuiltIn_Commands_TestImplementation.cs
@@ -1,377 +1,377 @@
1/* 1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/ 2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders. 3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4* 4*
5* Redistribution and use in source and binary forms, with or without 5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met: 6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright 7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer. 8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright 9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the 10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution. 11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the 12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products 13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission. 14* derived from this software without specific prior written permission.
15* 15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY 16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28/* Original code: Tedd Hansen */ 28/* Original code: Tedd Hansen */
29using System; 29using System;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Text; 31using System.Text;
32 32
33namespace OpenSim.Region.Scripting.LSL 33namespace OpenSim.Region.Scripting.LSL
34{ 34{
35 public class LSL_BuiltIn_Commands_TestImplementation: LSL_BuiltIn_Commands_Interface 35 public class LSL_BuiltIn_Commands_TestImplementation: LSL_BuiltIn_Commands_Interface
36 { 36 {
37 public LSL_BuiltIn_Commands_TestImplementation() 37 public LSL_BuiltIn_Commands_TestImplementation()
38 { 38 {
39 Common.SendToDebug("LSL_BuiltIn_Commands_TestImplementation: Creating object"); 39 Common.SendToDebug("LSL_BuiltIn_Commands_TestImplementation: Creating object");
40 } 40 }
41 41
42 public void llSin() { } 42 public void llSin() { }
43 public void llCos() { } 43 public void llCos() { }
44 public void llTan() { } 44 public void llTan() { }
45 public void llAtan2() { } 45 public void llAtan2() { }
46 public void llSqrt() { } 46 public void llSqrt() { }
47 public void llPow() { } 47 public void llPow() { }
48 public void llAbs() { } 48 public void llAbs() { }
49 public void llFabs() { } 49 public void llFabs() { }
50 public void llFrand() { } 50 public void llFrand() { }
51 public void llFloor() { } 51 public void llFloor() { }
52 public void llCeil() { } 52 public void llCeil() { }
53 public void llRound() { } 53 public void llRound() { }
54 public void llVecMag() { } 54 public void llVecMag() { }
55 public void llVecNorm() { } 55 public void llVecNorm() { }
56 public void llVecDist() { } 56 public void llVecDist() { }
57 public void llRot2Euler() { } 57 public void llRot2Euler() { }
58 public void llEuler2Rot() { } 58 public void llEuler2Rot() { }
59 public void llAxes2Rot() { } 59 public void llAxes2Rot() { }
60 public void llRot2Fwd() { } 60 public void llRot2Fwd() { }
61 public void llRot2Left() { } 61 public void llRot2Left() { }
62 public void llRot2Up() { } 62 public void llRot2Up() { }
63 public void llRotBetween() { } 63 public void llRotBetween() { }
64 public void llWhisper() { } 64 public void llWhisper() { }
65 public void llSay(UInt32 channelID, string text) 65 public void llSay(UInt32 channelID, string text)
66 { 66 {
67 Common.SendToDebug("INTERNAL FUNCTION llSay(" + channelID + ", \"" + text + "\");"); 67 Common.SendToDebug("INTERNAL FUNCTION llSay(" + channelID + ", \"" + text + "\");");
68 } 68 }
69 public void llShout() { } 69 public void llShout() { }
70 public void llListen() { } 70 public void llListen() { }
71 public void llListenControl() { } 71 public void llListenControl() { }
72 public void llListenRemove() { } 72 public void llListenRemove() { }
73 public void llSensor() { } 73 public void llSensor() { }
74 public void llSensorRepeat() { } 74 public void llSensorRepeat() { }
75 public void llSensorRemove() { } 75 public void llSensorRemove() { }
76 public void llDetectedName() { } 76 public void llDetectedName() { }
77 public void llDetectedKey() { } 77 public void llDetectedKey() { }
78 public void llDetectedOwner() { } 78 public void llDetectedOwner() { }
79 public void llDetectedType() { } 79 public void llDetectedType() { }
80 public void llDetectedPos() { } 80 public void llDetectedPos() { }
81 public void llDetectedVel() { } 81 public void llDetectedVel() { }
82 public void llDetectedGrab() { } 82 public void llDetectedGrab() { }
83 public void llDetectedRot() { } 83 public void llDetectedRot() { }
84 public void llDetectedGroup() { } 84 public void llDetectedGroup() { }
85 public void llDetectedLinkNumber() { } 85 public void llDetectedLinkNumber() { }
86 public void llDie() { } 86 public void llDie() { }
87 public void llGround() { } 87 public void llGround() { }
88 public void llCloud() { } 88 public void llCloud() { }
89 public void llWind() { } 89 public void llWind() { }
90 public void llSetStatus() { } 90 public void llSetStatus() { }
91 public void llGetStatus() { } 91 public void llGetStatus() { }
92 public void llSetScale() { } 92 public void llSetScale() { }
93 public void llGetScale() { } 93 public void llGetScale() { }
94 public void llSetColor() { } 94 public void llSetColor() { }
95 public void llGetAlpha() { } 95 public void llGetAlpha() { }
96 public void llSetAlpha() { } 96 public void llSetAlpha() { }
97 public void llGetColor() { } 97 public void llGetColor() { }
98 public void llSetTexture() { } 98 public void llSetTexture() { }
99 public void llScaleTexture() { } 99 public void llScaleTexture() { }
100 public void llOffsetTexture() { } 100 public void llOffsetTexture() { }
101 public void llRotateTexture() { } 101 public void llRotateTexture() { }
102 public void llGetTexture() { } 102 public void llGetTexture() { }
103 public void llSetPos() { } 103 public void llSetPos() { }
104 public void llGetPos() { } 104 public void llGetPos() { }
105 public void llGetLocalPos() { } 105 public void llGetLocalPos() { }
106 public void llSetRot() { } 106 public void llSetRot() { }
107 public void llGetRot() { } 107 public void llGetRot() { }
108 public void llGetLocalRot() { } 108 public void llGetLocalRot() { }
109 public void llSetForce() { } 109 public void llSetForce() { }
110 public void llGetForce() { } 110 public void llGetForce() { }
111 public void llTarget() { } 111 public void llTarget() { }
112 public void llTargetRemove() { } 112 public void llTargetRemove() { }
113 public void llRotTarget() { } 113 public void llRotTarget() { }
114 public void llRotTargetRemove() { } 114 public void llRotTargetRemove() { }
115 public void llMoveToTarget() { } 115 public void llMoveToTarget() { }
116 public void llStopMoveToTarget() { } 116 public void llStopMoveToTarget() { }
117 public void llApplyImpulse() { } 117 public void llApplyImpulse() { }
118 public void llApplyRotationalImpulse() { } 118 public void llApplyRotationalImpulse() { }
119 public void llSetTorque() { } 119 public void llSetTorque() { }
120 public void llGetTorque() { } 120 public void llGetTorque() { }
121 public void llSetForceAndTorque() { } 121 public void llSetForceAndTorque() { }
122 public void llGetVel() { } 122 public void llGetVel() { }
123 public void llGetAccel() { } 123 public void llGetAccel() { }
124 public void llGetOmega() { } 124 public void llGetOmega() { }
125 public void llGetTimeOfDay() { } 125 public void llGetTimeOfDay() { }
126 public void llGetWallclock() { } 126 public void llGetWallclock() { }
127 public void llGetTime() { } 127 public void llGetTime() { }
128 public void llResetTime() { } 128 public void llResetTime() { }
129 public void llGetAndResetTime() { } 129 public void llGetAndResetTime() { }
130 public void llSound() { } 130 public void llSound() { }
131 public void llPlaySound() { } 131 public void llPlaySound() { }
132 public void llLoopSound() { } 132 public void llLoopSound() { }
133 public void llLoopSoundMaster() { } 133 public void llLoopSoundMaster() { }
134 public void llLoopSoundSlave() { } 134 public void llLoopSoundSlave() { }
135 public void llPlaySoundSlave() { } 135 public void llPlaySoundSlave() { }
136 public void llTriggerSound() { } 136 public void llTriggerSound() { }
137 public void llStopSound() { } 137 public void llStopSound() { }
138 public void llPreloadSound() { } 138 public void llPreloadSound() { }
139 public void llGetSubString() { } 139 public void llGetSubString() { }
140 public void llDeleteSubString() { } 140 public void llDeleteSubString() { }
141 public void llInsertString() { } 141 public void llInsertString() { }
142 public void llToUpper() { } 142 public void llToUpper() { }
143 public void llToLower() { } 143 public void llToLower() { }
144 public void llGiveMoney() { } 144 public void llGiveMoney() { }
145 public void llMakeExplosion() { } 145 public void llMakeExplosion() { }
146 public void llMakeFountain() { } 146 public void llMakeFountain() { }
147 public void llMakeSmoke() { } 147 public void llMakeSmoke() { }
148 public void llMakeFire() { } 148 public void llMakeFire() { }
149 public void llRezObject() { } 149 public void llRezObject() { }
150 public void llLookAt() { } 150 public void llLookAt() { }
151 public void llStopLookAt() { } 151 public void llStopLookAt() { }
152 public void llSetTimerEvent() { } 152 public void llSetTimerEvent() { }
153 public void llSleep() { } 153 public void llSleep() { }
154 public void llGetMass() { } 154 public void llGetMass() { }
155 public void llCollisionFilter() { } 155 public void llCollisionFilter() { }
156 public void llTakeControls() { } 156 public void llTakeControls() { }
157 public void llReleaseControls() { } 157 public void llReleaseControls() { }
158 public void llAttachToAvatar() { } 158 public void llAttachToAvatar() { }
159 public void llDetachFromAvatar() { } 159 public void llDetachFromAvatar() { }
160 public void llTakeCamera() { } 160 public void llTakeCamera() { }
161 public void llReleaseCamera() { } 161 public void llReleaseCamera() { }
162 public void llGetOwner() { } 162 public void llGetOwner() { }
163 public void llInstantMessage() { } 163 public void llInstantMessage() { }
164 public void llEmail() { } 164 public void llEmail() { }
165 public void llGetNextEmail() { } 165 public void llGetNextEmail() { }
166 public void llGetKey() { } 166 public void llGetKey() { }
167 public void llSetBuoyancy() { } 167 public void llSetBuoyancy() { }
168 public void llSetHoverHeight() { } 168 public void llSetHoverHeight() { }
169 public void llStopHover() { } 169 public void llStopHover() { }
170 public void llMinEventDelay() { } 170 public void llMinEventDelay() { }
171 public void llSoundPreload() { } 171 public void llSoundPreload() { }
172 public void llRotLookAt() { } 172 public void llRotLookAt() { }
173 public void llStringLength() { } 173 public void llStringLength() { }
174 public void llStartAnimation() { } 174 public void llStartAnimation() { }
175 public void llStopAnimation() { } 175 public void llStopAnimation() { }
176 public void llPointAt() { } 176 public void llPointAt() { }
177 public void llStopPointAt() { } 177 public void llStopPointAt() { }
178 public void llTargetOmega() { } 178 public void llTargetOmega() { }
179 public void llGetStartParameter() { } 179 public void llGetStartParameter() { }
180 public void llGodLikeRezObject() { } 180 public void llGodLikeRezObject() { }
181 public void llRequestPermissions() { } 181 public void llRequestPermissions() { }
182 public void llGetPermissionsKey() { } 182 public void llGetPermissionsKey() { }
183 public void llGetPermissions() { } 183 public void llGetPermissions() { }
184 public void llGetLinkNumber() { } 184 public void llGetLinkNumber() { }
185 public void llSetLinkColor() { } 185 public void llSetLinkColor() { }
186 public void llCreateLink() { } 186 public void llCreateLink() { }
187 public void llBreakLink() { } 187 public void llBreakLink() { }
188 public void llBreakAllLinks() { } 188 public void llBreakAllLinks() { }
189 public void llGetLinkKey() { } 189 public void llGetLinkKey() { }
190 public void llGetLinkName() { } 190 public void llGetLinkName() { }
191 public void llGetInventoryNumber() { } 191 public void llGetInventoryNumber() { }
192 public void llGetInventoryName() { } 192 public void llGetInventoryName() { }
193 public void llSetScriptState() { } 193 public void llSetScriptState() { }
194 public void llGetEnergy() { } 194 public void llGetEnergy() { }
195 public void llGiveInventory() { } 195 public void llGiveInventory() { }
196 public void llRemoveInventory() { } 196 public void llRemoveInventory() { }
197 public void llSetText() { } 197 public void llSetText() { }
198 public void llWater() { } 198 public void llWater() { }
199 public void llPassTouches() { } 199 public void llPassTouches() { }
200 public void llRequestAgentData() { } 200 public void llRequestAgentData() { }
201 public void llRequestInventoryData() { } 201 public void llRequestInventoryData() { }
202 public void llSetDamage() { } 202 public void llSetDamage() { }
203 public void llTeleportAgentHome() { } 203 public void llTeleportAgentHome() { }
204 public void llModifyLand() { } 204 public void llModifyLand() { }
205 public void llCollisionSound() { } 205 public void llCollisionSound() { }
206 public void llCollisionSprite() { } 206 public void llCollisionSprite() { }
207 public void llGetAnimation() { } 207 public void llGetAnimation() { }
208 public void llResetScript() { } 208 public void llResetScript() { }
209 public void llMessageLinked() { } 209 public void llMessageLinked() { }
210 public void llPushObject() { } 210 public void llPushObject() { }
211 public void llPassCollisions() { } 211 public void llPassCollisions() { }
212 public void llGetScriptName() { } 212 public void llGetScriptName() { }
213 public void llGetNumberOfSides() { } 213 public void llGetNumberOfSides() { }
214 public void llAxisAngle2Rot() { } 214 public void llAxisAngle2Rot() { }
215 public void llRot2Axis() { } 215 public void llRot2Axis() { }
216 public void llRot2Angle() { } 216 public void llRot2Angle() { }
217 public void llAcos() { } 217 public void llAcos() { }
218 public void llAsin() { } 218 public void llAsin() { }
219 public void llAngleBetween() { } 219 public void llAngleBetween() { }
220 public void llGetInventoryKey() { } 220 public void llGetInventoryKey() { }
221 public void llAllowInventoryDrop() { } 221 public void llAllowInventoryDrop() { }
222 public void llGetSunDirection() { } 222 public void llGetSunDirection() { }
223 public void llGetTextureOffset() { } 223 public void llGetTextureOffset() { }
224 public void llGetTextureScale() { } 224 public void llGetTextureScale() { }
225 public void llGetTextureRot() { } 225 public void llGetTextureRot() { }
226 public void llSubStringIndex() { } 226 public void llSubStringIndex() { }
227 public void llGetOwnerKey() { } 227 public void llGetOwnerKey() { }
228 public void llGetCenterOfMass() { } 228 public void llGetCenterOfMass() { }
229 public void llListSort() { } 229 public void llListSort() { }
230 public void llGetListLength() { } 230 public void llGetListLength() { }
231 public void llList2Integer() { } 231 public void llList2Integer() { }
232 public void llList2Float() { } 232 public void llList2Float() { }
233 public void llList2String() { } 233 public void llList2String() { }
234 public void llList2Key() { } 234 public void llList2Key() { }
235 public void llList2Vector() { } 235 public void llList2Vector() { }
236 public void llList2Rot() { } 236 public void llList2Rot() { }
237 public void llList2List() { } 237 public void llList2List() { }
238 public void llDeleteSubList() { } 238 public void llDeleteSubList() { }
239 public void llGetListEntryType() { } 239 public void llGetListEntryType() { }
240 public void llList2CSV() { } 240 public void llList2CSV() { }
241 public void llCSV2List() { } 241 public void llCSV2List() { }
242 public void llListRandomize() { } 242 public void llListRandomize() { }
243 public void llList2ListStrided() { } 243 public void llList2ListStrided() { }
244 public void llGetRegionCorner() { } 244 public void llGetRegionCorner() { }
245 public void llListInsertList() { } 245 public void llListInsertList() { }
246 public void llListFindList() { } 246 public void llListFindList() { }
247 public void llGetObjectName() { } 247 public void llGetObjectName() { }
248 public void llSetObjectName() { } 248 public void llSetObjectName() { }
249 public void llGetDate() { } 249 public void llGetDate() { }
250 public void llEdgeOfWorld() { } 250 public void llEdgeOfWorld() { }
251 public void llGetAgentInfo() { } 251 public void llGetAgentInfo() { }
252 public void llAdjustSoundVolume() { } 252 public void llAdjustSoundVolume() { }
253 public void llSetSoundQueueing() { } 253 public void llSetSoundQueueing() { }
254 public void llSetSoundRadius() { } 254 public void llSetSoundRadius() { }
255 public void llKey2Name() { } 255 public void llKey2Name() { }
256 public void llSetTextureAnim() { } 256 public void llSetTextureAnim() { }
257 public void llTriggerSoundLimited() { } 257 public void llTriggerSoundLimited() { }
258 public void llEjectFromLand() { } 258 public void llEjectFromLand() { }
259 public void llParseString2List() { } 259 public void llParseString2List() { }
260 public void llOverMyLand() { } 260 public void llOverMyLand() { }
261 public void llGetLandOwnerAt() { } 261 public void llGetLandOwnerAt() { }
262 public void llGetNotecardLine() { } 262 public void llGetNotecardLine() { }
263 public void llGetAgentSize() { } 263 public void llGetAgentSize() { }
264 public void llSameGroup() { } 264 public void llSameGroup() { }
265 public void llUnSit() { } 265 public void llUnSit() { }
266 public void llGroundSlope() { } 266 public void llGroundSlope() { }
267 public void llGroundNormal() { } 267 public void llGroundNormal() { }
268 public void llGroundContour() { } 268 public void llGroundContour() { }
269 public void llGetAttached() { } 269 public void llGetAttached() { }
270 public void llGetFreeMemory() { } 270 public void llGetFreeMemory() { }
271 public void llGetRegionName() { } 271 public void llGetRegionName() { }
272 public void llGetRegionTimeDilation() { } 272 public void llGetRegionTimeDilation() { }
273 public void llGetRegionFPS() { } 273 public void llGetRegionFPS() { }
274 public void llParticleSystem() { } 274 public void llParticleSystem() { }
275 public void llGroundRepel() { } 275 public void llGroundRepel() { }
276 public void llGiveInventoryList() { } 276 public void llGiveInventoryList() { }
277 public void llSetVehicleType() { } 277 public void llSetVehicleType() { }
278 public void llSetVehicleFloatParam() { } 278 public void llSetVehicleFloatParam() { }
279 public void llSetVehicleVectorParam() { } 279 public void llSetVehicleVectorParam() { }
280 public void llSetVehicleRotationParam() { } 280 public void llSetVehicleRotationParam() { }
281 public void llSetVehicleFlags() { } 281 public void llSetVehicleFlags() { }
282 public void llRemoveVehicleFlags() { } 282 public void llRemoveVehicleFlags() { }
283 public void llSitTarget() { } 283 public void llSitTarget() { }
284 public void llAvatarOnSitTarget() { } 284 public void llAvatarOnSitTarget() { }
285 public void llAddToLandPassList() { } 285 public void llAddToLandPassList() { }
286 public void llSetTouchText() { } 286 public void llSetTouchText() { }
287 public void llSetSitText() { } 287 public void llSetSitText() { }
288 public void llSetCameraEyeOffset() { } 288 public void llSetCameraEyeOffset() { }
289 public void llSetCameraAtOffset() { } 289 public void llSetCameraAtOffset() { }
290 public void llDumpList2String() { } 290 public void llDumpList2String() { }
291 public void llScriptDanger() { } 291 public void llScriptDanger() { }
292 public void llDialog() { } 292 public void llDialog() { }
293 public void llVolumeDetect() { } 293 public void llVolumeDetect() { }
294 public void llResetOtherScript() { } 294 public void llResetOtherScript() { }
295 public void llGetScriptState() { } 295 public void llGetScriptState() { }
296 public void llRemoteLoadScript() { } 296 public void llRemoteLoadScript() { }
297 public void llSetRemoteScriptAccessPin() { } 297 public void llSetRemoteScriptAccessPin() { }
298 public void llRemoteLoadScriptPin() { } 298 public void llRemoteLoadScriptPin() { }
299 public void llOpenRemoteDataChannel() { } 299 public void llOpenRemoteDataChannel() { }
300 public void llSendRemoteData() { } 300 public void llSendRemoteData() { }
301 public void llRemoteDataReply() { } 301 public void llRemoteDataReply() { }
302 public void llCloseRemoteDataChannel() { } 302 public void llCloseRemoteDataChannel() { }
303 public void llMD5String() { } 303 public void llMD5String() { }
304 public void llSetPrimitiveParams() { } 304 public void llSetPrimitiveParams() { }
305 public void llStringToBase64() { } 305 public void llStringToBase64() { }
306 public void llBase64ToString() { } 306 public void llBase64ToString() { }
307 public void llXorBase64Strings() { } 307 public void llXorBase64Strings() { }
308 public void llRemoteDataSetRegion() { } 308 public void llRemoteDataSetRegion() { }
309 public void llLog10() { } 309 public void llLog10() { }
310 public void llLog() { } 310 public void llLog() { }
311 public void llGetAnimationList() { } 311 public void llGetAnimationList() { }
312 public void llSetParcelMusicURL() { } 312 public void llSetParcelMusicURL() { }
313 public void llGetRootPosition() { } 313 public void llGetRootPosition() { }
314 public void llGetRootRotation() { } 314 public void llGetRootRotation() { }
315 public void llGetObjectDesc() { } 315 public void llGetObjectDesc() { }
316 public void llSetObjectDesc() { } 316 public void llSetObjectDesc() { }
317 public void llGetCreator() { } 317 public void llGetCreator() { }
318 public void llGetTimestamp() { } 318 public void llGetTimestamp() { }
319 public void llSetLinkAlpha() { } 319 public void llSetLinkAlpha() { }
320 public void llGetNumberOfPrims() { } 320 public void llGetNumberOfPrims() { }
321 public void llGetNumberOfNotecardLines() { } 321 public void llGetNumberOfNotecardLines() { }
322 public void llGetBoundingBox() { } 322 public void llGetBoundingBox() { }
323 public void llGetGeometricCenter() { } 323 public void llGetGeometricCenter() { }
324 public void llGetPrimitiveParams() { } 324 public void llGetPrimitiveParams() { }
325 public void llIntegerToBase64() { } 325 public void llIntegerToBase64() { }
326 public void llBase64ToInteger() { } 326 public void llBase64ToInteger() { }
327 public void llGetGMTclock() { } 327 public void llGetGMTclock() { }
328 public void llGetSimulatorHostname() { } 328 public void llGetSimulatorHostname() { }
329 public void llSetLocalRot() { } 329 public void llSetLocalRot() { }
330 public void llParseStringKeepNulls() { } 330 public void llParseStringKeepNulls() { }
331 public void llRezAtRoot() { } 331 public void llRezAtRoot() { }
332 public void llGetObjectPermMask() { } 332 public void llGetObjectPermMask() { }
333 public void llSetObjectPermMask() { } 333 public void llSetObjectPermMask() { }
334 public void llGetInventoryPermMask() { } 334 public void llGetInventoryPermMask() { }
335 public void llSetInventoryPermMask() { } 335 public void llSetInventoryPermMask() { }
336 public void llGetInventoryCreator() { } 336 public void llGetInventoryCreator() { }
337 public void llOwnerSay() { } 337 public void llOwnerSay() { }
338 public void llRequestSimulatorData() { } 338 public void llRequestSimulatorData() { }
339 public void llForceMouselook() { } 339 public void llForceMouselook() { }
340 public void llGetObjectMass() { } 340 public void llGetObjectMass() { }
341 public void llListReplaceList() { } 341 public void llListReplaceList() { }
342 public void llLoadURL() { } 342 public void llLoadURL() { }
343 public void llParcelMediaCommandList() { } 343 public void llParcelMediaCommandList() { }
344 public void llParcelMediaQuery() { } 344 public void llParcelMediaQuery() { }
345 public void llModPow() { } 345 public void llModPow() { }
346 public void llGetInventoryType() { } 346 public void llGetInventoryType() { }
347 public void llSetPayPrice() { } 347 public void llSetPayPrice() { }
348 public void llGetCameraPos() { } 348 public void llGetCameraPos() { }
349 public void llGetCameraRot() { } 349 public void llGetCameraRot() { }
350 public void llSetPrimURL() { } 350 public void llSetPrimURL() { }
351 public void llRefreshPrimURL() { } 351 public void llRefreshPrimURL() { }
352 public void llEscapeURL() { } 352 public void llEscapeURL() { }
353 public void llUnescapeURL() { } 353 public void llUnescapeURL() { }
354 public void llMapDestination() { } 354 public void llMapDestination() { }
355 public void llAddToLandBanList() { } 355 public void llAddToLandBanList() { }
356 public void llRemoveFromLandPassList() { } 356 public void llRemoveFromLandPassList() { }
357 public void llRemoveFromLandBanList() { } 357 public void llRemoveFromLandBanList() { }
358 public void llSetCameraParams() { } 358 public void llSetCameraParams() { }
359 public void llClearCameraParams() { } 359 public void llClearCameraParams() { }
360 public void llListStatistics() { } 360 public void llListStatistics() { }
361 public void llGetUnixTime() { } 361 public void llGetUnixTime() { }
362 public void llGetParcelFlags() { } 362 public void llGetParcelFlags() { }
363 public void llGetRegionFlags() { } 363 public void llGetRegionFlags() { }
364 public void llXorBase64StringsCorrect() { } 364 public void llXorBase64StringsCorrect() { }
365 public void llHTTPRequest() { } 365 public void llHTTPRequest() { }
366 public void llResetLandBanList() { } 366 public void llResetLandBanList() { }
367 public void llResetLandPassList() { } 367 public void llResetLandPassList() { }
368 public void llGetParcelPrimCount() { } 368 public void llGetParcelPrimCount() { }
369 public void llGetParcelPrimOwners() { } 369 public void llGetParcelPrimOwners() { }
370 public void llGetObjectPrimCount() { } 370 public void llGetObjectPrimCount() { }
371 public void llGetParcelMaxPrims() { } 371 public void llGetParcelMaxPrims() { }
372 public void llGetParcelDetails() { } 372 public void llGetParcelDetails() { }
373 373
374 374
375 375
376 } 376 }
377} 377}
diff --git a/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLHandler/LSL_OPCODE_IL_processor.cs b/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLHandler/LSL_OPCODE_IL_processor.cs
index 4b8f8d7..46f6845 100644
--- a/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLHandler/LSL_OPCODE_IL_processor.cs
+++ b/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLHandler/LSL_OPCODE_IL_processor.cs
@@ -1,351 +1,351 @@
1/* 1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/ 2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders. 3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4* 4*
5* Redistribution and use in source and binary forms, with or without 5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met: 6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright 7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer. 8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright 9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the 10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution. 11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the 12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products 13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission. 14* derived from this software without specific prior written permission.
15* 15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY 16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28/* Original code: Tedd Hansen */ 28/* Original code: Tedd Hansen */
29using System; 29using System;
30 using System.Collections.Generic; 30 using System.Collections.Generic;
31 using System.Text; 31 using System.Text;
32 using System.Reflection; 32 using System.Reflection;
33 using System.Reflection.Emit; 33 using System.Reflection.Emit;
34 34
35 namespace OpenSim.Region.Scripting.LSL 35 namespace OpenSim.Region.Scripting.LSL
36 { 36 {
37 partial class LSO_Parser 37 partial class LSO_Parser
38 { 38 {
39 //LSO_Enums MyLSO_Enums = new LSO_Enums(); 39 //LSO_Enums MyLSO_Enums = new LSO_Enums();
40 40
41 internal bool LSL_PROCESS_OPCODE(ILGenerator il) 41 internal bool LSL_PROCESS_OPCODE(ILGenerator il)
42 { 42 {
43 43
44 byte bp1; 44 byte bp1;
45 UInt32 u32p1; 45 UInt32 u32p1;
46 UInt16 opcode = br_read(1)[0]; 46 UInt16 opcode = br_read(1)[0];
47 Common.SendToDebug("OPCODE: " + ((LSO_Enums.Operation_Table)opcode).ToString()); 47 Common.SendToDebug("OPCODE: " + ((LSO_Enums.Operation_Table)opcode).ToString());
48 string idesc = ((LSO_Enums.Operation_Table)opcode).ToString(); 48 string idesc = ((LSO_Enums.Operation_Table)opcode).ToString();
49 switch ((LSO_Enums.Operation_Table)opcode) 49 switch ((LSO_Enums.Operation_Table)opcode)
50 { 50 {
51 51
52 case LSO_Enums.Operation_Table.POP: 52 case LSO_Enums.Operation_Table.POP:
53 case LSO_Enums.Operation_Table.POPL: 53 case LSO_Enums.Operation_Table.POPL:
54 case LSO_Enums.Operation_Table.POPV: 54 case LSO_Enums.Operation_Table.POPV:
55 case LSO_Enums.Operation_Table.POPQ: 55 case LSO_Enums.Operation_Table.POPQ:
56 case LSO_Enums.Operation_Table.POPIP: 56 case LSO_Enums.Operation_Table.POPIP:
57 case LSO_Enums.Operation_Table.POPBP: 57 case LSO_Enums.Operation_Table.POPBP:
58 case LSO_Enums.Operation_Table.POPSP: 58 case LSO_Enums.Operation_Table.POPSP:
59 case LSO_Enums.Operation_Table.POPSLR: 59 case LSO_Enums.Operation_Table.POPSLR:
60 // ignore -- builds callframe 60 // ignore -- builds callframe
61 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Pop);"); 61 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Pop);");
62 il.Emit(OpCodes.Pop); 62 il.Emit(OpCodes.Pop);
63 break; 63 break;
64 case LSO_Enums.Operation_Table.POPARG: 64 case LSO_Enums.Operation_Table.POPARG:
65 Common.SendToDebug("Instruction " + idesc + ": Ignored"); 65 Common.SendToDebug("Instruction " + idesc + ": Ignored");
66 Common.SendToDebug("Instruction " + idesc + ": Description: Drop x bytes from the stack "); 66 Common.SendToDebug("Instruction " + idesc + ": Description: Drop x bytes from the stack ");
67 Common.SendToDebug("Param1: " + BitConverter.ToUInt32(br_read(4), 0)); 67 Common.SendToDebug("Param1: " + BitConverter.ToUInt32(br_read(4), 0));
68 break; 68 break;
69 69
70 // LONG 70 // LONG
71 case LSO_Enums.Operation_Table.STORE: 71 case LSO_Enums.Operation_Table.STORE:
72 case LSO_Enums.Operation_Table.STORES: 72 case LSO_Enums.Operation_Table.STORES:
73 case LSO_Enums.Operation_Table.STOREL: 73 case LSO_Enums.Operation_Table.STOREL:
74 case LSO_Enums.Operation_Table.STOREV: 74 case LSO_Enums.Operation_Table.STOREV:
75 case LSO_Enums.Operation_Table.STOREQ: 75 case LSO_Enums.Operation_Table.STOREQ:
76 case LSO_Enums.Operation_Table.STOREG: 76 case LSO_Enums.Operation_Table.STOREG:
77 case LSO_Enums.Operation_Table.STOREGS: 77 case LSO_Enums.Operation_Table.STOREGS:
78 case LSO_Enums.Operation_Table.STOREGL: 78 case LSO_Enums.Operation_Table.STOREGL:
79 case LSO_Enums.Operation_Table.STOREGV: 79 case LSO_Enums.Operation_Table.STOREGV:
80 case LSO_Enums.Operation_Table.STOREGQ: 80 case LSO_Enums.Operation_Table.STOREGQ:
81 case LSO_Enums.Operation_Table.LOADP: 81 case LSO_Enums.Operation_Table.LOADP:
82 case LSO_Enums.Operation_Table.LOADSP: 82 case LSO_Enums.Operation_Table.LOADSP:
83 case LSO_Enums.Operation_Table.LOADLP: 83 case LSO_Enums.Operation_Table.LOADLP:
84 case LSO_Enums.Operation_Table.LOADVP: 84 case LSO_Enums.Operation_Table.LOADVP:
85 case LSO_Enums.Operation_Table.LOADQP: 85 case LSO_Enums.Operation_Table.LOADQP:
86 case LSO_Enums.Operation_Table.PUSH: 86 case LSO_Enums.Operation_Table.PUSH:
87 case LSO_Enums.Operation_Table.PUSHS: 87 case LSO_Enums.Operation_Table.PUSHS:
88 case LSO_Enums.Operation_Table.PUSHL: 88 case LSO_Enums.Operation_Table.PUSHL:
89 case LSO_Enums.Operation_Table.PUSHV: 89 case LSO_Enums.Operation_Table.PUSHV:
90 case LSO_Enums.Operation_Table.PUSHQ: 90 case LSO_Enums.Operation_Table.PUSHQ:
91 case LSO_Enums.Operation_Table.PUSHG: 91 case LSO_Enums.Operation_Table.PUSHG:
92 case LSO_Enums.Operation_Table.PUSHGS: 92 case LSO_Enums.Operation_Table.PUSHGS:
93 case LSO_Enums.Operation_Table.PUSHGL: 93 case LSO_Enums.Operation_Table.PUSHGL:
94 case LSO_Enums.Operation_Table.PUSHGV: 94 case LSO_Enums.Operation_Table.PUSHGV:
95 case LSO_Enums.Operation_Table.PUSHGQ: 95 case LSO_Enums.Operation_Table.PUSHGQ:
96 Common.SendToDebug("Param1: " + BitConverter.ToUInt32(br_read(4), 0)); 96 Common.SendToDebug("Param1: " + BitConverter.ToUInt32(br_read(4), 0));
97 break; 97 break;
98 // None 98 // None
99 case LSO_Enums.Operation_Table.PUSHIP: 99 case LSO_Enums.Operation_Table.PUSHIP:
100 case LSO_Enums.Operation_Table.PUSHBP: 100 case LSO_Enums.Operation_Table.PUSHBP:
101 case LSO_Enums.Operation_Table.PUSHSP: 101 case LSO_Enums.Operation_Table.PUSHSP:
102 // Push Stack Top (Memory Address) to stack 102 // Push Stack Top (Memory Address) to stack
103 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Ldc_I4, " + myHeader.SP + ");"); 103 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Ldc_I4, " + myHeader.SP + ");");
104 Common.SendToDebug("Instruction " + idesc + ": Description: Pushing Stack Top (Memory Address from header) to stack"); 104 Common.SendToDebug("Instruction " + idesc + ": Description: Pushing Stack Top (Memory Address from header) to stack");
105 il.Emit(OpCodes.Ldc_I4, myHeader.SP); 105 il.Emit(OpCodes.Ldc_I4, myHeader.SP);
106 break; 106 break;
107 // BYTE 107 // BYTE
108 case LSO_Enums.Operation_Table.PUSHARGB: 108 case LSO_Enums.Operation_Table.PUSHARGB:
109 Common.SendToDebug("Param1: " + br_read(1)[0]); 109 Common.SendToDebug("Param1: " + br_read(1)[0]);
110 break; 110 break;
111 // INTEGER 111 // INTEGER
112 case LSO_Enums.Operation_Table.PUSHARGI: 112 case LSO_Enums.Operation_Table.PUSHARGI:
113 // TODO: What is size of integer? 113 // TODO: What is size of integer?
114 u32p1 = BitConverter.ToUInt32(br_read(4), 0); 114 u32p1 = BitConverter.ToUInt32(br_read(4), 0);
115 Common.SendToDebug("Instruction PUSHSP: il.Emit(OpCodes.Ldc_I4, " + u32p1 + ");"); 115 Common.SendToDebug("Instruction PUSHSP: il.Emit(OpCodes.Ldc_I4, " + u32p1 + ");");
116 Common.SendToDebug("Param1: " + u32p1); 116 Common.SendToDebug("Param1: " + u32p1);
117 il.Emit(OpCodes.Ldc_I4, u32p1); 117 il.Emit(OpCodes.Ldc_I4, u32p1);
118 break; 118 break;
119 // FLOAT 119 // FLOAT
120 case LSO_Enums.Operation_Table.PUSHARGF: 120 case LSO_Enums.Operation_Table.PUSHARGF:
121 // TODO: What is size of float? 121 // TODO: What is size of float?
122 Common.SendToDebug("Param1: " + BitConverter.ToUInt32(br_read(4), 0)); 122 Common.SendToDebug("Param1: " + BitConverter.ToUInt32(br_read(4), 0));
123 break; 123 break;
124 // STRING 124 // STRING
125 case LSO_Enums.Operation_Table.PUSHARGS: 125 case LSO_Enums.Operation_Table.PUSHARGS:
126 string s = Read_String(); 126 string s = Read_String();
127 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Ldstr, \"" + s + "\");"); 127 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Ldstr, \"" + s + "\");");
128 Common.SendToDebug("Param1: " + s); 128 Common.SendToDebug("Param1: " + s);
129 il.Emit(OpCodes.Ldstr, s); 129 il.Emit(OpCodes.Ldstr, s);
130 break; 130 break;
131 // VECTOR z,y,x 131 // VECTOR z,y,x
132 case LSO_Enums.Operation_Table.PUSHARGV: 132 case LSO_Enums.Operation_Table.PUSHARGV:
133 Common.SendToDebug("Param1 Z: " + BitConverter.ToUInt32(br_read(4), 0)); 133 Common.SendToDebug("Param1 Z: " + BitConverter.ToUInt32(br_read(4), 0));
134 Common.SendToDebug("Param1 Y: " + BitConverter.ToUInt32(br_read(4), 0)); 134 Common.SendToDebug("Param1 Y: " + BitConverter.ToUInt32(br_read(4), 0));
135 Common.SendToDebug("Param1 X: " + BitConverter.ToUInt32(br_read(4), 0)); 135 Common.SendToDebug("Param1 X: " + BitConverter.ToUInt32(br_read(4), 0));
136 break; 136 break;
137 // ROTATION s,z,y,x 137 // ROTATION s,z,y,x
138 case LSO_Enums.Operation_Table.PUSHARGQ: 138 case LSO_Enums.Operation_Table.PUSHARGQ:
139 Common.SendToDebug("Param1 S: " + BitConverter.ToUInt32(br_read(4), 0)); 139 Common.SendToDebug("Param1 S: " + BitConverter.ToUInt32(br_read(4), 0));
140 Common.SendToDebug("Param1 Z: " + BitConverter.ToUInt32(br_read(4), 0)); 140 Common.SendToDebug("Param1 Z: " + BitConverter.ToUInt32(br_read(4), 0));
141 Common.SendToDebug("Param1 Y: " + BitConverter.ToUInt32(br_read(4), 0)); 141 Common.SendToDebug("Param1 Y: " + BitConverter.ToUInt32(br_read(4), 0));
142 Common.SendToDebug("Param1 X: " + BitConverter.ToUInt32(br_read(4), 0)); 142 Common.SendToDebug("Param1 X: " + BitConverter.ToUInt32(br_read(4), 0));
143 break; 143 break;
144 // LONG 144 // LONG
145 case LSO_Enums.Operation_Table.PUSHARGE: 145 case LSO_Enums.Operation_Table.PUSHARGE:
146 u32p1 = BitConverter.ToUInt32(br_read(4), 0); 146 u32p1 = BitConverter.ToUInt32(br_read(4), 0);
147 //Common.SendToDebug("Instruction PUSHSP: il.Emit(OpCodes., " + u32p1 + ");"); 147 //Common.SendToDebug("Instruction PUSHSP: il.Emit(OpCodes., " + u32p1 + ");");
148 Common.SendToDebug("Instruction " + idesc + ": Ignoring (not in use according to doc)"); 148 Common.SendToDebug("Instruction " + idesc + ": Ignoring (not in use according to doc)");
149 //Common.SendToDebug("Instruction " + idesc + ": Description: Pushes X bytes of $00 onto the stack (used to put space for local variable memory for a call)"); 149 //Common.SendToDebug("Instruction " + idesc + ": Description: Pushes X bytes of $00 onto the stack (used to put space for local variable memory for a call)");
150 Common.SendToDebug("Param1: " + u32p1); 150 Common.SendToDebug("Param1: " + u32p1);
151 //il.Emit(OpCodes.ldc_i4, u32p1); 151 //il.Emit(OpCodes.ldc_i4, u32p1);
152 //if (u32p1 > 0) { 152 //if (u32p1 > 0) {
153 //for (int _ic=0; _ic < u32p1; _ic++) 153 //for (int _ic=0; _ic < u32p1; _ic++)
154 //{ 154 //{
155 // Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Ldnull);"); 155 // Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Ldnull);");
156 // il.Emit(OpCodes.Ldnull); 156 // il.Emit(OpCodes.Ldnull);
157 //} 157 //}
158 break; 158 break;
159 // BYTE 159 // BYTE
160 case LSO_Enums.Operation_Table.ADD: 160 case LSO_Enums.Operation_Table.ADD:
161 bp1 = br_read(1)[0]; 161 bp1 = br_read(1)[0];
162 Common.SendToDebug("Instruction " + idesc + ": Add type: " + ((LSO_Enums.OpCode_Add_TypeDefs)bp1).ToString()); 162 Common.SendToDebug("Instruction " + idesc + ": Add type: " + ((LSO_Enums.OpCode_Add_TypeDefs)bp1).ToString());
163 Common.SendToDebug("Param1: " + bp1); 163 Common.SendToDebug("Param1: " + bp1);
164 switch ((LSO_Enums.OpCode_Add_TypeDefs)bp1) 164 switch ((LSO_Enums.OpCode_Add_TypeDefs)bp1)
165 { 165 {
166 case LSO_Enums.OpCode_Add_TypeDefs.String: 166 case LSO_Enums.OpCode_Add_TypeDefs.String:
167 Common.SendToDebug("Instruction " + idesc 167 Common.SendToDebug("Instruction " + idesc
168 + ": il.Emit(OpCodes.Call, typeof(System.String).GetMethod(\"Concat\", new Type[] { typeof(object), typeof(object) }));"); 168 + ": il.Emit(OpCodes.Call, typeof(System.String).GetMethod(\"Concat\", new Type[] { typeof(object), typeof(object) }));");
169 il.Emit(OpCodes.Call, typeof(System.String).GetMethod 169 il.Emit(OpCodes.Call, typeof(System.String).GetMethod
170 ("Concat", new Type[] { typeof(object), typeof(object) })); 170 ("Concat", new Type[] { typeof(object), typeof(object) }));
171 171
172 break; 172 break;
173 case LSO_Enums.OpCode_Add_TypeDefs.UInt32: 173 case LSO_Enums.OpCode_Add_TypeDefs.UInt32:
174 default: 174 default:
175 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Add);"); 175 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Add);");
176 il.Emit(OpCodes.Add); 176 il.Emit(OpCodes.Add);
177 break; 177 break;
178 } 178 }
179 179
180 180
181 //il.Emit(OpCodes.Add, p1); 181 //il.Emit(OpCodes.Add, p1);
182 break; 182 break;
183 case LSO_Enums.Operation_Table.SUB: 183 case LSO_Enums.Operation_Table.SUB:
184 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Sub);"); 184 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Sub);");
185 bp1 = br_read(1)[0]; 185 bp1 = br_read(1)[0];
186 Common.SendToDebug("Param1: " + bp1); 186 Common.SendToDebug("Param1: " + bp1);
187 il.Emit(OpCodes.Sub); 187 il.Emit(OpCodes.Sub);
188 //il.Emit(OpCodes.Sub, p1); 188 //il.Emit(OpCodes.Sub, p1);
189 break; 189 break;
190 case LSO_Enums.Operation_Table.MUL: 190 case LSO_Enums.Operation_Table.MUL:
191 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Mul);"); 191 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Mul);");
192 bp1 = br_read(1)[0]; 192 bp1 = br_read(1)[0];
193 Common.SendToDebug("Param1: " + bp1); 193 Common.SendToDebug("Param1: " + bp1);
194 il.Emit(OpCodes.Mul); 194 il.Emit(OpCodes.Mul);
195 //il.Emit(OpCodes.Mul, p1); 195 //il.Emit(OpCodes.Mul, p1);
196 break; 196 break;
197 case LSO_Enums.Operation_Table.DIV: 197 case LSO_Enums.Operation_Table.DIV:
198 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Div);"); 198 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Div);");
199 bp1 = br_read(1)[0]; 199 bp1 = br_read(1)[0];
200 Common.SendToDebug("Param1: " + bp1); 200 Common.SendToDebug("Param1: " + bp1);
201 il.Emit(OpCodes.Div); 201 il.Emit(OpCodes.Div);
202 //il.Emit(OpCodes.Div, p1); 202 //il.Emit(OpCodes.Div, p1);
203 break; 203 break;
204 case LSO_Enums.Operation_Table.EQ: 204 case LSO_Enums.Operation_Table.EQ:
205 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Ceq);"); 205 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Ceq);");
206 bp1 = br_read(1)[0]; 206 bp1 = br_read(1)[0];
207 Common.SendToDebug("Param1: " + bp1); 207 Common.SendToDebug("Param1: " + bp1);
208 il.Emit(OpCodes.Ceq); 208 il.Emit(OpCodes.Ceq);
209 //il.Emit(OpCodes.Ceq, p1); 209 //il.Emit(OpCodes.Ceq, p1);
210 break; 210 break;
211 case LSO_Enums.Operation_Table.NEQ: 211 case LSO_Enums.Operation_Table.NEQ:
212 case LSO_Enums.Operation_Table.LEQ: 212 case LSO_Enums.Operation_Table.LEQ:
213 case LSO_Enums.Operation_Table.GEQ: 213 case LSO_Enums.Operation_Table.GEQ:
214 case LSO_Enums.Operation_Table.LESS: 214 case LSO_Enums.Operation_Table.LESS:
215 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Clt_Un);"); 215 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Clt_Un);");
216 bp1 = br_read(1)[0]; 216 bp1 = br_read(1)[0];
217 Common.SendToDebug("Param1: " + bp1); 217 Common.SendToDebug("Param1: " + bp1);
218 il.Emit(OpCodes.Clt_Un); 218 il.Emit(OpCodes.Clt_Un);
219 //il.Emit(OpCodes.Clt, p1); 219 //il.Emit(OpCodes.Clt, p1);
220 break; 220 break;
221 case LSO_Enums.Operation_Table.GREATER: 221 case LSO_Enums.Operation_Table.GREATER:
222 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Cgt_Un);"); 222 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Cgt_Un);");
223 bp1 = br_read(1)[0]; 223 bp1 = br_read(1)[0];
224 Common.SendToDebug("Param1: " + bp1); 224 Common.SendToDebug("Param1: " + bp1);
225 il.Emit(OpCodes.Cgt_Un); 225 il.Emit(OpCodes.Cgt_Un);
226 //il.Emit(OpCodes.Cgt, p1); 226 //il.Emit(OpCodes.Cgt, p1);
227 break; 227 break;
228 case LSO_Enums.Operation_Table.MOD: 228 case LSO_Enums.Operation_Table.MOD:
229 case LSO_Enums.Operation_Table.BOOLOR: 229 case LSO_Enums.Operation_Table.BOOLOR:
230 bp1 = br_read(1)[0]; 230 bp1 = br_read(1)[0];
231 Common.SendToDebug("Param1: " + bp1); 231 Common.SendToDebug("Param1: " + bp1);
232 break; 232 break;
233 // LONG 233 // LONG
234 case LSO_Enums.Operation_Table.JUMP: 234 case LSO_Enums.Operation_Table.JUMP:
235 Common.SendToDebug("Param1: " + BitConverter.ToUInt32(br_read(4), 0)); 235 Common.SendToDebug("Param1: " + BitConverter.ToUInt32(br_read(4), 0));
236 break; 236 break;
237 // BYTE, LONG 237 // BYTE, LONG
238 case LSO_Enums.Operation_Table.JUMPIF: 238 case LSO_Enums.Operation_Table.JUMPIF:
239 case LSO_Enums.Operation_Table.JUMPNIF: 239 case LSO_Enums.Operation_Table.JUMPNIF:
240 Common.SendToDebug("Param1: " + br_read(1)[0]); 240 Common.SendToDebug("Param1: " + br_read(1)[0]);
241 Common.SendToDebug("Param2: " + BitConverter.ToUInt32(br_read(4), 0)); 241 Common.SendToDebug("Param2: " + BitConverter.ToUInt32(br_read(4), 0));
242 break; 242 break;
243 // LONG 243 // LONG
244 case LSO_Enums.Operation_Table.STATE: 244 case LSO_Enums.Operation_Table.STATE:
245 bp1 = br_read(1)[0]; 245 bp1 = br_read(1)[0];
246 //il.Emit(OpCodes.Ld); // Load local variable 0 onto stack 246 //il.Emit(OpCodes.Ld); // Load local variable 0 onto stack
247 //il.Emit(OpCodes.Ldc_I4, 0); // Push index position 247 //il.Emit(OpCodes.Ldc_I4, 0); // Push index position
248 //il.Emit(OpCodes.Ldstr, EventList[p1]); // Push value 248 //il.Emit(OpCodes.Ldstr, EventList[p1]); // Push value
249 //il.Emit(OpCodes.Stelem_Ref); // Perform array[index] = value 249 //il.Emit(OpCodes.Stelem_Ref); // Perform array[index] = value
250 break; 250 break;
251 case LSO_Enums.Operation_Table.CALL: 251 case LSO_Enums.Operation_Table.CALL:
252 Common.SendToDebug("Param1: " + BitConverter.ToUInt32(br_read(4), 0)); 252 Common.SendToDebug("Param1: " + BitConverter.ToUInt32(br_read(4), 0));
253 break; 253 break;
254 // BYTE 254 // BYTE
255 case LSO_Enums.Operation_Table.CAST: 255 case LSO_Enums.Operation_Table.CAST:
256 bp1 = br_read(1)[0]; 256 bp1 = br_read(1)[0];
257 Common.SendToDebug("Instruction " + idesc + ": Cast to type: " + ((LSO_Enums.OpCode_Cast_TypeDefs)bp1)); 257 Common.SendToDebug("Instruction " + idesc + ": Cast to type: " + ((LSO_Enums.OpCode_Cast_TypeDefs)bp1));
258 Common.SendToDebug("Param1: " + bp1); 258 Common.SendToDebug("Param1: " + bp1);
259 switch ((LSO_Enums.OpCode_Cast_TypeDefs)bp1) 259 switch ((LSO_Enums.OpCode_Cast_TypeDefs)bp1)
260 { 260 {
261 case LSO_Enums.OpCode_Cast_TypeDefs.String: 261 case LSO_Enums.OpCode_Cast_TypeDefs.String:
262 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Calli, typeof(System.Convert).GetMethod(\"ToString\", new Type[] { typeof(object) }));"); 262 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Calli, typeof(System.Convert).GetMethod(\"ToString\", new Type[] { typeof(object) }));");
263 //il.Emit(OpCodes.Box, typeof (UInt32)); 263 //il.Emit(OpCodes.Box, typeof (UInt32));
264 il.Emit(OpCodes.Calli, typeof(Common).GetMethod 264 il.Emit(OpCodes.Calli, typeof(Common).GetMethod
265 ("Cast_ToString", new Type[] { typeof(object) })); 265 ("Cast_ToString", new Type[] { typeof(object) }));
266 266
267 //il.Emit(OpCodes.Box, typeof(System.UInt32) ); 267 //il.Emit(OpCodes.Box, typeof(System.UInt32) );
268 //il.Emit(OpCodes.Box, typeof(string)); 268 //il.Emit(OpCodes.Box, typeof(string));
269 269
270 //il.Emit(OpCodes.Conv_R8); 270 //il.Emit(OpCodes.Conv_R8);
271 //il.Emit(OpCodes.Call, typeof(System.Convert).GetMethod 271 //il.Emit(OpCodes.Call, typeof(System.Convert).GetMethod
272 // ("ToString", new Type[] { typeof(float) })); 272 // ("ToString", new Type[] { typeof(float) }));
273 273
274 break; 274 break;
275 default: 275 default:
276 Common.SendToDebug("Instruction " + idesc + ": Unknown cast type!"); 276 Common.SendToDebug("Instruction " + idesc + ": Unknown cast type!");
277 break; 277 break;
278 } 278 }
279 break; 279 break;
280 // LONG 280 // LONG
281 case LSO_Enums.Operation_Table.STACKTOS: 281 case LSO_Enums.Operation_Table.STACKTOS:
282 case LSO_Enums.Operation_Table.STACKTOL: 282 case LSO_Enums.Operation_Table.STACKTOL:
283 Common.SendToDebug("Param1: " + BitConverter.ToUInt32(br_read(4), 0)); 283 Common.SendToDebug("Param1: " + BitConverter.ToUInt32(br_read(4), 0));
284 break; 284 break;
285 // BYTE 285 // BYTE
286 case LSO_Enums.Operation_Table.PRINT: 286 case LSO_Enums.Operation_Table.PRINT:
287 case LSO_Enums.Operation_Table.CALLLIB: 287 case LSO_Enums.Operation_Table.CALLLIB:
288 Common.SendToDebug("Param1: " + br_read(1)[0]); 288 Common.SendToDebug("Param1: " + br_read(1)[0]);
289 break; 289 break;
290 // SHORT 290 // SHORT
291 case LSO_Enums.Operation_Table.CALLLIB_TWO_BYTE: 291 case LSO_Enums.Operation_Table.CALLLIB_TWO_BYTE:
292 // TODO: What is size of short? 292 // TODO: What is size of short?
293 UInt16 U16p1 = BitConverter.ToUInt16(br_read(2), 0); 293 UInt16 U16p1 = BitConverter.ToUInt16(br_read(2), 0);
294 Common.SendToDebug("Instruction " + idesc + ": Builtin Command: " + ((LSO_Enums.BuiltIn_Functions)U16p1).ToString()); 294 Common.SendToDebug("Instruction " + idesc + ": Builtin Command: " + ((LSO_Enums.BuiltIn_Functions)U16p1).ToString());
295 Common.SendToDebug("Param1: " + U16p1); 295 Common.SendToDebug("Param1: " + U16p1);
296 switch ((LSO_Enums.BuiltIn_Functions)U16p1) 296 switch ((LSO_Enums.BuiltIn_Functions)U16p1)
297 { 297 {
298 case LSO_Enums.BuiltIn_Functions.llSay: 298 case LSO_Enums.BuiltIn_Functions.llSay:
299 Common.SendToDebug("Instruction " + idesc + " " + ((LSO_Enums.BuiltIn_Functions)U16p1).ToString() 299 Common.SendToDebug("Instruction " + idesc + " " + ((LSO_Enums.BuiltIn_Functions)U16p1).ToString()
300 + ": Mapped to internal function"); 300 + ": Mapped to internal function");
301 301
302 //il.Emit(OpCodes.Ldstr, "INTERNAL COMMAND: llSay({0}, \"{1}\""); 302 //il.Emit(OpCodes.Ldstr, "INTERNAL COMMAND: llSay({0}, \"{1}\"");
303 //il.Emit(OpCodes.Call, typeof(IL_Helper).GetMethod("ReverseFormatString", 303 //il.Emit(OpCodes.Call, typeof(IL_Helper).GetMethod("ReverseFormatString",
304 // new Type[] { typeof(string), typeof(UInt32), typeof(string) } 304 // new Type[] { typeof(string), typeof(UInt32), typeof(string) }
305 //)); 305 //));
306 306
307 307
308 //il.Emit(OpCodes.Pop); 308 //il.Emit(OpCodes.Pop);
309 //il.Emit(OpCodes.Call, 309 //il.Emit(OpCodes.Call,
310 // typeof(Console).GetMethod("WriteLine", 310 // typeof(Console).GetMethod("WriteLine",
311 // new Type[] { typeof(string) } 311 // new Type[] { typeof(string) }
312 //)); 312 //));
313 313
314 314
315 il.Emit(OpCodes.Call, 315 il.Emit(OpCodes.Call,
316 typeof(Common).GetMethod("SendToLog", 316 typeof(Common).GetMethod("SendToLog",
317 new Type[] { typeof(string) } 317 new Type[] { typeof(string) }
318 )); 318 ));
319 319
320 320
321 321
322 //il.Emit(OpCodes.Pop); 322 //il.Emit(OpCodes.Pop);
323 323
324 //il.Emit(OpCodes.Ldind_I2, 0); 324 //il.Emit(OpCodes.Ldind_I2, 0);
325 325
326 //il.Emit(OpCodes.Call, typeof(string).GetMethod("Format", new Type[] { typeof(string), typeof(object) })); 326 //il.Emit(OpCodes.Call, typeof(string).GetMethod("Format", new Type[] { typeof(string), typeof(object) }));
327 //il.EmitCalli(OpCodes.Calli, 327 //il.EmitCalli(OpCodes.Calli,
328 //il.Emit(OpCodes.Call, typeof().GetMethod 328 //il.Emit(OpCodes.Call, typeof().GetMethod
329 // ("llSay", new Type[] { typeof(UInt32), typeof(string) })); 329 // ("llSay", new Type[] { typeof(UInt32), typeof(string) }));
330 break; 330 break;
331 default: 331 default:
332 Common.SendToDebug("Instruction " + idesc + ": " + ((LSO_Enums.BuiltIn_Functions)U16p1).ToString() + ": INTERNAL COMMAND NOT IMPLEMENTED"); 332 Common.SendToDebug("Instruction " + idesc + ": " + ((LSO_Enums.BuiltIn_Functions)U16p1).ToString() + ": INTERNAL COMMAND NOT IMPLEMENTED");
333 break; 333 break;
334 } 334 }
335 335
336 //Common.SendToDebug("Instruction " + idesc + ": DEBUG: Faking return code:"); 336 //Common.SendToDebug("Instruction " + idesc + ": DEBUG: Faking return code:");
337 //Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Ldc_I4, 0);"); 337 //Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Ldc_I4, 0);");
338 //il.Emit(OpCodes.Ldc_I4, 0); 338 //il.Emit(OpCodes.Ldc_I4, 0);
339 break; 339 break;
340 340
341 // RETURN 341 // RETURN
342 case LSO_Enums.Operation_Table.RETURN: 342 case LSO_Enums.Operation_Table.RETURN:
343 343
344 Common.SendToDebug("Last OPCODE was return command. Code chunk execution complete."); 344 Common.SendToDebug("Last OPCODE was return command. Code chunk execution complete.");
345 return true; 345 return true;
346 } 346 }
347 return false; 347 return false;
348 } 348 }
349 349
350 } 350 }
351 } 351 }
diff --git a/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLScript.cs b/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLScript.cs
index 4ee4d37..49357f5 100644
--- a/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLScript.cs
+++ b/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLScript.cs
@@ -1,33 +1,33 @@
1using System; 1using System;
2using System.Collections.Generic; 2using System.Collections.Generic;
3using System.Text; 3using System.Text;
4 4
5using OpenSim.Region.Scripting; 5using OpenSim.Region.Scripting;
6using OpenSim.Region.Scripting.LSL; 6using OpenSim.Region.Scripting.LSL;
7 7
8namespace OpenSim.Region.Scripting.LSL 8namespace OpenSim.Region.Scripting.LSL
9{ 9{
10 class LSLScript : IScript 10 class LSLScript : IScript
11 { 11 {
12 ScriptInfo scriptInfo; 12 ScriptInfo scriptInfo;
13 LSL.Engine lindenScriptEngine; 13 LSL.Engine lindenScriptEngine;
14 14
15 public LSLScript(string filename, libsecondlife.LLUUID taskObject) 15 public LSLScript(string filename, libsecondlife.LLUUID taskObject)
16 { 16 {
17 scriptInfo.CreateTaskAPI(taskObject); 17 scriptInfo.CreateTaskAPI(taskObject);
18 18
19 lindenScriptEngine = new Engine(); 19 lindenScriptEngine = new Engine();
20 lindenScriptEngine.Start(filename); 20 lindenScriptEngine.Start(filename);
21 } 21 }
22 22
23 public void Initialise(ScriptInfo info) 23 public void Initialise(ScriptInfo info)
24 { 24 {
25 scriptInfo = info; 25 scriptInfo = info;
26 } 26 }
27 27
28 public string getName() 28 public string getName()
29 { 29 {
30 return "LSL Script"; 30 return "LSL Script";
31 } 31 }
32 } 32 }
33} 33}
diff --git a/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLScriptEngine.cs b/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLScriptEngine.cs
index 10706ad..c232c2f 100644
--- a/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLScriptEngine.cs
+++ b/OpenSim/Region/Environment/Scenes/scripting/Engines/LSLEngine/LSLScriptEngine.cs
@@ -1,27 +1,27 @@
1using System; 1using System;
2using System.Collections.Generic; 2using System.Collections.Generic;
3using System.Text; 3using System.Text;
4 4
5using OpenSim.Region.Scripting; 5using OpenSim.Region.Scripting;
6using OpenSim.Region.Scripting.LSL; 6using OpenSim.Region.Scripting.LSL;
7 7
8namespace OpenSim.Region.Scripting 8namespace OpenSim.Region.Scripting
9{ 9{
10 public class LSLEngine : IScriptCompiler 10 public class LSLEngine : IScriptCompiler
11 { 11 {
12 public string FileExt() 12 public string FileExt()
13 { 13 {
14 return ".lso"; 14 return ".lso";
15 } 15 }
16 16
17 public Dictionary<string, IScript> compile(string filename) 17 public Dictionary<string, IScript> compile(string filename)
18 { 18 {
19 LSLScript script = new LSLScript(filename, libsecondlife.LLUUID.Zero); 19 LSLScript script = new LSLScript(filename, libsecondlife.LLUUID.Zero);
20 Dictionary<string, IScript> returns = new Dictionary<string, IScript>(); 20 Dictionary<string, IScript> returns = new Dictionary<string, IScript>();
21 21
22 returns.Add(filename, script); 22 returns.Add(filename, script);
23 23
24 return returns; 24 return returns;
25 } 25 }
26 } 26 }
27} \ No newline at end of file 27} \ No newline at end of file