diff options
Diffstat (limited to 'OpenSim/Region/Environment')
52 files changed, 1370 insertions, 1396 deletions
diff --git a/OpenSim/Region/Environment/Interfaces/ICommander.cs b/OpenSim/Region/Environment/Interfaces/ICommander.cs index f2260c3..c4102af 100644 --- a/OpenSim/Region/Environment/Interfaces/ICommander.cs +++ b/OpenSim/Region/Environment/Interfaces/ICommander.cs | |||
@@ -27,8 +27,6 @@ | |||
27 | 27 | ||
28 | namespace OpenSim.Region.Environment.Interfaces | 28 | namespace OpenSim.Region.Environment.Interfaces |
29 | { | 29 | { |
30 | |||
31 | |||
32 | public interface ICommander | 30 | public interface ICommander |
33 | { | 31 | { |
34 | void ProcessConsoleCommand(string function, string[] args); | 32 | void ProcessConsoleCommand(string function, string[] args); |
diff --git a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs index ad5983c..4e716a2 100644 --- a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs +++ b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Region.Environment.Interfaces | |||
47 | /// <param name="obj"></param> | 47 | /// <param name="obj"></param> |
48 | /// <param name="regionUUID"></param> | 48 | /// <param name="regionUUID"></param> |
49 | void StoreObject(SceneObjectGroup obj, LLUUID regionUUID); | 49 | void StoreObject(SceneObjectGroup obj, LLUUID regionUUID); |
50 | 50 | ||
51 | /// <summary> | 51 | /// <summary> |
52 | /// Entirely removes the object, including inventory | 52 | /// Entirely removes the object, including inventory |
53 | /// </summary> | 53 | /// </summary> |
@@ -55,7 +55,7 @@ namespace OpenSim.Region.Environment.Interfaces | |||
55 | /// <param name="regionUUID"></param> | 55 | /// <param name="regionUUID"></param> |
56 | /// <returns></returns> | 56 | /// <returns></returns> |
57 | void RemoveObject(LLUUID uuid, LLUUID regionUUID); | 57 | void RemoveObject(LLUUID uuid, LLUUID regionUUID); |
58 | 58 | ||
59 | /// <summary> | 59 | /// <summary> |
60 | /// Store a prim's inventory | 60 | /// Store a prim's inventory |
61 | /// </summary> | 61 | /// </summary> |
diff --git a/OpenSim/Region/Environment/Interfaces/ITerrainChannel.cs b/OpenSim/Region/Environment/Interfaces/ITerrainChannel.cs index aa34c45..4bcb14b 100644 --- a/OpenSim/Region/Environment/Interfaces/ITerrainChannel.cs +++ b/OpenSim/Region/Environment/Interfaces/ITerrainChannel.cs | |||
@@ -38,7 +38,7 @@ namespace OpenSim.Region.Environment.Interfaces | |||
38 | /// </summary> | 38 | /// </summary> |
39 | /// <returns></returns> | 39 | /// <returns></returns> |
40 | float[] GetFloatsSerialised(); | 40 | float[] GetFloatsSerialised(); |
41 | 41 | ||
42 | double[,] GetDoubles(); | 42 | double[,] GetDoubles(); |
43 | bool Tainted(int x, int y); | 43 | bool Tainted(int x, int y); |
44 | ITerrainChannel MakeCopy(); | 44 | ITerrainChannel MakeCopy(); |
diff --git a/OpenSim/Region/Environment/ModuleLoader.cs b/OpenSim/Region/Environment/ModuleLoader.cs index 3f8b9ff..09f2dda 100644 --- a/OpenSim/Region/Environment/ModuleLoader.cs +++ b/OpenSim/Region/Environment/ModuleLoader.cs | |||
@@ -320,7 +320,7 @@ namespace OpenSim.Region.Environment | |||
320 | public void UnloadModule(IRegionModule rm) | 320 | public void UnloadModule(IRegionModule rm) |
321 | { | 321 | { |
322 | rm.Close(); | 322 | rm.Close(); |
323 | 323 | ||
324 | m_loadedModules.Remove(rm); | 324 | m_loadedModules.Remove(rm); |
325 | } | 325 | } |
326 | } | 326 | } |
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs index 10ef766..e6ee75f 100644 --- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs +++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs | |||
@@ -46,7 +46,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload | |||
46 | { | 46 | { |
47 | private static readonly ILog m_log | 47 | private static readonly ILog m_log |
48 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 48 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
49 | 49 | ||
50 | /// <summary> | 50 | /// <summary> |
51 | /// True if the service has been closed, probably because a user with texture requests still queued | 51 | /// True if the service has been closed, probably because a user with texture requests still queued |
52 | /// logged out. | 52 | /// logged out. |
@@ -175,7 +175,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload | |||
175 | public void TextureCallback(LLUUID textureID, AssetBase texture) | 175 | public void TextureCallback(LLUUID textureID, AssetBase texture) |
176 | { | 176 | { |
177 | //m_log.DebugFormat("[USER TEXTURE DOWNLOAD SERVICE]: Calling TextureCallback with {0}, texture == null is {1}", textureID, (texture == null ? true : false)); | 177 | //m_log.DebugFormat("[USER TEXTURE DOWNLOAD SERVICE]: Calling TextureCallback with {0}, texture == null is {1}", textureID, (texture == null ? true : false)); |
178 | 178 | ||
179 | // There may still be texture requests pending for a logged out client | 179 | // There may still be texture requests pending for a logged out client |
180 | if (closed) | 180 | if (closed) |
181 | return; | 181 | return; |
@@ -247,7 +247,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload | |||
247 | internal void Close() | 247 | internal void Close() |
248 | { | 248 | { |
249 | closed = true; | 249 | closed = true; |
250 | 250 | ||
251 | lock (m_textureSenders) | 251 | lock (m_textureSenders) |
252 | { | 252 | { |
253 | foreach (TextureSender.TextureSender textureSender in m_textureSenders.Values) | 253 | foreach (TextureSender.TextureSender textureSender in m_textureSenders.Values) |
@@ -257,7 +257,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload | |||
257 | 257 | ||
258 | m_textureSenders.Clear(); | 258 | m_textureSenders.Clear(); |
259 | } | 259 | } |
260 | 260 | ||
261 | // XXX: It might be possible to also remove pending texture requests from the asset cache queues, | 261 | // XXX: It might be possible to also remove pending texture requests from the asset cache queues, |
262 | // though this might also be more trouble than it's worth. | 262 | // though this might also be more trouble than it's worth. |
263 | } | 263 | } |
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs index c5a4a96..4a98622 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs | |||
@@ -186,7 +186,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends | |||
186 | client.OnTerminateFriendship += OnTerminateFriendship; | 186 | client.OnTerminateFriendship += OnTerminateFriendship; |
187 | 187 | ||
188 | doFriendListUpdateOnline(client.AgentId); | 188 | doFriendListUpdateOnline(client.AgentId); |
189 | 189 | ||
190 | } | 190 | } |
191 | 191 | ||
192 | private void doFriendListUpdateOnline(LLUUID AgentId) | 192 | private void doFriendListUpdateOnline(LLUUID AgentId) |
@@ -386,7 +386,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends | |||
386 | { | 386 | { |
387 | m_rootAgents.Add(avatar.UUID, avatar.RegionHandle); | 387 | m_rootAgents.Add(avatar.UUID, avatar.RegionHandle); |
388 | m_log.Info("[FRIEND]: Claiming " + avatar.Firstname + " " + avatar.Lastname + " in region:" + avatar.RegionHandle + "."); | 388 | m_log.Info("[FRIEND]: Claiming " + avatar.Firstname + " " + avatar.Lastname + " in region:" + avatar.RegionHandle + "."); |
389 | 389 | ||
390 | List<StoredFriendListUpdate> updateme = new List<StoredFriendListUpdate>(); | 390 | List<StoredFriendListUpdate> updateme = new List<StoredFriendListUpdate>(); |
391 | lock (StoredFriendListUpdates) | 391 | lock (StoredFriendListUpdates) |
392 | { | 392 | { |
@@ -546,7 +546,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends | |||
546 | 546 | ||
547 | SceneAgentIn.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule); | 547 | SceneAgentIn.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule); |
548 | SceneAgentIn.StoreAddFriendship(m_pendingFriendRequests[transactionID], agentID, (uint) 1); | 548 | SceneAgentIn.StoreAddFriendship(m_pendingFriendRequests[transactionID], agentID, (uint) 1); |
549 | 549 | ||
550 | 550 | ||
551 | //LLUUID[] Agents = new LLUUID[1]; | 551 | //LLUUID[] Agents = new LLUUID[1]; |
552 | //Agents[0] = msg.toAgentID; | 552 | //Agents[0] = msg.toAgentID; |
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs index a83730e..eaa5013 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs | |||
@@ -62,7 +62,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups | |||
62 | scene.EventManager.OnGridInstantMessageToGroupsModule += OnGridInstantMessage; | 62 | scene.EventManager.OnGridInstantMessageToGroupsModule += OnGridInstantMessage; |
63 | lock (m_groupUUIDGroup) | 63 | lock (m_groupUUIDGroup) |
64 | { | 64 | { |
65 | 65 | ||
66 | GroupData OpenSimulatorGroup = new GroupData(); | 66 | GroupData OpenSimulatorGroup = new GroupData(); |
67 | OpenSimulatorGroup.ActiveGroupTitle = "OpenSimulator Tester"; | 67 | OpenSimulatorGroup.ActiveGroupTitle = "OpenSimulator Tester"; |
68 | OpenSimulatorGroup.GroupID = opensimulatorGroupID; | 68 | OpenSimulatorGroup.GroupID = opensimulatorGroupID; |
@@ -136,7 +136,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups | |||
136 | } | 136 | } |
137 | 137 | ||
138 | } | 138 | } |
139 | 139 | ||
140 | lock (m_groupmap) | 140 | lock (m_groupmap) |
141 | { | 141 | { |
142 | if (!m_groupmap.ContainsKey(client.AgentId)) | 142 | if (!m_groupmap.ContainsKey(client.AgentId)) |
@@ -159,8 +159,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups | |||
159 | updateGroups[0] = OpenSimulatorGroup; | 159 | updateGroups[0] = OpenSimulatorGroup; |
160 | 160 | ||
161 | client.SendGroupMembership(updateGroups); | 161 | client.SendGroupMembership(updateGroups); |
162 | |||
163 | |||
164 | } | 162 | } |
165 | 163 | ||
166 | private void OnAgentDataUpdateRequest(IClientAPI remoteClient, LLUUID AgentID, LLUUID SessionID) | 164 | private void OnAgentDataUpdateRequest(IClientAPI remoteClient, LLUUID AgentID, LLUUID SessionID) |
@@ -275,6 +273,4 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups | |||
275 | GC.Collect(); | 273 | GC.Collect(); |
276 | } | 274 | } |
277 | } | 275 | } |
278 | 276 | } | |
279 | |||
280 | } \ No newline at end of file | ||
diff --git a/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs index a3452ab..15ce584 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs | |||
@@ -208,7 +208,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture | |||
208 | SceneObjectPart part = scene.GetSceneObjectPart(PrimID); | 208 | SceneObjectPart part = scene.GetSceneObjectPart(PrimID); |
209 | byte[] assetData; | 209 | byte[] assetData; |
210 | AssetBase oldAsset = null; | 210 | AssetBase oldAsset = null; |
211 | 211 | ||
212 | if (BlendWithOldTexture) | 212 | if (BlendWithOldTexture) |
213 | { | 213 | { |
214 | LLUUID lastTextureID = part.Shape.Textures.DefaultTexture.TextureID; | 214 | LLUUID lastTextureID = part.Shape.Textures.DefaultTexture.TextureID; |
@@ -228,7 +228,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture | |||
228 | assetData = new byte[data.Length]; | 228 | assetData = new byte[data.Length]; |
229 | Array.Copy(data, assetData, data.Length); | 229 | Array.Copy(data, assetData, data.Length); |
230 | } | 230 | } |
231 | 231 | ||
232 | // Create a new asset for user | 232 | // Create a new asset for user |
233 | AssetBase asset = new AssetBase(); | 233 | AssetBase asset = new AssetBase(); |
234 | asset.FullID = LLUUID.Random(); | 234 | asset.FullID = LLUUID.Random(); |
@@ -244,7 +244,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture | |||
244 | 244 | ||
245 | // mostly keep the values from before | 245 | // mostly keep the values from before |
246 | LLObject.TextureEntry tmptex = part.Shape.Textures; | 246 | LLObject.TextureEntry tmptex = part.Shape.Textures; |
247 | 247 | ||
248 | // remove the old asset from the cache | 248 | // remove the old asset from the cache |
249 | LLUUID oldID = tmptex.DefaultTexture.TextureID; | 249 | LLUUID oldID = tmptex.DefaultTexture.TextureID; |
250 | scene.AssetCache.ExpireAsset(oldID); | 250 | scene.AssetCache.ExpireAsset(oldID); |
@@ -298,4 +298,4 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture | |||
298 | 298 | ||
299 | #endregion | 299 | #endregion |
300 | } | 300 | } |
301 | } \ No newline at end of file | 301 | } |
diff --git a/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs b/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs index 1162c25..bcf3e76 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs | |||
@@ -68,14 +68,14 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
68 | { | 68 | { |
69 | m_Config = config; | 69 | m_Config = config; |
70 | IConfig SMTPConfig; | 70 | IConfig SMTPConfig; |
71 | 71 | ||
72 | //FIXME: RegionName is correct?? | 72 | //FIXME: RegionName is correct?? |
73 | //m_RegionName = scene.RegionInfo.RegionName; | 73 | //m_RegionName = scene.RegionInfo.RegionName; |
74 | 74 | ||
75 | IConfig startupConfig = m_Config.Configs["Startup"]; | 75 | IConfig startupConfig = m_Config.Configs["Startup"]; |
76 | 76 | ||
77 | m_Enabled = (startupConfig.GetString("emailmodule", "DefaultEmailModule") == "DefaultEmailModule"); | 77 | m_Enabled = (startupConfig.GetString("emailmodule", "DefaultEmailModule") == "DefaultEmailModule"); |
78 | 78 | ||
79 | //Load SMTP SERVER config | 79 | //Load SMTP SERVER config |
80 | try | 80 | try |
81 | { | 81 | { |
@@ -85,16 +85,16 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
85 | m_Enabled = false; | 85 | m_Enabled = false; |
86 | return; | 86 | return; |
87 | } | 87 | } |
88 | 88 | ||
89 | if (!SMTPConfig.GetBoolean("enabled", false)) | 89 | if (!SMTPConfig.GetBoolean("enabled", false)) |
90 | { | 90 | { |
91 | m_log.InfoFormat("[SMTP] module disabled in configuration"); | 91 | m_log.InfoFormat("[SMTP] module disabled in configuration"); |
92 | m_Enabled = false; | 92 | m_Enabled = false; |
93 | return; | 93 | return; |
94 | } | 94 | } |
95 | 95 | ||
96 | m_HostName = SMTPConfig.GetString("host_domain_header_from", m_HostName); | 96 | m_HostName = SMTPConfig.GetString("host_domain_header_from", m_HostName); |
97 | SMTP_SERVER_HOSTNAME = SMTPConfig.GetString("SMTP_SERVER_HOSTNAME",SMTP_SERVER_HOSTNAME); | 97 | SMTP_SERVER_HOSTNAME = SMTPConfig.GetString("SMTP_SERVER_HOSTNAME",SMTP_SERVER_HOSTNAME); |
98 | SMTP_SERVER_PORT = SMTPConfig.GetInt("SMTP_SERVER_PORT", SMTP_SERVER_PORT); | 98 | SMTP_SERVER_PORT = SMTPConfig.GetInt("SMTP_SERVER_PORT", SMTP_SERVER_PORT); |
99 | SMTP_SERVER_LOGIN = SMTPConfig.GetString("SMTP_SERVER_LOGIN", SMTP_SERVER_LOGIN); | 99 | SMTP_SERVER_LOGIN = SMTPConfig.GetString("SMTP_SERVER_LOGIN", SMTP_SERVER_LOGIN); |
100 | SMTP_SERVER_PASSWORD = SMTPConfig.GetString("SMTP_SERVER_PASSWORD", SMTP_SERVER_PASSWORD); | 100 | SMTP_SERVER_PASSWORD = SMTPConfig.GetString("SMTP_SERVER_PASSWORD", SMTP_SERVER_PASSWORD); |
@@ -124,7 +124,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
124 | m_Scenes.Add(scene.RegionInfo.RegionHandle, scene); | 124 | m_Scenes.Add(scene.RegionInfo.RegionHandle, scene); |
125 | } | 125 | } |
126 | } | 126 | } |
127 | 127 | ||
128 | m_log.Info("[EMAIL] Activated DefaultEmailModule"); | 128 | m_log.Info("[EMAIL] Activated DefaultEmailModule"); |
129 | } | 129 | } |
130 | } | 130 | } |
@@ -146,9 +146,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
146 | { | 146 | { |
147 | get { return true; } | 147 | get { return true; } |
148 | } | 148 | } |
149 | 149 | ||
150 | /// <summary> | 150 | /// <summary> |
151 | /// | 151 | /// |
152 | /// </summary> | 152 | /// </summary> |
153 | /// <param name="seconds"></param> | 153 | /// <param name="seconds"></param> |
154 | private void DelayInSeconds(int seconds) | 154 | private void DelayInSeconds(int seconds) |
@@ -156,11 +156,11 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
156 | TimeSpan DiffDelay = new TimeSpan(0, 0, seconds); | 156 | TimeSpan DiffDelay = new TimeSpan(0, 0, seconds); |
157 | DateTime EndDelay = DateTime.Now.Add(DiffDelay); | 157 | DateTime EndDelay = DateTime.Now.Add(DiffDelay); |
158 | while (DateTime.Now < EndDelay) | 158 | while (DateTime.Now < EndDelay) |
159 | { | 159 | { |
160 | ;//Do nothing!! | 160 | ;//Do nothing!! |
161 | } | 161 | } |
162 | } | 162 | } |
163 | 163 | ||
164 | private SceneObjectPart findPrim(LLUUID objectID, out string ObjectRegionName) | 164 | private SceneObjectPart findPrim(LLUUID objectID, out string ObjectRegionName) |
165 | { | 165 | { |
166 | lock (m_Scenes) | 166 | lock (m_Scenes) |
@@ -187,7 +187,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
187 | { | 187 | { |
188 | ObjectAbsolutePosition = part.AbsolutePosition.ToString(); | 188 | ObjectAbsolutePosition = part.AbsolutePosition.ToString(); |
189 | ObjectName = part.Name; | 189 | ObjectName = part.Name; |
190 | ObjectRegionName = m_ObjectRegionName; | 190 | ObjectRegionName = m_ObjectRegionName; |
191 | return; | 191 | return; |
192 | } | 192 | } |
193 | ObjectAbsolutePosition = part.AbsolutePosition.ToString(); | 193 | ObjectAbsolutePosition = part.AbsolutePosition.ToString(); |
@@ -195,7 +195,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
195 | ObjectRegionName = m_ObjectRegionName; | 195 | ObjectRegionName = m_ObjectRegionName; |
196 | return; | 196 | return; |
197 | } | 197 | } |
198 | 198 | ||
199 | /// <summary> | 199 | /// <summary> |
200 | /// SendMail function utilized by llEMail | 200 | /// SendMail function utilized by llEMail |
201 | /// </summary> | 201 | /// </summary> |
@@ -206,14 +206,14 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
206 | public void SendEmail(LLUUID objectID, string address, string subject, string body) | 206 | public void SendEmail(LLUUID objectID, string address, string subject, string body) |
207 | { | 207 | { |
208 | //Check if address is empty | 208 | //Check if address is empty |
209 | if (address == string.Empty) | 209 | if (address == string.Empty) |
210 | return; | 210 | return; |
211 | 211 | ||
212 | //FIXED:Check the email is correct form in REGEX | 212 | //FIXED:Check the email is correct form in REGEX |
213 | string EMailpatternStrict = @"^(([^<>()[\]\\.,;:\s@\""]+" | 213 | string EMailpatternStrict = @"^(([^<>()[\]\\.,;:\s@\""]+" |
214 | + @"(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@" | 214 | + @"(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@" |
215 | + @"((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" | 215 | + @"((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" |
216 | + @"\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+" | 216 | + @"\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+" |
217 | + @"[a-zA-Z]{2,}))$"; | 217 | + @"[a-zA-Z]{2,}))$"; |
218 | Regex EMailreStrict = new Regex(EMailpatternStrict); | 218 | Regex EMailreStrict = new Regex(EMailpatternStrict); |
219 | bool isEMailStrictMatch = EMailreStrict.IsMatch(address); | 219 | bool isEMailStrictMatch = EMailreStrict.IsMatch(address); |
@@ -226,9 +226,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
226 | if ((subject.Length + body.Length) > 1024) | 226 | if ((subject.Length + body.Length) > 1024) |
227 | { | 227 | { |
228 | m_log.Error("[EMAIL] subject + body > 1024 Byte"); | 228 | m_log.Error("[EMAIL] subject + body > 1024 Byte"); |
229 | return; | 229 | return; |
230 | } | 230 | } |
231 | 231 | ||
232 | try | 232 | try |
233 | { | 233 | { |
234 | string LastObjectName = string.Empty; | 234 | string LastObjectName = string.Empty; |
@@ -242,21 +242,21 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
242 | //From | 242 | //From |
243 | emailMessage.FromAddress = new EmailAddress(objectID.UUID.ToString()+"@"+m_HostName); | 243 | emailMessage.FromAddress = new EmailAddress(objectID.UUID.ToString()+"@"+m_HostName); |
244 | //To - Only One | 244 | //To - Only One |
245 | emailMessage.AddToAddress(new EmailAddress(address)); | 245 | emailMessage.AddToAddress(new EmailAddress(address)); |
246 | //Subject | 246 | //Subject |
247 | emailMessage.Subject = subject; | 247 | emailMessage.Subject = subject; |
248 | //TEXT Body | 248 | //TEXT Body |
249 | resolveNamePositionRegionName(objectID, out LastObjectName, out LastObjectPosition, out LastObjectRegionName); | 249 | resolveNamePositionRegionName(objectID, out LastObjectName, out LastObjectPosition, out LastObjectRegionName); |
250 | emailMessage.TextPart = new TextAttachment("Object-Name: " + LastObjectName + | 250 | emailMessage.TextPart = new TextAttachment("Object-Name: " + LastObjectName + |
251 | "\r\nRegion: " + LastObjectRegionName + "\r\nLocal-Position: " + | 251 | "\r\nRegion: " + LastObjectRegionName + "\r\nLocal-Position: " + |
252 | LastObjectPosition+"\r\n\r\n\r\n" + body); | 252 | LastObjectPosition+"\r\n\r\n\r\n" + body); |
253 | //HTML Body | 253 | //HTML Body |
254 | emailMessage.HtmlPart = new HtmlAttachment("<html><body><p>" + | 254 | emailMessage.HtmlPart = new HtmlAttachment("<html><body><p>" + |
255 | "<BR>Object-Name: " + LastObjectName + | 255 | "<BR>Object-Name: " + LastObjectName + |
256 | "<BR>Region: " + LastObjectRegionName + | 256 | "<BR>Region: " + LastObjectRegionName + |
257 | "<BR>Local-Position: " + LastObjectPosition + "<BR><BR><BR>" | 257 | "<BR>Local-Position: " + LastObjectPosition + "<BR><BR><BR>" |
258 | +body+"\r\n</p></body><html>"); | 258 | +body+"\r\n</p></body><html>"); |
259 | 259 | ||
260 | //Set SMTP SERVER config | 260 | //Set SMTP SERVER config |
261 | SmtpServer smtpServer=new SmtpServer(SMTP_SERVER_HOSTNAME,SMTP_SERVER_PORT); | 261 | SmtpServer smtpServer=new SmtpServer(SMTP_SERVER_HOSTNAME,SMTP_SERVER_PORT); |
262 | //Authentication | 262 | //Authentication |
@@ -272,9 +272,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
272 | return; | 272 | return; |
273 | } | 273 | } |
274 | } | 274 | } |
275 | 275 | ||
276 | /// <summary> | 276 | /// <summary> |
277 | /// | 277 | /// |
278 | /// </summary> | 278 | /// </summary> |
279 | /// <param name="objectID"></param> | 279 | /// <param name="objectID"></param> |
280 | /// <param name="sender"></param> | 280 | /// <param name="sender"></param> |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs index a5688ef..a76ff0d 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs | |||
@@ -39,33 +39,33 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
39 | /// The location of the archive control file | 39 | /// The location of the archive control file |
40 | /// </summary> | 40 | /// </summary> |
41 | public static readonly string CONTROL_FILE_PATH = "archive.xml"; | 41 | public static readonly string CONTROL_FILE_PATH = "archive.xml"; |
42 | 42 | ||
43 | /// <summary> | 43 | /// <summary> |
44 | /// Path for the assets held in an archive | 44 | /// Path for the assets held in an archive |
45 | /// </summary> | 45 | /// </summary> |
46 | public static readonly string ASSETS_PATH = "assets/"; | 46 | public static readonly string ASSETS_PATH = "assets/"; |
47 | 47 | ||
48 | /// <summary> | 48 | /// <summary> |
49 | /// Path for the assets metadata file | 49 | /// Path for the assets metadata file |
50 | /// </summary> | 50 | /// </summary> |
51 | //public static readonly string ASSETS_METADATA_PATH = "assets.xml"; | 51 | //public static readonly string ASSETS_METADATA_PATH = "assets.xml"; |
52 | 52 | ||
53 | /// <summary> | 53 | /// <summary> |
54 | /// Path for the prims file | 54 | /// Path for the prims file |
55 | /// </summary> | 55 | /// </summary> |
56 | public static readonly string OBJECTS_PATH = "objects/"; | 56 | public static readonly string OBJECTS_PATH = "objects/"; |
57 | 57 | ||
58 | /// <summary> | 58 | /// <summary> |
59 | /// Path for terrains. Technically these may be assets, but I think it's quite nice to split them out. | 59 | /// Path for terrains. Technically these may be assets, but I think it's quite nice to split them out. |
60 | /// </summary> | 60 | /// </summary> |
61 | public static readonly string TERRAINS_PATH = "terrains/"; | 61 | public static readonly string TERRAINS_PATH = "terrains/"; |
62 | 62 | ||
63 | /// <summary> | 63 | /// <summary> |
64 | /// Extensions used for asset types in the archive | 64 | /// Extensions used for asset types in the archive |
65 | /// </summary> | 65 | /// </summary> |
66 | public static readonly IDictionary<sbyte, string> ASSET_TYPE_TO_EXTENSION = new Dictionary<sbyte, string>(); | 66 | public static readonly IDictionary<sbyte, string> ASSET_TYPE_TO_EXTENSION = new Dictionary<sbyte, string>(); |
67 | public static readonly IDictionary<string, sbyte> EXTENSION_TO_ASSET_TYPE = new Dictionary<string, sbyte>(); | 67 | public static readonly IDictionary<string, sbyte> EXTENSION_TO_ASSET_TYPE = new Dictionary<string, sbyte>(); |
68 | 68 | ||
69 | static ArchiveConstants() | 69 | static ArchiveConstants() |
70 | { | 70 | { |
71 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Animation] = "_animation.bvh"; | 71 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Animation] = "_animation.bvh"; |
@@ -79,11 +79,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
79 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LostAndFoundFolder] = "_lostandfoundfolder.txt"; // Not sure if we'll ever see this | 79 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LostAndFoundFolder] = "_lostandfoundfolder.txt"; // Not sure if we'll ever see this |
80 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLBytecode] = "_bytecode.lso"; | 80 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLBytecode] = "_bytecode.lso"; |
81 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLText] = "_script.lsl"; | 81 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLText] = "_script.lsl"; |
82 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Notecard] = "_notecard.txt"; | 82 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Notecard] = "_notecard.txt"; |
83 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Object] = "_object.xml"; | 83 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Object] = "_object.xml"; |
84 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.RootFolder] = "_rootfolder.txt"; // Not sure if we'll ever see this | 84 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.RootFolder] = "_rootfolder.txt"; // Not sure if we'll ever see this |
85 | // disable warning: we know Script is obsolete, but need to support it | 85 | // disable warning: we know Script is obsolete, but need to support it |
86 | // anyhow | 86 | // anyhow |
87 | #pragma warning disable 0612 | 87 | #pragma warning disable 0612 |
88 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Script] = "_script.txt"; // Not sure if we'll ever see this | 88 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Script] = "_script.txt"; // Not sure if we'll ever see this |
89 | #pragma warning restore 0612 | 89 | #pragma warning restore 0612 |
@@ -93,8 +93,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
93 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.SoundWAV] = "_sound.wav"; | 93 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.SoundWAV] = "_sound.wav"; |
94 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Texture] = "_texture.jp2"; | 94 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Texture] = "_texture.jp2"; |
95 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TextureTGA] = "_texture.tga"; | 95 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TextureTGA] = "_texture.tga"; |
96 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TrashFolder] = "_trashfolder.txt"; // Not sure if we'll ever see this | 96 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TrashFolder] = "_trashfolder.txt"; // Not sure if we'll ever see this |
97 | 97 | ||
98 | EXTENSION_TO_ASSET_TYPE["_animation.bvh"] = (sbyte)AssetType.Animation; | 98 | EXTENSION_TO_ASSET_TYPE["_animation.bvh"] = (sbyte)AssetType.Animation; |
99 | EXTENSION_TO_ASSET_TYPE["_bodypart.txt"] = (sbyte)AssetType.Bodypart; | 99 | EXTENSION_TO_ASSET_TYPE["_bodypart.txt"] = (sbyte)AssetType.Bodypart; |
100 | EXTENSION_TO_ASSET_TYPE["_callingcard.txt"] = (sbyte)AssetType.CallingCard; | 100 | EXTENSION_TO_ASSET_TYPE["_callingcard.txt"] = (sbyte)AssetType.CallingCard; |
@@ -110,7 +110,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
110 | EXTENSION_TO_ASSET_TYPE["_object.xml"] = (sbyte)AssetType.Object; | 110 | EXTENSION_TO_ASSET_TYPE["_object.xml"] = (sbyte)AssetType.Object; |
111 | EXTENSION_TO_ASSET_TYPE["_rootfolder.txt"] = (sbyte)AssetType.RootFolder; | 111 | EXTENSION_TO_ASSET_TYPE["_rootfolder.txt"] = (sbyte)AssetType.RootFolder; |
112 | // disable warning: we know Script is obsolete, but need to support it | 112 | // disable warning: we know Script is obsolete, but need to support it |
113 | // anyhow | 113 | // anyhow |
114 | #pragma warning disable 0612 | 114 | #pragma warning disable 0612 |
115 | EXTENSION_TO_ASSET_TYPE["_script.txt"] = (sbyte)AssetType.Script; | 115 | EXTENSION_TO_ASSET_TYPE["_script.txt"] = (sbyte)AssetType.Script; |
116 | #pragma warning restore 0612 | 116 | #pragma warning restore 0612 |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs index 1340f8b..87106fb 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -53,7 +53,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
53 | 53 | ||
54 | private Scene m_scene; | 54 | private Scene m_scene; |
55 | private string m_loadPath; | 55 | private string m_loadPath; |
56 | 56 | ||
57 | /// <summary> | 57 | /// <summary> |
58 | /// Used to cache lookups for valid uuids. | 58 | /// Used to cache lookups for valid uuids. |
59 | /// </summary> | 59 | /// </summary> |
@@ -68,15 +68,15 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
68 | } | 68 | } |
69 | 69 | ||
70 | private void DearchiveRegion() | 70 | private void DearchiveRegion() |
71 | { | 71 | { |
72 | TarArchiveReader archive | 72 | TarArchiveReader archive |
73 | = new TarArchiveReader( | 73 | = new TarArchiveReader( |
74 | new GZipStream(new FileStream(m_loadPath, FileMode.Open), CompressionMode.Decompress)); | 74 | new GZipStream(new FileStream(m_loadPath, FileMode.Open), CompressionMode.Decompress)); |
75 | //AssetsDearchiver dearchiver = new AssetsDearchiver(m_scene.AssetCache); | 75 | //AssetsDearchiver dearchiver = new AssetsDearchiver(m_scene.AssetCache); |
76 | 76 | ||
77 | List<string> serialisedSceneObjects = new List<string>(); | 77 | List<string> serialisedSceneObjects = new List<string>(); |
78 | string filePath = "ERROR"; | 78 | string filePath = "ERROR"; |
79 | 79 | ||
80 | int successfulAssetRestores = 0; | 80 | int successfulAssetRestores = 0; |
81 | int failedAssetRestores = 0; | 81 | int failedAssetRestores = 0; |
82 | 82 | ||
@@ -111,30 +111,30 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
111 | //m_log.Debug("[ARCHIVER]: Reached end of archive"); | 111 | //m_log.Debug("[ARCHIVER]: Reached end of archive"); |
112 | 112 | ||
113 | archive.Close(); | 113 | archive.Close(); |
114 | 114 | ||
115 | m_log.InfoFormat("[ARCHIVER]: Restored {0} assets", successfulAssetRestores); | 115 | m_log.InfoFormat("[ARCHIVER]: Restored {0} assets", successfulAssetRestores); |
116 | 116 | ||
117 | if (failedAssetRestores > 0) | 117 | if (failedAssetRestores > 0) |
118 | m_log.ErrorFormat("[ARCHIVER]: Failed to load {0} assets", failedAssetRestores); | 118 | m_log.ErrorFormat("[ARCHIVER]: Failed to load {0} assets", failedAssetRestores); |
119 | 119 | ||
120 | m_log.Info("[ARCHIVER]: Clearing all existing scene objects"); | 120 | m_log.Info("[ARCHIVER]: Clearing all existing scene objects"); |
121 | m_scene.DeleteAllSceneObjects(); | 121 | m_scene.DeleteAllSceneObjects(); |
122 | 122 | ||
123 | // Reload serialized prims | 123 | // Reload serialized prims |
124 | m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count); | 124 | m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count); |
125 | 125 | ||
126 | IRegionSerialiser serialiser = m_scene.RequestModuleInterface<IRegionSerialiser>(); | 126 | IRegionSerialiser serialiser = m_scene.RequestModuleInterface<IRegionSerialiser>(); |
127 | ICollection<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); | 127 | ICollection<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); |
128 | 128 | ||
129 | foreach (string serialisedSceneObject in serialisedSceneObjects) | 129 | foreach (string serialisedSceneObject in serialisedSceneObjects) |
130 | { | 130 | { |
131 | SceneObjectGroup sceneObject = serialiser.DeserializeGroupFromXml2(serialisedSceneObject); | 131 | SceneObjectGroup sceneObject = serialiser.DeserializeGroupFromXml2(serialisedSceneObject); |
132 | 132 | ||
133 | // For now, give all incoming scene objects new uuids. This will allow scenes to be cloned | 133 | // For now, give all incoming scene objects new uuids. This will allow scenes to be cloned |
134 | // on the same region server and multiple examples a single object archive to be imported | 134 | // on the same region server and multiple examples a single object archive to be imported |
135 | // to the same scene (when this is possible). | 135 | // to the same scene (when this is possible). |
136 | sceneObject.ResetIDs(); | 136 | sceneObject.ResetIDs(); |
137 | 137 | ||
138 | // Try to retain the original creator/owner/lastowner if their uuid is present on this grid | 138 | // Try to retain the original creator/owner/lastowner if their uuid is present on this grid |
139 | // otherwise, use the master avatar uuid instead | 139 | // otherwise, use the master avatar uuid instead |
140 | LLUUID masterAvatarId = m_scene.RegionInfo.MasterAvatarAssignedUUID; | 140 | LLUUID masterAvatarId = m_scene.RegionInfo.MasterAvatarAssignedUUID; |
@@ -144,41 +144,41 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
144 | { | 144 | { |
145 | if (!resolveUserUuid(part.CreatorID)) | 145 | if (!resolveUserUuid(part.CreatorID)) |
146 | part.CreatorID = masterAvatarId; | 146 | part.CreatorID = masterAvatarId; |
147 | 147 | ||
148 | if (!resolveUserUuid(part.OwnerID)) | 148 | if (!resolveUserUuid(part.OwnerID)) |
149 | part.OwnerID = masterAvatarId; | 149 | part.OwnerID = masterAvatarId; |
150 | 150 | ||
151 | if (!resolveUserUuid(part.LastOwnerID)) | 151 | if (!resolveUserUuid(part.LastOwnerID)) |
152 | part.LastOwnerID = masterAvatarId; | 152 | part.LastOwnerID = masterAvatarId; |
153 | 153 | ||
154 | // And zap any troublesome sit target information | 154 | // And zap any troublesome sit target information |
155 | part.SitTargetOrientation = new Quaternion(0,0,0,1); | 155 | part.SitTargetOrientation = new Quaternion(0,0,0,1); |
156 | part.SitTargetPosition = new Vector3(0,0,0); | 156 | part.SitTargetPosition = new Vector3(0,0,0); |
157 | } | 157 | } |
158 | 158 | ||
159 | if (m_scene.AddRestoredSceneObject(sceneObject, true, false)) | 159 | if (m_scene.AddRestoredSceneObject(sceneObject, true, false)) |
160 | { | 160 | { |
161 | sceneObjects.Add(sceneObject); | 161 | sceneObjects.Add(sceneObject); |
162 | } | 162 | } |
163 | } | 163 | } |
164 | 164 | ||
165 | m_log.InfoFormat("[ARCHIVER]: Restored {0} scene objects to the scene", sceneObjects.Count); | 165 | m_log.InfoFormat("[ARCHIVER]: Restored {0} scene objects to the scene", sceneObjects.Count); |
166 | 166 | ||
167 | int ignoredObjects = serialisedSceneObjects.Count - sceneObjects.Count; | 167 | int ignoredObjects = serialisedSceneObjects.Count - sceneObjects.Count; |
168 | 168 | ||
169 | if (ignoredObjects > 0) | 169 | if (ignoredObjects > 0) |
170 | m_log.WarnFormat("[ARCHIVER]: Ignored {0} scene objects that already existed in the scene", ignoredObjects); | 170 | m_log.WarnFormat("[ARCHIVER]: Ignored {0} scene objects that already existed in the scene", ignoredObjects); |
171 | 171 | ||
172 | m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive"); | 172 | m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive"); |
173 | 173 | ||
174 | m_log.Debug("[ARCHIVER]: Starting scripts"); | 174 | m_log.Debug("[ARCHIVER]: Starting scripts"); |
175 | 175 | ||
176 | foreach (SceneObjectGroup sceneObject in sceneObjects) | 176 | foreach (SceneObjectGroup sceneObject in sceneObjects) |
177 | { | 177 | { |
178 | sceneObject.CreateScriptInstances(0, true); | 178 | sceneObject.CreateScriptInstances(0, true); |
179 | } | 179 | } |
180 | } | 180 | } |
181 | 181 | ||
182 | /// <summary> | 182 | /// <summary> |
183 | /// Look up the given user id to check whether it's one that is valid for this grid. | 183 | /// Look up the given user id to check whether it's one that is valid for this grid. |
184 | /// </summary> | 184 | /// </summary> |
@@ -194,13 +194,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
194 | else | 194 | else |
195 | m_validUserUuids.Add(uuid, false); | 195 | m_validUserUuids.Add(uuid, false); |
196 | } | 196 | } |
197 | 197 | ||
198 | if (m_validUserUuids[uuid]) | 198 | if (m_validUserUuids[uuid]) |
199 | return true; | 199 | return true; |
200 | else | 200 | else |
201 | return false; | 201 | return false; |
202 | } | 202 | } |
203 | 203 | ||
204 | /// <summary> | 204 | /// <summary> |
205 | /// Load an asset | 205 | /// Load an asset |
206 | /// </summary> | 206 | /// </summary> |
@@ -212,20 +212,20 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
212 | // Right now we're nastily obtaining the lluuid from the filename | 212 | // Right now we're nastily obtaining the lluuid from the filename |
213 | string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); | 213 | string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); |
214 | string extension = filename.Substring(filename.LastIndexOf("_")); | 214 | string extension = filename.Substring(filename.LastIndexOf("_")); |
215 | string uuid = filename.Remove(filename.Length - extension.Length); | 215 | string uuid = filename.Remove(filename.Length - extension.Length); |
216 | 216 | ||
217 | if (ArchiveConstants.EXTENSION_TO_ASSET_TYPE.ContainsKey(extension)) | 217 | if (ArchiveConstants.EXTENSION_TO_ASSET_TYPE.ContainsKey(extension)) |
218 | { | 218 | { |
219 | sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; | 219 | sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; |
220 | 220 | ||
221 | //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); | 221 | //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); |
222 | 222 | ||
223 | AssetBase asset = new AssetBase(new LLUUID(uuid), String.Empty); | 223 | AssetBase asset = new AssetBase(new LLUUID(uuid), String.Empty); |
224 | asset.Type = assetType; | 224 | asset.Type = assetType; |
225 | asset.Data = data; | 225 | asset.Data = data; |
226 | 226 | ||
227 | m_scene.AssetCache.AddAsset(asset); | 227 | m_scene.AssetCache.AddAsset(asset); |
228 | 228 | ||
229 | return true; | 229 | return true; |
230 | } | 230 | } |
231 | else | 231 | else |
@@ -233,11 +233,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
233 | m_log.ErrorFormat( | 233 | m_log.ErrorFormat( |
234 | "[ARCHIVER]: Tried to dearchive data with path {0} with an unknown type extension {1}", | 234 | "[ARCHIVER]: Tried to dearchive data with path {0} with an unknown type extension {1}", |
235 | assetPath, extension); | 235 | assetPath, extension); |
236 | 236 | ||
237 | return false; | 237 | return false; |
238 | } | 238 | } |
239 | } | 239 | } |
240 | 240 | ||
241 | /// <summary> | 241 | /// <summary> |
242 | /// Load terrain data | 242 | /// Load terrain data |
243 | /// </summary> | 243 | /// </summary> |
@@ -249,13 +249,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
249 | private bool LoadTerrain(string terrainPath, byte[] data) | 249 | private bool LoadTerrain(string terrainPath, byte[] data) |
250 | { | 250 | { |
251 | ITerrainModule terrainModule = m_scene.RequestModuleInterface<ITerrainModule>(); | 251 | ITerrainModule terrainModule = m_scene.RequestModuleInterface<ITerrainModule>(); |
252 | 252 | ||
253 | MemoryStream ms = new MemoryStream(data); | 253 | MemoryStream ms = new MemoryStream(data); |
254 | terrainModule.LoadFromStream(terrainPath, ms); | 254 | terrainModule.LoadFromStream(terrainPath, ms); |
255 | ms.Close(); | 255 | ms.Close(); |
256 | 256 | ||
257 | m_log.DebugFormat("[ARCHIVER]: Restored terrain {0}", terrainPath); | 257 | m_log.DebugFormat("[ARCHIVER]: Restored terrain {0}", terrainPath); |
258 | 258 | ||
259 | return true; | 259 | return true; |
260 | } | 260 | } |
261 | } | 261 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs index 0341a70..26d4797 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs | |||
@@ -61,8 +61,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
61 | 61 | ||
62 | public ArchiveWriteRequestExecution( | 62 | public ArchiveWriteRequestExecution( |
63 | List<SceneObjectGroup> sceneObjects, | 63 | List<SceneObjectGroup> sceneObjects, |
64 | ITerrainModule terrainModule, | 64 | ITerrainModule terrainModule, |
65 | IRegionSerialiser serialiser, | 65 | IRegionSerialiser serialiser, |
66 | string sceneName, | 66 | string sceneName, |
67 | string savePath) | 67 | string savePath) |
68 | { | 68 | { |
@@ -79,37 +79,37 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
79 | { | 79 | { |
80 | m_log.DebugFormat("[ARCHIVER]: Could not find asset {0}", uuid); | 80 | m_log.DebugFormat("[ARCHIVER]: Could not find asset {0}", uuid); |
81 | } | 81 | } |
82 | 82 | ||
83 | m_log.InfoFormat( | 83 | m_log.InfoFormat( |
84 | "[ARCHIVER]: Received {0} of {1} assets requested", assetsFound.Count, assetsFound.Count + assetsNotFoundUuids.Count); | 84 | "[ARCHIVER]: Received {0} of {1} assets requested", assetsFound.Count, assetsFound.Count + assetsNotFoundUuids.Count); |
85 | 85 | ||
86 | TarArchiveWriter archive = new TarArchiveWriter(); | 86 | TarArchiveWriter archive = new TarArchiveWriter(); |
87 | 87 | ||
88 | // Write out control file | 88 | // Write out control file |
89 | archive.AddFile(ArchiveConstants.CONTROL_FILE_PATH, CreateControlFile()); | 89 | archive.AddFile(ArchiveConstants.CONTROL_FILE_PATH, CreateControlFile()); |
90 | 90 | ||
91 | // Write out terrain | 91 | // Write out terrain |
92 | string terrainPath = String.Format("{0}{1}.r32", ArchiveConstants.TERRAINS_PATH, m_sceneName); | 92 | string terrainPath = String.Format("{0}{1}.r32", ArchiveConstants.TERRAINS_PATH, m_sceneName); |
93 | MemoryStream ms = new MemoryStream(); | 93 | MemoryStream ms = new MemoryStream(); |
94 | m_terrainModule.SaveToStream(terrainPath, ms); | 94 | m_terrainModule.SaveToStream(terrainPath, ms); |
95 | archive.AddFile(terrainPath, ms.ToArray()); | 95 | archive.AddFile(terrainPath, ms.ToArray()); |
96 | ms.Close(); | 96 | ms.Close(); |
97 | 97 | ||
98 | // Write out scene object metadata | 98 | // Write out scene object metadata |
99 | foreach (SceneObjectGroup sceneObject in m_sceneObjects) | 99 | foreach (SceneObjectGroup sceneObject in m_sceneObjects) |
100 | { | 100 | { |
101 | //m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType()); | 101 | //m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType()); |
102 | 102 | ||
103 | LLVector3 position = sceneObject.AbsolutePosition; | 103 | LLVector3 position = sceneObject.AbsolutePosition; |
104 | 104 | ||
105 | string serializedObject = m_serialiser.SaveGroupToXml2(sceneObject); | 105 | string serializedObject = m_serialiser.SaveGroupToXml2(sceneObject); |
106 | string filename | 106 | string filename |
107 | = string.Format( | 107 | = string.Format( |
108 | "{0}{1}_{2:000}-{3:000}-{4:000}__{5}.xml", | 108 | "{0}{1}_{2:000}-{3:000}-{4:000}__{5}.xml", |
109 | ArchiveConstants.OBJECTS_PATH, sceneObject.Name, | 109 | ArchiveConstants.OBJECTS_PATH, sceneObject.Name, |
110 | Math.Round(position.X), Math.Round(position.Y), Math.Round(position.Z), | 110 | Math.Round(position.X), Math.Round(position.Y), Math.Round(position.Z), |
111 | sceneObject.UUID); | 111 | sceneObject.UUID); |
112 | 112 | ||
113 | archive.AddFile(filename, serializedObject); | 113 | archive.AddFile(filename, serializedObject); |
114 | } | 114 | } |
115 | 115 | ||
@@ -120,8 +120,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
120 | archive.WriteTar(new GZipStream(new FileStream(m_savePath, FileMode.Create), CompressionMode.Compress)); | 120 | archive.WriteTar(new GZipStream(new FileStream(m_savePath, FileMode.Create), CompressionMode.Compress)); |
121 | 121 | ||
122 | m_log.InfoFormat("[ARCHIVER]: Wrote out OpenSimulator archive {0}", m_savePath); | 122 | m_log.InfoFormat("[ARCHIVER]: Wrote out OpenSimulator archive {0}", m_savePath); |
123 | } | 123 | } |
124 | 124 | ||
125 | /// <summary> | 125 | /// <summary> |
126 | /// Create the control file for this archive | 126 | /// Create the control file for this archive |
127 | /// </summary> | 127 | /// </summary> |
@@ -136,13 +136,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
136 | xtw.WriteAttributeString("major_version", "0"); | 136 | xtw.WriteAttributeString("major_version", "0"); |
137 | xtw.WriteAttributeString("minor_version", "1"); | 137 | xtw.WriteAttributeString("minor_version", "1"); |
138 | xtw.WriteEndElement(); | 138 | xtw.WriteEndElement(); |
139 | 139 | ||
140 | xtw.Flush(); | 140 | xtw.Flush(); |
141 | xtw.Close(); | 141 | xtw.Close(); |
142 | 142 | ||
143 | String s = sw.ToString(); | 143 | String s = sw.ToString(); |
144 | sw.Close(); | 144 | sw.Close(); |
145 | 145 | ||
146 | return s; | 146 | return s; |
147 | } | 147 | } |
148 | } | 148 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs index 327808a..20e15ab 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs | |||
@@ -52,14 +52,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
52 | 52 | ||
53 | protected Scene m_scene; | 53 | protected Scene m_scene; |
54 | protected string m_savePath; | 54 | protected string m_savePath; |
55 | 55 | ||
56 | /// <summary> | 56 | /// <summary> |
57 | /// Used for identifying uuids embedded in scripts | 57 | /// Used for identifying uuids embedded in scripts |
58 | /// </summary> | 58 | /// </summary> |
59 | protected static readonly Regex m_uuidRegex | 59 | protected static readonly Regex m_uuidRegex |
60 | = new Regex( | 60 | = new Regex( |
61 | "[0-9a-eA-E]{8}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{12}", | 61 | "[0-9a-eA-E]{8}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{12}", |
62 | RegexOptions.Compiled); | 62 | RegexOptions.Compiled); |
63 | 63 | ||
64 | /// <summary> | 64 | /// <summary> |
65 | /// Used as a temporary store of an asset which represents an object. This can be a null if no appropriate | 65 | /// Used as a temporary store of an asset which represents an object. This can be a null if no appropriate |
@@ -93,9 +93,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
93 | Monitor.Pulse(this); | 93 | Monitor.Pulse(this); |
94 | } | 94 | } |
95 | } | 95 | } |
96 | 96 | ||
97 | /// <summary> | 97 | /// <summary> |
98 | /// Get an asset synchronously, potentially using an asynchronous callback. If the | 98 | /// Get an asset synchronously, potentially using an asynchronous callback. If the |
99 | /// asynchronous callback is used, we will wait for it to complete. | 99 | /// asynchronous callback is used, we will wait for it to complete. |
100 | /// </summary> | 100 | /// </summary> |
101 | /// <param name="uuid"></param> | 101 | /// <param name="uuid"></param> |
@@ -118,11 +118,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
118 | Monitor.Wait(this); | 118 | Monitor.Wait(this); |
119 | m_waitingForObjectAsset = false; | 119 | m_waitingForObjectAsset = false; |
120 | } | 120 | } |
121 | } | 121 | } |
122 | 122 | ||
123 | return m_requestedObjectAsset; | 123 | return m_requestedObjectAsset; |
124 | } | 124 | } |
125 | 125 | ||
126 | /// <summary> | 126 | /// <summary> |
127 | /// Record the asset uuids embedded within the given script. | 127 | /// Record the asset uuids embedded within the given script. |
128 | /// </summary> | 128 | /// </summary> |
@@ -138,16 +138,16 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
138 | //m_log.DebugFormat("[ARCHIVER]: Script {0}", script); | 138 | //m_log.DebugFormat("[ARCHIVER]: Script {0}", script); |
139 | MatchCollection uuidMatches = m_uuidRegex.Matches(script); | 139 | MatchCollection uuidMatches = m_uuidRegex.Matches(script); |
140 | //m_log.DebugFormat("[ARCHIVER]: Found {0} matches in script", uuidMatches.Count); | 140 | //m_log.DebugFormat("[ARCHIVER]: Found {0} matches in script", uuidMatches.Count); |
141 | 141 | ||
142 | foreach (Match uuidMatch in uuidMatches) | 142 | foreach (Match uuidMatch in uuidMatches) |
143 | { | 143 | { |
144 | LLUUID uuid = new LLUUID(uuidMatch.Value); | 144 | LLUUID uuid = new LLUUID(uuidMatch.Value); |
145 | //m_log.DebugFormat("[ARCHIVER]: Recording {0} in script", uuid); | 145 | //m_log.DebugFormat("[ARCHIVER]: Recording {0} in script", uuid); |
146 | assetUuids[uuid] = 1; | 146 | assetUuids[uuid] = 1; |
147 | } | 147 | } |
148 | } | 148 | } |
149 | } | 149 | } |
150 | 150 | ||
151 | /// <summary> | 151 | /// <summary> |
152 | /// Record the uuids referenced by the given wearable asset | 152 | /// Record the uuids referenced by the given wearable asset |
153 | /// </summary> | 153 | /// </summary> |
@@ -159,25 +159,25 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
159 | //m_log.Debug(new System.Text.ASCIIEncoding().GetString(bodypartAsset.Data)); | 159 | //m_log.Debug(new System.Text.ASCIIEncoding().GetString(bodypartAsset.Data)); |
160 | AssetWearable wearableAsset = new AssetBodypart(assetBase.Data); | 160 | AssetWearable wearableAsset = new AssetBodypart(assetBase.Data); |
161 | wearableAsset.Decode(); | 161 | wearableAsset.Decode(); |
162 | 162 | ||
163 | //m_log.DebugFormat( | 163 | //m_log.DebugFormat( |
164 | // "[ARCHIVER]: Wearable asset {0} references {1} assets", wearableAssetUuid, wearableAsset.Textures.Count); | 164 | // "[ARCHIVER]: Wearable asset {0} references {1} assets", wearableAssetUuid, wearableAsset.Textures.Count); |
165 | 165 | ||
166 | foreach (LLUUID uuid in wearableAsset.Textures.Values) | 166 | foreach (LLUUID uuid in wearableAsset.Textures.Values) |
167 | { | 167 | { |
168 | //m_log.DebugFormat("[ARCHIVER]: Got bodypart uuid {0}", uuid); | 168 | //m_log.DebugFormat("[ARCHIVER]: Got bodypart uuid {0}", uuid); |
169 | assetUuids[uuid] = 1; | 169 | assetUuids[uuid] = 1; |
170 | } | 170 | } |
171 | } | 171 | } |
172 | 172 | ||
173 | /// <summary> | 173 | /// <summary> |
174 | /// Get all the asset uuids associated with a given object. This includes both those directly associated with | 174 | /// Get all the asset uuids associated with a given object. This includes both those directly associated with |
175 | /// it (e.g. face textures) and recursively, those of items within it's inventory (e.g. objects contained | 175 | /// it (e.g. face textures) and recursively, those of items within it's inventory (e.g. objects contained |
176 | /// within this object). | 176 | /// within this object). |
177 | /// </summary> | 177 | /// </summary> |
178 | /// <param name="sceneObject"></param> | 178 | /// <param name="sceneObject"></param> |
179 | /// <param name="assetUuids"></param> | 179 | /// <param name="assetUuids"></param> |
180 | protected void GetSceneObjectAssetUuids(LLUUID sceneObjectUuid, IDictionary<LLUUID, int> assetUuids) | 180 | protected void GetSceneObjectAssetUuids(LLUUID sceneObjectUuid, IDictionary<LLUUID, int> assetUuids) |
181 | { | 181 | { |
182 | AssetBase objectAsset = GetAsset(sceneObjectUuid); | 182 | AssetBase objectAsset = GetAsset(sceneObjectUuid); |
183 | 183 | ||
@@ -186,7 +186,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
186 | string xml = Helpers.FieldToUTF8String(objectAsset.Data); | 186 | string xml = Helpers.FieldToUTF8String(objectAsset.Data); |
187 | SceneObjectGroup sog = new SceneObjectGroup(m_scene, m_scene.RegionInfo.RegionHandle, xml); | 187 | SceneObjectGroup sog = new SceneObjectGroup(m_scene, m_scene.RegionInfo.RegionHandle, xml); |
188 | GetSceneObjectAssetUuids(sog, assetUuids); | 188 | GetSceneObjectAssetUuids(sog, assetUuids); |
189 | } | 189 | } |
190 | } | 190 | } |
191 | 191 | ||
192 | /// <summary> | 192 | /// <summary> |
@@ -209,10 +209,10 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
209 | try | 209 | try |
210 | { | 210 | { |
211 | LLObject.TextureEntry textureEntry = part.Shape.Textures; | 211 | LLObject.TextureEntry textureEntry = part.Shape.Textures; |
212 | 212 | ||
213 | // Get the prim's default texture. This will be used for faces which don't have their own texture | 213 | // Get the prim's default texture. This will be used for faces which don't have their own texture |
214 | assetUuids[textureEntry.DefaultTexture.TextureID] = 1; | 214 | assetUuids[textureEntry.DefaultTexture.TextureID] = 1; |
215 | 215 | ||
216 | // XXX: Not a great way to iterate through face textures, but there's no | 216 | // XXX: Not a great way to iterate through face textures, but there's no |
217 | // other method available to tell how many faces there actually are | 217 | // other method available to tell how many faces there actually are |
218 | //int i = 0; | 218 | //int i = 0; |
@@ -224,15 +224,15 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
224 | assetUuids[texture.TextureID] = 1; | 224 | assetUuids[texture.TextureID] = 1; |
225 | } | 225 | } |
226 | } | 226 | } |
227 | 227 | ||
228 | foreach (TaskInventoryItem tii in part.TaskInventory.Values) | 228 | foreach (TaskInventoryItem tii in part.TaskInventory.Values) |
229 | { | 229 | { |
230 | //m_log.DebugFormat("[ARCHIVER]: Analysing item asset type {0}", tii.Type); | 230 | //m_log.DebugFormat("[ARCHIVER]: Analysing item asset type {0}", tii.Type); |
231 | 231 | ||
232 | if (!assetUuids.ContainsKey(tii.AssetID)) | 232 | if (!assetUuids.ContainsKey(tii.AssetID)) |
233 | { | 233 | { |
234 | assetUuids[tii.AssetID] = 1; | 234 | assetUuids[tii.AssetID] = 1; |
235 | 235 | ||
236 | if ((int)AssetType.Bodypart == tii.Type || ((int)AssetType.Clothing == tii.Type)) | 236 | if ((int)AssetType.Bodypart == tii.Type || ((int)AssetType.Clothing == tii.Type)) |
237 | { | 237 | { |
238 | GetWearableAssetUuids(tii.AssetID, assetUuids); | 238 | GetWearableAssetUuids(tii.AssetID, assetUuids); |
@@ -275,20 +275,20 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
275 | if (entity is SceneObjectGroup) | 275 | if (entity is SceneObjectGroup) |
276 | sceneObjects.Add((SceneObjectGroup)entity); | 276 | sceneObjects.Add((SceneObjectGroup)entity); |
277 | } | 277 | } |
278 | 278 | ||
279 | foreach (SceneObjectGroup sceneObject in sceneObjects) | 279 | foreach (SceneObjectGroup sceneObject in sceneObjects) |
280 | { | 280 | { |
281 | GetSceneObjectAssetUuids(sceneObject, assetUuids); | 281 | GetSceneObjectAssetUuids(sceneObject, assetUuids); |
282 | } | 282 | } |
283 | 283 | ||
284 | m_log.DebugFormat( | 284 | m_log.DebugFormat( |
285 | "[ARCHIVER]: {0} scene objects to serialize requiring save of {1} assets", | 285 | "[ARCHIVER]: {0} scene objects to serialize requiring save of {1} assets", |
286 | sceneObjects.Count, assetUuids.Count); | 286 | sceneObjects.Count, assetUuids.Count); |
287 | 287 | ||
288 | // Asynchronously request all the assets required to perform this archive operation | 288 | // Asynchronously request all the assets required to perform this archive operation |
289 | ArchiveWriteRequestExecution awre | 289 | ArchiveWriteRequestExecution awre |
290 | = new ArchiveWriteRequestExecution( | 290 | = new ArchiveWriteRequestExecution( |
291 | sceneObjects, | 291 | sceneObjects, |
292 | m_scene.RequestModuleInterface<ITerrainModule>(), | 292 | m_scene.RequestModuleInterface<ITerrainModule>(), |
293 | m_scene.RequestModuleInterface<IRegionSerialiser>(), | 293 | m_scene.RequestModuleInterface<IRegionSerialiser>(), |
294 | m_scene.RegionInfo.RegionName, | 294 | m_scene.RegionInfo.RegionName, |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs index 2704224..708bed3 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs | |||
@@ -41,17 +41,17 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
41 | public class AssetsArchiver | 41 | public class AssetsArchiver |
42 | { | 42 | { |
43 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 43 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
44 | 44 | ||
45 | /// <summary> | 45 | /// <summary> |
46 | /// Archive assets | 46 | /// Archive assets |
47 | /// </summary> | 47 | /// </summary> |
48 | protected IDictionary<LLUUID, AssetBase> m_assets; | 48 | protected IDictionary<LLUUID, AssetBase> m_assets; |
49 | 49 | ||
50 | public AssetsArchiver(IDictionary<LLUUID, AssetBase> assets) | 50 | public AssetsArchiver(IDictionary<LLUUID, AssetBase> assets) |
51 | { | 51 | { |
52 | m_assets = assets; | 52 | m_assets = assets; |
53 | } | 53 | } |
54 | 54 | ||
55 | /// <summary> | 55 | /// <summary> |
56 | /// Archive the assets given to this archiver to the given archive. | 56 | /// Archive the assets given to this archiver to the given archive. |
57 | /// </summary> | 57 | /// </summary> |
@@ -70,44 +70,44 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
70 | { | 70 | { |
71 | StringWriter sw = new StringWriter(); | 71 | StringWriter sw = new StringWriter(); |
72 | XmlTextWriter xtw = new XmlTextWriter(sw); | 72 | XmlTextWriter xtw = new XmlTextWriter(sw); |
73 | 73 | ||
74 | xtw.Formatting = Formatting.Indented; | 74 | xtw.Formatting = Formatting.Indented; |
75 | xtw.WriteStartDocument(); | 75 | xtw.WriteStartDocument(); |
76 | 76 | ||
77 | xtw.WriteStartElement("assets"); | 77 | xtw.WriteStartElement("assets"); |
78 | 78 | ||
79 | foreach (LLUUID uuid in m_assets.Keys) | 79 | foreach (LLUUID uuid in m_assets.Keys) |
80 | { | 80 | { |
81 | AssetBase asset = m_assets[uuid]; | 81 | AssetBase asset = m_assets[uuid]; |
82 | 82 | ||
83 | if (asset != null) | 83 | if (asset != null) |
84 | { | 84 | { |
85 | xtw.WriteStartElement("asset"); | 85 | xtw.WriteStartElement("asset"); |
86 | 86 | ||
87 | string extension = string.Empty; | 87 | string extension = string.Empty; |
88 | 88 | ||
89 | if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) | 89 | if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) |
90 | { | 90 | { |
91 | extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; | 91 | extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; |
92 | } | 92 | } |
93 | 93 | ||
94 | xtw.WriteElementString("filename", uuid.ToString() + extension); | 94 | xtw.WriteElementString("filename", uuid.ToString() + extension); |
95 | 95 | ||
96 | xtw.WriteElementString("name", asset.Name); | 96 | xtw.WriteElementString("name", asset.Name); |
97 | xtw.WriteElementString("description", asset.Description); | 97 | xtw.WriteElementString("description", asset.Description); |
98 | xtw.WriteElementString("asset-type", asset.Type.ToString()); | 98 | xtw.WriteElementString("asset-type", asset.Type.ToString()); |
99 | 99 | ||
100 | xtw.WriteEndElement(); | 100 | xtw.WriteEndElement(); |
101 | } | 101 | } |
102 | } | 102 | } |
103 | 103 | ||
104 | xtw.WriteEndElement(); | 104 | xtw.WriteEndElement(); |
105 | 105 | ||
106 | xtw.WriteEndDocument(); | 106 | xtw.WriteEndDocument(); |
107 | 107 | ||
108 | archive.AddFile("assets.xml", sw.ToString()); | 108 | archive.AddFile("assets.xml", sw.ToString()); |
109 | } | 109 | } |
110 | 110 | ||
111 | /// <summary> | 111 | /// <summary> |
112 | /// Write asset data files to the given archive | 112 | /// Write asset data files to the given archive |
113 | /// </summary> | 113 | /// </summary> |
@@ -116,18 +116,18 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
116 | { | 116 | { |
117 | // It appears that gtar, at least, doesn't need the intermediate directory entries in the tar | 117 | // It appears that gtar, at least, doesn't need the intermediate directory entries in the tar |
118 | //archive.AddDir("assets"); | 118 | //archive.AddDir("assets"); |
119 | 119 | ||
120 | foreach (LLUUID uuid in m_assets.Keys) | 120 | foreach (LLUUID uuid in m_assets.Keys) |
121 | { | 121 | { |
122 | AssetBase asset = m_assets[uuid]; | 122 | AssetBase asset = m_assets[uuid]; |
123 | 123 | ||
124 | string extension = string.Empty; | 124 | string extension = string.Empty; |
125 | 125 | ||
126 | if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) | 126 | if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) |
127 | { | 127 | { |
128 | extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; | 128 | extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; |
129 | } | 129 | } |
130 | 130 | ||
131 | archive.AddFile( | 131 | archive.AddFile( |
132 | ArchiveConstants.ASSETS_PATH + uuid.ToString() + extension, | 132 | ArchiveConstants.ASSETS_PATH + uuid.ToString() + extension, |
133 | asset.Data); | 133 | asset.Data); |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs index 284a39e..17abb24 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs | |||
@@ -43,9 +43,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
43 | public class AssetsDearchiver | 43 | public class AssetsDearchiver |
44 | { | 44 | { |
45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | 46 | ||
47 | protected static System.Text.ASCIIEncoding m_asciiEncoding = new System.Text.ASCIIEncoding(); | 47 | protected static System.Text.ASCIIEncoding m_asciiEncoding = new System.Text.ASCIIEncoding(); |
48 | 48 | ||
49 | /// <summary> | 49 | /// <summary> |
50 | /// Store for asset data we received before we get the metadata | 50 | /// Store for asset data we received before we get the metadata |
51 | /// </summary> | 51 | /// </summary> |
@@ -55,17 +55,17 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
55 | /// Asset metadata. Is null if asset metadata isn't yet available. | 55 | /// Asset metadata. Is null if asset metadata isn't yet available. |
56 | /// </summary> | 56 | /// </summary> |
57 | protected Dictionary<string, AssetMetadata> m_metadata; | 57 | protected Dictionary<string, AssetMetadata> m_metadata; |
58 | 58 | ||
59 | /// <summary> | 59 | /// <summary> |
60 | /// Cache to which dearchived assets will be added | 60 | /// Cache to which dearchived assets will be added |
61 | /// </summary> | 61 | /// </summary> |
62 | protected AssetCache m_cache; | 62 | protected AssetCache m_cache; |
63 | 63 | ||
64 | public AssetsDearchiver(AssetCache cache) | 64 | public AssetsDearchiver(AssetCache cache) |
65 | { | 65 | { |
66 | m_cache = cache; | 66 | m_cache = cache; |
67 | } | 67 | } |
68 | 68 | ||
69 | /// <summary> | 69 | /// <summary> |
70 | /// Add asset data to the dearchiver | 70 | /// Add asset data to the dearchiver |
71 | /// </summary> | 71 | /// </summary> |
@@ -82,7 +82,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
82 | ResolveAssetData(assetFilename, data); | 82 | ResolveAssetData(assetFilename, data); |
83 | } | 83 | } |
84 | } | 84 | } |
85 | 85 | ||
86 | /// <summary> | 86 | /// <summary> |
87 | /// Add asset metadata xml | 87 | /// Add asset metadata xml |
88 | /// </summary> | 88 | /// </summary> |
@@ -90,39 +90,39 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
90 | public void AddAssetMetadata(string xml) | 90 | public void AddAssetMetadata(string xml) |
91 | { | 91 | { |
92 | m_metadata = new Dictionary<string, AssetMetadata>(); | 92 | m_metadata = new Dictionary<string, AssetMetadata>(); |
93 | 93 | ||
94 | StringReader sr = new StringReader(xml); | 94 | StringReader sr = new StringReader(xml); |
95 | XmlTextReader reader = new XmlTextReader(sr); | 95 | XmlTextReader reader = new XmlTextReader(sr); |
96 | 96 | ||
97 | reader.ReadStartElement("assets"); | 97 | reader.ReadStartElement("assets"); |
98 | reader.Read(); | 98 | reader.Read(); |
99 | 99 | ||
100 | while (reader.Name.Equals("asset")) | 100 | while (reader.Name.Equals("asset")) |
101 | { | 101 | { |
102 | reader.Read(); | 102 | reader.Read(); |
103 | 103 | ||
104 | AssetMetadata metadata = new AssetMetadata(); | 104 | AssetMetadata metadata = new AssetMetadata(); |
105 | 105 | ||
106 | string filename = reader.ReadElementString("filename"); | 106 | string filename = reader.ReadElementString("filename"); |
107 | m_log.DebugFormat("[DEARCHIVER]: Reading node {0}", filename); | 107 | m_log.DebugFormat("[DEARCHIVER]: Reading node {0}", filename); |
108 | 108 | ||
109 | metadata.Name = reader.ReadElementString("name"); | 109 | metadata.Name = reader.ReadElementString("name"); |
110 | metadata.Description = reader.ReadElementString("description"); | 110 | metadata.Description = reader.ReadElementString("description"); |
111 | metadata.AssetType = Convert.ToSByte(reader.ReadElementString("asset-type")); | 111 | metadata.AssetType = Convert.ToSByte(reader.ReadElementString("asset-type")); |
112 | 112 | ||
113 | m_metadata[filename] = metadata; | 113 | m_metadata[filename] = metadata; |
114 | 114 | ||
115 | // Read asset end tag | 115 | // Read asset end tag |
116 | reader.ReadEndElement(); | 116 | reader.ReadEndElement(); |
117 | 117 | ||
118 | reader.Read(); | 118 | reader.Read(); |
119 | } | 119 | } |
120 | 120 | ||
121 | m_log.DebugFormat("[DEARCHIVER]: Resolved {0} items of asset metadata", m_metadata.Count); | 121 | m_log.DebugFormat("[DEARCHIVER]: Resolved {0} items of asset metadata", m_metadata.Count); |
122 | 122 | ||
123 | ResolvePendingAssetData(); | 123 | ResolvePendingAssetData(); |
124 | } | 124 | } |
125 | 125 | ||
126 | /// <summary> | 126 | /// <summary> |
127 | /// Resolve asset data that we collected before receiving the metadata | 127 | /// Resolve asset data that we collected before receiving the metadata |
128 | /// </summary> | 128 | /// </summary> |
@@ -133,7 +133,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
133 | ResolveAssetData(filename, m_assetDataAwaitingMetadata[filename]); | 133 | ResolveAssetData(filename, m_assetDataAwaitingMetadata[filename]); |
134 | } | 134 | } |
135 | } | 135 | } |
136 | 136 | ||
137 | /// <summary> | 137 | /// <summary> |
138 | /// Resolve a new piece of asset data against stored metadata | 138 | /// Resolve a new piece of asset data against stored metadata |
139 | /// </summary> | 139 | /// </summary> |
@@ -143,11 +143,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
143 | { | 143 | { |
144 | // Right now we're nastily obtaining the lluuid from the filename | 144 | // Right now we're nastily obtaining the lluuid from the filename |
145 | string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); | 145 | string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); |
146 | 146 | ||
147 | if (m_metadata.ContainsKey(filename)) | 147 | if (m_metadata.ContainsKey(filename)) |
148 | { | 148 | { |
149 | AssetMetadata metadata = m_metadata[filename]; | 149 | AssetMetadata metadata = m_metadata[filename]; |
150 | 150 | ||
151 | if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(metadata.AssetType)) | 151 | if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(metadata.AssetType)) |
152 | { | 152 | { |
153 | string extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[metadata.AssetType]; | 153 | string extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[metadata.AssetType]; |
@@ -166,11 +166,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
166 | else | 166 | else |
167 | { | 167 | { |
168 | m_log.ErrorFormat( | 168 | m_log.ErrorFormat( |
169 | "[DEARCHIVER]: Tried to dearchive data with filename {0} without any corresponding metadata", | 169 | "[DEARCHIVER]: Tried to dearchive data with filename {0} without any corresponding metadata", |
170 | assetPath); | 170 | assetPath); |
171 | } | 171 | } |
172 | } | 172 | } |
173 | 173 | ||
174 | /// <summary> | 174 | /// <summary> |
175 | /// Metadata for an asset | 175 | /// Metadata for an asset |
176 | /// </summary> | 176 | /// </summary> |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs index 6ffbcbb..2164f7e 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs | |||
@@ -43,12 +43,12 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
43 | class AssetsRequest | 43 | class AssetsRequest |
44 | { | 44 | { |
45 | //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 45 | //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | 46 | ||
47 | /// <summary> | 47 | /// <summary> |
48 | /// uuids to request | 48 | /// uuids to request |
49 | /// </summary> | 49 | /// </summary> |
50 | protected ICollection<LLUUID> m_uuids; | 50 | protected ICollection<LLUUID> m_uuids; |
51 | 51 | ||
52 | /// <summary> | 52 | /// <summary> |
53 | /// Callback used when all the assets requested have been received. | 53 | /// Callback used when all the assets requested have been received. |
54 | /// </summary> | 54 | /// </summary> |
@@ -58,7 +58,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
58 | /// Assets retrieved in this request | 58 | /// Assets retrieved in this request |
59 | /// </summary> | 59 | /// </summary> |
60 | protected Dictionary<LLUUID, AssetBase> m_assets = new Dictionary<LLUUID, AssetBase>(); | 60 | protected Dictionary<LLUUID, AssetBase> m_assets = new Dictionary<LLUUID, AssetBase>(); |
61 | 61 | ||
62 | /// <summary> | 62 | /// <summary> |
63 | /// Maintain a list of assets that could not be found. This will be passed back to the requester. | 63 | /// Maintain a list of assets that could not be found. This will be passed back to the requester. |
64 | /// </summary> | 64 | /// </summary> |
@@ -81,7 +81,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
81 | m_assetCache = assetCache; | 81 | m_assetCache = assetCache; |
82 | m_repliesRequired = uuids.Count; | 82 | m_repliesRequired = uuids.Count; |
83 | } | 83 | } |
84 | 84 | ||
85 | protected internal void Execute() | 85 | protected internal void Execute() |
86 | { | 86 | { |
87 | // We can stop here if there are no assets to fetch | 87 | // We can stop here if there are no assets to fetch |
@@ -105,7 +105,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
105 | m_assets[assetID] = asset; | 105 | m_assets[assetID] = asset; |
106 | else | 106 | else |
107 | m_notFoundAssetUuids.Add(assetID); | 107 | m_notFoundAssetUuids.Add(assetID); |
108 | 108 | ||
109 | //m_log.DebugFormat( | 109 | //m_log.DebugFormat( |
110 | // "[ARCHIVER]: Received {0} assets and notification of {1} missing assets", m_assets.Count, m_notFoundAssetUuids.Count); | 110 | // "[ARCHIVER]: Received {0} assets and notification of {1} missing assets", m_assets.Count, m_notFoundAssetUuids.Count); |
111 | 111 | ||
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs index 585d1d4..4e000cc 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs | |||
@@ -69,9 +69,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
69 | public byte[] ReadEntry(out string filePath) | 69 | public byte[] ReadEntry(out string filePath) |
70 | { | 70 | { |
71 | filePath = String.Empty; | 71 | filePath = String.Empty; |
72 | 72 | ||
73 | TarHeader header = ReadHeader(); | 73 | TarHeader header = ReadHeader(); |
74 | 74 | ||
75 | if (null == header) | 75 | if (null == header) |
76 | return null; | 76 | return null; |
77 | 77 | ||
@@ -98,14 +98,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
98 | /// </summary> | 98 | /// </summary> |
99 | /// <returns>A tar header struct. null if we have reached the end of the archive.</returns> | 99 | /// <returns>A tar header struct. null if we have reached the end of the archive.</returns> |
100 | protected TarHeader ReadHeader() | 100 | protected TarHeader ReadHeader() |
101 | { | 101 | { |
102 | byte[] header = m_br.ReadBytes(512); | 102 | byte[] header = m_br.ReadBytes(512); |
103 | 103 | ||
104 | // If we've reached the end of the archive we'll be in null block territory, which means | 104 | // If we've reached the end of the archive we'll be in null block territory, which means |
105 | // the next byte will be 0 | 105 | // the next byte will be 0 |
106 | if (header[0] == 0) | 106 | if (header[0] == 0) |
107 | return null; | 107 | return null; |
108 | 108 | ||
109 | TarHeader tarHeader = new TarHeader(); | 109 | TarHeader tarHeader = new TarHeader(); |
110 | 110 | ||
111 | tarHeader.FilePath = m_asciiEncoding.GetString(header, 0, 100); | 111 | tarHeader.FilePath = m_asciiEncoding.GetString(header, 0, 100); |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs index f70a93d..83b9250 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs | |||
@@ -54,10 +54,10 @@ namespace OpenSim.Region.Environment | |||
54 | // Directories are signalled by a final / | 54 | // Directories are signalled by a final / |
55 | if (!dirName.EndsWith("/")) | 55 | if (!dirName.EndsWith("/")) |
56 | dirName += "/"; | 56 | dirName += "/"; |
57 | 57 | ||
58 | AddFile(dirName, new byte[0]); | 58 | AddFile(dirName, new byte[0]); |
59 | } | 59 | } |
60 | 60 | ||
61 | /// <summary> | 61 | /// <summary> |
62 | /// Add a file to the tar archive | 62 | /// Add a file to the tar archive |
63 | /// </summary> | 63 | /// </summary> |
@@ -161,7 +161,7 @@ namespace OpenSim.Region.Environment | |||
161 | if (data.Length % 512 != 0) | 161 | if (data.Length % 512 != 0) |
162 | { | 162 | { |
163 | int paddingRequired = 512 - (data.Length % 512); | 163 | int paddingRequired = 512 - (data.Length % 512); |
164 | 164 | ||
165 | //m_log.DebugFormat("[TAR ARCHIVE WRITER]: Padding data with {0} bytes", paddingRequired); | 165 | //m_log.DebugFormat("[TAR ARCHIVE WRITER]: Padding data with {0} bytes", paddingRequired); |
166 | 166 | ||
167 | byte[] padding = new byte[paddingRequired]; | 167 | byte[] padding = new byte[paddingRequired]; |
diff --git a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs index 1e622be..28347d0 100644 --- a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs | |||
@@ -223,7 +223,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate | |||
223 | if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId, false) || m_scene.ExternalChecks.ExternalChecksBypassPermissions()) | 223 | if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId, false) || m_scene.ExternalChecks.ExternalChecksBypassPermissions()) |
224 | { | 224 | { |
225 | EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans; | 225 | EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans; |
226 | 226 | ||
227 | bool alreadyInList = false; | 227 | bool alreadyInList = false; |
228 | 228 | ||
229 | for (int i = 0; i < banlistcheck.Length; i++) | 229 | for (int i = 0; i < banlistcheck.Length; i++) |
@@ -407,8 +407,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate | |||
407 | args.useEstateSun = m_scene.RegionInfo.RegionSettings.UseEstateSun; | 407 | args.useEstateSun = m_scene.RegionInfo.RegionSettings.UseEstateSun; |
408 | args.waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight; | 408 | args.waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight; |
409 | args.simName = m_scene.RegionInfo.RegionName; | 409 | args.simName = m_scene.RegionInfo.RegionName; |
410 | 410 | ||
411 | |||
412 | remote_client.SendRegionInfoToEstateMenu(args); | 411 | remote_client.SendRegionInfoToEstateMenu(args); |
413 | } | 412 | } |
414 | 413 | ||
@@ -416,6 +415,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate | |||
416 | { | 415 | { |
417 | remote_client.SendEstateCovenantInformation(m_scene.RegionInfo.RegionSettings.Covenant); | 416 | remote_client.SendEstateCovenantInformation(m_scene.RegionInfo.RegionSettings.Covenant); |
418 | } | 417 | } |
418 | |||
419 | private void HandleLandStatRequest(int parcelID, uint reportType, uint requestFlags, string filter, IClientAPI remoteClient) | 419 | private void HandleLandStatRequest(int parcelID, uint reportType, uint requestFlags, string filter, IClientAPI remoteClient) |
420 | { | 420 | { |
421 | Dictionary<uint, float> SceneData = new Dictionary<uint,float>(); | 421 | Dictionary<uint, float> SceneData = new Dictionary<uint,float>(); |
@@ -472,7 +472,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate | |||
472 | continue; | 472 | continue; |
473 | } | 473 | } |
474 | } | 474 | } |
475 | 475 | ||
476 | SceneReport.Add(lsri); | 476 | SceneReport.Add(lsri); |
477 | } | 477 | } |
478 | } | 478 | } |
@@ -481,7 +481,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate | |||
481 | } | 481 | } |
482 | } | 482 | } |
483 | remoteClient.SendLandStatReply(reportType, requestFlags, (uint)SceneReport.Count,SceneReport.ToArray()); | 483 | remoteClient.SendLandStatReply(reportType, requestFlags, (uint)SceneReport.Count,SceneReport.ToArray()); |
484 | 484 | ||
485 | if (uuidNameLookupList.Count > 0) | 485 | if (uuidNameLookupList.Count > 0) |
486 | LookupUUID(uuidNameLookupList); | 486 | LookupUUID(uuidNameLookupList); |
487 | } | 487 | } |
@@ -502,7 +502,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate | |||
502 | private void LookupUUIDsAsync(List<LLUUID> uuidLst) | 502 | private void LookupUUIDsAsync(List<LLUUID> uuidLst) |
503 | { | 503 | { |
504 | LLUUID[] uuidarr = new LLUUID[0]; | 504 | LLUUID[] uuidarr = new LLUUID[0]; |
505 | 505 | ||
506 | lock (uuidLst) | 506 | lock (uuidLst) |
507 | { | 507 | { |
508 | uuidarr = uuidLst.ToArray(); | 508 | uuidarr = uuidLst.ToArray(); |
@@ -539,7 +539,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate | |||
539 | if (EstateManagers[i] == remoteClient.AgentId) | 539 | if (EstateManagers[i] == remoteClient.AgentId) |
540 | estatemanager = true; | 540 | estatemanager = true; |
541 | } | 541 | } |
542 | 542 | ||
543 | args.isEstateManager = estatemanager; | 543 | args.isEstateManager = estatemanager; |
544 | 544 | ||
545 | args.billableFactor = m_scene.RegionInfo.EstateSettings.BillableFactor; | 545 | args.billableFactor = m_scene.RegionInfo.EstateSettings.BillableFactor; |
@@ -729,11 +729,11 @@ namespace OpenSim.Region.Environment.Modules.World.Estate | |||
729 | client.OnLandStatRequest += HandleLandStatRequest; | 729 | client.OnLandStatRequest += HandleLandStatRequest; |
730 | sendRegionHandshake(client); | 730 | sendRegionHandshake(client); |
731 | } | 731 | } |
732 | 732 | ||
733 | public uint GetRegionFlags() | 733 | public uint GetRegionFlags() |
734 | { | 734 | { |
735 | Simulator.RegionFlags flags = Simulator.RegionFlags.None; | 735 | Simulator.RegionFlags flags = Simulator.RegionFlags.None; |
736 | 736 | ||
737 | // Fully implemented | 737 | // Fully implemented |
738 | // | 738 | // |
739 | if (m_scene.RegionInfo.RegionSettings.AllowDamage) | 739 | if (m_scene.RegionInfo.RegionSettings.AllowDamage) |
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs index 9b1b9b5..00994fb 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs | |||
@@ -47,14 +47,12 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
47 | { | 47 | { |
48 | private static readonly ILog m_log = | 48 | private static readonly ILog m_log = |
49 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 49 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
50 | 50 | ||
51 | private static readonly string remoteParcelRequestPath = "0009/"; | 51 | private static readonly string remoteParcelRequestPath = "0009/"; |
52 | 52 | ||
53 | private LandChannel landChannel; | 53 | private LandChannel landChannel; |
54 | private Scene m_scene; | 54 | private Scene m_scene; |
55 | 55 | ||
56 | |||
57 | |||
58 | private readonly int[,] landIDList = new int[64, 64]; | 56 | private readonly int[,] landIDList = new int[64, 64]; |
59 | private readonly Dictionary<int, ILandObject> landList = new Dictionary<int, ILandObject>(); | 57 | private readonly Dictionary<int, ILandObject> landList = new Dictionary<int, ILandObject>(); |
60 | 58 | ||
@@ -115,8 +113,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
115 | } | 113 | } |
116 | } | 114 | } |
117 | 115 | ||
118 | |||
119 | |||
120 | public void PostInitialise() | 116 | public void PostInitialise() |
121 | { | 117 | { |
122 | } | 118 | } |
@@ -153,8 +149,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
153 | } | 149 | } |
154 | } | 150 | } |
155 | 151 | ||
156 | |||
157 | |||
158 | public bool AllowedForcefulBans | 152 | public bool AllowedForcefulBans |
159 | { | 153 | { |
160 | get { return m_allowedForcefulBans; } | 154 | get { return m_allowedForcefulBans; } |
@@ -185,11 +179,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
185 | public List<ILandObject> ParcelsNearPoint(LLVector3 position) | 179 | public List<ILandObject> ParcelsNearPoint(LLVector3 position) |
186 | { | 180 | { |
187 | List<ILandObject> parcelsNear = new List<ILandObject>(); | 181 | List<ILandObject> parcelsNear = new List<ILandObject>(); |
188 | int x; | 182 | for (int x = -4; x <= 4; x += 4) |
189 | for (x = -4; x <= 4; x += 4) | ||
190 | { | 183 | { |
191 | int y; | 184 | for (int y = -4; y <= 4; y += 4) |
192 | for (y = -4; y <= 4; y += 4) | ||
193 | { | 185 | { |
194 | ILandObject check = GetLandObject(position.X + x, position.Y + y); | 186 | ILandObject check = GetLandObject(position.X + x, position.Y + y); |
195 | if (check != null) | 187 | if (check != null) |
@@ -286,7 +278,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
286 | ILandObject over = GetLandObject((int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.X))), | 278 | ILandObject over = GetLandObject((int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.X))), |
287 | (int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.Y)))); | 279 | (int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.Y)))); |
288 | 280 | ||
289 | |||
290 | if (over != null) | 281 | if (over != null) |
291 | { | 282 | { |
292 | if (force) | 283 | if (force) |
@@ -387,6 +378,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
387 | Console.WriteLine("INVALID LOCAL LAND ID"); | 378 | Console.WriteLine("INVALID LOCAL LAND ID"); |
388 | } | 379 | } |
389 | } | 380 | } |
381 | |||
390 | /// <summary> | 382 | /// <summary> |
391 | /// Creates a basic Parcel object without an owner (a zeroed key) | 383 | /// Creates a basic Parcel object without an owner (a zeroed key) |
392 | /// </summary> | 384 | /// </summary> |
@@ -406,13 +398,10 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
406 | new_land.landData.LocalID = lastLandLocalID; | 398 | new_land.landData.LocalID = lastLandLocalID; |
407 | landList.Add(lastLandLocalID, new_land.Copy()); | 399 | landList.Add(lastLandLocalID, new_land.Copy()); |
408 | 400 | ||
409 | |||
410 | bool[,] landBitmap = new_land.getLandBitmap(); | 401 | bool[,] landBitmap = new_land.getLandBitmap(); |
411 | int x; | 402 | for (int x = 0; x < 64; x++) |
412 | for (x = 0; x < 64; x++) | ||
413 | { | 403 | { |
414 | int y; | 404 | for (int y = 0; y < 64; y++) |
415 | for (y = 0; y < 64; y++) | ||
416 | { | 405 | { |
417 | if (landBitmap[x, y]) | 406 | if (landBitmap[x, y]) |
418 | { | 407 | { |
@@ -431,11 +420,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
431 | /// <param name="local_id">Land.localID of the peice of land to remove.</param> | 420 | /// <param name="local_id">Land.localID of the peice of land to remove.</param> |
432 | public void removeLandObject(int local_id) | 421 | public void removeLandObject(int local_id) |
433 | { | 422 | { |
434 | int x; | 423 | for (int x = 0; x < 64; x++) |
435 | for (x = 0; x < 64; x++) | ||
436 | { | 424 | { |
437 | int y; | 425 | for (int y = 0; y < 64; y++) |
438 | for (y = 0; y < 64; y++) | ||
439 | { | 426 | { |
440 | if (landIDList[x, y] == local_id) | 427 | if (landIDList[x, y] == local_id) |
441 | { | 428 | { |
@@ -451,12 +438,10 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
451 | 438 | ||
452 | private void performFinalLandJoin(ILandObject master, ILandObject slave) | 439 | private void performFinalLandJoin(ILandObject master, ILandObject slave) |
453 | { | 440 | { |
454 | int x; | ||
455 | bool[,] landBitmapSlave = slave.getLandBitmap(); | 441 | bool[,] landBitmapSlave = slave.getLandBitmap(); |
456 | for (x = 0; x < 64; x++) | 442 | for (int x = 0; x < 64; x++) |
457 | { | 443 | { |
458 | int y; | 444 | for (int y = 0; y < 64; y++) |
459 | for (y = 0; y < 64; y++) | ||
460 | { | 445 | { |
461 | if (landBitmapSlave[x, y]) | 446 | if (landBitmapSlave[x, y]) |
462 | { | 447 | { |
@@ -519,6 +504,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
519 | } | 504 | } |
520 | return landList[landIDList[x / 4, y / 4]]; | 505 | return landList[landIDList[x / 4, y / 4]]; |
521 | } | 506 | } |
507 | |||
522 | #endregion | 508 | #endregion |
523 | 509 | ||
524 | #region Parcel Modification | 510 | #region Parcel Modification |
@@ -601,7 +587,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
601 | ResetAllLandPrimCounts(); | 587 | ResetAllLandPrimCounts(); |
602 | lock (m_scene.Entities) | 588 | lock (m_scene.Entities) |
603 | { | 589 | { |
604 | foreach (EntityBase obj in m_scene.Entities.Values) | 590 | foreach (EntityBase obj in m_scene.Entities.Values) |
605 | { | 591 | { |
606 | if (obj != null) | 592 | if (obj != null) |
607 | { | 593 | { |
@@ -647,11 +633,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
647 | { | 633 | { |
648 | int totalX = end_x - start_x; | 634 | int totalX = end_x - start_x; |
649 | int totalY = end_y - start_y; | 635 | int totalY = end_y - start_y; |
650 | int y; | 636 | for (int y = 0; y < totalY; y++) |
651 | for (y = 0; y < totalY; y++) | ||
652 | { | 637 | { |
653 | int x; | 638 | for (int x = 0; x < totalX; x++) |
654 | for (x = 0; x < totalX; x++) | ||
655 | { | 639 | { |
656 | ILandObject tempLandObject = GetLandObject(start_x + x, start_y + y); | 640 | ILandObject tempLandObject = GetLandObject(start_x + x, start_y + y); |
657 | if (tempLandObject == null) return; | 641 | if (tempLandObject == null) return; |
@@ -690,9 +674,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
690 | ILandObject result = AddLandObject(newLand); | 674 | ILandObject result = AddLandObject(newLand); |
691 | UpdateLandObject(startLandObject.landData.LocalID, startLandObject.landData); | 675 | UpdateLandObject(startLandObject.landData.LocalID, startLandObject.landData); |
692 | result.sendLandUpdateToAvatarsOverMe(); | 676 | result.sendLandUpdateToAvatarsOverMe(); |
693 | |||
694 | |||
695 | return; | ||
696 | } | 677 | } |
697 | 678 | ||
698 | /// <summary> | 679 | /// <summary> |
@@ -730,7 +711,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
730 | ILandObject masterLandObject = selectedLandObjects[0]; | 711 | ILandObject masterLandObject = selectedLandObjects[0]; |
731 | selectedLandObjects.RemoveAt(0); | 712 | selectedLandObjects.RemoveAt(0); |
732 | 713 | ||
733 | |||
734 | if (selectedLandObjects.Count < 1) | 714 | if (selectedLandObjects.Count < 1) |
735 | { | 715 | { |
736 | return; | 716 | return; |
@@ -753,12 +733,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
753 | performFinalLandJoin(masterLandObject, slaveLandObject); | 733 | performFinalLandJoin(masterLandObject, slaveLandObject); |
754 | } | 734 | } |
755 | 735 | ||
756 | |||
757 | SetPrimsTainted(); | 736 | SetPrimsTainted(); |
758 | 737 | ||
759 | masterLandObject.sendLandUpdateToAvatarsOverMe(); | 738 | masterLandObject.sendLandUpdateToAvatarsOverMe(); |
760 | |||
761 | return; | ||
762 | } | 739 | } |
763 | 740 | ||
764 | #endregion | 741 | #endregion |
@@ -777,17 +754,14 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
777 | int byteArrayCount = 0; | 754 | int byteArrayCount = 0; |
778 | int sequenceID = 0; | 755 | int sequenceID = 0; |
779 | 756 | ||
780 | int y; | 757 | for (int y = 0; y < 64; y++) |
781 | for (y = 0; y < 64; y++) | ||
782 | { | 758 | { |
783 | int x; | 759 | for (int x = 0; x < 64; x++) |
784 | for (x = 0; x < 64; x++) | ||
785 | { | 760 | { |
786 | byte tempByte = 0; //This represents the byte for the current 4x4 | 761 | byte tempByte = 0; //This represents the byte for the current 4x4 |
787 | 762 | ||
788 | ILandObject currentParcelBlock = GetLandObject(x * 4, y * 4); | 763 | ILandObject currentParcelBlock = GetLandObject(x * 4, y * 4); |
789 | 764 | ||
790 | |||
791 | if (currentParcelBlock != null) | 765 | if (currentParcelBlock != null) |
792 | { | 766 | { |
793 | if (currentParcelBlock.landData.OwnerID == remote_client.AgentId) | 767 | if (currentParcelBlock.landData.OwnerID == remote_client.AgentId) |
@@ -813,7 +787,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
813 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_OTHER); | 787 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_OTHER); |
814 | } | 788 | } |
815 | 789 | ||
816 | |||
817 | //Now for border control | 790 | //Now for border control |
818 | 791 | ||
819 | ILandObject westParcel = null; | 792 | ILandObject westParcel = null; |
@@ -864,14 +837,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
864 | { | 837 | { |
865 | //Get the land objects within the bounds | 838 | //Get the land objects within the bounds |
866 | List<ILandObject> temp = new List<ILandObject>(); | 839 | List<ILandObject> temp = new List<ILandObject>(); |
867 | int x; | ||
868 | int i; | ||
869 | int inc_x = end_x - start_x; | 840 | int inc_x = end_x - start_x; |
870 | int inc_y = end_y - start_y; | 841 | int inc_y = end_y - start_y; |
871 | for (x = 0; x < inc_x; x++) | 842 | for (int x = 0; x < inc_x; x++) |
872 | { | 843 | { |
873 | int y; | 844 | for (int y = 0; y < inc_y; y++) |
874 | for (y = 0; y < inc_y; y++) | ||
875 | { | 845 | { |
876 | ILandObject currentParcel = GetLandObject(start_x + x, start_y + y); | 846 | ILandObject currentParcel = GetLandObject(start_x + x, start_y + y); |
877 | 847 | ||
@@ -892,12 +862,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
892 | requestResult = LandChannel.LAND_RESULT_MULTIPLE; | 862 | requestResult = LandChannel.LAND_RESULT_MULTIPLE; |
893 | } | 863 | } |
894 | 864 | ||
895 | for (i = 0; i < temp.Count; i++) | 865 | for (int i = 0; i < temp.Count; i++) |
896 | { | 866 | { |
897 | temp[i].sendLandProperties(sequence_id, snap_selection, requestResult, remote_client); | 867 | temp[i].sendLandProperties(sequence_id, snap_selection, requestResult, remote_client); |
898 | } | 868 | } |
899 | 869 | ||
900 | |||
901 | SendParcelOverlay(remote_client); | 870 | SendParcelOverlay(remote_client); |
902 | } | 871 | } |
903 | 872 | ||
@@ -921,7 +890,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
921 | 890 | ||
922 | public void handleParcelSelectObjectsRequest(int local_id, int request_type, IClientAPI remote_client) | 891 | public void handleParcelSelectObjectsRequest(int local_id, int request_type, IClientAPI remote_client) |
923 | { | 892 | { |
924 | |||
925 | landList[local_id].sendForceObjectSelect(local_id, request_type, remote_client); | 893 | landList[local_id].sendForceObjectSelect(local_id, request_type, remote_client); |
926 | } | 894 | } |
927 | 895 | ||
@@ -954,7 +922,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
954 | landList[local_id].sendLandUpdateToClient(remote_client); | 922 | landList[local_id].sendLandUpdateToClient(remote_client); |
955 | } | 923 | } |
956 | } | 924 | } |
957 | |||
958 | } | 925 | } |
959 | 926 | ||
960 | public void handleParcelReclaim(int local_id, IClientAPI remote_client) | 927 | public void handleParcelReclaim(int local_id, IClientAPI remote_client) |
@@ -972,7 +939,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
972 | landList[local_id].sendLandUpdateToClient(remote_client); | 939 | landList[local_id].sendLandUpdateToClient(remote_client); |
973 | } | 940 | } |
974 | } | 941 | } |
975 | |||
976 | } | 942 | } |
977 | #endregion | 943 | #endregion |
978 | 944 | ||
@@ -1076,7 +1042,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
1076 | { | 1042 | { |
1077 | selectedParcel.returnLandObjects(returnType, agentIDs, remoteClient); | 1043 | selectedParcel.returnLandObjects(returnType, agentIDs, remoteClient); |
1078 | } | 1044 | } |
1079 | |||
1080 | } | 1045 | } |
1081 | 1046 | ||
1082 | public void NoLandDataFromStorage() | 1047 | public void NoLandDataFromStorage() |
@@ -1093,11 +1058,13 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
1093 | obj.setParcelObjectMaxOverride(overrideDel); | 1058 | obj.setParcelObjectMaxOverride(overrideDel); |
1094 | } | 1059 | } |
1095 | } | 1060 | } |
1061 | |||
1096 | public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel) | 1062 | public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel) |
1097 | { | 1063 | { |
1098 | } | 1064 | } |
1099 | 1065 | ||
1100 | #region CAPS handler | 1066 | #region CAPS handler |
1067 | |||
1101 | private void OnRegisterCaps(LLUUID agentID, Caps caps) | 1068 | private void OnRegisterCaps(LLUUID agentID, Caps caps) |
1102 | { | 1069 | { |
1103 | string capsBase = "/CAPS/" + caps.CapsObjectPath; | 1070 | string capsBase = "/CAPS/" + caps.CapsObjectPath; |
@@ -1109,7 +1076,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
1109 | return RemoteParcelRequest(request, path, param, agentID, caps); | 1076 | return RemoteParcelRequest(request, path, param, agentID, caps); |
1110 | })); | 1077 | })); |
1111 | } | 1078 | } |
1112 | 1079 | ||
1113 | // we cheat here: As we don't have (and want) a grid-global parcel-store, we can't return the | 1080 | // we cheat here: As we don't have (and want) a grid-global parcel-store, we can't return the |
1114 | // "real" parcelID, because we wouldn't be able to map that to the region the parcel belongs to. | 1081 | // "real" parcelID, because we wouldn't be able to map that to the region the parcel belongs to. |
1115 | // So, we create a "fake" parcelID by using the regionHandle (64 bit), and the local (integer) x | 1082 | // So, we create a "fake" parcelID by using the regionHandle (64 bit), and the local (integer) x |
@@ -1171,11 +1138,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
1171 | { | 1138 | { |
1172 | m_log.ErrorFormat("[LAND] Wrong type in request {0}", request); | 1139 | m_log.ErrorFormat("[LAND] Wrong type in request {0}", request); |
1173 | } | 1140 | } |
1174 | 1141 | ||
1175 | LLSDRemoteParcelResponse response = new LLSDRemoteParcelResponse(); | 1142 | LLSDRemoteParcelResponse response = new LLSDRemoteParcelResponse(); |
1176 | response.parcel_id = parcelID; | 1143 | response.parcel_id = parcelID; |
1177 | m_log.DebugFormat("[LAND] got parcelID {0}", parcelID); | 1144 | m_log.DebugFormat("[LAND] got parcelID {0}", parcelID); |
1178 | 1145 | ||
1179 | return LLSDHelpers.SerialiseLLSDReply(response); | 1146 | return LLSDHelpers.SerialiseLLSDReply(response); |
1180 | } | 1147 | } |
1181 | 1148 | ||
@@ -1191,7 +1158,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
1191 | uint x, y; | 1158 | uint x, y; |
1192 | Util.ParseFakeParcelID(parcelID, out regionHandle, out x, out y); | 1159 | Util.ParseFakeParcelID(parcelID, out regionHandle, out x, out y); |
1193 | m_log.DebugFormat("[LAND] got parcelinfo request for regionHandle {0}, x/y {1}/{2}", regionHandle, x, y); | 1160 | m_log.DebugFormat("[LAND] got parcelinfo request for regionHandle {0}, x/y {1}/{2}", regionHandle, x, y); |
1194 | 1161 | ||
1195 | LandData landData; | 1162 | LandData landData; |
1196 | if (regionHandle == m_scene.RegionInfo.RegionHandle) | 1163 | if (regionHandle == m_scene.RegionInfo.RegionHandle) |
1197 | landData = this.GetLandObject(x, y).landData; | 1164 | landData = this.GetLandObject(x, y).landData; |
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs index 305e236..6388a1c 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs | |||
@@ -116,7 +116,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
116 | return newLand; | 116 | return newLand; |
117 | } | 117 | } |
118 | 118 | ||
119 | 119 | ||
120 | static overrideParcelMaxPrimCountDelegate overrideParcelMaxPrimCount; | 120 | static overrideParcelMaxPrimCountDelegate overrideParcelMaxPrimCount; |
121 | static overrideSimulatorMaxPrimCountDelegate overrideSimulatorMaxPrimCount; | 121 | static overrideSimulatorMaxPrimCountDelegate overrideSimulatorMaxPrimCount; |
122 | 122 | ||
@@ -156,7 +156,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
156 | } | 156 | } |
157 | } | 157 | } |
158 | #endregion | 158 | #endregion |
159 | 159 | ||
160 | #region Packet Request Handling | 160 | #region Packet Request Handling |
161 | 161 | ||
162 | public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client) | 162 | public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client) |
diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs index 7b05027..09f12b2 100644 --- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs | |||
@@ -305,7 +305,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC | |||
305 | 305 | ||
306 | public event RegionHandleRequest OnRegionHandleRequest; | 306 | public event RegionHandleRequest OnRegionHandleRequest; |
307 | public event ParcelInfoRequest OnParcelInfoRequest; | 307 | public event ParcelInfoRequest OnParcelInfoRequest; |
308 | 308 | ||
309 | #pragma warning restore 67 | 309 | #pragma warning restore 67 |
310 | 310 | ||
311 | #endregion | 311 | #endregion |
@@ -368,7 +368,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC | |||
368 | { | 368 | { |
369 | get { return 0; } | 369 | get { return 0; } |
370 | } | 370 | } |
371 | 371 | ||
372 | public ulong GetGroupPowers(LLUUID groupID) | 372 | public ulong GetGroupPowers(LLUUID groupID) |
373 | { | 373 | { |
374 | return 0; | 374 | return 0; |
@@ -820,13 +820,13 @@ namespace OpenSim.Region.Environment.Modules.World.NPC | |||
820 | 820 | ||
821 | 821 | ||
822 | public void SendParcelMediaCommand(uint flags, ParcelMediaCommandEnum command, float time) | 822 | public void SendParcelMediaCommand(uint flags, ParcelMediaCommandEnum command, float time) |
823 | { | 823 | { |
824 | } | 824 | } |
825 | 825 | ||
826 | public void SendParcelMediaUpdate(string mediaUrl, LLUUID mediaTextureID, | 826 | public void SendParcelMediaUpdate(string mediaUrl, LLUUID mediaTextureID, |
827 | byte autoScale, string mediaType, string mediaDesc, int mediaWidth, int mediaHeight, | 827 | byte autoScale, string mediaType, string mediaDesc, int mediaWidth, int mediaHeight, |
828 | byte mediaLoop) | 828 | byte mediaLoop) |
829 | { | 829 | { |
830 | } | 830 | } |
831 | 831 | ||
832 | public void SendSetFollowCamProperties (LLUUID objectID, SortedDictionary<int, float> parameters) | 832 | public void SendSetFollowCamProperties (LLUUID objectID, SortedDictionary<int, float> parameters) |
diff --git a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs index 6107f48..071e3af 100644 --- a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs | |||
@@ -146,7 +146,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions | |||
146 | m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", true); | 146 | m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", true); |
147 | m_RegionOwnerIsGod = myConfig.GetBoolean("region_owner_is_god", true); | 147 | m_RegionOwnerIsGod = myConfig.GetBoolean("region_owner_is_god", true); |
148 | m_ParcelOwnerIsGod = myConfig.GetBoolean("parcel_owner_is_god", true); | 148 | m_ParcelOwnerIsGod = myConfig.GetBoolean("parcel_owner_is_god", true); |
149 | 149 | ||
150 | if (m_bypassPermissions) | 150 | if (m_bypassPermissions) |
151 | m_log.Info("[PERMISSIONS]: serviceside_object_permissions = false in ini file so disabling all region service permission checks"); | 151 | m_log.Info("[PERMISSIONS]: serviceside_object_permissions = false in ini file so disabling all region service permission checks"); |
152 | else | 152 | else |
diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs index 0df19d9..22c9b29 100644 --- a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs +++ b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs | |||
@@ -44,7 +44,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
44 | public class SceneXmlLoader | 44 | public class SceneXmlLoader |
45 | { | 45 | { |
46 | //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 46 | //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
47 | 47 | ||
48 | public static void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, LLVector3 loadOffset) | 48 | public static void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, LLVector3 loadOffset) |
49 | { | 49 | { |
50 | XmlDocument doc = new XmlDocument(); | 50 | XmlDocument doc = new XmlDocument(); |
@@ -114,7 +114,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
114 | doc.Load(reader); | 114 | doc.Load(reader); |
115 | reader.Close(); | 115 | reader.Close(); |
116 | rootNode = doc.FirstChild; | 116 | rootNode = doc.FirstChild; |
117 | 117 | ||
118 | // This is to deal with neighbouring regions that are still surrounding the group xml with the <scene> | 118 | // This is to deal with neighbouring regions that are still surrounding the group xml with the <scene> |
119 | // tag. It should be possible to remove the first part of this if statement once we go past 0.5.9 (or | 119 | // tag. It should be possible to remove the first part of this if statement once we go past 0.5.9 (or |
120 | // when some other changes forces all regions to upgrade). | 120 | // when some other changes forces all regions to upgrade). |
@@ -127,13 +127,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
127 | // There is only ever one prim. This oddity should be removeable post 0.5.9 | 127 | // There is only ever one prim. This oddity should be removeable post 0.5.9 |
128 | return new SceneObjectGroup(aPrimNode.OuterXml); | 128 | return new SceneObjectGroup(aPrimNode.OuterXml); |
129 | } | 129 | } |
130 | 130 | ||
131 | return null; | 131 | return null; |
132 | } | 132 | } |
133 | else | 133 | else |
134 | { | 134 | { |
135 | return new SceneObjectGroup(rootNode.OuterXml); | 135 | return new SceneObjectGroup(rootNode.OuterXml); |
136 | } | 136 | } |
137 | } | 137 | } |
138 | 138 | ||
139 | /// <summary> | 139 | /// <summary> |
@@ -171,7 +171,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
171 | reader.Close(); | 171 | reader.Close(); |
172 | XmlNode rootNode = doc.FirstChild; | 172 | XmlNode rootNode = doc.FirstChild; |
173 | 173 | ||
174 | ICollection<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); | 174 | ICollection<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); |
175 | foreach (XmlNode aPrimNode in rootNode.ChildNodes) | 175 | foreach (XmlNode aPrimNode in rootNode.ChildNodes) |
176 | { | 176 | { |
177 | SceneObjectGroup obj = CreatePrimFromXml2(scene, aPrimNode.OuterXml); | 177 | SceneObjectGroup obj = CreatePrimFromXml2(scene, aPrimNode.OuterXml); |
@@ -195,7 +195,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
195 | { | 195 | { |
196 | SceneObjectGroup obj = new SceneObjectGroup(xmlData); | 196 | SceneObjectGroup obj = new SceneObjectGroup(xmlData); |
197 | 197 | ||
198 | if (scene.AddRestoredSceneObject(obj, true, false)) | 198 | if (scene.AddRestoredSceneObject(obj, true, false)) |
199 | return obj; | 199 | return obj; |
200 | else | 200 | else |
201 | return null; | 201 | return null; |
@@ -254,7 +254,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
254 | if (max.X < pos.X || max.Y < pos.Y || max.Z < pos.Z) | 254 | if (max.X < pos.X || max.Y < pos.Y || max.Z < pos.Z) |
255 | continue; | 255 | continue; |
256 | } | 256 | } |
257 | 257 | ||
258 | stream.WriteLine(g.ToXmlString2()); | 258 | stream.WriteLine(g.ToXmlString2()); |
259 | primCount++; | 259 | primCount++; |
260 | } | 260 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs index 5682de3..9690433 100644 --- a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs | |||
@@ -94,7 +94,7 @@ namespace OpenSim.Region.Environment.Modules | |||
94 | private LLVector3 Position = new LLVector3(0,0,0); | 94 | private LLVector3 Position = new LLVector3(0,0,0); |
95 | private LLVector3 Velocity = new LLVector3(0,0,0); | 95 | private LLVector3 Velocity = new LLVector3(0,0,0); |
96 | private LLQuaternion Tilt = new LLQuaternion(1,0,0,0); | 96 | private LLQuaternion Tilt = new LLQuaternion(1,0,0,0); |
97 | 97 | ||
98 | private long LindenHourOffset = 0; | 98 | private long LindenHourOffset = 0; |
99 | private bool sunFixed = false; | 99 | private bool sunFixed = false; |
100 | 100 | ||
@@ -111,7 +111,7 @@ namespace OpenSim.Region.Environment.Modules | |||
111 | private float GetLindenEstateHourFromCurrentTime() | 111 | private float GetLindenEstateHourFromCurrentTime() |
112 | { | 112 | { |
113 | float ticksleftover = ((float)CurrentTime) % ((float)SecondsPerSunCycle); | 113 | float ticksleftover = ((float)CurrentTime) % ((float)SecondsPerSunCycle); |
114 | 114 | ||
115 | float hour = (24 * (ticksleftover / SecondsPerSunCycle)) + 6; | 115 | float hour = (24 * (ticksleftover / SecondsPerSunCycle)) + 6; |
116 | 116 | ||
117 | return hour; | 117 | return hour; |
@@ -132,7 +132,7 @@ namespace OpenSim.Region.Environment.Modules | |||
132 | float hour = (24 * (ticksleftover / SecondsPerSunCycle)); | 132 | float hour = (24 * (ticksleftover / SecondsPerSunCycle)); |
133 | 133 | ||
134 | float offsethours = 0; | 134 | float offsethours = 0; |
135 | 135 | ||
136 | if (LindenHour - 6 > hour) | 136 | if (LindenHour - 6 > hour) |
137 | { | 137 | { |
138 | offsethours = hour + ((LindenHour-6) - hour); | 138 | offsethours = hour + ((LindenHour-6) - hour); |
@@ -142,7 +142,7 @@ namespace OpenSim.Region.Environment.Modules | |||
142 | offsethours = hour - (hour - (LindenHour - 6)); | 142 | offsethours = hour - (hour - (LindenHour - 6)); |
143 | } | 143 | } |
144 | //m_log.Debug("[OFFSET]: " + hour + " - " + LindenHour + " - " + offsethours.ToString()); | 144 | //m_log.Debug("[OFFSET]: " + hour + " - " + LindenHour + " - " + offsethours.ToString()); |
145 | 145 | ||
146 | LindenHourOffset = (long)((float)offsethours * (36000000000/m_day_length)); | 146 | LindenHourOffset = (long)((float)offsethours * (36000000000/m_day_length)); |
147 | m_log.Info("[SUN]: Directive from the Estate Tools to set the sun phase to LindenHour " + GetLindenEstateHourFromCurrentTime().ToString()); | 147 | m_log.Info("[SUN]: Directive from the Estate Tools to set the sun phase to LindenHour " + GetLindenEstateHourFromCurrentTime().ToString()); |
148 | 148 | ||
@@ -422,7 +422,7 @@ namespace OpenSim.Region.Environment.Modules | |||
422 | } | 422 | } |
423 | } | 423 | } |
424 | } | 424 | } |
425 | 425 | ||
426 | public void EstateToolsTimeUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float LindenHour) | 426 | public void EstateToolsTimeUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float LindenHour) |
427 | { | 427 | { |
428 | if (m_scene.RegionInfo.RegionHandle == regionHandle) | 428 | if (m_scene.RegionInfo.RegionHandle == regionHandle) |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs index 34bbf78..48da96d 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs | |||
@@ -51,7 +51,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
51 | 51 | ||
52 | colours.Save(filename, ImageFormat.Bmp); | 52 | colours.Save(filename, ImageFormat.Bmp); |
53 | } | 53 | } |
54 | 54 | ||
55 | /// <summary> | 55 | /// <summary> |
56 | /// Exports a stream using a System.Drawing exporter. | 56 | /// Exports a stream using a System.Drawing exporter. |
57 | /// </summary> | 57 | /// </summary> |
@@ -62,7 +62,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
62 | Bitmap colours = CreateGrayscaleBitmapFromMap(map); | 62 | Bitmap colours = CreateGrayscaleBitmapFromMap(map); |
63 | 63 | ||
64 | colours.Save(stream, ImageFormat.Png); | 64 | colours.Save(stream, ImageFormat.Png); |
65 | } | 65 | } |
66 | 66 | ||
67 | /// <summary> | 67 | /// <summary> |
68 | /// The human readable version of the file format(s) this loader handles | 68 | /// The human readable version of the file format(s) this loader handles |
@@ -73,4 +73,4 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
73 | return "BMP"; | 73 | return "BMP"; |
74 | } | 74 | } |
75 | } | 75 | } |
76 | } \ No newline at end of file | 76 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs index 0cd9000..accffd2 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs | |||
@@ -40,7 +40,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
40 | 40 | ||
41 | colours.Save(filename, ImageFormat.Gif); | 41 | colours.Save(filename, ImageFormat.Gif); |
42 | } | 42 | } |
43 | 43 | ||
44 | /// <summary> | 44 | /// <summary> |
45 | /// Exports a stream using a System.Drawing exporter. | 45 | /// Exports a stream using a System.Drawing exporter. |
46 | /// </summary> | 46 | /// </summary> |
@@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
51 | Bitmap colours = CreateGrayscaleBitmapFromMap(map); | 51 | Bitmap colours = CreateGrayscaleBitmapFromMap(map); |
52 | 52 | ||
53 | colours.Save(stream, ImageFormat.Gif); | 53 | colours.Save(stream, ImageFormat.Gif); |
54 | } | 54 | } |
55 | 55 | ||
56 | public override string ToString() | 56 | public override string ToString() |
57 | { | 57 | { |
58 | return "GIF"; | 58 | return "GIF"; |
59 | } | 59 | } |
60 | } | 60 | } |
61 | } \ No newline at end of file | 61 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs index 4d213e0..983ad29 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs | |||
@@ -58,19 +58,19 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
58 | /// <returns>A terrain channel generated from the image.</returns> | 58 | /// <returns>A terrain channel generated from the image.</returns> |
59 | public virtual ITerrainChannel LoadFile(string filename) | 59 | public virtual ITerrainChannel LoadFile(string filename) |
60 | { | 60 | { |
61 | return LoadBitmap(new Bitmap(filename)); | 61 | return LoadBitmap(new Bitmap(filename)); |
62 | } | 62 | } |
63 | 63 | ||
64 | public ITerrainChannel LoadFile(string filename, int x, int y, int fileWidth, int fileHeight, int w, int h) | 64 | public ITerrainChannel LoadFile(string filename, int x, int y, int fileWidth, int fileHeight, int w, int h) |
65 | { | 65 | { |
66 | throw new NotImplementedException(); | 66 | throw new NotImplementedException(); |
67 | } | 67 | } |
68 | 68 | ||
69 | public virtual ITerrainChannel LoadStream(Stream stream) | 69 | public virtual ITerrainChannel LoadStream(Stream stream) |
70 | { | 70 | { |
71 | return LoadBitmap(new Bitmap(stream)); | 71 | return LoadBitmap(new Bitmap(stream)); |
72 | } | 72 | } |
73 | 73 | ||
74 | protected virtual ITerrainChannel LoadBitmap(Bitmap bitmap) | 74 | protected virtual ITerrainChannel LoadBitmap(Bitmap bitmap) |
75 | { | 75 | { |
76 | ITerrainChannel retval = new TerrainChannel(bitmap.Width, bitmap.Height); | 76 | ITerrainChannel retval = new TerrainChannel(bitmap.Width, bitmap.Height); |
@@ -85,7 +85,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
85 | } | 85 | } |
86 | } | 86 | } |
87 | 87 | ||
88 | return retval; | 88 | return retval; |
89 | } | 89 | } |
90 | 90 | ||
91 | /// <summary> | 91 | /// <summary> |
@@ -99,7 +99,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
99 | 99 | ||
100 | colours.Save(filename, ImageFormat.Png); | 100 | colours.Save(filename, ImageFormat.Png); |
101 | } | 101 | } |
102 | 102 | ||
103 | /// <summary> | 103 | /// <summary> |
104 | /// Exports a stream using a System.Drawing exporter. | 104 | /// Exports a stream using a System.Drawing exporter. |
105 | /// </summary> | 105 | /// </summary> |
@@ -110,7 +110,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
110 | Bitmap colours = CreateGrayscaleBitmapFromMap(map); | 110 | Bitmap colours = CreateGrayscaleBitmapFromMap(map); |
111 | 111 | ||
112 | colours.Save(stream, ImageFormat.Png); | 112 | colours.Save(stream, ImageFormat.Png); |
113 | } | 113 | } |
114 | 114 | ||
115 | #endregion | 115 | #endregion |
116 | 116 | ||
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs index 9886b81..35576c7 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs | |||
@@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
51 | { | 51 | { |
52 | throw new NotImplementedException(); | 52 | throw new NotImplementedException(); |
53 | } | 53 | } |
54 | 54 | ||
55 | public ITerrainChannel LoadStream(Stream stream) | 55 | public ITerrainChannel LoadStream(Stream stream) |
56 | { | 56 | { |
57 | throw new NotImplementedException(); | 57 | throw new NotImplementedException(); |
58 | } | 58 | } |
59 | 59 | ||
60 | public void SaveFile(string filename, ITerrainChannel map) | 60 | public void SaveFile(string filename, ITerrainChannel map) |
61 | { | 61 | { |
@@ -63,7 +63,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
63 | 63 | ||
64 | colours.Save(filename, ImageFormat.Jpeg); | 64 | colours.Save(filename, ImageFormat.Jpeg); |
65 | } | 65 | } |
66 | 66 | ||
67 | /// <summary> | 67 | /// <summary> |
68 | /// Exports a stream using a System.Drawing exporter. | 68 | /// Exports a stream using a System.Drawing exporter. |
69 | /// </summary> | 69 | /// </summary> |
@@ -74,7 +74,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
74 | Bitmap colours = CreateBitmapFromMap(map); | 74 | Bitmap colours = CreateBitmapFromMap(map); |
75 | 75 | ||
76 | colours.Save(stream, ImageFormat.Jpeg); | 76 | colours.Save(stream, ImageFormat.Jpeg); |
77 | } | 77 | } |
78 | 78 | ||
79 | #endregion | 79 | #endregion |
80 | 80 | ||
@@ -109,4 +109,4 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
109 | return bmp; | 109 | return bmp; |
110 | } | 110 | } |
111 | } | 111 | } |
112 | } \ No newline at end of file | 112 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs index 21fba2b..5f13d01 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs | |||
@@ -74,7 +74,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
74 | FileInfo file = new FileInfo(filename); | 74 | FileInfo file = new FileInfo(filename); |
75 | FileStream s = file.Open(FileMode.Open, FileAccess.Read); | 75 | FileStream s = file.Open(FileMode.Open, FileAccess.Read); |
76 | ITerrainChannel retval = LoadStream(s); | 76 | ITerrainChannel retval = LoadStream(s); |
77 | 77 | ||
78 | s.Close(); | 78 | s.Close(); |
79 | 79 | ||
80 | return retval; | 80 | return retval; |
@@ -113,7 +113,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
113 | // i.e. eat X upto where we start | 113 | // i.e. eat X upto where we start |
114 | while (currFileXOffset < offsetX) | 114 | while (currFileXOffset < offsetX) |
115 | { | 115 | { |
116 | bs.ReadBytes(sectionWidth * 13); | 116 | bs.ReadBytes(sectionWidth * 13); |
117 | currFileXOffset++; | 117 | currFileXOffset++; |
118 | } | 118 | } |
119 | 119 | ||
@@ -143,11 +143,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
143 | 143 | ||
144 | return retval; | 144 | return retval; |
145 | } | 145 | } |
146 | 146 | ||
147 | public ITerrainChannel LoadStream(Stream s) | 147 | public ITerrainChannel LoadStream(Stream s) |
148 | { | 148 | { |
149 | TerrainChannel retval = new TerrainChannel(); | 149 | TerrainChannel retval = new TerrainChannel(); |
150 | 150 | ||
151 | BinaryReader bs = new BinaryReader(s); | 151 | BinaryReader bs = new BinaryReader(s); |
152 | int y; | 152 | int y; |
153 | for (y = 0; y < retval.Height; y++) | 153 | for (y = 0; y < retval.Height; y++) |
@@ -160,8 +160,8 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
160 | } | 160 | } |
161 | } | 161 | } |
162 | 162 | ||
163 | bs.Close(); | 163 | bs.Close(); |
164 | 164 | ||
165 | return retval; | 165 | return retval; |
166 | } | 166 | } |
167 | 167 | ||
@@ -173,7 +173,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
173 | 173 | ||
174 | s.Close(); | 174 | s.Close(); |
175 | } | 175 | } |
176 | 176 | ||
177 | public void SaveStream(Stream s, ITerrainChannel map) | 177 | public void SaveStream(Stream s, ITerrainChannel map) |
178 | { | 178 | { |
179 | BinaryWriter binStream = new BinaryWriter(s); | 179 | BinaryWriter binStream = new BinaryWriter(s); |
@@ -224,9 +224,9 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
224 | } | 224 | } |
225 | } | 225 | } |
226 | 226 | ||
227 | binStream.Close(); | 227 | binStream.Close(); |
228 | } | 228 | } |
229 | 229 | ||
230 | public string FileExtension | 230 | public string FileExtension |
231 | { | 231 | { |
232 | get { return ".raw"; } | 232 | get { return ".raw"; } |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/PNG.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/PNG.cs index cf95486..19e181e 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/PNG.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/PNG.cs | |||
@@ -40,7 +40,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
40 | 40 | ||
41 | colours.Save(filename, ImageFormat.Png); | 41 | colours.Save(filename, ImageFormat.Png); |
42 | } | 42 | } |
43 | 43 | ||
44 | /// <summary> | 44 | /// <summary> |
45 | /// Exports a stream using a System.Drawing exporter. | 45 | /// Exports a stream using a System.Drawing exporter. |
46 | /// </summary> | 46 | /// </summary> |
@@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
51 | Bitmap colours = CreateGrayscaleBitmapFromMap(map); | 51 | Bitmap colours = CreateGrayscaleBitmapFromMap(map); |
52 | 52 | ||
53 | colours.Save(stream, ImageFormat.Png); | 53 | colours.Save(stream, ImageFormat.Png); |
54 | } | 54 | } |
55 | 55 | ||
56 | public override string ToString() | 56 | public override string ToString() |
57 | { | 57 | { |
58 | return "PNG"; | 58 | return "PNG"; |
59 | } | 59 | } |
60 | } | 60 | } |
61 | } \ No newline at end of file | 61 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs index bb8b0f7..758821a 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs | |||
@@ -112,11 +112,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
112 | 112 | ||
113 | return retval; | 113 | return retval; |
114 | } | 114 | } |
115 | 115 | ||
116 | public ITerrainChannel LoadStream(Stream s) | 116 | public ITerrainChannel LoadStream(Stream s) |
117 | { | 117 | { |
118 | TerrainChannel retval = new TerrainChannel(); | 118 | TerrainChannel retval = new TerrainChannel(); |
119 | 119 | ||
120 | BinaryReader bs = new BinaryReader(s); | 120 | BinaryReader bs = new BinaryReader(s); |
121 | int y; | 121 | int y; |
122 | for (y = 0; y < retval.Height; y++) | 122 | for (y = 0; y < retval.Height; y++) |
@@ -129,10 +129,10 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
129 | } | 129 | } |
130 | 130 | ||
131 | bs.Close(); | 131 | bs.Close(); |
132 | 132 | ||
133 | return retval; | 133 | return retval; |
134 | } | 134 | } |
135 | 135 | ||
136 | public void SaveFile(string filename, ITerrainChannel map) | 136 | public void SaveFile(string filename, ITerrainChannel map) |
137 | { | 137 | { |
138 | FileInfo file = new FileInfo(filename); | 138 | FileInfo file = new FileInfo(filename); |
@@ -141,7 +141,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
141 | 141 | ||
142 | s.Close(); | 142 | s.Close(); |
143 | } | 143 | } |
144 | 144 | ||
145 | public void SaveStream(Stream s, ITerrainChannel map) | 145 | public void SaveStream(Stream s, ITerrainChannel map) |
146 | { | 146 | { |
147 | BinaryWriter bs = new BinaryWriter(s); | 147 | BinaryWriter bs = new BinaryWriter(s); |
@@ -156,7 +156,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
156 | } | 156 | } |
157 | } | 157 | } |
158 | 158 | ||
159 | bs.Close(); | 159 | bs.Close(); |
160 | } | 160 | } |
161 | 161 | ||
162 | #endregion | 162 | #endregion |
@@ -166,4 +166,4 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
166 | return "RAW32"; | 166 | return "RAW32"; |
167 | } | 167 | } |
168 | } | 168 | } |
169 | } \ No newline at end of file | 169 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/TIFF.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/TIFF.cs index 3f98f40..95b43b0 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/TIFF.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/TIFF.cs | |||
@@ -40,7 +40,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
40 | 40 | ||
41 | colours.Save(filename, ImageFormat.Tiff); | 41 | colours.Save(filename, ImageFormat.Tiff); |
42 | } | 42 | } |
43 | 43 | ||
44 | /// <summary> | 44 | /// <summary> |
45 | /// Exports a stream using a System.Drawing exporter. | 45 | /// Exports a stream using a System.Drawing exporter. |
46 | /// </summary> | 46 | /// </summary> |
@@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
51 | Bitmap colours = CreateGrayscaleBitmapFromMap(map); | 51 | Bitmap colours = CreateGrayscaleBitmapFromMap(map); |
52 | 52 | ||
53 | colours.Save(stream, ImageFormat.Tiff); | 53 | colours.Save(stream, ImageFormat.Tiff); |
54 | } | 54 | } |
55 | 55 | ||
56 | public override string ToString() | 56 | public override string ToString() |
57 | { | 57 | { |
58 | return "TIFF"; | 58 | return "TIFF"; |
59 | } | 59 | } |
60 | } | 60 | } |
61 | } \ No newline at end of file | 61 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs index 5dc2aa5..2bf029e 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs | |||
@@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
51 | 51 | ||
52 | return retval; | 52 | return retval; |
53 | } | 53 | } |
54 | 54 | ||
55 | public ITerrainChannel LoadStream(Stream s) | 55 | public ITerrainChannel LoadStream(Stream s) |
56 | { | 56 | { |
57 | TerrainChannel retval = new TerrainChannel(); | 57 | TerrainChannel retval = new TerrainChannel(); |
58 | 58 | ||
59 | BinaryReader bs = new BinaryReader(s); | 59 | BinaryReader bs = new BinaryReader(s); |
60 | 60 | ||
61 | bool eof = false; | 61 | bool eof = false; |
@@ -107,7 +107,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
107 | } | 107 | } |
108 | 108 | ||
109 | bs.Close(); | 109 | bs.Close(); |
110 | 110 | ||
111 | return retval; | 111 | return retval; |
112 | } | 112 | } |
113 | 113 | ||
@@ -115,7 +115,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
115 | { | 115 | { |
116 | throw new NotImplementedException(); | 116 | throw new NotImplementedException(); |
117 | } | 117 | } |
118 | 118 | ||
119 | public void SaveStream(Stream stream, ITerrainChannel map) | 119 | public void SaveStream(Stream stream, ITerrainChannel map) |
120 | { | 120 | { |
121 | throw new NotImplementedException(); | 121 | throw new NotImplementedException(); |
@@ -138,4 +138,4 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
138 | return "Terragen"; | 138 | return "Terragen"; |
139 | } | 139 | } |
140 | } | 140 | } |
141 | } \ No newline at end of file | 141 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/ITerrainModule.cs b/OpenSim/Region/Environment/Modules/World/Terrain/ITerrainModule.cs index e255515..beeff03 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/ITerrainModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/ITerrainModule.cs | |||
@@ -33,7 +33,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
33 | { | 33 | { |
34 | void LoadFromFile(string filename); | 34 | void LoadFromFile(string filename); |
35 | void SaveToFile(string filename); | 35 | void SaveToFile(string filename); |
36 | 36 | ||
37 | /// <summary> | 37 | /// <summary> |
38 | /// Load a terrain from a stream. | 38 | /// Load a terrain from a stream. |
39 | /// </summary> | 39 | /// </summary> |
@@ -42,7 +42,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
42 | /// </param> | 42 | /// </param> |
43 | /// <param name="stream"></param> | 43 | /// <param name="stream"></param> |
44 | void LoadFromStream(string filename, Stream stream); | 44 | void LoadFromStream(string filename, Stream stream); |
45 | 45 | ||
46 | /// <summary> | 46 | /// <summary> |
47 | /// Save a terrain to a stream. | 47 | /// Save a terrain to a stream. |
48 | /// </summary> | 48 | /// </summary> |
@@ -51,7 +51,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
51 | /// </param> | 51 | /// </param> |
52 | /// <param name="stream"></param> | 52 | /// <param name="stream"></param> |
53 | void SaveToStream(string filename, Stream stream); | 53 | void SaveToStream(string filename, Stream stream); |
54 | 54 | ||
55 | void InstallPlugin(string name, ITerrainEffect plug); | 55 | void InstallPlugin(string name, ITerrainEffect plug); |
56 | } | 56 | } |
57 | } | 57 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs index 8fbc62e..4a62446 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs | |||
@@ -221,7 +221,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
221 | throw new TerrainException(String.Format("Unable to save heightmap: saving of this file format not implemented")); | 221 | throw new TerrainException(String.Format("Unable to save heightmap: saving of this file format not implemented")); |
222 | } | 222 | } |
223 | } | 223 | } |
224 | 224 | ||
225 | /// <summary> | 225 | /// <summary> |
226 | /// Loads a terrain file from a stream and installs it in the scene. | 226 | /// Loads a terrain file from a stream and installs it in the scene. |
227 | /// </summary> | 227 | /// </summary> |
@@ -281,7 +281,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
281 | m_log.Error("Unable to save to " + filename + ", saving of this file format has not been implemented."); | 281 | m_log.Error("Unable to save to " + filename + ", saving of this file format has not been implemented."); |
282 | throw new TerrainException(String.Format("Unable to save heightmap: saving of this file format not implemented")); | 282 | throw new TerrainException(String.Format("Unable to save heightmap: saving of this file format not implemented")); |
283 | } | 283 | } |
284 | } | 284 | } |
285 | 285 | ||
286 | #region Plugin Loading Methods | 286 | #region Plugin Loading Methods |
287 | 287 | ||
@@ -450,7 +450,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
450 | m_tainted = false; | 450 | m_tainted = false; |
451 | m_scene.PhysicsScene.SetTerrain(m_channel.GetFloatsSerialised()); | 451 | m_scene.PhysicsScene.SetTerrain(m_channel.GetFloatsSerialised()); |
452 | m_scene.SaveTerrain(); | 452 | m_scene.SaveTerrain(); |
453 | 453 | ||
454 | // Clients who look at the map will never see changes after they looked at the map, so i've commented this out. | 454 | // Clients who look at the map will never see changes after they looked at the map, so i've commented this out. |
455 | //m_scene.CreateTerrainTexture(true); | 455 | //m_scene.CreateTerrainTexture(true); |
456 | } | 456 | } |
@@ -517,11 +517,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
517 | // fixup and height deltas that don't respect them | 517 | // fixup and height deltas that don't respect them |
518 | if (respectEstateSettings && LimitChannelChanges(x, y)) | 518 | if (respectEstateSettings && LimitChannelChanges(x, y)) |
519 | { | 519 | { |
520 | // this has been vetoed, so update | 520 | // this has been vetoed, so update |
521 | // what we are going to send to the client | 521 | // what we are going to send to the client |
522 | serialised = m_channel.GetFloatsSerialised(); | 522 | serialised = m_channel.GetFloatsSerialised(); |
523 | } | 523 | } |
524 | 524 | ||
525 | SendToClients(serialised, x, y); | 525 | SendToClients(serialised, x, y); |
526 | shouldTaint = true; | 526 | shouldTaint = true; |
527 | } | 527 | } |
@@ -580,9 +580,9 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
580 | private void SendToClients(float[] serialised, int x, int y) | 580 | private void SendToClients(float[] serialised, int x, int y) |
581 | { | 581 | { |
582 | m_scene.ForEachClient( | 582 | m_scene.ForEachClient( |
583 | delegate(IClientAPI controller) | 583 | delegate(IClientAPI controller) |
584 | { controller.SendLayerData( | 584 | { controller.SendLayerData( |
585 | x / Constants.TerrainPatchSize, y / Constants.TerrainPatchSize, serialised); | 585 | x / Constants.TerrainPatchSize, y / Constants.TerrainPatchSize, serialised); |
586 | } | 586 | } |
587 | ); | 587 | ); |
588 | } | 588 | } |
@@ -647,7 +647,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
647 | { | 647 | { |
648 | // Not a good permissions check (see client_OnModifyTerrain above), need to check the entire area. | 648 | // Not a good permissions check (see client_OnModifyTerrain above), need to check the entire area. |
649 | // for now check a point in the centre of the region | 649 | // for now check a point in the centre of the region |
650 | 650 | ||
651 | if (m_scene.ExternalChecks.ExternalChecksCanTerraformLand(remoteClient.AgentId, new LLVector3(127, 127, 0))) | 651 | if (m_scene.ExternalChecks.ExternalChecksCanTerraformLand(remoteClient.AgentId, new LLVector3(127, 127, 0))) |
652 | { | 652 | { |
653 | InterfaceBakeTerrain(null); //bake terrain does not use the passed in parameter | 653 | InterfaceBakeTerrain(null); //bake terrain does not use the passed in parameter |
diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs index a331d37..9b8dc75 100644 --- a/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs +++ b/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs | |||
@@ -162,7 +162,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
162 | { | 162 | { |
163 | int tc = System.Environment.TickCount; | 163 | int tc = System.Environment.TickCount; |
164 | m_log.Info("[MAPTILE]: Generating Maptile Step 1: Terrain"); | 164 | m_log.Info("[MAPTILE]: Generating Maptile Step 1: Terrain"); |
165 | 165 | ||
166 | double[,] hm = whichScene.Heightmap.GetDoubles(); | 166 | double[,] hm = whichScene.Heightmap.GetDoubles(); |
167 | bool ShadowDebugContinue = true; | 167 | bool ShadowDebugContinue = true; |
168 | //Color prim = Color.FromArgb(120, 120, 120); | 168 | //Color prim = Color.FromArgb(120, 120, 120); |
@@ -247,7 +247,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
247 | //X | 247 | //X |
248 | // . | 248 | // . |
249 | // | 249 | // |
250 | // Shade the terrain for shadows | 250 | // Shade the terrain for shadows |
251 | if ((x - 1 > 0) && (y - 1 > 0)) | 251 | if ((x - 1 > 0) && (y - 1 > 0)) |
252 | { | 252 | { |
253 | hfvalue = (float)hm[x, y]; | 253 | hfvalue = (float)hm[x, y]; |
@@ -268,7 +268,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
268 | else if (hfdiff < -0.3f) | 268 | else if (hfdiff < -0.3f) |
269 | { | 269 | { |
270 | // We have to desaturate and blacken the land at the same time | 270 | // We have to desaturate and blacken the land at the same time |
271 | // we use floats, colors use bytes, so shrink are space down to | 271 | // we use floats, colors use bytes, so shrink are space down to |
272 | // 0-255 | 272 | // 0-255 |
273 | 273 | ||
274 | 274 | ||
@@ -368,8 +368,8 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
368 | 368 | ||
369 | return mapbmp; | 369 | return mapbmp; |
370 | } | 370 | } |
371 | 371 | ||
372 | 372 | ||
373 | private Bitmap DrawObjectVolume(Scene whichScene, Bitmap mapbmp) | 373 | private Bitmap DrawObjectVolume(Scene whichScene, Bitmap mapbmp) |
374 | { | 374 | { |
375 | int tc = 0; | 375 | int tc = 0; |
@@ -570,4 +570,4 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
570 | } | 570 | } |
571 | #endregion | 571 | #endregion |
572 | } | 572 | } |
573 | } \ No newline at end of file | 573 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs index 2a7af87..2430822 100644 --- a/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs | |||
@@ -54,13 +54,13 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
54 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 54 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
55 | 55 | ||
56 | private static readonly string m_mapLayerPath = "0001/"; | 56 | private static readonly string m_mapLayerPath = "0001/"; |
57 | 57 | ||
58 | //private IConfig m_config; | 58 | //private IConfig m_config; |
59 | private Scene m_scene; | 59 | private Scene m_scene; |
60 | private List<MapBlockData> cachedMapBlocks = new List<MapBlockData>(); | 60 | private List<MapBlockData> cachedMapBlocks = new List<MapBlockData>(); |
61 | private int cachedTime = 0; | 61 | private int cachedTime = 0; |
62 | private byte[] myMapImageJPEG; | 62 | private byte[] myMapImageJPEG; |
63 | 63 | ||
64 | //private int CacheRegionsDistance = 256; | 64 | //private int CacheRegionsDistance = 256; |
65 | 65 | ||
66 | #region IRegionModule Members | 66 | #region IRegionModule Members |
@@ -85,7 +85,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
85 | } | 85 | } |
86 | public void PostInitialise() | 86 | public void PostInitialise() |
87 | { | 87 | { |
88 | 88 | ||
89 | } | 89 | } |
90 | 90 | ||
91 | public void Close() | 91 | public void Close() |
@@ -102,10 +102,6 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
102 | } | 102 | } |
103 | 103 | ||
104 | #endregion | 104 | #endregion |
105 | |||
106 | |||
107 | |||
108 | |||
109 | 105 | ||
110 | public void OnRegisterCaps(LLUUID agentID, Caps caps) | 106 | public void OnRegisterCaps(LLUUID agentID, Caps caps) |
111 | { | 107 | { |
@@ -117,9 +113,8 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
117 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 113 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) |
118 | { | 114 | { |
119 | return MapLayerRequest(request, path, param, | 115 | return MapLayerRequest(request, path, param, |
120 | agentID, caps); | 116 | agentID, caps); |
121 | })); | 117 | })); |
122 | |||
123 | } | 118 | } |
124 | 119 | ||
125 | /// <summary> | 120 | /// <summary> |
@@ -138,12 +133,12 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
138 | //{ | 133 | //{ |
139 | //m_log.DebugFormat("[MAPLAYER]: request: {0}, path: {1}, param: {2}, agent:{3}", | 134 | //m_log.DebugFormat("[MAPLAYER]: request: {0}, path: {1}, param: {2}, agent:{3}", |
140 | //request, path, param,agentID.ToString()); | 135 | //request, path, param,agentID.ToString()); |
141 | 136 | ||
142 | // this is here because CAPS map requests work even beyond the 10,000 limit. | 137 | // this is here because CAPS map requests work even beyond the 10,000 limit. |
143 | ScenePresence avatarPresence = null; | 138 | ScenePresence avatarPresence = null; |
144 | 139 | ||
145 | m_scene.TryGetAvatar(agentID, out avatarPresence); | 140 | m_scene.TryGetAvatar(agentID, out avatarPresence); |
146 | 141 | ||
147 | if (avatarPresence != null) | 142 | if (avatarPresence != null) |
148 | { | 143 | { |
149 | bool lookup = false; | 144 | bool lookup = false; |
@@ -168,7 +163,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
168 | 163 | ||
169 | mapBlocks = m_scene.SceneGridService.RequestNeighbourMapBlocks((int)m_scene.RegionInfo.RegionLocX - 8, (int)m_scene.RegionInfo.RegionLocY - 8, (int)m_scene.RegionInfo.RegionLocX + 8, (int)m_scene.RegionInfo.RegionLocY + 8); | 164 | mapBlocks = m_scene.SceneGridService.RequestNeighbourMapBlocks((int)m_scene.RegionInfo.RegionLocX - 8, (int)m_scene.RegionInfo.RegionLocY - 8, (int)m_scene.RegionInfo.RegionLocX + 8, (int)m_scene.RegionInfo.RegionLocY + 8); |
170 | avatarPresence.ControllingClient.SendMapBlock(mapBlocks,0); | 165 | avatarPresence.ControllingClient.SendMapBlock(mapBlocks,0); |
171 | 166 | ||
172 | lock (cachedMapBlocks) | 167 | lock (cachedMapBlocks) |
173 | cachedMapBlocks = mapBlocks; | 168 | cachedMapBlocks = mapBlocks; |
174 | 169 | ||
@@ -262,18 +257,16 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
262 | MemoryStream imgstream = new MemoryStream(); | 257 | MemoryStream imgstream = new MemoryStream(); |
263 | Bitmap mapTexture = new Bitmap(1,1); | 258 | Bitmap mapTexture = new Bitmap(1,1); |
264 | System.Drawing.Image image = (System.Drawing.Image)mapTexture; | 259 | System.Drawing.Image image = (System.Drawing.Image)mapTexture; |
265 | 260 | ||
266 | |||
267 | try | 261 | try |
268 | { | 262 | { |
269 | // Taking our jpeg2000 data, decoding it, then saving it to a byte array with regular jpeg data | 263 | // Taking our jpeg2000 data, decoding it, then saving it to a byte array with regular jpeg data |
270 | 264 | ||
271 | |||
272 | imgstream = new MemoryStream(); | 265 | imgstream = new MemoryStream(); |
273 | 266 | ||
274 | // non-async because we know we have the asset immediately. | 267 | // non-async because we know we have the asset immediately. |
275 | AssetBase mapasset = m_scene.AssetCache.GetAsset(m_scene.RegionInfo.lastMapUUID, true); | 268 | AssetBase mapasset = m_scene.AssetCache.GetAsset(m_scene.RegionInfo.lastMapUUID, true); |
276 | 269 | ||
277 | // Decode image to System.Drawing.Image | 270 | // Decode image to System.Drawing.Image |
278 | image = OpenJPEG.DecodeToImage(mapasset.Data); | 271 | image = OpenJPEG.DecodeToImage(mapasset.Data); |
279 | 272 | ||
@@ -293,7 +286,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
293 | 286 | ||
294 | myEncoderParameter = new EncoderParameter(myEncoder, 95L); | 287 | myEncoderParameter = new EncoderParameter(myEncoder, 95L); |
295 | myEncoderParameters.Param[0] = myEncoderParameter; | 288 | myEncoderParameters.Param[0] = myEncoderParameter; |
296 | 289 | ||
297 | // Save bitmap to stream | 290 | // Save bitmap to stream |
298 | mapTexture.Save(imgstream, myImageCodecInfo, myEncoderParameters); | 291 | mapTexture.Save(imgstream, myImageCodecInfo, myEncoderParameters); |
299 | 292 | ||
@@ -332,16 +325,14 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
332 | // From msdn | 325 | // From msdn |
333 | private static ImageCodecInfo GetEncoderInfo(String mimeType) | 326 | private static ImageCodecInfo GetEncoderInfo(String mimeType) |
334 | { | 327 | { |
335 | int j; | ||
336 | ImageCodecInfo[] encoders; | 328 | ImageCodecInfo[] encoders; |
337 | encoders = ImageCodecInfo.GetImageEncoders(); | 329 | encoders = ImageCodecInfo.GetImageEncoders(); |
338 | for (j = 0; j < encoders.Length; ++j) | 330 | for (int j = 0; j < encoders.Length; ++j) |
339 | { | 331 | { |
340 | if (encoders[j].MimeType == mimeType) | 332 | if (encoders[j].MimeType == mimeType) |
341 | return encoders[j]; | 333 | return encoders[j]; |
342 | } | 334 | } |
343 | return null; | 335 | return null; |
344 | } | 336 | } |
345 | |||
346 | } | 337 | } |
347 | } | 338 | } |
diff --git a/OpenSim/Region/Environment/Scenes/EntityBase.cs b/OpenSim/Region/Environment/Scenes/EntityBase.cs index bc3e06c..40caabc 100644 --- a/OpenSim/Region/Environment/Scenes/EntityBase.cs +++ b/OpenSim/Region/Environment/Scenes/EntityBase.cs | |||
@@ -63,7 +63,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
63 | get { return m_name; } | 63 | get { return m_name; } |
64 | set { m_name = value; } | 64 | set { m_name = value; } |
65 | } | 65 | } |
66 | 66 | ||
67 | /// <summary> | 67 | /// <summary> |
68 | /// Signals whether this group was in a scene but has since been deleted from it. | 68 | /// Signals whether this group was in a scene but has since been deleted from it. |
69 | /// </summary> | 69 | /// </summary> |
@@ -71,7 +71,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
71 | { | 71 | { |
72 | get { return m_isDeleted; } | 72 | get { return m_isDeleted; } |
73 | } | 73 | } |
74 | protected bool m_isDeleted; | 74 | protected bool m_isDeleted; |
75 | 75 | ||
76 | protected LLVector3 m_pos; | 76 | protected LLVector3 m_pos; |
77 | 77 | ||
diff --git a/OpenSim/Region/Environment/Scenes/EventManager.cs b/OpenSim/Region/Environment/Scenes/EventManager.cs index 2b1adee..1dd2273 100644 --- a/OpenSim/Region/Environment/Scenes/EventManager.cs +++ b/OpenSim/Region/Environment/Scenes/EventManager.cs | |||
@@ -131,13 +131,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
131 | 131 | ||
132 | public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel; | 132 | public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel; |
133 | 133 | ||
134 | |||
135 | public delegate void SignificantClientMovement(IClientAPI remote_client); | 134 | public delegate void SignificantClientMovement(IClientAPI remote_client); |
136 | 135 | ||
137 | public event SignificantClientMovement OnSignificantClientMovement; | 136 | public event SignificantClientMovement OnSignificantClientMovement; |
138 | 137 | ||
139 | |||
140 | |||
141 | public delegate void NewGridInstantMessage(GridInstantMessage message); | 138 | public delegate void NewGridInstantMessage(GridInstantMessage message); |
142 | 139 | ||
143 | public event NewGridInstantMessage OnGridInstantMessageToIMModule; | 140 | public event NewGridInstantMessage OnGridInstantMessageToIMModule; |
@@ -163,7 +160,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
163 | public event ScriptAtTargetEvent OnScriptAtTargetEvent; | 160 | public event ScriptAtTargetEvent OnScriptAtTargetEvent; |
164 | 161 | ||
165 | public delegate void ScriptNotAtTargetEvent(uint localID); | 162 | public delegate void ScriptNotAtTargetEvent(uint localID); |
166 | 163 | ||
167 | public event ScriptNotAtTargetEvent OnScriptNotAtTargetEvent; | 164 | public event ScriptNotAtTargetEvent OnScriptNotAtTargetEvent; |
168 | 165 | ||
169 | public delegate void ScriptColliding(uint localID, ColliderArgs colliders); | 166 | public delegate void ScriptColliding(uint localID, ColliderArgs colliders); |
@@ -172,8 +169,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
172 | public event ScriptColliding OnScriptColliding; | 169 | public event ScriptColliding OnScriptColliding; |
173 | public event ScriptColliding OnScriptCollidingEnd; | 170 | public event ScriptColliding OnScriptCollidingEnd; |
174 | 171 | ||
175 | |||
176 | |||
177 | public delegate void OnMakeChildAgentDelegate(ScenePresence presence); | 172 | public delegate void OnMakeChildAgentDelegate(ScenePresence presence); |
178 | public event OnMakeChildAgentDelegate OnMakeChildAgent; | 173 | public event OnMakeChildAgentDelegate OnMakeChildAgent; |
179 | 174 | ||
@@ -289,7 +284,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
289 | public int transactionID = 0; | 284 | public int transactionID = 0; |
290 | public int amountDebited = 0; | 285 | public int amountDebited = 0; |
291 | 286 | ||
292 | |||
293 | public LandBuyArgs(LLUUID pagentId, LLUUID pgroupId, bool pfinal, bool pgroupOwned, | 287 | public LandBuyArgs(LLUUID pagentId, LLUUID pgroupId, bool pfinal, bool pgroupOwned, |
294 | bool premoveContribution, int pparcelLocalID, int pparcelArea, int pparcelPrice, | 288 | bool premoveContribution, int pparcelLocalID, int pparcelArea, int pparcelPrice, |
295 | bool pauthenticated) | 289 | bool pauthenticated) |
@@ -306,8 +300,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
306 | } | 300 | } |
307 | } | 301 | } |
308 | 302 | ||
309 | |||
310 | |||
311 | public delegate void MoneyTransferEvent(Object sender, MoneyTransferArgs e); | 303 | public delegate void MoneyTransferEvent(Object sender, MoneyTransferArgs e); |
312 | 304 | ||
313 | public delegate void LandBuy(Object sender, LandBuyArgs e); | 305 | public delegate void LandBuy(Object sender, LandBuyArgs e); |
@@ -377,7 +369,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
377 | private ScriptColliding handlerColliding = null; | 369 | private ScriptColliding handlerColliding = null; |
378 | private ScriptColliding handlerCollidingEnd = null; | 370 | private ScriptColliding handlerCollidingEnd = null; |
379 | 371 | ||
380 | |||
381 | private SunLindenHour handlerSunGetLindenHour = null; | 372 | private SunLindenHour handlerSunGetLindenHour = null; |
382 | 373 | ||
383 | public void TriggerOnScriptChangedEvent(uint localID, uint change) | 374 | public void TriggerOnScriptChangedEvent(uint localID, uint change) |
@@ -491,7 +482,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
491 | if (handlerObjectBeingRemovedFromScene != null) | 482 | if (handlerObjectBeingRemovedFromScene != null) |
492 | { | 483 | { |
493 | handlerObjectBeingRemovedFromScene(obj); | 484 | handlerObjectBeingRemovedFromScene(obj); |
494 | |||
495 | } | 485 | } |
496 | } | 486 | } |
497 | 487 | ||
@@ -641,7 +631,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
641 | { | 631 | { |
642 | handlerGridInstantMessageToFriends(message); | 632 | handlerGridInstantMessageToFriends(message); |
643 | } | 633 | } |
644 | |||
645 | } | 634 | } |
646 | } | 635 | } |
647 | 636 | ||
@@ -698,7 +687,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
698 | handlerNewInventoryItemUpdateComplete(agentID, AssetID, AssetName, userlevel); | 687 | handlerNewInventoryItemUpdateComplete(agentID, AssetID, AssetName, userlevel); |
699 | } | 688 | } |
700 | } | 689 | } |
701 | public void TriggerLandBuy (Object sender, LandBuyArgs e) | 690 | |
691 | public void TriggerLandBuy(Object sender, LandBuyArgs e) | ||
702 | { | 692 | { |
703 | handlerLandBuy = OnLandBuy; | 693 | handlerLandBuy = OnLandBuy; |
704 | if (handlerLandBuy != null) | 694 | if (handlerLandBuy != null) |
@@ -706,6 +696,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
706 | handlerLandBuy(sender, e); | 696 | handlerLandBuy(sender, e); |
707 | } | 697 | } |
708 | } | 698 | } |
699 | |||
709 | public void TriggerValidateLandBuy(Object sender, LandBuyArgs e) | 700 | public void TriggerValidateLandBuy(Object sender, LandBuyArgs e) |
710 | { | 701 | { |
711 | handlerValidateLandBuy = OnValidateLandBuy; | 702 | handlerValidateLandBuy = OnValidateLandBuy; |
@@ -741,6 +732,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
741 | handlerRequestChangeWaterHeight(height); | 732 | handlerRequestChangeWaterHeight(height); |
742 | } | 733 | } |
743 | } | 734 | } |
735 | |||
744 | public void TriggerAvatarKill(uint KillerObjectLocalID, ScenePresence DeadAvatar) | 736 | public void TriggerAvatarKill(uint KillerObjectLocalID, ScenePresence DeadAvatar) |
745 | { | 737 | { |
746 | handlerAvatarKill = OnAvatarKilled; | 738 | handlerAvatarKill = OnAvatarKilled; |
@@ -756,7 +748,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
756 | if (handlerSignificantClientMovement != null) | 748 | if (handlerSignificantClientMovement != null) |
757 | { | 749 | { |
758 | handlerSignificantClientMovement(client); | 750 | handlerSignificantClientMovement(client); |
759 | |||
760 | } | 751 | } |
761 | } | 752 | } |
762 | 753 | ||
@@ -787,7 +778,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
787 | } | 778 | } |
788 | } | 779 | } |
789 | 780 | ||
790 | |||
791 | public void TriggerNoticeNoLandDataFromStorage() | 781 | public void TriggerNoticeNoLandDataFromStorage() |
792 | { | 782 | { |
793 | handlerNoticeNoLandDataFromStorage = OnNoticeNoLandDataFromStorage; | 783 | handlerNoticeNoLandDataFromStorage = OnNoticeNoLandDataFromStorage; |
@@ -818,26 +808,24 @@ namespace OpenSim.Region.Environment.Scenes | |||
818 | } | 808 | } |
819 | } | 809 | } |
820 | 810 | ||
821 | |||
822 | |||
823 | public void TriggerRequestParcelPrimCountUpdate() | 811 | public void TriggerRequestParcelPrimCountUpdate() |
824 | { | 812 | { |
825 | handlerRequestParcelPrimCountUpdate = OnRequestParcelPrimCountUpdate; | 813 | handlerRequestParcelPrimCountUpdate = OnRequestParcelPrimCountUpdate; |
826 | if (handlerRequestParcelPrimCountUpdate != null) | 814 | if (handlerRequestParcelPrimCountUpdate != null) |
827 | { | 815 | { |
828 | handlerRequestParcelPrimCountUpdate(); | 816 | handlerRequestParcelPrimCountUpdate(); |
829 | |||
830 | } | 817 | } |
831 | } | 818 | } |
819 | |||
832 | public void TriggerParcelPrimCountTainted() | 820 | public void TriggerParcelPrimCountTainted() |
833 | { | 821 | { |
834 | handlerParcelPrimCountTainted = OnParcelPrimCountTainted; | 822 | handlerParcelPrimCountTainted = OnParcelPrimCountTainted; |
835 | if (handlerParcelPrimCountTainted != null) | 823 | if (handlerParcelPrimCountTainted != null) |
836 | { | 824 | { |
837 | handlerParcelPrimCountTainted(); | 825 | handlerParcelPrimCountTainted(); |
838 | |||
839 | } | 826 | } |
840 | } | 827 | } |
828 | |||
841 | // this lets us keep track of nasty script events like timer, etc. | 829 | // this lets us keep track of nasty script events like timer, etc. |
842 | public void TriggerTimerEvent(uint objLocalID, double Interval) | 830 | public void TriggerTimerEvent(uint objLocalID, double Interval) |
843 | { | 831 | { |
@@ -845,9 +833,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
845 | if (handlerScriptTimerEvent != null) | 833 | if (handlerScriptTimerEvent != null) |
846 | { | 834 | { |
847 | handlerScriptTimerEvent(objLocalID, Interval); | 835 | handlerScriptTimerEvent(objLocalID, Interval); |
848 | |||
849 | } | 836 | } |
850 | |||
851 | } | 837 | } |
852 | 838 | ||
853 | public void TriggerEstateToolsTimeUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float LindenHour) | 839 | public void TriggerEstateToolsTimeUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float LindenHour) |
@@ -875,19 +861,19 @@ namespace OpenSim.Region.Environment.Scenes | |||
875 | if (handlerCollidingStart != null) | 861 | if (handlerCollidingStart != null) |
876 | handlerCollidingStart(localId, colliders); | 862 | handlerCollidingStart(localId, colliders); |
877 | } | 863 | } |
864 | |||
878 | public void TriggerScriptColliding(uint localId, ColliderArgs colliders) | 865 | public void TriggerScriptColliding(uint localId, ColliderArgs colliders) |
879 | { | 866 | { |
880 | |||
881 | handlerColliding = OnScriptColliding; | 867 | handlerColliding = OnScriptColliding; |
882 | if (handlerColliding != null) | 868 | if (handlerColliding != null) |
883 | handlerColliding(localId, colliders); | 869 | handlerColliding(localId, colliders); |
884 | } | 870 | } |
871 | |||
885 | public void TriggerScriptCollidingEnd(uint localId, ColliderArgs colliders) | 872 | public void TriggerScriptCollidingEnd(uint localId, ColliderArgs colliders) |
886 | { | 873 | { |
887 | handlerCollidingEnd = OnScriptCollidingEnd; | 874 | handlerCollidingEnd = OnScriptCollidingEnd; |
888 | if (handlerCollidingEnd != null) | 875 | if (handlerCollidingEnd != null) |
889 | handlerCollidingEnd(localId, colliders); | 876 | handlerCollidingEnd(localId, colliders); |
890 | } | 877 | } |
891 | |||
892 | } | 878 | } |
893 | } | 879 | } |
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 3021891..6695dbf 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs | |||
@@ -96,7 +96,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
96 | // Then we've got to remove the previous | 96 | // Then we've got to remove the previous |
97 | // event handler | 97 | // event handler |
98 | 98 | ||
99 | if (_PhyScene != null) | 99 | if (_PhyScene != null) |
100 | _PhyScene.OnPhysicsCrash -= physicsBasedCrash; | 100 | _PhyScene.OnPhysicsCrash -= physicsBasedCrash; |
101 | 101 | ||
102 | _PhyScene = value; | 102 | _PhyScene = value; |
@@ -194,7 +194,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
194 | /// </param> | 194 | /// </param> |
195 | /// <returns> | 195 | /// <returns> |
196 | /// true if the object was added, false if an object with the same uuid was already in the scene | 196 | /// true if the object was added, false if an object with the same uuid was already in the scene |
197 | /// </returns> | 197 | /// </returns> |
198 | protected internal bool AddRestoredSceneObject( | 198 | protected internal bool AddRestoredSceneObject( |
199 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) | 199 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) |
200 | { | 200 | { |
@@ -205,7 +205,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
205 | { | 205 | { |
206 | part.LocalId = m_parentScene.PrimIDAllocate(); | 206 | part.LocalId = m_parentScene.PrimIDAllocate(); |
207 | } | 207 | } |
208 | 208 | ||
209 | sceneObject.UpdateParentIDs(); | 209 | sceneObject.UpdateParentIDs(); |
210 | 210 | ||
211 | if (!alreadyPersisted) | 211 | if (!alreadyPersisted) |
@@ -213,10 +213,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
213 | sceneObject.ForceInventoryPersistence(); | 213 | sceneObject.ForceInventoryPersistence(); |
214 | sceneObject.HasGroupChanged = true; | 214 | sceneObject.HasGroupChanged = true; |
215 | } | 215 | } |
216 | 216 | ||
217 | return AddSceneObject(sceneObject, attachToBackup); | 217 | return AddSceneObject(sceneObject, attachToBackup); |
218 | } | 218 | } |
219 | 219 | ||
220 | /// <summary> | 220 | /// <summary> |
221 | /// Add a newly created object to the scene. This will both update the scene, and send information about the | 221 | /// Add a newly created object to the scene. This will both update the scene, and send information about the |
222 | /// new object to all clients interested in the scene. | 222 | /// new object to all clients interested in the scene. |
@@ -228,12 +228,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
228 | /// </param> | 228 | /// </param> |
229 | /// <returns> | 229 | /// <returns> |
230 | /// true if the object was added, false if an object with the same uuid was already in the scene | 230 | /// true if the object was added, false if an object with the same uuid was already in the scene |
231 | /// </returns> | 231 | /// </returns> |
232 | protected internal bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup) | 232 | protected internal bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup) |
233 | { | 233 | { |
234 | // Ensure that we persist this new scene object | 234 | // Ensure that we persist this new scene object |
235 | sceneObject.HasGroupChanged = true; | 235 | sceneObject.HasGroupChanged = true; |
236 | 236 | ||
237 | return AddSceneObject(sceneObject, attachToBackup); | 237 | return AddSceneObject(sceneObject, attachToBackup); |
238 | } | 238 | } |
239 | 239 | ||
@@ -252,7 +252,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
252 | { | 252 | { |
253 | sceneObject.ApplyPhysics(m_parentScene.m_physicalPrim); | 253 | sceneObject.ApplyPhysics(m_parentScene.m_physicalPrim); |
254 | sceneObject.ScheduleGroupForFullUpdate(); | 254 | sceneObject.ScheduleGroupForFullUpdate(); |
255 | 255 | ||
256 | lock (Entities) | 256 | lock (Entities) |
257 | { | 257 | { |
258 | if (!Entities.ContainsKey(sceneObject.UUID)) | 258 | if (!Entities.ContainsKey(sceneObject.UUID)) |
@@ -261,8 +261,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
261 | Entities.Add(sceneObject.UUID, sceneObject); | 261 | Entities.Add(sceneObject.UUID, sceneObject); |
262 | m_numPrim += sceneObject.Children.Count; | 262 | m_numPrim += sceneObject.Children.Count; |
263 | 263 | ||
264 | if (attachToBackup) | 264 | if (attachToBackup) |
265 | sceneObject.AttachToBackup(); | 265 | sceneObject.AttachToBackup(); |
266 | 266 | ||
267 | return true; | 267 | return true; |
268 | } | 268 | } |
@@ -342,7 +342,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
342 | "[INNER SCENE]: Failed to update {0}, {1} - {2}", entity.Name, entity.UUID, e); | 342 | "[INNER SCENE]: Failed to update {0}, {1} - {2}", entity.Name, entity.UUID, e); |
343 | } | 343 | } |
344 | } | 344 | } |
345 | 345 | ||
346 | m_updateList.Clear(); | 346 | m_updateList.Clear(); |
347 | } | 347 | } |
348 | } | 348 | } |
@@ -555,7 +555,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
555 | protected internal void AddScenePresence(ScenePresence presence) | 555 | protected internal void AddScenePresence(ScenePresence presence) |
556 | { | 556 | { |
557 | bool child = presence.IsChildAgent; | 557 | bool child = presence.IsChildAgent; |
558 | 558 | ||
559 | if (child) | 559 | if (child) |
560 | { | 560 | { |
561 | m_numChildAgents++; | 561 | m_numChildAgents++; |
@@ -598,7 +598,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
598 | { | 598 | { |
599 | if (!ScenePresences.Remove(agentID)) | 599 | if (!ScenePresences.Remove(agentID)) |
600 | { | 600 | { |
601 | m_log.WarnFormat("[SCENE] Tried to remove non-existent scene presence with agent ID {0} from scene ScenePresences list", agentID); | 601 | m_log.WarnFormat("[SCENE] Tried to remove non-existent scene presence with agent ID {0} from scene ScenePresences list", agentID); |
602 | } | 602 | } |
603 | // else | 603 | // else |
604 | // { | 604 | // { |
@@ -774,7 +774,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
774 | /// Get a scene object group that contains the prim with the given uuid | 774 | /// Get a scene object group that contains the prim with the given uuid |
775 | /// </summary> | 775 | /// </summary> |
776 | /// <param name="fullID"></param> | 776 | /// <param name="fullID"></param> |
777 | /// <returns>null if no scene object group containing that prim is found</returns> | 777 | /// <returns>null if no scene object group containing that prim is found</returns> |
778 | private SceneObjectGroup GetGroupByPrim(LLUUID fullID) | 778 | private SceneObjectGroup GetGroupByPrim(LLUUID fullID) |
779 | { | 779 | { |
780 | List<EntityBase> EntityList = GetEntities(); | 780 | List<EntityBase> EntityList = GetEntities(); |
@@ -823,7 +823,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
823 | protected internal SceneObjectPart GetSceneObjectPart(uint localID) | 823 | protected internal SceneObjectPart GetSceneObjectPart(uint localID) |
824 | { | 824 | { |
825 | SceneObjectGroup group = GetGroupByPrim(localID); | 825 | SceneObjectGroup group = GetGroupByPrim(localID); |
826 | 826 | ||
827 | if (group != null) | 827 | if (group != null) |
828 | return group.GetChildPart(localID); | 828 | return group.GetChildPart(localID); |
829 | else | 829 | else |
@@ -834,7 +834,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
834 | /// Get a part contained in this scene. | 834 | /// Get a part contained in this scene. |
835 | /// </summary> | 835 | /// </summary> |
836 | /// <param name="fullID"></param> | 836 | /// <param name="fullID"></param> |
837 | /// <returns>null if the part was not found</returns> | 837 | /// <returns>null if the part was not found</returns> |
838 | protected internal SceneObjectPart GetSceneObjectPart(LLUUID fullID) | 838 | protected internal SceneObjectPart GetSceneObjectPart(LLUUID fullID) |
839 | { | 839 | { |
840 | SceneObjectGroup group = GetGroupByPrim(fullID); | 840 | SceneObjectGroup group = GetGroupByPrim(fullID); |
@@ -1089,7 +1089,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1089 | group.SendGroupTerseUpdate(); | 1089 | group.SendGroupTerseUpdate(); |
1090 | return; | 1090 | return; |
1091 | } | 1091 | } |
1092 | 1092 | ||
1093 | if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId) || group.RootPart.IsAttachment) | 1093 | if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId) || group.RootPart.IsAttachment) |
1094 | { | 1094 | { |
1095 | group.UpdateSinglePosition(pos, localID); | 1095 | group.UpdateSinglePosition(pos, localID); |
@@ -1119,7 +1119,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1119 | if (!m_parentScene.ExternalChecks.ExternalChecksCanObjectEntry(group.UUID,pos) && !group.RootPart.IsAttachment) | 1119 | if (!m_parentScene.ExternalChecks.ExternalChecksCanObjectEntry(group.UUID,pos) && !group.RootPart.IsAttachment) |
1120 | { | 1120 | { |
1121 | group.SendGroupTerseUpdate(); | 1121 | group.SendGroupTerseUpdate(); |
1122 | 1122 | ||
1123 | return; | 1123 | return; |
1124 | } | 1124 | } |
1125 | if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId) || group.RootPart.IsAttachment) | 1125 | if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId) || group.RootPart.IsAttachment) |
@@ -1397,14 +1397,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
1397 | if (sendEvents) | 1397 | if (sendEvents) |
1398 | parenPrim.TriggerScriptChangedEvent(Changed.LINK); | 1398 | parenPrim.TriggerScriptChangedEvent(Changed.LINK); |
1399 | } | 1399 | } |
1400 | else | 1400 | else |
1401 | { | 1401 | { |
1402 | // The link set has prims remaining. This path is taken | 1402 | // The link set has prims remaining. This path is taken |
1403 | // when a subset of a link set's prims are selected | 1403 | // when a subset of a link set's prims are selected |
1404 | // and the root prim is part of that selection | 1404 | // and the root prim is part of that selection |
1405 | // | 1405 | // |
1406 | List<SceneObjectPart> parts = new List<SceneObjectPart>(parenPrim.Children.Values); | 1406 | List<SceneObjectPart> parts = new List<SceneObjectPart>(parenPrim.Children.Values); |
1407 | 1407 | ||
1408 | List<uint> unlink_ids = new List<uint>(); | 1408 | List<uint> unlink_ids = new List<uint>(); |
1409 | foreach (SceneObjectPart unlink_part in parts) | 1409 | foreach (SceneObjectPart unlink_part in parts) |
1410 | unlink_ids.Add(unlink_part.LocalId); | 1410 | unlink_ids.Add(unlink_part.LocalId); |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index fe66dd5..0148d76 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | |||
@@ -242,9 +242,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
242 | 242 | ||
243 | // Retrieve item | 243 | // Retrieve item |
244 | TaskInventoryItem item = group.GetInventoryItem(part.LocalId, itemId); | 244 | TaskInventoryItem item = group.GetInventoryItem(part.LocalId, itemId); |
245 | 245 | ||
246 | if (null == item) | 246 | if (null == item) |
247 | { | 247 | { |
248 | m_log.ErrorFormat( | 248 | m_log.ErrorFormat( |
249 | "[PRIM INVENTORY]: Tried to retrieve item ID {0} from prim {1}, {2} for caps script update " | 249 | "[PRIM INVENTORY]: Tried to retrieve item ID {0} from prim {1}, {2} for caps script update " |
250 | + " but the item does not exist in this inventory", | 250 | + " but the item does not exist in this inventory", |
@@ -338,7 +338,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
338 | item.CreationDate = Util.UnixTimeSinceEpoch(); | 338 | item.CreationDate = Util.UnixTimeSinceEpoch(); |
339 | else | 339 | else |
340 | item.CreationDate = itemUpd.CreationDate; | 340 | item.CreationDate = itemUpd.CreationDate; |
341 | |||
342 | 341 | ||
343 | // TODO: Check if folder changed and move item | 342 | // TODO: Check if folder changed and move item |
344 | //item.NextPermissions = itemUpd.Folder; | 343 | //item.NextPermissions = itemUpd.Folder; |
@@ -577,7 +576,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
577 | asset.Type = assetType; | 576 | asset.Type = assetType; |
578 | asset.FullID = LLUUID.Random(); | 577 | asset.FullID = LLUUID.Random(); |
579 | asset.Data = (data == null) ? new byte[1] : data; | 578 | asset.Data = (data == null) ? new byte[1] : data; |
580 | 579 | ||
581 | return asset; | 580 | return asset; |
582 | } | 581 | } |
583 | 582 | ||
@@ -958,7 +957,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
958 | agentItem.Folder = folderId; | 957 | agentItem.Folder = folderId; |
959 | AddInventoryItem(remoteClient, agentItem); | 958 | AddInventoryItem(remoteClient, agentItem); |
960 | } | 959 | } |
961 | 960 | ||
962 | /// <summary> | 961 | /// <summary> |
963 | /// <see>ClientMoveTaskInventoryItem</see> | 962 | /// <see>ClientMoveTaskInventoryItem</see> |
964 | /// </summary> | 963 | /// </summary> |
@@ -981,13 +980,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
981 | } | 980 | } |
982 | 981 | ||
983 | TaskInventoryItem taskItem = part.GetInventoryItem(itemId); | 982 | TaskInventoryItem taskItem = part.GetInventoryItem(itemId); |
984 | 983 | ||
985 | if (null == taskItem) | 984 | if (null == taskItem) |
986 | { | 985 | { |
987 | m_log.WarnFormat("[PRIM INVENTORY]: Move of inventory item {0} from prim with local id {1} failed" | 986 | m_log.WarnFormat("[PRIM INVENTORY]: Move of inventory item {0} from prim with local id {1} failed" |
988 | + " because the inventory item could not be found", | 987 | + " because the inventory item could not be found", |
989 | itemId, primLocalId); | 988 | itemId, primLocalId); |
990 | 989 | ||
991 | return; | 990 | return; |
992 | } | 991 | } |
993 | 992 | ||
@@ -997,7 +996,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
997 | 996 | ||
998 | MoveTaskInventoryItem(remoteClient, folderId, part, itemId); | 997 | MoveTaskInventoryItem(remoteClient, folderId, part, itemId); |
999 | } | 998 | } |
1000 | 999 | ||
1001 | /// <summary> | 1000 | /// <summary> |
1002 | /// <see>MoveTaskInventoryItem</see> | 1001 | /// <see>MoveTaskInventoryItem</see> |
1003 | /// </summary> | 1002 | /// </summary> |
@@ -1029,7 +1028,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1029 | AddInventoryItem(avatarId, agentItem); | 1028 | AddInventoryItem(avatarId, agentItem); |
1030 | } | 1029 | } |
1031 | } | 1030 | } |
1032 | 1031 | ||
1033 | /// <summary> | 1032 | /// <summary> |
1034 | /// Copy a task (prim) inventory item to another task (prim) | 1033 | /// Copy a task (prim) inventory item to another task (prim) |
1035 | /// </summary> | 1034 | /// </summary> |
@@ -1049,7 +1048,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1049 | 1048 | ||
1050 | return; | 1049 | return; |
1051 | } | 1050 | } |
1052 | 1051 | ||
1053 | SceneObjectPart destPart = GetSceneObjectPart(destId); | 1052 | SceneObjectPart destPart = GetSceneObjectPart(destId); |
1054 | 1053 | ||
1055 | if (destPart == null) | 1054 | if (destPart == null) |
@@ -1060,7 +1059,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1060 | destId); | 1059 | destId); |
1061 | return; | 1060 | return; |
1062 | } | 1061 | } |
1063 | 1062 | ||
1064 | if (part.OwnerID != destPart.OwnerID && (part.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.AllowInventoryDrop) == 0) | 1063 | if (part.OwnerID != destPart.OwnerID && (part.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.AllowInventoryDrop) == 0) |
1065 | { | 1064 | { |
1066 | // object cannot copy items to an object owned by a different owner | 1065 | // object cannot copy items to an object owned by a different owner |
@@ -1076,7 +1075,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1076 | } | 1075 | } |
1077 | 1076 | ||
1078 | TaskInventoryItem destTaskItem = new TaskInventoryItem(); | 1077 | TaskInventoryItem destTaskItem = new TaskInventoryItem(); |
1079 | 1078 | ||
1080 | destTaskItem.ItemID = LLUUID.Random(); | 1079 | destTaskItem.ItemID = LLUUID.Random(); |
1081 | destTaskItem.CreatorID = srcTaskItem.CreatorID; | 1080 | destTaskItem.CreatorID = srcTaskItem.CreatorID; |
1082 | destTaskItem.AssetID = srcTaskItem.AssetID; | 1081 | destTaskItem.AssetID = srcTaskItem.AssetID; |
@@ -1091,7 +1090,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1091 | destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions; | 1090 | destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions; |
1092 | destTaskItem.NextPermissions = srcTaskItem.NextPermissions; | 1091 | destTaskItem.NextPermissions = srcTaskItem.NextPermissions; |
1093 | destTaskItem.Flags = srcTaskItem.Flags; | 1092 | destTaskItem.Flags = srcTaskItem.Flags; |
1094 | 1093 | ||
1095 | if (destPart.OwnerID != part.OwnerID) | 1094 | if (destPart.OwnerID != part.OwnerID) |
1096 | { | 1095 | { |
1097 | if (ExternalChecks.ExternalChecksPropagatePermissions()) | 1096 | if (ExternalChecks.ExternalChecksPropagatePermissions()) |
@@ -1112,20 +1111,20 @@ namespace OpenSim.Region.Environment.Scenes | |||
1112 | destTaskItem.Name = srcTaskItem.Name; | 1111 | destTaskItem.Name = srcTaskItem.Name; |
1113 | destTaskItem.InvType = srcTaskItem.InvType; | 1112 | destTaskItem.InvType = srcTaskItem.InvType; |
1114 | destTaskItem.Type = srcTaskItem.Type; | 1113 | destTaskItem.Type = srcTaskItem.Type; |
1115 | 1114 | ||
1116 | destPart.AddInventoryItem(destTaskItem); | 1115 | destPart.AddInventoryItem(destTaskItem); |
1117 | 1116 | ||
1118 | if ((srcTaskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0) | 1117 | if ((srcTaskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0) |
1119 | part.RemoveInventoryItem(itemId); | 1118 | part.RemoveInventoryItem(itemId); |
1120 | 1119 | ||
1121 | ScenePresence avatar; | 1120 | ScenePresence avatar; |
1122 | 1121 | ||
1123 | if (TryGetAvatar(srcTaskItem.OwnerID, out avatar)) | 1122 | if (TryGetAvatar(srcTaskItem.OwnerID, out avatar)) |
1124 | { | 1123 | { |
1125 | destPart.GetProperties(avatar.ControllingClient); | 1124 | destPart.GetProperties(avatar.ControllingClient); |
1126 | } | 1125 | } |
1127 | } | 1126 | } |
1128 | 1127 | ||
1129 | public void MoveTaskInventoryItems(LLUUID destID, string category, SceneObjectPart host, List<LLUUID> items) | 1128 | public void MoveTaskInventoryItems(LLUUID destID, string category, SceneObjectPart host, List<LLUUID> items) |
1130 | { | 1129 | { |
1131 | CachedUserInfo profile = CommsManager.UserProfileCacheService.GetUserDetails(destID); | 1130 | CachedUserInfo profile = CommsManager.UserProfileCacheService.GetUserDetails(destID); |
@@ -1139,7 +1138,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1139 | } | 1138 | } |
1140 | 1139 | ||
1141 | LLUUID newFolderID = LLUUID.Random(); | 1140 | LLUUID newFolderID = LLUUID.Random(); |
1142 | 1141 | ||
1143 | profile.CreateFolder(category, newFolderID, 0xffff, profile.RootFolder.ID); | 1142 | profile.CreateFolder(category, newFolderID, 0xffff, profile.RootFolder.ID); |
1144 | 1143 | ||
1145 | foreach (LLUUID itemID in items) | 1144 | foreach (LLUUID itemID in items) |
@@ -1346,7 +1345,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1346 | 1345 | ||
1347 | part.AddInventoryItem(taskItem); | 1346 | part.AddInventoryItem(taskItem); |
1348 | part.GetProperties(remoteClient); | 1347 | part.GetProperties(remoteClient); |
1349 | 1348 | ||
1350 | part.CreateScriptInstance(taskItem, 0, false); | 1349 | part.CreateScriptInstance(taskItem, 0, false); |
1351 | } | 1350 | } |
1352 | } | 1351 | } |
@@ -1370,7 +1369,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1370 | 1369 | ||
1371 | return; | 1370 | return; |
1372 | } | 1371 | } |
1373 | 1372 | ||
1374 | SceneObjectPart destPart = GetSceneObjectPart(destId); | 1373 | SceneObjectPart destPart = GetSceneObjectPart(destId); |
1375 | 1374 | ||
1376 | if (destPart == null) | 1375 | if (destPart == null) |
@@ -1381,7 +1380,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1381 | destId); | 1380 | destId); |
1382 | return; | 1381 | return; |
1383 | } | 1382 | } |
1384 | 1383 | ||
1385 | // Must own the object, and have modify rights | 1384 | // Must own the object, and have modify rights |
1386 | if (srcPart.OwnerID != destPart.OwnerID) | 1385 | if (srcPart.OwnerID != destPart.OwnerID) |
1387 | return; | 1386 | return; |
@@ -1395,14 +1394,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
1395 | "[PRIM INVENTORY]: " + | 1394 | "[PRIM INVENTORY]: " + |
1396 | "Script in object {0} : {1}, attempted to load script {2} : {3} into object {4} : {5} with invalid pin {6}", | 1395 | "Script in object {0} : {1}, attempted to load script {2} : {3} into object {4} : {5} with invalid pin {6}", |
1397 | srcPart.Name, srcId, srcTaskItem.Name, srcTaskItem.ItemID, destPart.Name, destId, pin); | 1396 | srcPart.Name, srcId, srcTaskItem.Name, srcTaskItem.ItemID, destPart.Name, destId, pin); |
1398 | // the LSL Wiki says we are supposed to shout on the DEBUG_CHANNEL - | 1397 | // the LSL Wiki says we are supposed to shout on the DEBUG_CHANNEL - |
1399 | // "Object: Task Object trying to illegally load script onto task Other_Object!" | 1398 | // "Object: Task Object trying to illegally load script onto task Other_Object!" |
1400 | // How do we shout from in here? | 1399 | // How do we shout from in here? |
1401 | return; | 1400 | return; |
1402 | } | 1401 | } |
1403 | 1402 | ||
1404 | TaskInventoryItem destTaskItem = new TaskInventoryItem(); | 1403 | TaskInventoryItem destTaskItem = new TaskInventoryItem(); |
1405 | 1404 | ||
1406 | destTaskItem.ItemID = LLUUID.Random(); | 1405 | destTaskItem.ItemID = LLUUID.Random(); |
1407 | destTaskItem.CreatorID = srcTaskItem.CreatorID; | 1406 | destTaskItem.CreatorID = srcTaskItem.CreatorID; |
1408 | destTaskItem.AssetID = srcTaskItem.AssetID; | 1407 | destTaskItem.AssetID = srcTaskItem.AssetID; |
@@ -1417,7 +1416,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1417 | destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions; | 1416 | destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions; |
1418 | destTaskItem.NextPermissions = srcTaskItem.NextPermissions; | 1417 | destTaskItem.NextPermissions = srcTaskItem.NextPermissions; |
1419 | destTaskItem.Flags = srcTaskItem.Flags; | 1418 | destTaskItem.Flags = srcTaskItem.Flags; |
1420 | 1419 | ||
1421 | if (destPart.OwnerID != srcPart.OwnerID) | 1420 | if (destPart.OwnerID != srcPart.OwnerID) |
1422 | { | 1421 | { |
1423 | if (ExternalChecks.ExternalChecksPropagatePermissions()) | 1422 | if (ExternalChecks.ExternalChecksPropagatePermissions()) |
@@ -1438,22 +1437,22 @@ namespace OpenSim.Region.Environment.Scenes | |||
1438 | destTaskItem.Name = srcTaskItem.Name; | 1437 | destTaskItem.Name = srcTaskItem.Name; |
1439 | destTaskItem.InvType = srcTaskItem.InvType; | 1438 | destTaskItem.InvType = srcTaskItem.InvType; |
1440 | destTaskItem.Type = srcTaskItem.Type; | 1439 | destTaskItem.Type = srcTaskItem.Type; |
1441 | 1440 | ||
1442 | destPart.AddInventoryItemExclusive(destTaskItem); | 1441 | destPart.AddInventoryItemExclusive(destTaskItem); |
1443 | 1442 | ||
1444 | if (running > 0) | 1443 | if (running > 0) |
1445 | { | 1444 | { |
1446 | destPart.CreateScriptInstance(destTaskItem, 0, false); | 1445 | destPart.CreateScriptInstance(destTaskItem, 0, false); |
1447 | } | 1446 | } |
1448 | 1447 | ||
1449 | ScenePresence avatar; | 1448 | ScenePresence avatar; |
1450 | 1449 | ||
1451 | if (TryGetAvatar(srcTaskItem.OwnerID, out avatar)) | 1450 | if (TryGetAvatar(srcTaskItem.OwnerID, out avatar)) |
1452 | { | 1451 | { |
1453 | destPart.GetProperties(avatar.ControllingClient); | 1452 | destPart.GetProperties(avatar.ControllingClient); |
1454 | } | 1453 | } |
1455 | } | 1454 | } |
1456 | 1455 | ||
1457 | /// <summary> | 1456 | /// <summary> |
1458 | /// Called when an object is removed from the environment into inventory. | 1457 | /// Called when an object is removed from the environment into inventory. |
1459 | /// </summary> | 1458 | /// </summary> |
@@ -1566,7 +1565,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1566 | private bool InventoryDeQueueAndDelete() | 1565 | private bool InventoryDeQueueAndDelete() |
1567 | { | 1566 | { |
1568 | DeleteToInventoryHolder x = null; | 1567 | DeleteToInventoryHolder x = null; |
1569 | 1568 | ||
1570 | try | 1569 | try |
1571 | { | 1570 | { |
1572 | lock (m_inventoryDeletes) | 1571 | lock (m_inventoryDeletes) |
@@ -1580,13 +1579,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
1580 | return true; | 1579 | return true; |
1581 | } | 1580 | } |
1582 | } | 1581 | } |
1583 | } | 1582 | } |
1584 | catch(Exception e) | 1583 | catch(Exception e) |
1585 | { | 1584 | { |
1586 | // We can't put the object group details in here since the root part may have disappeared (which is where these sit). | 1585 | // We can't put the object group details in here since the root part may have disappeared (which is where these sit). |
1587 | // FIXME: This needs to be fixed. | 1586 | // FIXME: This needs to be fixed. |
1588 | m_log.ErrorFormat( | 1587 | m_log.ErrorFormat( |
1589 | "[AGENT INVENTORY]: Queued deletion of scene object to agent {0} {1} failed: {2}", | 1588 | "[AGENT INVENTORY]: Queued deletion of scene object to agent {0} {1} failed: {2}", |
1590 | (x != null ? x.remoteClient.Name : "unavailable"), (x != null ? x.remoteClient.AgentId : "unavailable"), e.ToString()); | 1589 | (x != null ? x.remoteClient.Name : "unavailable"), (x != null ? x.remoteClient.AgentId : "unavailable"), e.ToString()); |
1591 | } | 1590 | } |
1592 | 1591 | ||
@@ -1745,7 +1744,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1745 | } | 1744 | } |
1746 | } | 1745 | } |
1747 | } | 1746 | } |
1748 | 1747 | ||
1749 | AssetBase asset = CreateAsset( | 1748 | AssetBase asset = CreateAsset( |
1750 | objectGroup.GetPartName(objectGroup.LocalId), | 1749 | objectGroup.GetPartName(objectGroup.LocalId), |
1751 | objectGroup.GetPartDescription(objectGroup.LocalId), | 1750 | objectGroup.GetPartDescription(objectGroup.LocalId), |
@@ -1792,7 +1791,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1792 | } | 1791 | } |
1793 | } | 1792 | } |
1794 | } | 1793 | } |
1795 | 1794 | ||
1796 | public LLUUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, LLUUID AgentId) | 1795 | public LLUUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, LLUUID AgentId) |
1797 | { | 1796 | { |
1798 | SceneObjectGroup objectGroup = grp; | 1797 | SceneObjectGroup objectGroup = grp; |
@@ -2057,7 +2056,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2057 | /// <param name="param"></param> | 2056 | /// <param name="param"></param> |
2058 | /// <returns></returns> | 2057 | /// <returns></returns> |
2059 | public virtual SceneObjectGroup RezObject( | 2058 | public virtual SceneObjectGroup RezObject( |
2060 | SceneObjectPart sourcePart, TaskInventoryItem item, | 2059 | SceneObjectPart sourcePart, TaskInventoryItem item, |
2061 | LLVector3 pos, LLQuaternion rot, LLVector3 vel, int param) | 2060 | LLVector3 pos, LLQuaternion rot, LLVector3 vel, int param) |
2062 | { | 2061 | { |
2063 | // Rez object | 2062 | // Rez object |
@@ -2142,10 +2141,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
2142 | return rootPart.ParentGroup; | 2141 | return rootPart.ParentGroup; |
2143 | } | 2142 | } |
2144 | } | 2143 | } |
2145 | 2144 | ||
2146 | return null; | 2145 | return null; |
2147 | } | 2146 | } |
2148 | 2147 | ||
2149 | public virtual bool returnObjects(SceneObjectGroup[] returnobjects, LLUUID AgentId) | 2148 | public virtual bool returnObjects(SceneObjectGroup[] returnobjects, LLUUID AgentId) |
2150 | { | 2149 | { |
2151 | string message = ""; | 2150 | string message = ""; |
@@ -2218,7 +2217,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2218 | item.AssetType = asset.Type; | 2217 | item.AssetType = asset.Type; |
2219 | item.InvType = (int)InventoryType.Object; | 2218 | item.InvType = (int)InventoryType.Object; |
2220 | item.Folder = folderID; | 2219 | item.Folder = folderID; |
2221 | 2220 | ||
2222 | if ((AgentId != returnobjects[i].RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions()) | 2221 | if ((AgentId != returnobjects[i].RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions()) |
2223 | { | 2222 | { |
2224 | uint perms = returnobjects[i].GetEffectivePermissions(); | 2223 | uint perms = returnobjects[i].GetEffectivePermissions(); |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index e8a8a78..474f062 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -74,11 +74,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
74 | public InnerScene m_innerScene; | 74 | public InnerScene m_innerScene; |
75 | 75 | ||
76 | /// <summary> | 76 | /// <summary> |
77 | /// The last allocated local prim id. When a new local id is requested, the next number in the sequence is | 77 | /// The last allocated local prim id. When a new local id is requested, the next number in the sequence is |
78 | /// dispenced. | 78 | /// dispenced. |
79 | /// </summary> | 79 | /// </summary> |
80 | private uint m_lastAllocatedLocalId = 720000; | 80 | private uint m_lastAllocatedLocalId = 720000; |
81 | 81 | ||
82 | private readonly Mutex _primAllocateMutex = new Mutex(false); | 82 | private readonly Mutex _primAllocateMutex = new Mutex(false); |
83 | 83 | ||
84 | private int m_timePhase = 24; | 84 | private int m_timePhase = 24; |
@@ -607,7 +607,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
607 | public override void Close() | 607 | public override void Close() |
608 | { | 608 | { |
609 | m_log.InfoFormat("[SCENE]: Closing down the single simulator: {0}", RegionInfo.RegionName); | 609 | m_log.InfoFormat("[SCENE]: Closing down the single simulator: {0}", RegionInfo.RegionName); |
610 | 610 | ||
611 | // Kick all ROOT agents with the message, 'The simulator is going down' | 611 | // Kick all ROOT agents with the message, 'The simulator is going down' |
612 | ForEachScenePresence(delegate(ScenePresence avatar) | 612 | ForEachScenePresence(delegate(ScenePresence avatar) |
613 | { | 613 | { |
@@ -765,7 +765,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
765 | if (m_frame % m_update_backup == 0) | 765 | if (m_frame % m_update_backup == 0) |
766 | { | 766 | { |
767 | UpdateStorageBackup(); | 767 | UpdateStorageBackup(); |
768 | 768 | ||
769 | } | 769 | } |
770 | 770 | ||
771 | if (m_frame % m_update_terrain == 0) | 771 | if (m_frame % m_update_terrain == 0) |
@@ -1112,7 +1112,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1112 | //X | 1112 | //X |
1113 | // . | 1113 | // . |
1114 | // | 1114 | // |
1115 | // Shade the terrain for shadows | 1115 | // Shade the terrain for shadows |
1116 | if ((x - 1 > 0) && (y - 1 > 0)) | 1116 | if ((x - 1 > 0) && (y - 1 > 0)) |
1117 | { | 1117 | { |
1118 | hfvalue = (float)hm[x, y]; | 1118 | hfvalue = (float)hm[x, y]; |
@@ -1133,7 +1133,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1133 | else if (hfdiff < -0.3f) | 1133 | else if (hfdiff < -0.3f) |
1134 | { | 1134 | { |
1135 | // We have to desaturate and blacken the land at the same time | 1135 | // We have to desaturate and blacken the land at the same time |
1136 | // we use floats, colors use bytes, so shrink are space down to | 1136 | // we use floats, colors use bytes, so shrink are space down to |
1137 | // 0-255 | 1137 | // 0-255 |
1138 | 1138 | ||
1139 | 1139 | ||
@@ -1429,13 +1429,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
1429 | public void LazySaveGeneratedMaptile(byte[] data, bool temporary) | 1429 | public void LazySaveGeneratedMaptile(byte[] data, bool temporary) |
1430 | { | 1430 | { |
1431 | // Overwrites the local Asset cache with new maptile data | 1431 | // Overwrites the local Asset cache with new maptile data |
1432 | // Assets are single write, this causes the asset server to ignore this update, | 1432 | // Assets are single write, this causes the asset server to ignore this update, |
1433 | // but the local asset cache does not | 1433 | // but the local asset cache does not |
1434 | 1434 | ||
1435 | // this is on purpose! The net result of this is the region always has the most up to date | 1435 | // this is on purpose! The net result of this is the region always has the most up to date |
1436 | // map tile while protecting the (grid) asset database from bloat caused by a new asset each | 1436 | // map tile while protecting the (grid) asset database from bloat caused by a new asset each |
1437 | // time a mapimage is generated! | 1437 | // time a mapimage is generated! |
1438 | 1438 | ||
1439 | LLUUID lastMapRegionUUID = m_regInfo.lastMapUUID; | 1439 | LLUUID lastMapRegionUUID = m_regInfo.lastMapUUID; |
1440 | 1440 | ||
1441 | int lastMapRefresh = 0; | 1441 | int lastMapRefresh = 0; |
@@ -1711,7 +1711,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1711 | /// </param> | 1711 | /// </param> |
1712 | /// <returns> | 1712 | /// <returns> |
1713 | /// true if the object was added, false if an object with the same uuid was already in the scene | 1713 | /// true if the object was added, false if an object with the same uuid was already in the scene |
1714 | /// </returns> | 1714 | /// </returns> |
1715 | public bool AddRestoredSceneObject( | 1715 | public bool AddRestoredSceneObject( |
1716 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) | 1716 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) |
1717 | { | 1717 | { |
@@ -1739,15 +1739,15 @@ namespace OpenSim.Region.Environment.Scenes | |||
1739 | lock (Entities) | 1739 | lock (Entities) |
1740 | { | 1740 | { |
1741 | ICollection<EntityBase> entities = new List<EntityBase>(Entities.Values); | 1741 | ICollection<EntityBase> entities = new List<EntityBase>(Entities.Values); |
1742 | 1742 | ||
1743 | foreach (EntityBase e in entities) | 1743 | foreach (EntityBase e in entities) |
1744 | { | 1744 | { |
1745 | if (e is SceneObjectGroup) | 1745 | if (e is SceneObjectGroup) |
1746 | DeleteSceneObject((SceneObjectGroup)e); | 1746 | DeleteSceneObject((SceneObjectGroup)e); |
1747 | } | 1747 | } |
1748 | } | 1748 | } |
1749 | } | 1749 | } |
1750 | 1750 | ||
1751 | /// <summary> | 1751 | /// <summary> |
1752 | /// Delete the given object from the scene. | 1752 | /// Delete the given object from the scene. |
1753 | /// </summary> | 1753 | /// </summary> |
@@ -1791,8 +1791,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
1791 | 1791 | ||
1792 | public void LoadPrimsFromXml(string fileName, bool newIdsFlag, LLVector3 loadOffset) | 1792 | public void LoadPrimsFromXml(string fileName, bool newIdsFlag, LLVector3 loadOffset) |
1793 | { | 1793 | { |
1794 | m_log.InfoFormat("[SCENE]: Loading prims in xml format to region {0} from {1}", RegionInfo.RegionName); | 1794 | m_log.InfoFormat("[SCENE]: Loading prims in xml format to region {0} from {1}", RegionInfo.RegionName); |
1795 | 1795 | ||
1796 | m_serialiser.LoadPrimsFromXml(this, fileName, newIdsFlag, loadOffset); | 1796 | m_serialiser.LoadPrimsFromXml(this, fileName, newIdsFlag, loadOffset); |
1797 | } | 1797 | } |
1798 | 1798 | ||
@@ -1805,29 +1805,29 @@ namespace OpenSim.Region.Environment.Scenes | |||
1805 | 1805 | ||
1806 | public void LoadPrimsFromXml2(string fileName) | 1806 | public void LoadPrimsFromXml2(string fileName) |
1807 | { | 1807 | { |
1808 | m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from {1}", RegionInfo.RegionName, fileName); | 1808 | m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from {1}", RegionInfo.RegionName, fileName); |
1809 | 1809 | ||
1810 | m_serialiser.LoadPrimsFromXml2(this, fileName); | 1810 | m_serialiser.LoadPrimsFromXml2(this, fileName); |
1811 | } | 1811 | } |
1812 | 1812 | ||
1813 | public void LoadPrimsFromXml2(TextReader reader, bool startScripts) | 1813 | public void LoadPrimsFromXml2(TextReader reader, bool startScripts) |
1814 | { | 1814 | { |
1815 | m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from stream", RegionInfo.RegionName); | 1815 | m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from stream", RegionInfo.RegionName); |
1816 | 1816 | ||
1817 | m_serialiser.LoadPrimsFromXml2(this, reader, startScripts); | 1817 | m_serialiser.LoadPrimsFromXml2(this, reader, startScripts); |
1818 | } | 1818 | } |
1819 | 1819 | ||
1820 | public void SavePrimsToXml2(string fileName) | 1820 | public void SavePrimsToXml2(string fileName) |
1821 | { | 1821 | { |
1822 | m_log.InfoFormat("[SCENE]: Saving prims in xml2 format for region {0} to {1}", RegionInfo.RegionName, fileName); | 1822 | m_log.InfoFormat("[SCENE]: Saving prims in xml2 format for region {0} to {1}", RegionInfo.RegionName, fileName); |
1823 | 1823 | ||
1824 | m_serialiser.SavePrimsToXml2(this, fileName); | 1824 | m_serialiser.SavePrimsToXml2(this, fileName); |
1825 | } | 1825 | } |
1826 | 1826 | ||
1827 | public void SavePrimsToXml2(TextWriter stream, LLVector3 min, LLVector3 max) | 1827 | public void SavePrimsToXml2(TextWriter stream, LLVector3 min, LLVector3 max) |
1828 | { | 1828 | { |
1829 | m_log.InfoFormat("[SCENE]: Saving prims in xml2 format for region {0} to stream", RegionInfo.RegionName); | 1829 | m_log.InfoFormat("[SCENE]: Saving prims in xml2 format for region {0} to stream", RegionInfo.RegionName); |
1830 | 1830 | ||
1831 | m_serialiser.SavePrimsToXml2(this, stream, min, max); | 1831 | m_serialiser.SavePrimsToXml2(this, stream, min, max); |
1832 | } | 1832 | } |
1833 | 1833 | ||
@@ -1835,7 +1835,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1835 | { | 1835 | { |
1836 | m_log.InfoFormat( | 1836 | m_log.InfoFormat( |
1837 | "[SCENE]: Saving prims with name {0} in xml2 format for region {1} to {2}", primName, RegionInfo.RegionName, fileName); | 1837 | "[SCENE]: Saving prims with name {0} in xml2 format for region {1} to {2}", primName, RegionInfo.RegionName, fileName); |
1838 | 1838 | ||
1839 | List<EntityBase> entityList = GetEntities(); | 1839 | List<EntityBase> entityList = GetEntities(); |
1840 | List<EntityBase> primList = new List<EntityBase>(); | 1840 | List<EntityBase> primList = new List<EntityBase>(); |
1841 | 1841 | ||
@@ -1860,7 +1860,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1860 | public void LoadPrimsFromArchive(string filePath) | 1860 | public void LoadPrimsFromArchive(string filePath) |
1861 | { | 1861 | { |
1862 | m_log.InfoFormat("[SCENE]: Loading archive to region {0} from {1}", RegionInfo.RegionName, filePath); | 1862 | m_log.InfoFormat("[SCENE]: Loading archive to region {0} from {1}", RegionInfo.RegionName, filePath); |
1863 | 1863 | ||
1864 | m_archiver.DearchiveRegion(filePath); | 1864 | m_archiver.DearchiveRegion(filePath); |
1865 | } | 1865 | } |
1866 | 1866 | ||
@@ -1871,7 +1871,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1871 | public void SavePrimsToArchive(string filePath) | 1871 | public void SavePrimsToArchive(string filePath) |
1872 | { | 1872 | { |
1873 | m_log.InfoFormat("[SCENE]: Writing archive for region {0} to {1}", RegionInfo.RegionName, filePath); | 1873 | m_log.InfoFormat("[SCENE]: Writing archive for region {0} to {1}", RegionInfo.RegionName, filePath); |
1874 | 1874 | ||
1875 | m_archiver.ArchiveRegion(filePath); | 1875 | m_archiver.ArchiveRegion(filePath); |
1876 | } | 1876 | } |
1877 | 1877 | ||
@@ -1986,7 +1986,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1986 | m_log.Warn("{[INTERREGION]: A new prim arrived from a neighbor"); | 1986 | m_log.Warn("{[INTERREGION]: A new prim arrived from a neighbor"); |
1987 | if (XMLMethod == 0) | 1987 | if (XMLMethod == 0) |
1988 | { | 1988 | { |
1989 | SceneObjectGroup sceneObject = m_serialiser.DeserializeGroupFromXml2(objXMLData); | 1989 | SceneObjectGroup sceneObject = m_serialiser.DeserializeGroupFromXml2(objXMLData); |
1990 | AddRestoredSceneObject(sceneObject, true, false); | 1990 | AddRestoredSceneObject(sceneObject, true, false); |
1991 | 1991 | ||
1992 | SceneObjectPart RootPrim = GetSceneObjectPart(primID); | 1992 | SceneObjectPart RootPrim = GetSceneObjectPart(primID); |
@@ -1999,7 +1999,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1999 | { | 1999 | { |
2000 | DeleteSceneObject(grp); | 2000 | DeleteSceneObject(grp); |
2001 | } | 2001 | } |
2002 | 2002 | ||
2003 | m_log.Info("[INTERREGION]: Denied prim crossing for banned avatar"); | 2003 | m_log.Info("[INTERREGION]: Denied prim crossing for banned avatar"); |
2004 | 2004 | ||
2005 | return false; | 2005 | return false; |
@@ -2075,7 +2075,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2075 | else | 2075 | else |
2076 | { | 2076 | { |
2077 | m_log.DebugFormat( | 2077 | m_log.DebugFormat( |
2078 | "[SCENE]: Adding new {0} agent {1} {2} in {3}", | 2078 | "[SCENE]: Adding new {0} agent {1} {2} in {3}", |
2079 | (child ? "child" : "root"), client.Name, client.AgentId, RegionInfo.RegionName); | 2079 | (child ? "child" : "root"), client.Name, client.AgentId, RegionInfo.RegionName); |
2080 | 2080 | ||
2081 | CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); | 2081 | CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); |
@@ -2156,7 +2156,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2156 | client.OnScriptReset += ProcessScriptReset; | 2156 | client.OnScriptReset += ProcessScriptReset; |
2157 | client.OnGetScriptRunning += GetScriptRunning; | 2157 | client.OnGetScriptRunning += GetScriptRunning; |
2158 | client.OnSetScriptRunning += SetScriptRunning; | 2158 | client.OnSetScriptRunning += SetScriptRunning; |
2159 | 2159 | ||
2160 | client.OnRegionHandleRequest += RegionHandleRequest; | 2160 | client.OnRegionHandleRequest += RegionHandleRequest; |
2161 | 2161 | ||
2162 | client.OnUnackedTerrain += TerrainUnAcked; | 2162 | client.OnUnackedTerrain += TerrainUnAcked; |
@@ -2310,7 +2310,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2310 | public void GetAvatarAppearance(IClientAPI client, out AvatarAppearance appearance) | 2310 | public void GetAvatarAppearance(IClientAPI client, out AvatarAppearance appearance) |
2311 | { | 2311 | { |
2312 | appearance = null; // VS needs this line, mono doesn't | 2312 | appearance = null; // VS needs this line, mono doesn't |
2313 | 2313 | ||
2314 | try | 2314 | try |
2315 | { | 2315 | { |
2316 | if (m_AvatarFactory == null || | 2316 | if (m_AvatarFactory == null || |
@@ -2323,10 +2323,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
2323 | catch (Exception e) | 2323 | catch (Exception e) |
2324 | { | 2324 | { |
2325 | m_log.ErrorFormat( | 2325 | m_log.ErrorFormat( |
2326 | "[APPERANCE]: Problem when fetching appearance for avatar {0}, {1}, using default. {2}", | 2326 | "[APPERANCE]: Problem when fetching appearance for avatar {0}, {1}, using default. {2}", |
2327 | client.Name, client.AgentId, e); | 2327 | client.Name, client.AgentId, e); |
2328 | appearance = new AvatarAppearance(); | 2328 | appearance = new AvatarAppearance(); |
2329 | } | 2329 | } |
2330 | } | 2330 | } |
2331 | 2331 | ||
2332 | /// <summary> | 2332 | /// <summary> |
@@ -2341,13 +2341,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
2341 | { | 2341 | { |
2342 | childagentYN = avatar.IsChildAgent; | 2342 | childagentYN = avatar.IsChildAgent; |
2343 | } | 2343 | } |
2344 | 2344 | ||
2345 | try | 2345 | try |
2346 | { | 2346 | { |
2347 | m_log.DebugFormat( | 2347 | m_log.DebugFormat( |
2348 | "[SCENE]: Removing {0} agent {1} from region {2}", | 2348 | "[SCENE]: Removing {0} agent {1} from region {2}", |
2349 | (childagentYN ? "child" : "root"), agentID, RegionInfo.RegionName); | 2349 | (childagentYN ? "child" : "root"), agentID, RegionInfo.RegionName); |
2350 | 2350 | ||
2351 | if (avatar.IsChildAgent) | 2351 | if (avatar.IsChildAgent) |
2352 | { | 2352 | { |
2353 | m_innerScene.removeUserCount(false); | 2353 | m_innerScene.removeUserCount(false); |
@@ -2378,7 +2378,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2378 | // We don't know which count to remove it from | 2378 | // We don't know which count to remove it from |
2379 | // Avatar is already disposed :/ | 2379 | // Avatar is already disposed :/ |
2380 | } | 2380 | } |
2381 | 2381 | ||
2382 | m_eventManager.TriggerOnRemovePresence(agentID); | 2382 | m_eventManager.TriggerOnRemovePresence(agentID); |
2383 | Broadcast(delegate(IClientAPI client) | 2383 | Broadcast(delegate(IClientAPI client) |
2384 | { | 2384 | { |
@@ -2717,7 +2717,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2717 | { | 2717 | { |
2718 | m_innerScene.removeUserCount(true); | 2718 | m_innerScene.removeUserCount(true); |
2719 | } | 2719 | } |
2720 | 2720 | ||
2721 | // Tell a single agent to disconnect from the region. | 2721 | // Tell a single agent to disconnect from the region. |
2722 | presence.ControllingClient.SendShutdownConnectionNotice(); | 2722 | presence.ControllingClient.SendShutdownConnectionNotice(); |
2723 | 2723 | ||
@@ -3827,9 +3827,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
3827 | { | 3827 | { |
3828 | //should be doing this by parcel, but as its only for testing | 3828 | //should be doing this by parcel, but as its only for testing |
3829 | // The use of Thread.Sleep here causes the following compiler error under mono 1.2.4 | 3829 | // The use of Thread.Sleep here causes the following compiler error under mono 1.2.4 |
3830 | // OpenSim/Region/Environment/Scenes/Scene.cs(3675,17): error CS0103: The name `Thread' does not exist | 3830 | // OpenSim/Region/Environment/Scenes/Scene.cs(3675,17): error CS0103: The name `Thread' does not exist |
3831 | // in the context of `<>c__CompilerGenerated17' | 3831 | // in the context of `<>c__CompilerGenerated17' |
3832 | // MW said it was okay to comment the body of this method out for now since the code is experimental | 3832 | // MW said it was okay to comment the body of this method out for now since the code is experimental |
3833 | // and will be replaced anyway | 3833 | // and will be replaced anyway |
3834 | // ForEachClient(delegate(IClientAPI client) | 3834 | // ForEachClient(delegate(IClientAPI client) |
3835 | // { | 3835 | // { |
@@ -3840,7 +3840,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
3840 | // client.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0); | 3840 | // client.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0); |
3841 | // }); | 3841 | // }); |
3842 | } | 3842 | } |
3843 | 3843 | ||
3844 | public void RegionHandleRequest(IClientAPI client, LLUUID regionID) | 3844 | public void RegionHandleRequest(IClientAPI client, LLUUID regionID) |
3845 | { | 3845 | { |
3846 | RegionInfo info; | 3846 | RegionInfo info; |
@@ -3860,4 +3860,4 @@ namespace OpenSim.Region.Environment.Scenes | |||
3860 | client.SendLayerData(patchX, patchY, Heightmap.GetFloatsSerialised()); | 3860 | client.SendLayerData(patchX, patchY, Heightmap.GetFloatsSerialised()); |
3861 | } | 3861 | } |
3862 | } | 3862 | } |
3863 | } | 3863 | } |
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs index 35a7434..adad7d3 100644 --- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs | |||
@@ -60,7 +60,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
60 | public event RemoveKnownRegionsFromAvatarList OnRemoveKnownRegionFromAvatar; | 60 | public event RemoveKnownRegionsFromAvatarList OnRemoveKnownRegionFromAvatar; |
61 | public event LogOffUser OnLogOffUser; | 61 | public event LogOffUser OnLogOffUser; |
62 | public event GetLandData OnGetLandData; | 62 | public event GetLandData OnGetLandData; |
63 | 63 | ||
64 | private AgentCrossing handlerAvatarCrossingIntoRegion = null; // OnAvatarCrossingIntoRegion; | 64 | private AgentCrossing handlerAvatarCrossingIntoRegion = null; // OnAvatarCrossingIntoRegion; |
65 | private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser; | 65 | private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser; |
66 | private ExpectPrimDelegate handlerExpectPrim = null; // OnExpectPrim; | 66 | private ExpectPrimDelegate handlerExpectPrim = null; // OnExpectPrim; |
@@ -70,7 +70,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
70 | private ChildAgentUpdate handlerChildAgentUpdate = null; // OnChildAgentUpdate; | 70 | private ChildAgentUpdate handlerChildAgentUpdate = null; // OnChildAgentUpdate; |
71 | private RemoveKnownRegionsFromAvatarList handlerRemoveKnownRegionFromAvatar = null; // OnRemoveKnownRegionFromAvatar; | 71 | private RemoveKnownRegionsFromAvatarList handlerRemoveKnownRegionFromAvatar = null; // OnRemoveKnownRegionFromAvatar; |
72 | private LogOffUser handlerLogOffUser = null; | 72 | private LogOffUser handlerLogOffUser = null; |
73 | private GetLandData handlerGetLandData = null; // OnGetLandData | 73 | private GetLandData handlerGetLandData = null; // OnGetLandData |
74 | 74 | ||
75 | public KillObjectDelegate KillObject; | 75 | public KillObjectDelegate KillObject; |
76 | public string _debugRegionName = String.Empty; | 76 | public string _debugRegionName = String.Empty; |
@@ -240,7 +240,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
240 | } | 240 | } |
241 | return null; | 241 | return null; |
242 | } | 242 | } |
243 | 243 | ||
244 | #endregion | 244 | #endregion |
245 | 245 | ||
246 | #region Inform Client of Neighbours | 246 | #region Inform Client of Neighbours |
@@ -582,7 +582,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
582 | LLVector3 lookAt, uint flags) | 582 | LLVector3 lookAt, uint flags) |
583 | { | 583 | { |
584 | bool destRegionUp = false; | 584 | bool destRegionUp = false; |
585 | 585 | ||
586 | if (regionHandle == m_regionInfo.RegionHandle) | 586 | if (regionHandle == m_regionInfo.RegionHandle) |
587 | { | 587 | { |
588 | // Teleport within the same region | 588 | // Teleport within the same region |
diff --git a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs index 0b2cc9e..a0e0a37 100644 --- a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs +++ b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.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 | * |
@@ -45,534 +45,553 @@ namespace OpenSim.Region.Environment.Scenes | |||
45 | 45 | ||
46 | #region Object Permission Checks | 46 | #region Object Permission Checks |
47 | 47 | ||
48 | public delegate uint GenerateClientFlags(LLUUID userID, LLUUID objectIDID); | 48 | public delegate uint GenerateClientFlags(LLUUID userID, LLUUID objectIDID); |
49 | private List<GenerateClientFlags> GenerateClientFlagsCheckFunctions = new List<GenerateClientFlags>(); | 49 | private List<GenerateClientFlags> GenerateClientFlagsCheckFunctions = new List<GenerateClientFlags>(); |
50 | 50 | ||
51 | public void addGenerateClientFlags(GenerateClientFlags delegateFunc) | 51 | public void addGenerateClientFlags(GenerateClientFlags delegateFunc) |
52 | { | 52 | { |
53 | if (!GenerateClientFlagsCheckFunctions.Contains(delegateFunc)) | 53 | if (!GenerateClientFlagsCheckFunctions.Contains(delegateFunc)) |
54 | GenerateClientFlagsCheckFunctions.Add(delegateFunc); | 54 | GenerateClientFlagsCheckFunctions.Add(delegateFunc); |
55 | } | 55 | } |
56 | public void removeGenerateClientFlags(GenerateClientFlags delegateFunc) | ||
57 | { | ||
58 | if (GenerateClientFlagsCheckFunctions.Contains(delegateFunc)) | ||
59 | GenerateClientFlagsCheckFunctions.Remove(delegateFunc); | ||
60 | } | ||
61 | 56 | ||
62 | public uint ExternalChecksGenerateClientFlags(LLUUID userID, LLUUID objectID) | 57 | public void removeGenerateClientFlags(GenerateClientFlags delegateFunc) |
63 | { | 58 | { |
64 | SceneObjectPart part=m_scene.GetSceneObjectPart(objectID); | 59 | if (GenerateClientFlagsCheckFunctions.Contains(delegateFunc)) |
65 | 60 | GenerateClientFlagsCheckFunctions.Remove(delegateFunc); | |
66 | if (part == null) | 61 | } |
67 | return 0; | ||
68 | |||
69 | uint perms=part.GetEffectiveObjectFlags() | | ||
70 | (uint)LLObject.ObjectFlags.ObjectModify | | ||
71 | (uint)LLObject.ObjectFlags.ObjectCopy | | ||
72 | (uint)LLObject.ObjectFlags.ObjectMove | | ||
73 | (uint)LLObject.ObjectFlags.ObjectTransfer | | ||
74 | (uint)LLObject.ObjectFlags.ObjectYouOwner | | ||
75 | (uint)LLObject.ObjectFlags.ObjectAnyOwner | | ||
76 | (uint)LLObject.ObjectFlags.ObjectOwnerModify | | ||
77 | (uint)LLObject.ObjectFlags.ObjectYouOfficer; | ||
78 | |||
79 | foreach (GenerateClientFlags check in GenerateClientFlagsCheckFunctions) | ||
80 | { | ||
81 | perms &= check(userID, objectID); | ||
82 | } | ||
83 | return perms; | ||
84 | } | ||
85 | 62 | ||
86 | public delegate void SetBypassPermissions(bool value); | 63 | public uint ExternalChecksGenerateClientFlags(LLUUID userID, LLUUID objectID) |
87 | private List<SetBypassPermissions> SetBypassPermissionsCheckFunctions = new List<SetBypassPermissions>(); | 64 | { |
65 | SceneObjectPart part=m_scene.GetSceneObjectPart(objectID); | ||
88 | 66 | ||
89 | public void addSetBypassPermissions(SetBypassPermissions delegateFunc) | 67 | if (part == null) |
90 | { | 68 | return 0; |
91 | if (!SetBypassPermissionsCheckFunctions.Contains(delegateFunc)) | ||
92 | SetBypassPermissionsCheckFunctions.Add(delegateFunc); | ||
93 | } | ||
94 | public void removeSetBypassPermissions(SetBypassPermissions delegateFunc) | ||
95 | { | ||
96 | if (SetBypassPermissionsCheckFunctions.Contains(delegateFunc)) | ||
97 | SetBypassPermissionsCheckFunctions.Remove(delegateFunc); | ||
98 | } | ||
99 | 69 | ||
100 | public void ExternalChecksSetBypassPermissions(bool value) | 70 | uint perms=part.GetEffectiveObjectFlags() | |
71 | (uint)LLObject.ObjectFlags.ObjectModify | | ||
72 | (uint)LLObject.ObjectFlags.ObjectCopy | | ||
73 | (uint)LLObject.ObjectFlags.ObjectMove | | ||
74 | (uint)LLObject.ObjectFlags.ObjectTransfer | | ||
75 | (uint)LLObject.ObjectFlags.ObjectYouOwner | | ||
76 | (uint)LLObject.ObjectFlags.ObjectAnyOwner | | ||
77 | (uint)LLObject.ObjectFlags.ObjectOwnerModify | | ||
78 | (uint)LLObject.ObjectFlags.ObjectYouOfficer; | ||
79 | |||
80 | foreach (GenerateClientFlags check in GenerateClientFlagsCheckFunctions) | ||
101 | { | 81 | { |
102 | foreach (SetBypassPermissions check in SetBypassPermissionsCheckFunctions) | 82 | perms &= check(userID, objectID); |
103 | { | ||
104 | check(value); | ||
105 | } | ||
106 | } | 83 | } |
84 | return perms; | ||
85 | } | ||
107 | 86 | ||
108 | public delegate bool BypassPermissions(); | 87 | public delegate void SetBypassPermissions(bool value); |
109 | private List<BypassPermissions> BypassPermissionsCheckFunctions = new List<BypassPermissions>(); | 88 | private List<SetBypassPermissions> SetBypassPermissionsCheckFunctions = new List<SetBypassPermissions>(); |
110 | 89 | ||
111 | public void addBypassPermissions(BypassPermissions delegateFunc) | 90 | public void addSetBypassPermissions(SetBypassPermissions delegateFunc) |
112 | { | 91 | { |
113 | if (!BypassPermissionsCheckFunctions.Contains(delegateFunc)) | 92 | if (!SetBypassPermissionsCheckFunctions.Contains(delegateFunc)) |
114 | BypassPermissionsCheckFunctions.Add(delegateFunc); | 93 | SetBypassPermissionsCheckFunctions.Add(delegateFunc); |
115 | } | 94 | } |
116 | public void removeBypassPermissions(BypassPermissions delegateFunc) | 95 | |
96 | public void removeSetBypassPermissions(SetBypassPermissions delegateFunc) | ||
97 | { | ||
98 | if (SetBypassPermissionsCheckFunctions.Contains(delegateFunc)) | ||
99 | SetBypassPermissionsCheckFunctions.Remove(delegateFunc); | ||
100 | } | ||
101 | |||
102 | public void ExternalChecksSetBypassPermissions(bool value) | ||
103 | { | ||
104 | foreach (SetBypassPermissions check in SetBypassPermissionsCheckFunctions) | ||
117 | { | 105 | { |
118 | if (BypassPermissionsCheckFunctions.Contains(delegateFunc)) | 106 | check(value); |
119 | BypassPermissionsCheckFunctions.Remove(delegateFunc); | ||
120 | } | 107 | } |
108 | } | ||
121 | 109 | ||
122 | public bool ExternalChecksBypassPermissions() | 110 | public delegate bool BypassPermissions(); |
111 | private List<BypassPermissions> BypassPermissionsCheckFunctions = new List<BypassPermissions>(); | ||
112 | |||
113 | public void addBypassPermissions(BypassPermissions delegateFunc) | ||
114 | { | ||
115 | if (!BypassPermissionsCheckFunctions.Contains(delegateFunc)) | ||
116 | BypassPermissionsCheckFunctions.Add(delegateFunc); | ||
117 | } | ||
118 | |||
119 | public void removeBypassPermissions(BypassPermissions delegateFunc) | ||
120 | { | ||
121 | if (BypassPermissionsCheckFunctions.Contains(delegateFunc)) | ||
122 | BypassPermissionsCheckFunctions.Remove(delegateFunc); | ||
123 | } | ||
124 | |||
125 | public bool ExternalChecksBypassPermissions() | ||
126 | { | ||
127 | foreach (BypassPermissions check in BypassPermissionsCheckFunctions) | ||
123 | { | 128 | { |
124 | foreach (BypassPermissions check in BypassPermissionsCheckFunctions) | 129 | if (check() == false) |
125 | { | 130 | { |
126 | if (check() == false) | 131 | return false; |
127 | { | ||
128 | return false; | ||
129 | } | ||
130 | } | 132 | } |
131 | return true; | ||
132 | } | 133 | } |
134 | return true; | ||
135 | } | ||
133 | 136 | ||
134 | public delegate bool PropagatePermissions(); | 137 | public delegate bool PropagatePermissions(); |
135 | private List<PropagatePermissions> PropagatePermissionsCheckFunctions = new List<PropagatePermissions>(); | 138 | private List<PropagatePermissions> PropagatePermissionsCheckFunctions = new List<PropagatePermissions>(); |
136 | 139 | ||
137 | public void addPropagatePermissions(PropagatePermissions delegateFunc) | 140 | public void addPropagatePermissions(PropagatePermissions delegateFunc) |
138 | { | 141 | { |
139 | if (!PropagatePermissionsCheckFunctions.Contains(delegateFunc)) | 142 | if (!PropagatePermissionsCheckFunctions.Contains(delegateFunc)) |
140 | PropagatePermissionsCheckFunctions.Add(delegateFunc); | 143 | PropagatePermissionsCheckFunctions.Add(delegateFunc); |
141 | } | 144 | } |
142 | public void removePropagatePermissions(PropagatePermissions delegateFunc) | ||
143 | { | ||
144 | if (PropagatePermissionsCheckFunctions.Contains(delegateFunc)) | ||
145 | PropagatePermissionsCheckFunctions.Remove(delegateFunc); | ||
146 | } | ||
147 | 145 | ||
148 | public bool ExternalChecksPropagatePermissions() | 146 | public void removePropagatePermissions(PropagatePermissions delegateFunc) |
147 | { | ||
148 | if (PropagatePermissionsCheckFunctions.Contains(delegateFunc)) | ||
149 | PropagatePermissionsCheckFunctions.Remove(delegateFunc); | ||
150 | } | ||
151 | |||
152 | public bool ExternalChecksPropagatePermissions() | ||
153 | { | ||
154 | foreach (PropagatePermissions check in PropagatePermissionsCheckFunctions) | ||
149 | { | 155 | { |
150 | foreach (PropagatePermissions check in PropagatePermissionsCheckFunctions) | 156 | if (check() == false) |
151 | { | 157 | { |
152 | if (check() == false) | 158 | return false; |
153 | { | ||
154 | return false; | ||
155 | } | ||
156 | } | 159 | } |
157 | return true; | ||
158 | } | 160 | } |
161 | return true; | ||
162 | } | ||
159 | 163 | ||
160 | #region REZ OBJECT | 164 | #region REZ OBJECT |
161 | public delegate bool CanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition, Scene scene); | 165 | public delegate bool CanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition, Scene scene); |
162 | private List<CanRezObject> CanRezObjectCheckFunctions = new List<CanRezObject>(); | 166 | private List<CanRezObject> CanRezObjectCheckFunctions = new List<CanRezObject>(); |
163 | 167 | ||
164 | public void addCheckRezObject(CanRezObject delegateFunc) | 168 | public void addCheckRezObject(CanRezObject delegateFunc) |
165 | { | 169 | { |
166 | if (!CanRezObjectCheckFunctions.Contains(delegateFunc)) | 170 | if (!CanRezObjectCheckFunctions.Contains(delegateFunc)) |
167 | CanRezObjectCheckFunctions.Add(delegateFunc); | 171 | CanRezObjectCheckFunctions.Add(delegateFunc); |
168 | } | 172 | } |
169 | public void removeCheckRezObject(CanRezObject delegateFunc) | ||
170 | { | ||
171 | if (CanRezObjectCheckFunctions.Contains(delegateFunc)) | ||
172 | CanRezObjectCheckFunctions.Remove(delegateFunc); | ||
173 | } | ||
174 | 173 | ||
175 | public bool ExternalChecksCanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition) | 174 | public void removeCheckRezObject(CanRezObject delegateFunc) |
175 | { | ||
176 | if (CanRezObjectCheckFunctions.Contains(delegateFunc)) | ||
177 | CanRezObjectCheckFunctions.Remove(delegateFunc); | ||
178 | } | ||
179 | |||
180 | public bool ExternalChecksCanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition) | ||
181 | { | ||
182 | foreach (CanRezObject check in CanRezObjectCheckFunctions) | ||
176 | { | 183 | { |
177 | foreach (CanRezObject check in CanRezObjectCheckFunctions) | 184 | if (check(objectCount, owner,objectPosition, m_scene) == false) |
178 | { | 185 | { |
179 | if (check(objectCount, owner,objectPosition, m_scene) == false) | 186 | return false; |
180 | { | ||
181 | return false; | ||
182 | } | ||
183 | } | 187 | } |
184 | return true; | ||
185 | } | 188 | } |
189 | return true; | ||
190 | } | ||
186 | 191 | ||
187 | #endregion | 192 | #endregion |
188 | 193 | ||
189 | #region DELETE OBJECT | 194 | #region DELETE OBJECT |
190 | public delegate bool CanDeleteObject(LLUUID objectID, LLUUID deleter, Scene scene); | 195 | public delegate bool CanDeleteObject(LLUUID objectID, LLUUID deleter, Scene scene); |
191 | private List<CanDeleteObject> CanDeleteObjectCheckFunctions = new List<CanDeleteObject>(); | 196 | private List<CanDeleteObject> CanDeleteObjectCheckFunctions = new List<CanDeleteObject>(); |
192 | 197 | ||
193 | public void addCheckDeleteObject(CanDeleteObject delegateFunc) | 198 | public void addCheckDeleteObject(CanDeleteObject delegateFunc) |
194 | { | 199 | { |
195 | if (!CanDeleteObjectCheckFunctions.Contains(delegateFunc)) | 200 | if (!CanDeleteObjectCheckFunctions.Contains(delegateFunc)) |
196 | CanDeleteObjectCheckFunctions.Add(delegateFunc); | 201 | CanDeleteObjectCheckFunctions.Add(delegateFunc); |
197 | } | 202 | } |
198 | public void removeCheckDeleteObject(CanDeleteObject delegateFunc) | ||
199 | { | ||
200 | if (CanDeleteObjectCheckFunctions.Contains(delegateFunc)) | ||
201 | CanDeleteObjectCheckFunctions.Remove(delegateFunc); | ||
202 | } | ||
203 | 203 | ||
204 | public bool ExternalChecksCanDeleteObject(LLUUID objectID, LLUUID deleter) | 204 | public void removeCheckDeleteObject(CanDeleteObject delegateFunc) |
205 | { | ||
206 | if (CanDeleteObjectCheckFunctions.Contains(delegateFunc)) | ||
207 | CanDeleteObjectCheckFunctions.Remove(delegateFunc); | ||
208 | } | ||
209 | |||
210 | public bool ExternalChecksCanDeleteObject(LLUUID objectID, LLUUID deleter) | ||
211 | { | ||
212 | foreach (CanDeleteObject check in CanDeleteObjectCheckFunctions) | ||
205 | { | 213 | { |
206 | foreach (CanDeleteObject check in CanDeleteObjectCheckFunctions) | 214 | if (check(objectID,deleter,m_scene) == false) |
207 | { | 215 | { |
208 | if (check(objectID,deleter,m_scene) == false) | 216 | return false; |
209 | { | ||
210 | return false; | ||
211 | } | ||
212 | } | 217 | } |
213 | return true; | ||
214 | } | 218 | } |
219 | return true; | ||
220 | } | ||
215 | 221 | ||
216 | #endregion | 222 | #endregion |
217 | 223 | ||
218 | #region TAKE OBJECT | 224 | #region TAKE OBJECT |
219 | public delegate bool CanTakeObject(LLUUID objectID, LLUUID stealer, Scene scene); | 225 | public delegate bool CanTakeObject(LLUUID objectID, LLUUID stealer, Scene scene); |
220 | private List<CanTakeObject> CanTakeObjectCheckFunctions = new List<CanTakeObject>(); | 226 | private List<CanTakeObject> CanTakeObjectCheckFunctions = new List<CanTakeObject>(); |
221 | 227 | ||
222 | public void addCheckTakeObject(CanTakeObject delegateFunc) | 228 | public void addCheckTakeObject(CanTakeObject delegateFunc) |
223 | { | 229 | { |
224 | if (!CanTakeObjectCheckFunctions.Contains(delegateFunc)) | 230 | if (!CanTakeObjectCheckFunctions.Contains(delegateFunc)) |
225 | CanTakeObjectCheckFunctions.Add(delegateFunc); | 231 | CanTakeObjectCheckFunctions.Add(delegateFunc); |
226 | } | 232 | } |
227 | public void removeCheckTakeObject(CanTakeObject delegateFunc) | ||
228 | { | ||
229 | if (CanTakeObjectCheckFunctions.Contains(delegateFunc)) | ||
230 | CanTakeObjectCheckFunctions.Remove(delegateFunc); | ||
231 | } | ||
232 | 233 | ||
233 | public bool ExternalChecksCanTakeObject(LLUUID objectID, LLUUID AvatarTakingUUID) | 234 | public void removeCheckTakeObject(CanTakeObject delegateFunc) |
235 | { | ||
236 | if (CanTakeObjectCheckFunctions.Contains(delegateFunc)) | ||
237 | CanTakeObjectCheckFunctions.Remove(delegateFunc); | ||
238 | } | ||
239 | |||
240 | public bool ExternalChecksCanTakeObject(LLUUID objectID, LLUUID AvatarTakingUUID) | ||
241 | { | ||
242 | foreach (CanTakeObject check in CanTakeObjectCheckFunctions) | ||
234 | { | 243 | { |
235 | foreach (CanTakeObject check in CanTakeObjectCheckFunctions) | 244 | if (check(objectID, AvatarTakingUUID, m_scene) == false) |
236 | { | 245 | { |
237 | if (check(objectID, AvatarTakingUUID, m_scene) == false) | 246 | return false; |
238 | { | ||
239 | return false; | ||
240 | } | ||
241 | } | 247 | } |
242 | return true; | ||
243 | } | 248 | } |
249 | return true; | ||
250 | } | ||
244 | 251 | ||
245 | #endregion | 252 | #endregion |
246 | 253 | ||
247 | #region TAKE COPY OBJECT | 254 | #region TAKE COPY OBJECT |
248 | public delegate bool CanTakeCopyObject(LLUUID objectID, LLUUID userID, Scene inScene); | 255 | public delegate bool CanTakeCopyObject(LLUUID objectID, LLUUID userID, Scene inScene); |
249 | private List<CanTakeCopyObject> CanTakeCopyObjectCheckFunctions = new List<CanTakeCopyObject>(); | 256 | private List<CanTakeCopyObject> CanTakeCopyObjectCheckFunctions = new List<CanTakeCopyObject>(); |
250 | 257 | ||
251 | public void addCheckTakeCopyObject(CanTakeCopyObject delegateFunc) | 258 | public void addCheckTakeCopyObject(CanTakeCopyObject delegateFunc) |
252 | { | 259 | { |
253 | if (!CanTakeCopyObjectCheckFunctions.Contains(delegateFunc)) | 260 | if (!CanTakeCopyObjectCheckFunctions.Contains(delegateFunc)) |
254 | CanTakeCopyObjectCheckFunctions.Add(delegateFunc); | 261 | CanTakeCopyObjectCheckFunctions.Add(delegateFunc); |
255 | } | 262 | } |
256 | public void removeCheckTakeCopyObject(CanTakeCopyObject delegateFunc) | ||
257 | { | ||
258 | if (CanTakeCopyObjectCheckFunctions.Contains(delegateFunc)) | ||
259 | CanTakeCopyObjectCheckFunctions.Remove(delegateFunc); | ||
260 | } | ||
261 | 263 | ||
262 | public bool ExternalChecksCanTakeCopyObject(LLUUID objectID, LLUUID userID) | 264 | public void removeCheckTakeCopyObject(CanTakeCopyObject delegateFunc) |
265 | { | ||
266 | if (CanTakeCopyObjectCheckFunctions.Contains(delegateFunc)) | ||
267 | CanTakeCopyObjectCheckFunctions.Remove(delegateFunc); | ||
268 | } | ||
269 | |||
270 | public bool ExternalChecksCanTakeCopyObject(LLUUID objectID, LLUUID userID) | ||
271 | { | ||
272 | foreach (CanTakeCopyObject check in CanTakeCopyObjectCheckFunctions) | ||
263 | { | 273 | { |
264 | foreach (CanTakeCopyObject check in CanTakeCopyObjectCheckFunctions) | 274 | if (check(objectID,userID,m_scene) == false) |
265 | { | 275 | { |
266 | if (check(objectID,userID,m_scene) == false) | 276 | return false; |
267 | { | ||
268 | return false; | ||
269 | } | ||
270 | } | 277 | } |
271 | return true; | ||
272 | } | 278 | } |
279 | return true; | ||
280 | } | ||
273 | 281 | ||
274 | #endregion | 282 | #endregion |
275 | 283 | ||
276 | #region DUPLICATE OBJECT | 284 | #region DUPLICATE OBJECT |
277 | public delegate bool CanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, Scene scene, LLVector3 objectPosition); | 285 | public delegate bool CanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, Scene scene, LLVector3 objectPosition); |
278 | private List<CanDuplicateObject> CanDuplicateObjectCheckFunctions = new List<CanDuplicateObject>(); | 286 | private List<CanDuplicateObject> CanDuplicateObjectCheckFunctions = new List<CanDuplicateObject>(); |
279 | 287 | ||
280 | public void addCheckDuplicateObject(CanDuplicateObject delegateFunc) | 288 | public void addCheckDuplicateObject(CanDuplicateObject delegateFunc) |
281 | { | 289 | { |
282 | if (!CanDuplicateObjectCheckFunctions.Contains(delegateFunc)) | 290 | if (!CanDuplicateObjectCheckFunctions.Contains(delegateFunc)) |
283 | CanDuplicateObjectCheckFunctions.Add(delegateFunc); | 291 | CanDuplicateObjectCheckFunctions.Add(delegateFunc); |
284 | } | 292 | } |
285 | public void removeCheckDuplicateObject(CanDuplicateObject delegateFunc) | ||
286 | { | ||
287 | if (CanDuplicateObjectCheckFunctions.Contains(delegateFunc)) | ||
288 | CanDuplicateObjectCheckFunctions.Remove(delegateFunc); | ||
289 | } | ||
290 | 293 | ||
291 | public bool ExternalChecksCanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, LLVector3 objectPosition) | 294 | public void removeCheckDuplicateObject(CanDuplicateObject delegateFunc) |
295 | { | ||
296 | if (CanDuplicateObjectCheckFunctions.Contains(delegateFunc)) | ||
297 | CanDuplicateObjectCheckFunctions.Remove(delegateFunc); | ||
298 | } | ||
299 | |||
300 | public bool ExternalChecksCanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, LLVector3 objectPosition) | ||
301 | { | ||
302 | foreach (CanDuplicateObject check in CanDuplicateObjectCheckFunctions) | ||
292 | { | 303 | { |
293 | foreach (CanDuplicateObject check in CanDuplicateObjectCheckFunctions) | 304 | if (check(objectCount, objectID, owner, m_scene, objectPosition) == false) |
294 | { | 305 | { |
295 | if (check(objectCount, objectID, owner, m_scene, objectPosition) == false) | 306 | return false; |
296 | { | ||
297 | return false; | ||
298 | } | ||
299 | } | 307 | } |
300 | return true; | ||
301 | } | 308 | } |
309 | return true; | ||
310 | } | ||
302 | 311 | ||
303 | #endregion | 312 | #endregion |
304 | 313 | ||
305 | #region EDIT OBJECT | 314 | #region EDIT OBJECT |
306 | public delegate bool CanEditObject(LLUUID objectID, LLUUID editorID, Scene scene); | 315 | public delegate bool CanEditObject(LLUUID objectID, LLUUID editorID, Scene scene); |
307 | private List<CanEditObject> CanEditObjectCheckFunctions = new List<CanEditObject>(); | 316 | private List<CanEditObject> CanEditObjectCheckFunctions = new List<CanEditObject>(); |
308 | 317 | ||
309 | public void addCheckEditObject(CanEditObject delegateFunc) | 318 | public void addCheckEditObject(CanEditObject delegateFunc) |
310 | { | 319 | { |
311 | if (!CanEditObjectCheckFunctions.Contains(delegateFunc)) | 320 | if (!CanEditObjectCheckFunctions.Contains(delegateFunc)) |
312 | CanEditObjectCheckFunctions.Add(delegateFunc); | 321 | CanEditObjectCheckFunctions.Add(delegateFunc); |
313 | } | 322 | } |
314 | public void removeCheckEditObject(CanEditObject delegateFunc) | ||
315 | { | ||
316 | if (CanEditObjectCheckFunctions.Contains(delegateFunc)) | ||
317 | CanEditObjectCheckFunctions.Remove(delegateFunc); | ||
318 | } | ||
319 | 323 | ||
320 | public bool ExternalChecksCanEditObject(LLUUID objectID, LLUUID editorID) | 324 | public void removeCheckEditObject(CanEditObject delegateFunc) |
325 | { | ||
326 | if (CanEditObjectCheckFunctions.Contains(delegateFunc)) | ||
327 | CanEditObjectCheckFunctions.Remove(delegateFunc); | ||
328 | } | ||
329 | |||
330 | public bool ExternalChecksCanEditObject(LLUUID objectID, LLUUID editorID) | ||
331 | { | ||
332 | foreach (CanEditObject check in CanEditObjectCheckFunctions) | ||
321 | { | 333 | { |
322 | foreach (CanEditObject check in CanEditObjectCheckFunctions) | 334 | if (check(objectID, editorID, m_scene) == false) |
323 | { | 335 | { |
324 | if (check(objectID, editorID, m_scene) == false) | 336 | return false; |
325 | { | ||
326 | return false; | ||
327 | } | ||
328 | } | 337 | } |
329 | return true; | ||
330 | } | 338 | } |
339 | return true; | ||
340 | } | ||
331 | 341 | ||
332 | #endregion | 342 | #endregion |
333 | 343 | ||
334 | #region MOVE OBJECT | 344 | #region MOVE OBJECT |
335 | public delegate bool CanMoveObject(LLUUID objectID, LLUUID moverID, Scene scene); | 345 | public delegate bool CanMoveObject(LLUUID objectID, LLUUID moverID, Scene scene); |
336 | private List<CanMoveObject> CanMoveObjectCheckFunctions = new List<CanMoveObject>(); | 346 | private List<CanMoveObject> CanMoveObjectCheckFunctions = new List<CanMoveObject>(); |
337 | 347 | ||
338 | public void addCheckMoveObject(CanMoveObject delegateFunc) | 348 | public void addCheckMoveObject(CanMoveObject delegateFunc) |
339 | { | 349 | { |
340 | if (!CanMoveObjectCheckFunctions.Contains(delegateFunc)) | 350 | if (!CanMoveObjectCheckFunctions.Contains(delegateFunc)) |
341 | CanMoveObjectCheckFunctions.Add(delegateFunc); | 351 | CanMoveObjectCheckFunctions.Add(delegateFunc); |
342 | } | 352 | } |
343 | public void removeCheckMoveObject(CanMoveObject delegateFunc) | ||
344 | { | ||
345 | if (CanMoveObjectCheckFunctions.Contains(delegateFunc)) | ||
346 | CanMoveObjectCheckFunctions.Remove(delegateFunc); | ||
347 | } | ||
348 | 353 | ||
349 | public bool ExternalChecksCanMoveObject(LLUUID objectID, LLUUID moverID) | 354 | public void removeCheckMoveObject(CanMoveObject delegateFunc) |
355 | { | ||
356 | if (CanMoveObjectCheckFunctions.Contains(delegateFunc)) | ||
357 | CanMoveObjectCheckFunctions.Remove(delegateFunc); | ||
358 | } | ||
359 | |||
360 | public bool ExternalChecksCanMoveObject(LLUUID objectID, LLUUID moverID) | ||
361 | { | ||
362 | foreach (CanMoveObject check in CanMoveObjectCheckFunctions) | ||
350 | { | 363 | { |
351 | foreach (CanMoveObject check in CanMoveObjectCheckFunctions) | 364 | if (check(objectID,moverID,m_scene) == false) |
352 | { | 365 | { |
353 | if (check(objectID,moverID,m_scene) == false) | 366 | return false; |
354 | { | ||
355 | return false; | ||
356 | } | ||
357 | } | 367 | } |
358 | return true; | ||
359 | } | 368 | } |
369 | return true; | ||
370 | } | ||
360 | 371 | ||
361 | #endregion | 372 | #endregion |
362 | 373 | ||
363 | #region OBJECT ENTRY | 374 | #region OBJECT ENTRY |
364 | public delegate bool CanObjectEntry(LLUUID objectID, LLVector3 newPoint, Scene scene); | 375 | public delegate bool CanObjectEntry(LLUUID objectID, LLVector3 newPoint, Scene scene); |
365 | private List<CanObjectEntry> CanObjectEntryCheckFunctions = new List<CanObjectEntry>(); | 376 | private List<CanObjectEntry> CanObjectEntryCheckFunctions = new List<CanObjectEntry>(); |
366 | 377 | ||
367 | public void addCheckObjectEntry(CanObjectEntry delegateFunc) | 378 | public void addCheckObjectEntry(CanObjectEntry delegateFunc) |
368 | { | 379 | { |
369 | if (!CanObjectEntryCheckFunctions.Contains(delegateFunc)) | 380 | if (!CanObjectEntryCheckFunctions.Contains(delegateFunc)) |
370 | CanObjectEntryCheckFunctions.Add(delegateFunc); | 381 | CanObjectEntryCheckFunctions.Add(delegateFunc); |
371 | } | 382 | } |
372 | public void removeCheckObjectEntry(CanObjectEntry delegateFunc) | ||
373 | { | ||
374 | if (CanObjectEntryCheckFunctions.Contains(delegateFunc)) | ||
375 | CanObjectEntryCheckFunctions.Remove(delegateFunc); | ||
376 | } | ||
377 | 383 | ||
378 | public bool ExternalChecksCanObjectEntry(LLUUID objectID, LLVector3 newPoint) | 384 | public void removeCheckObjectEntry(CanObjectEntry delegateFunc) |
385 | { | ||
386 | if (CanObjectEntryCheckFunctions.Contains(delegateFunc)) | ||
387 | CanObjectEntryCheckFunctions.Remove(delegateFunc); | ||
388 | } | ||
389 | |||
390 | public bool ExternalChecksCanObjectEntry(LLUUID objectID, LLVector3 newPoint) | ||
391 | { | ||
392 | foreach (CanObjectEntry check in CanObjectEntryCheckFunctions) | ||
379 | { | 393 | { |
380 | foreach (CanObjectEntry check in CanObjectEntryCheckFunctions) | 394 | if (check(objectID, newPoint, m_scene) == false) |
381 | { | 395 | { |
382 | if (check(objectID, newPoint, m_scene) == false) | 396 | return false; |
383 | { | ||
384 | return false; | ||
385 | } | ||
386 | } | 397 | } |
387 | return true; | ||
388 | } | 398 | } |
399 | return true; | ||
400 | } | ||
389 | 401 | ||
390 | #endregion | 402 | #endregion |
391 | 403 | ||
392 | #region RETURN OBJECT | 404 | #region RETURN OBJECT |
393 | public delegate bool CanReturnObject(LLUUID objectID, LLUUID returnerID, Scene scene); | 405 | public delegate bool CanReturnObject(LLUUID objectID, LLUUID returnerID, Scene scene); |
394 | private List<CanReturnObject> CanReturnObjectCheckFunctions = new List<CanReturnObject>(); | 406 | private List<CanReturnObject> CanReturnObjectCheckFunctions = new List<CanReturnObject>(); |
395 | 407 | ||
396 | public void addCheckReturnObject(CanReturnObject delegateFunc) | 408 | public void addCheckReturnObject(CanReturnObject delegateFunc) |
397 | { | 409 | { |
398 | if (!CanReturnObjectCheckFunctions.Contains(delegateFunc)) | 410 | if (!CanReturnObjectCheckFunctions.Contains(delegateFunc)) |
399 | CanReturnObjectCheckFunctions.Add(delegateFunc); | 411 | CanReturnObjectCheckFunctions.Add(delegateFunc); |
400 | } | 412 | } |
401 | public void removeCheckReturnObject(CanReturnObject delegateFunc) | ||
402 | { | ||
403 | if (CanReturnObjectCheckFunctions.Contains(delegateFunc)) | ||
404 | CanReturnObjectCheckFunctions.Remove(delegateFunc); | ||
405 | } | ||
406 | 413 | ||
407 | public bool ExternalChecksCanReturnObject(LLUUID objectID, LLUUID returnerID) | 414 | public void removeCheckReturnObject(CanReturnObject delegateFunc) |
415 | { | ||
416 | if (CanReturnObjectCheckFunctions.Contains(delegateFunc)) | ||
417 | CanReturnObjectCheckFunctions.Remove(delegateFunc); | ||
418 | } | ||
419 | |||
420 | public bool ExternalChecksCanReturnObject(LLUUID objectID, LLUUID returnerID) | ||
421 | { | ||
422 | foreach (CanReturnObject check in CanReturnObjectCheckFunctions) | ||
408 | { | 423 | { |
409 | foreach (CanReturnObject check in CanReturnObjectCheckFunctions) | 424 | if (check(objectID,returnerID,m_scene) == false) |
410 | { | 425 | { |
411 | if (check(objectID,returnerID,m_scene) == false) | 426 | return false; |
412 | { | ||
413 | return false; | ||
414 | } | ||
415 | } | 427 | } |
416 | return true; | ||
417 | } | 428 | } |
429 | return true; | ||
430 | } | ||
418 | 431 | ||
419 | #endregion | 432 | #endregion |
420 | 433 | ||
421 | #region INSTANT MESSAGE | 434 | #region INSTANT MESSAGE |
422 | public delegate bool CanInstantMessage(LLUUID user, LLUUID target, Scene startScene); | 435 | public delegate bool CanInstantMessage(LLUUID user, LLUUID target, Scene startScene); |
423 | private List<CanInstantMessage> CanInstantMessageCheckFunctions = new List<CanInstantMessage>(); | 436 | private List<CanInstantMessage> CanInstantMessageCheckFunctions = new List<CanInstantMessage>(); |
424 | 437 | ||
425 | public void addCheckInstantMessage(CanInstantMessage delegateFunc) | 438 | public void addCheckInstantMessage(CanInstantMessage delegateFunc) |
426 | { | 439 | { |
427 | if (!CanInstantMessageCheckFunctions.Contains(delegateFunc)) | 440 | if (!CanInstantMessageCheckFunctions.Contains(delegateFunc)) |
428 | CanInstantMessageCheckFunctions.Add(delegateFunc); | 441 | CanInstantMessageCheckFunctions.Add(delegateFunc); |
429 | } | 442 | } |
430 | public void removeCheckInstantMessage(CanInstantMessage delegateFunc) | 443 | |
431 | { | 444 | public void removeCheckInstantMessage(CanInstantMessage delegateFunc) |
432 | if (CanInstantMessageCheckFunctions.Contains(delegateFunc)) | 445 | { |
433 | CanInstantMessageCheckFunctions.Remove(delegateFunc); | 446 | if (CanInstantMessageCheckFunctions.Contains(delegateFunc)) |
434 | } | 447 | CanInstantMessageCheckFunctions.Remove(delegateFunc); |
448 | } | ||
435 | 449 | ||
436 | public bool ExternalChecksCanInstantMessage(LLUUID user, LLUUID target) | 450 | public bool ExternalChecksCanInstantMessage(LLUUID user, LLUUID target) |
451 | { | ||
452 | foreach (CanInstantMessage check in CanInstantMessageCheckFunctions) | ||
437 | { | 453 | { |
438 | foreach (CanInstantMessage check in CanInstantMessageCheckFunctions) | 454 | if (check(user, target, m_scene) == false) |
439 | { | 455 | { |
440 | if (check(user, target, m_scene) == false) | 456 | return false; |
441 | { | ||
442 | return false; | ||
443 | } | ||
444 | } | 457 | } |
445 | return true; | ||
446 | } | 458 | } |
459 | return true; | ||
460 | } | ||
447 | 461 | ||
448 | #endregion | 462 | #endregion |
449 | 463 | ||
450 | #region INVENTORY TRANSFER | 464 | #region INVENTORY TRANSFER |
451 | public delegate bool CanInventoryTransfer(LLUUID user, LLUUID target, Scene startScene); | 465 | public delegate bool CanInventoryTransfer(LLUUID user, LLUUID target, Scene startScene); |
452 | private List<CanInventoryTransfer> CanInventoryTransferCheckFunctions = new List<CanInventoryTransfer>(); | 466 | private List<CanInventoryTransfer> CanInventoryTransferCheckFunctions = new List<CanInventoryTransfer>(); |
453 | 467 | ||
454 | public void addCheckInventoryTransfer(CanInventoryTransfer delegateFunc) | 468 | public void addCheckInventoryTransfer(CanInventoryTransfer delegateFunc) |
455 | { | 469 | { |
456 | if (!CanInventoryTransferCheckFunctions.Contains(delegateFunc)) | 470 | if (!CanInventoryTransferCheckFunctions.Contains(delegateFunc)) |
457 | CanInventoryTransferCheckFunctions.Add(delegateFunc); | 471 | CanInventoryTransferCheckFunctions.Add(delegateFunc); |
458 | } | 472 | } |
459 | public void removeCheckInventoryTransfer(CanInventoryTransfer delegateFunc) | 473 | |
474 | public void removeCheckInventoryTransfer(CanInventoryTransfer delegateFunc) | ||
460 | { | 475 | { |
461 | if (CanInventoryTransferCheckFunctions.Contains(delegateFunc)) | 476 | if (CanInventoryTransferCheckFunctions.Contains(delegateFunc)) |
462 | CanInventoryTransferCheckFunctions.Remove(delegateFunc); | 477 | CanInventoryTransferCheckFunctions.Remove(delegateFunc); |
463 | } | 478 | } |
464 | 479 | ||
465 | public bool ExternalChecksCanInventoryTransfer(LLUUID user, LLUUID target) | 480 | public bool ExternalChecksCanInventoryTransfer(LLUUID user, LLUUID target) |
481 | { | ||
482 | foreach (CanInventoryTransfer check in CanInventoryTransferCheckFunctions) | ||
466 | { | 483 | { |
467 | foreach (CanInventoryTransfer check in CanInventoryTransferCheckFunctions) | 484 | if (check(user, target, m_scene) == false) |
468 | { | 485 | { |
469 | if (check(user, target, m_scene) == false) | 486 | return false; |
470 | { | ||
471 | return false; | ||
472 | } | ||
473 | } | 487 | } |
474 | return true; | ||
475 | } | 488 | } |
489 | return true; | ||
490 | } | ||
476 | 491 | ||
477 | #endregion | 492 | #endregion |
478 | 493 | ||
479 | #region VIEW SCRIPT | 494 | #region VIEW SCRIPT |
480 | public delegate bool CanViewScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); | 495 | public delegate bool CanViewScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); |
481 | private List<CanViewScript> CanViewScriptCheckFunctions = new List<CanViewScript>(); | 496 | private List<CanViewScript> CanViewScriptCheckFunctions = new List<CanViewScript>(); |
482 | 497 | ||
483 | public void addCheckViewScript(CanViewScript delegateFunc) | 498 | public void addCheckViewScript(CanViewScript delegateFunc) |
484 | { | 499 | { |
485 | if (!CanViewScriptCheckFunctions.Contains(delegateFunc)) | 500 | if (!CanViewScriptCheckFunctions.Contains(delegateFunc)) |
486 | CanViewScriptCheckFunctions.Add(delegateFunc); | 501 | CanViewScriptCheckFunctions.Add(delegateFunc); |
487 | } | 502 | } |
488 | public void removeCheckViewScript(CanViewScript delegateFunc) | ||
489 | { | ||
490 | if (CanViewScriptCheckFunctions.Contains(delegateFunc)) | ||
491 | CanViewScriptCheckFunctions.Remove(delegateFunc); | ||
492 | } | ||
493 | 503 | ||
494 | public bool ExternalChecksCanViewScript(LLUUID script, LLUUID objectID, LLUUID user) | 504 | public void removeCheckViewScript(CanViewScript delegateFunc) |
505 | { | ||
506 | if (CanViewScriptCheckFunctions.Contains(delegateFunc)) | ||
507 | CanViewScriptCheckFunctions.Remove(delegateFunc); | ||
508 | } | ||
509 | |||
510 | public bool ExternalChecksCanViewScript(LLUUID script, LLUUID objectID, LLUUID user) | ||
511 | { | ||
512 | foreach (CanViewScript check in CanViewScriptCheckFunctions) | ||
495 | { | 513 | { |
496 | foreach (CanViewScript check in CanViewScriptCheckFunctions) | 514 | if (check(script, objectID, user, m_scene) == false) |
497 | { | 515 | { |
498 | if (check(script, objectID, user, m_scene) == false) | 516 | return false; |
499 | { | ||
500 | return false; | ||
501 | } | ||
502 | } | 517 | } |
503 | return true; | ||
504 | } | 518 | } |
519 | return true; | ||
520 | } | ||
505 | 521 | ||
506 | public delegate bool CanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); | 522 | public delegate bool CanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); |
507 | private List<CanViewNotecard> CanViewNotecardCheckFunctions = new List<CanViewNotecard>(); | 523 | private List<CanViewNotecard> CanViewNotecardCheckFunctions = new List<CanViewNotecard>(); |
508 | 524 | ||
509 | public void addCheckViewNotecard(CanViewNotecard delegateFunc) | 525 | public void addCheckViewNotecard(CanViewNotecard delegateFunc) |
510 | { | 526 | { |
511 | if (!CanViewNotecardCheckFunctions.Contains(delegateFunc)) | 527 | if (!CanViewNotecardCheckFunctions.Contains(delegateFunc)) |
512 | CanViewNotecardCheckFunctions.Add(delegateFunc); | 528 | CanViewNotecardCheckFunctions.Add(delegateFunc); |
513 | } | 529 | } |
514 | public void removeCheckViewNotecard(CanViewNotecard delegateFunc) | 530 | |
515 | { | 531 | public void removeCheckViewNotecard(CanViewNotecard delegateFunc) |
516 | if (CanViewNotecardCheckFunctions.Contains(delegateFunc)) | 532 | { |
517 | CanViewNotecardCheckFunctions.Remove(delegateFunc); | 533 | if (CanViewNotecardCheckFunctions.Contains(delegateFunc)) |
518 | } | 534 | CanViewNotecardCheckFunctions.Remove(delegateFunc); |
535 | } | ||
519 | 536 | ||
520 | public bool ExternalChecksCanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user) | 537 | public bool ExternalChecksCanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user) |
538 | { | ||
539 | foreach (CanViewNotecard check in CanViewNotecardCheckFunctions) | ||
521 | { | 540 | { |
522 | foreach (CanViewNotecard check in CanViewNotecardCheckFunctions) | 541 | if (check(script, objectID, user, m_scene) == false) |
523 | { | 542 | { |
524 | if (check(script, objectID, user, m_scene) == false) | 543 | return false; |
525 | { | ||
526 | return false; | ||
527 | } | ||
528 | } | 544 | } |
529 | return true; | ||
530 | } | 545 | } |
546 | return true; | ||
547 | } | ||
548 | |||
549 | #endregion | ||
531 | 550 | ||
532 | #endregion | 551 | #region EDIT SCRIPT |
552 | public delegate bool CanEditScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); | ||
553 | private List<CanEditScript> CanEditScriptCheckFunctions = new List<CanEditScript>(); | ||
533 | 554 | ||
534 | #region EDIT SCRIPT | 555 | public void addCheckEditScript(CanEditScript delegateFunc) |
535 | public delegate bool CanEditScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); | 556 | { |
536 | private List<CanEditScript> CanEditScriptCheckFunctions = new List<CanEditScript>(); | 557 | if (!CanEditScriptCheckFunctions.Contains(delegateFunc)) |
558 | CanEditScriptCheckFunctions.Add(delegateFunc); | ||
559 | } | ||
537 | 560 | ||
538 | public void addCheckEditScript(CanEditScript delegateFunc) | 561 | public void removeCheckEditScript(CanEditScript delegateFunc) |
539 | { | 562 | { |
540 | if (!CanEditScriptCheckFunctions.Contains(delegateFunc)) | 563 | if (CanEditScriptCheckFunctions.Contains(delegateFunc)) |
541 | CanEditScriptCheckFunctions.Add(delegateFunc); | 564 | CanEditScriptCheckFunctions.Remove(delegateFunc); |
542 | } | 565 | } |
543 | public void removeCheckEditScript(CanEditScript delegateFunc) | ||
544 | { | ||
545 | if (CanEditScriptCheckFunctions.Contains(delegateFunc)) | ||
546 | CanEditScriptCheckFunctions.Remove(delegateFunc); | ||
547 | } | ||
548 | 566 | ||
549 | public bool ExternalChecksCanEditScript(LLUUID script, LLUUID objectID, LLUUID user) | 567 | public bool ExternalChecksCanEditScript(LLUUID script, LLUUID objectID, LLUUID user) |
568 | { | ||
569 | foreach (CanEditScript check in CanEditScriptCheckFunctions) | ||
550 | { | 570 | { |
551 | foreach (CanEditScript check in CanEditScriptCheckFunctions) | 571 | if (check(script, objectID, user, m_scene) == false) |
552 | { | 572 | { |
553 | if (check(script, objectID, user, m_scene) == false) | 573 | return false; |
554 | { | ||
555 | return false; | ||
556 | } | ||
557 | } | 574 | } |
558 | return true; | ||
559 | } | 575 | } |
576 | return true; | ||
577 | } | ||
560 | 578 | ||
561 | public delegate bool CanEditNotecard(LLUUID notecard, LLUUID objectID, LLUUID user, Scene scene); | 579 | public delegate bool CanEditNotecard(LLUUID notecard, LLUUID objectID, LLUUID user, Scene scene); |
562 | private List<CanEditNotecard> CanEditNotecardCheckFunctions = new List<CanEditNotecard>(); | 580 | private List<CanEditNotecard> CanEditNotecardCheckFunctions = new List<CanEditNotecard>(); |
563 | 581 | ||
564 | public void addCheckEditNotecard(CanEditNotecard delegateFunc) | 582 | public void addCheckEditNotecard(CanEditNotecard delegateFunc) |
565 | { | 583 | { |
566 | if (!CanEditNotecardCheckFunctions.Contains(delegateFunc)) | 584 | if (!CanEditNotecardCheckFunctions.Contains(delegateFunc)) |
567 | CanEditNotecardCheckFunctions.Add(delegateFunc); | 585 | CanEditNotecardCheckFunctions.Add(delegateFunc); |
568 | } | 586 | } |
569 | public void removeCheckEditNotecard(CanEditNotecard delegateFunc) | ||
570 | { | ||
571 | if (CanEditNotecardCheckFunctions.Contains(delegateFunc)) | ||
572 | CanEditNotecardCheckFunctions.Remove(delegateFunc); | ||
573 | } | ||
574 | 587 | ||
575 | public bool ExternalChecksCanEditNotecard(LLUUID script, LLUUID objectID, LLUUID user) | 588 | public void removeCheckEditNotecard(CanEditNotecard delegateFunc) |
589 | { | ||
590 | if (CanEditNotecardCheckFunctions.Contains(delegateFunc)) | ||
591 | CanEditNotecardCheckFunctions.Remove(delegateFunc); | ||
592 | } | ||
593 | |||
594 | public bool ExternalChecksCanEditNotecard(LLUUID script, LLUUID objectID, LLUUID user) | ||
576 | { | 595 | { |
577 | foreach (CanEditNotecard check in CanEditNotecardCheckFunctions) | 596 | foreach (CanEditNotecard check in CanEditNotecardCheckFunctions) |
578 | { | 597 | { |
@@ -584,388 +603,402 @@ namespace OpenSim.Region.Environment.Scenes | |||
584 | return true; | 603 | return true; |
585 | } | 604 | } |
586 | 605 | ||
587 | #endregion | 606 | #endregion |
588 | 607 | ||
589 | #region RUN SCRIPT (When Script Placed in Object) | 608 | #region RUN SCRIPT (When Script Placed in Object) |
590 | public delegate bool CanRunScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); | 609 | public delegate bool CanRunScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); |
591 | private List<CanRunScript> CanRunScriptCheckFunctions = new List<CanRunScript>(); | 610 | private List<CanRunScript> CanRunScriptCheckFunctions = new List<CanRunScript>(); |
592 | 611 | ||
593 | public void addCheckRunScript(CanRunScript delegateFunc) | 612 | public void addCheckRunScript(CanRunScript delegateFunc) |
594 | { | 613 | { |
595 | if (!CanRunScriptCheckFunctions.Contains(delegateFunc)) | 614 | if (!CanRunScriptCheckFunctions.Contains(delegateFunc)) |
596 | CanRunScriptCheckFunctions.Add(delegateFunc); | 615 | CanRunScriptCheckFunctions.Add(delegateFunc); |
597 | } | 616 | } |
598 | public void removeCheckRunScript(CanRunScript delegateFunc) | ||
599 | { | ||
600 | if (CanRunScriptCheckFunctions.Contains(delegateFunc)) | ||
601 | CanRunScriptCheckFunctions.Remove(delegateFunc); | ||
602 | } | ||
603 | 617 | ||
604 | public bool ExternalChecksCanRunScript(LLUUID script, LLUUID objectID, LLUUID user) | 618 | public void removeCheckRunScript(CanRunScript delegateFunc) |
619 | { | ||
620 | if (CanRunScriptCheckFunctions.Contains(delegateFunc)) | ||
621 | CanRunScriptCheckFunctions.Remove(delegateFunc); | ||
622 | } | ||
623 | |||
624 | public bool ExternalChecksCanRunScript(LLUUID script, LLUUID objectID, LLUUID user) | ||
625 | { | ||
626 | foreach (CanRunScript check in CanRunScriptCheckFunctions) | ||
605 | { | 627 | { |
606 | foreach (CanRunScript check in CanRunScriptCheckFunctions) | 628 | if (check(script, objectID, user, m_scene) == false) |
607 | { | 629 | { |
608 | if (check(script, objectID, user, m_scene) == false) | 630 | return false; |
609 | { | ||
610 | return false; | ||
611 | } | ||
612 | } | 631 | } |
613 | return true; | ||
614 | } | 632 | } |
633 | return true; | ||
634 | } | ||
615 | 635 | ||
616 | #endregion | 636 | #endregion |
617 | 637 | ||
618 | #region START SCRIPT (When Script run box is Checked after placed in object) | 638 | #region START SCRIPT (When Script run box is Checked after placed in object) |
619 | public delegate bool CanStartScript(LLUUID script, LLUUID user, Scene scene); | 639 | public delegate bool CanStartScript(LLUUID script, LLUUID user, Scene scene); |
620 | private List<CanStartScript> CanStartScriptCheckFunctions = new List<CanStartScript>(); | 640 | private List<CanStartScript> CanStartScriptCheckFunctions = new List<CanStartScript>(); |
621 | 641 | ||
622 | public void addCheckStartScript(CanStartScript delegateFunc) | 642 | public void addCheckStartScript(CanStartScript delegateFunc) |
623 | { | 643 | { |
624 | if (!CanStartScriptCheckFunctions.Contains(delegateFunc)) | 644 | if (!CanStartScriptCheckFunctions.Contains(delegateFunc)) |
625 | CanStartScriptCheckFunctions.Add(delegateFunc); | 645 | CanStartScriptCheckFunctions.Add(delegateFunc); |
626 | } | 646 | } |
627 | public void removeCheckStartScript(CanStartScript delegateFunc) | ||
628 | { | ||
629 | if (CanStartScriptCheckFunctions.Contains(delegateFunc)) | ||
630 | CanStartScriptCheckFunctions.Remove(delegateFunc); | ||
631 | } | ||
632 | 647 | ||
633 | public bool ExternalChecksCanStartScript(LLUUID script, LLUUID user) | 648 | public void removeCheckStartScript(CanStartScript delegateFunc) |
649 | { | ||
650 | if (CanStartScriptCheckFunctions.Contains(delegateFunc)) | ||
651 | CanStartScriptCheckFunctions.Remove(delegateFunc); | ||
652 | } | ||
653 | |||
654 | public bool ExternalChecksCanStartScript(LLUUID script, LLUUID user) | ||
655 | { | ||
656 | foreach (CanStartScript check in CanStartScriptCheckFunctions) | ||
634 | { | 657 | { |
635 | foreach (CanStartScript check in CanStartScriptCheckFunctions) | 658 | if (check(script, user, m_scene) == false) |
636 | { | 659 | { |
637 | if (check(script, user, m_scene) == false) | 660 | return false; |
638 | { | ||
639 | return false; | ||
640 | } | ||
641 | } | 661 | } |
642 | return true; | ||
643 | } | 662 | } |
663 | return true; | ||
664 | } | ||
644 | 665 | ||
645 | #endregion | 666 | #endregion |
646 | 667 | ||
647 | #region STOP SCRIPT (When Script run box is unchecked after placed in object) | 668 | #region STOP SCRIPT (When Script run box is unchecked after placed in object) |
648 | public delegate bool CanStopScript(LLUUID script, LLUUID user, Scene scene); | 669 | public delegate bool CanStopScript(LLUUID script, LLUUID user, Scene scene); |
649 | private List<CanStopScript> CanStopScriptCheckFunctions = new List<CanStopScript>(); | 670 | private List<CanStopScript> CanStopScriptCheckFunctions = new List<CanStopScript>(); |
650 | 671 | ||
651 | public void addCheckStopScript(CanStopScript delegateFunc) | 672 | public void addCheckStopScript(CanStopScript delegateFunc) |
652 | { | 673 | { |
653 | if (!CanStopScriptCheckFunctions.Contains(delegateFunc)) | 674 | if (!CanStopScriptCheckFunctions.Contains(delegateFunc)) |
654 | CanStopScriptCheckFunctions.Add(delegateFunc); | 675 | CanStopScriptCheckFunctions.Add(delegateFunc); |
655 | } | 676 | } |
656 | public void removeCheckStopScript(CanStopScript delegateFunc) | ||
657 | { | ||
658 | if (CanStopScriptCheckFunctions.Contains(delegateFunc)) | ||
659 | CanStopScriptCheckFunctions.Remove(delegateFunc); | ||
660 | } | ||
661 | 677 | ||
662 | public bool ExternalChecksCanStopScript(LLUUID script, LLUUID user) | 678 | public void removeCheckStopScript(CanStopScript delegateFunc) |
679 | { | ||
680 | if (CanStopScriptCheckFunctions.Contains(delegateFunc)) | ||
681 | CanStopScriptCheckFunctions.Remove(delegateFunc); | ||
682 | } | ||
683 | |||
684 | public bool ExternalChecksCanStopScript(LLUUID script, LLUUID user) | ||
685 | { | ||
686 | foreach (CanStopScript check in CanStopScriptCheckFunctions) | ||
663 | { | 687 | { |
664 | foreach (CanStopScript check in CanStopScriptCheckFunctions) | 688 | if (check(script, user, m_scene) == false) |
665 | { | 689 | { |
666 | if (check(script, user, m_scene) == false) | 690 | return false; |
667 | { | ||
668 | return false; | ||
669 | } | ||
670 | } | 691 | } |
671 | return true; | ||
672 | } | 692 | } |
693 | return true; | ||
694 | } | ||
673 | 695 | ||
674 | #endregion | 696 | #endregion |
675 | 697 | ||
676 | #region RESET SCRIPT | 698 | #region RESET SCRIPT |
677 | public delegate bool CanResetScript(LLUUID script, LLUUID user, Scene scene); | 699 | public delegate bool CanResetScript(LLUUID script, LLUUID user, Scene scene); |
678 | private List<CanResetScript> CanResetScriptCheckFunctions = new List<CanResetScript>(); | 700 | private List<CanResetScript> CanResetScriptCheckFunctions = new List<CanResetScript>(); |
679 | 701 | ||
680 | public void addCheckResetScript(CanResetScript delegateFunc) | 702 | public void addCheckResetScript(CanResetScript delegateFunc) |
681 | { | 703 | { |
682 | if (!CanResetScriptCheckFunctions.Contains(delegateFunc)) | 704 | if (!CanResetScriptCheckFunctions.Contains(delegateFunc)) |
683 | CanResetScriptCheckFunctions.Add(delegateFunc); | 705 | CanResetScriptCheckFunctions.Add(delegateFunc); |
684 | } | 706 | } |
685 | public void removeCheckResetScript(CanResetScript delegateFunc) | 707 | |
686 | { | 708 | public void removeCheckResetScript(CanResetScript delegateFunc) |
687 | if (CanResetScriptCheckFunctions.Contains(delegateFunc)) | 709 | { |
688 | CanResetScriptCheckFunctions.Remove(delegateFunc); | 710 | if (CanResetScriptCheckFunctions.Contains(delegateFunc)) |
689 | } | 711 | CanResetScriptCheckFunctions.Remove(delegateFunc); |
712 | } | ||
690 | 713 | ||
691 | public bool ExternalChecksCanResetScript(LLUUID script, LLUUID user) | 714 | public bool ExternalChecksCanResetScript(LLUUID script, LLUUID user) |
715 | { | ||
716 | foreach (CanResetScript check in CanResetScriptCheckFunctions) | ||
692 | { | 717 | { |
693 | foreach (CanResetScript check in CanResetScriptCheckFunctions) | 718 | if (check(script, user, m_scene) == false) |
694 | { | 719 | { |
695 | if (check(script, user, m_scene) == false) | 720 | return false; |
696 | { | ||
697 | return false; | ||
698 | } | ||
699 | } | 721 | } |
700 | return true; | ||
701 | } | 722 | } |
723 | return true; | ||
724 | } | ||
702 | 725 | ||
703 | #endregion | 726 | #endregion |
704 | 727 | ||
705 | #region TERRAFORM LAND | 728 | #region TERRAFORM LAND |
706 | public delegate bool CanTerraformLand(LLUUID user, LLVector3 position, Scene requestFromScene); | 729 | public delegate bool CanTerraformLand(LLUUID user, LLVector3 position, Scene requestFromScene); |
707 | private List<CanTerraformLand> CanTerraformLandCheckFunctions = new List<CanTerraformLand>(); | 730 | private List<CanTerraformLand> CanTerraformLandCheckFunctions = new List<CanTerraformLand>(); |
708 | 731 | ||
709 | public void addCheckTerraformLand(CanTerraformLand delegateFunc) | 732 | public void addCheckTerraformLand(CanTerraformLand delegateFunc) |
710 | { | 733 | { |
711 | if (!CanTerraformLandCheckFunctions.Contains(delegateFunc)) | 734 | if (!CanTerraformLandCheckFunctions.Contains(delegateFunc)) |
712 | CanTerraformLandCheckFunctions.Add(delegateFunc); | 735 | CanTerraformLandCheckFunctions.Add(delegateFunc); |
713 | } | 736 | } |
714 | public void removeCheckTerraformLand(CanTerraformLand delegateFunc) | ||
715 | { | ||
716 | if (CanTerraformLandCheckFunctions.Contains(delegateFunc)) | ||
717 | CanTerraformLandCheckFunctions.Remove(delegateFunc); | ||
718 | } | ||
719 | 737 | ||
720 | public bool ExternalChecksCanTerraformLand(LLUUID user, LLVector3 pos) | 738 | public void removeCheckTerraformLand(CanTerraformLand delegateFunc) |
739 | { | ||
740 | if (CanTerraformLandCheckFunctions.Contains(delegateFunc)) | ||
741 | CanTerraformLandCheckFunctions.Remove(delegateFunc); | ||
742 | } | ||
743 | |||
744 | public bool ExternalChecksCanTerraformLand(LLUUID user, LLVector3 pos) | ||
745 | { | ||
746 | foreach (CanTerraformLand check in CanTerraformLandCheckFunctions) | ||
721 | { | 747 | { |
722 | foreach (CanTerraformLand check in CanTerraformLandCheckFunctions) | 748 | if (check(user, pos, m_scene) == false) |
723 | { | 749 | { |
724 | if (check(user, pos, m_scene) == false) | 750 | return false; |
725 | { | ||
726 | return false; | ||
727 | } | ||
728 | } | 751 | } |
729 | return true; | ||
730 | } | 752 | } |
753 | return true; | ||
754 | } | ||
731 | 755 | ||
732 | #endregion | 756 | #endregion |
733 | 757 | ||
734 | #region RUN CONSOLE COMMAND | 758 | #region RUN CONSOLE COMMAND |
735 | public delegate bool CanRunConsoleCommand(LLUUID user, Scene requestFromScene); | 759 | public delegate bool CanRunConsoleCommand(LLUUID user, Scene requestFromScene); |
736 | private List<CanRunConsoleCommand> CanRunConsoleCommandCheckFunctions = new List<CanRunConsoleCommand>(); | 760 | private List<CanRunConsoleCommand> CanRunConsoleCommandCheckFunctions = new List<CanRunConsoleCommand>(); |
737 | 761 | ||
738 | public void addCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc) | 762 | public void addCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc) |
739 | { | 763 | { |
740 | if (!CanRunConsoleCommandCheckFunctions.Contains(delegateFunc)) | 764 | if (!CanRunConsoleCommandCheckFunctions.Contains(delegateFunc)) |
741 | CanRunConsoleCommandCheckFunctions.Add(delegateFunc); | 765 | CanRunConsoleCommandCheckFunctions.Add(delegateFunc); |
742 | } | 766 | } |
743 | public void removeCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc) | ||
744 | { | ||
745 | if (CanRunConsoleCommandCheckFunctions.Contains(delegateFunc)) | ||
746 | CanRunConsoleCommandCheckFunctions.Remove(delegateFunc); | ||
747 | } | ||
748 | 767 | ||
749 | public bool ExternalChecksCanRunConsoleCommand(LLUUID user) | 768 | public void removeCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc) |
769 | { | ||
770 | if (CanRunConsoleCommandCheckFunctions.Contains(delegateFunc)) | ||
771 | CanRunConsoleCommandCheckFunctions.Remove(delegateFunc); | ||
772 | } | ||
773 | |||
774 | public bool ExternalChecksCanRunConsoleCommand(LLUUID user) | ||
775 | { | ||
776 | foreach (CanRunConsoleCommand check in CanRunConsoleCommandCheckFunctions) | ||
750 | { | 777 | { |
751 | foreach (CanRunConsoleCommand check in CanRunConsoleCommandCheckFunctions) | 778 | if (check(user, m_scene) == false) |
752 | { | 779 | { |
753 | if (check(user, m_scene) == false) | 780 | return false; |
754 | { | ||
755 | return false; | ||
756 | } | ||
757 | } | 781 | } |
758 | return true; | ||
759 | } | 782 | } |
783 | return true; | ||
784 | } | ||
760 | 785 | ||
761 | #endregion | 786 | #endregion |
762 | 787 | ||
763 | #region CAN ISSUE ESTATE COMMAND | 788 | #region CAN ISSUE ESTATE COMMAND |
764 | public delegate bool CanIssueEstateCommand(LLUUID user, Scene requestFromScene, bool ownerCommand); | 789 | public delegate bool CanIssueEstateCommand(LLUUID user, Scene requestFromScene, bool ownerCommand); |
765 | private List<CanIssueEstateCommand> CanIssueEstateCommandCheckFunctions = new List<CanIssueEstateCommand>(); | 790 | private List<CanIssueEstateCommand> CanIssueEstateCommandCheckFunctions = new List<CanIssueEstateCommand>(); |
766 | 791 | ||
767 | public void addCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc) | 792 | public void addCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc) |
768 | { | 793 | { |
769 | if (!CanIssueEstateCommandCheckFunctions.Contains(delegateFunc)) | 794 | if (!CanIssueEstateCommandCheckFunctions.Contains(delegateFunc)) |
770 | CanIssueEstateCommandCheckFunctions.Add(delegateFunc); | 795 | CanIssueEstateCommandCheckFunctions.Add(delegateFunc); |
771 | } | 796 | } |
772 | public void removeCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc) | ||
773 | { | ||
774 | if (CanIssueEstateCommandCheckFunctions.Contains(delegateFunc)) | ||
775 | CanIssueEstateCommandCheckFunctions.Remove(delegateFunc); | ||
776 | } | ||
777 | 797 | ||
778 | public bool ExternalChecksCanIssueEstateCommand(LLUUID user, bool ownerCommand) | 798 | public void removeCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc) |
799 | { | ||
800 | if (CanIssueEstateCommandCheckFunctions.Contains(delegateFunc)) | ||
801 | CanIssueEstateCommandCheckFunctions.Remove(delegateFunc); | ||
802 | } | ||
803 | |||
804 | public bool ExternalChecksCanIssueEstateCommand(LLUUID user, bool ownerCommand) | ||
805 | { | ||
806 | foreach (CanIssueEstateCommand check in CanIssueEstateCommandCheckFunctions) | ||
779 | { | 807 | { |
780 | foreach (CanIssueEstateCommand check in CanIssueEstateCommandCheckFunctions) | 808 | if (check(user, m_scene, ownerCommand) == false) |
781 | { | 809 | { |
782 | if (check(user, m_scene, ownerCommand) == false) | 810 | return false; |
783 | { | ||
784 | return false; | ||
785 | } | ||
786 | } | 811 | } |
787 | return true; | ||
788 | } | 812 | } |
789 | #endregion | 813 | return true; |
814 | } | ||
815 | #endregion | ||
790 | 816 | ||
791 | #region CAN BE GODLIKE | 817 | #region CAN BE GODLIKE |
792 | public delegate bool CanBeGodLike(LLUUID user, Scene requestFromScene); | 818 | public delegate bool CanBeGodLike(LLUUID user, Scene requestFromScene); |
793 | private List<CanBeGodLike> CanBeGodLikeCheckFunctions = new List<CanBeGodLike>(); | 819 | private List<CanBeGodLike> CanBeGodLikeCheckFunctions = new List<CanBeGodLike>(); |
794 | 820 | ||
795 | public void addCheckBeGodLike(CanBeGodLike delegateFunc) | 821 | public void addCheckBeGodLike(CanBeGodLike delegateFunc) |
796 | { | 822 | { |
797 | if (!CanBeGodLikeCheckFunctions.Contains(delegateFunc)) | 823 | if (!CanBeGodLikeCheckFunctions.Contains(delegateFunc)) |
798 | CanBeGodLikeCheckFunctions.Add(delegateFunc); | 824 | CanBeGodLikeCheckFunctions.Add(delegateFunc); |
799 | } | 825 | } |
800 | public void removeCheckBeGodLike(CanBeGodLike delegateFunc) | 826 | |
801 | { | 827 | public void removeCheckBeGodLike(CanBeGodLike delegateFunc) |
802 | if (CanBeGodLikeCheckFunctions.Contains(delegateFunc)) | 828 | { |
803 | CanBeGodLikeCheckFunctions.Remove(delegateFunc); | 829 | if (CanBeGodLikeCheckFunctions.Contains(delegateFunc)) |
804 | } | 830 | CanBeGodLikeCheckFunctions.Remove(delegateFunc); |
831 | } | ||
805 | 832 | ||
806 | public bool ExternalChecksCanBeGodLike(LLUUID user) | 833 | public bool ExternalChecksCanBeGodLike(LLUUID user) |
834 | { | ||
835 | foreach (CanBeGodLike check in CanBeGodLikeCheckFunctions) | ||
807 | { | 836 | { |
808 | foreach (CanBeGodLike check in CanBeGodLikeCheckFunctions) | 837 | if (check(user, m_scene) == false) |
809 | { | 838 | { |
810 | if (check(user, m_scene) == false) | 839 | return false; |
811 | { | ||
812 | return false; | ||
813 | } | ||
814 | } | 840 | } |
815 | return true; | ||
816 | } | 841 | } |
817 | #endregion | 842 | return true; |
843 | } | ||
844 | #endregion | ||
818 | 845 | ||
819 | #region EDIT PARCEL | 846 | #region EDIT PARCEL |
820 | public delegate bool CanEditParcel(LLUUID user, ILandObject parcel, Scene scene); | 847 | public delegate bool CanEditParcel(LLUUID user, ILandObject parcel, Scene scene); |
821 | private List<CanEditParcel> CanEditParcelCheckFunctions = new List<CanEditParcel>(); | 848 | private List<CanEditParcel> CanEditParcelCheckFunctions = new List<CanEditParcel>(); |
822 | 849 | ||
823 | public void addCheckEditParcel(CanEditParcel delegateFunc) | 850 | public void addCheckEditParcel(CanEditParcel delegateFunc) |
824 | { | 851 | { |
825 | if (!CanEditParcelCheckFunctions.Contains(delegateFunc)) | 852 | if (!CanEditParcelCheckFunctions.Contains(delegateFunc)) |
826 | CanEditParcelCheckFunctions.Add(delegateFunc); | 853 | CanEditParcelCheckFunctions.Add(delegateFunc); |
827 | } | 854 | } |
828 | public void removeCheckEditParcel(CanEditParcel delegateFunc) | 855 | |
829 | { | 856 | public void removeCheckEditParcel(CanEditParcel delegateFunc) |
830 | if (CanEditParcelCheckFunctions.Contains(delegateFunc)) | 857 | { |
831 | CanEditParcelCheckFunctions.Remove(delegateFunc); | 858 | if (CanEditParcelCheckFunctions.Contains(delegateFunc)) |
832 | } | 859 | CanEditParcelCheckFunctions.Remove(delegateFunc); |
860 | } | ||
833 | 861 | ||
834 | public bool ExternalChecksCanEditParcel(LLUUID user, ILandObject parcel) | 862 | public bool ExternalChecksCanEditParcel(LLUUID user, ILandObject parcel) |
863 | { | ||
864 | foreach (CanEditParcel check in CanEditParcelCheckFunctions) | ||
835 | { | 865 | { |
836 | foreach (CanEditParcel check in CanEditParcelCheckFunctions) | 866 | if (check(user, parcel, m_scene) == false) |
837 | { | 867 | { |
838 | if (check(user, parcel, m_scene) == false) | 868 | return false; |
839 | { | ||
840 | return false; | ||
841 | } | ||
842 | } | 869 | } |
843 | return true; | ||
844 | } | 870 | } |
845 | #endregion | 871 | return true; |
872 | } | ||
873 | #endregion | ||
846 | 874 | ||
847 | #region SELL PARCEL | 875 | #region SELL PARCEL |
848 | public delegate bool CanSellParcel(LLUUID user, ILandObject parcel, Scene scene); | 876 | public delegate bool CanSellParcel(LLUUID user, ILandObject parcel, Scene scene); |
849 | private List<CanSellParcel> CanSellParcelCheckFunctions = new List<CanSellParcel>(); | 877 | private List<CanSellParcel> CanSellParcelCheckFunctions = new List<CanSellParcel>(); |
850 | 878 | ||
851 | public void addCheckSellParcel(CanSellParcel delegateFunc) | 879 | public void addCheckSellParcel(CanSellParcel delegateFunc) |
852 | { | 880 | { |
853 | if (!CanSellParcelCheckFunctions.Contains(delegateFunc)) | 881 | if (!CanSellParcelCheckFunctions.Contains(delegateFunc)) |
854 | CanSellParcelCheckFunctions.Add(delegateFunc); | 882 | CanSellParcelCheckFunctions.Add(delegateFunc); |
855 | } | 883 | } |
856 | public void removeCheckSellParcel(CanSellParcel delegateFunc) | 884 | |
857 | { | 885 | public void removeCheckSellParcel(CanSellParcel delegateFunc) |
858 | if (CanSellParcelCheckFunctions.Contains(delegateFunc)) | 886 | { |
859 | CanSellParcelCheckFunctions.Remove(delegateFunc); | 887 | if (CanSellParcelCheckFunctions.Contains(delegateFunc)) |
860 | } | 888 | CanSellParcelCheckFunctions.Remove(delegateFunc); |
889 | } | ||
861 | 890 | ||
862 | public bool ExternalChecksCanSellParcel(LLUUID user, ILandObject parcel) | 891 | public bool ExternalChecksCanSellParcel(LLUUID user, ILandObject parcel) |
892 | { | ||
893 | foreach (CanSellParcel check in CanSellParcelCheckFunctions) | ||
863 | { | 894 | { |
864 | foreach (CanSellParcel check in CanSellParcelCheckFunctions) | 895 | if (check(user, parcel, m_scene) == false) |
865 | { | 896 | { |
866 | if (check(user, parcel, m_scene) == false) | 897 | return false; |
867 | { | ||
868 | return false; | ||
869 | } | ||
870 | } | 898 | } |
871 | return true; | ||
872 | } | 899 | } |
873 | #endregion | 900 | return true; |
901 | } | ||
902 | #endregion | ||
874 | 903 | ||
875 | #region ABANDON PARCEL | 904 | #region ABANDON PARCEL |
876 | public delegate bool CanAbandonParcel(LLUUID user, ILandObject parcel, Scene scene); | 905 | public delegate bool CanAbandonParcel(LLUUID user, ILandObject parcel, Scene scene); |
877 | private List<CanAbandonParcel> CanAbandonParcelCheckFunctions = new List<CanAbandonParcel>(); | 906 | private List<CanAbandonParcel> CanAbandonParcelCheckFunctions = new List<CanAbandonParcel>(); |
878 | 907 | ||
879 | public void addCheckAbandonParcel(CanAbandonParcel delegateFunc) | 908 | public void addCheckAbandonParcel(CanAbandonParcel delegateFunc) |
880 | { | 909 | { |
881 | if (!CanAbandonParcelCheckFunctions.Contains(delegateFunc)) | 910 | if (!CanAbandonParcelCheckFunctions.Contains(delegateFunc)) |
882 | CanAbandonParcelCheckFunctions.Add(delegateFunc); | 911 | CanAbandonParcelCheckFunctions.Add(delegateFunc); |
883 | } | 912 | } |
884 | public void removeCheckAbandonParcel(CanAbandonParcel delegateFunc) | ||
885 | { | ||
886 | if (CanAbandonParcelCheckFunctions.Contains(delegateFunc)) | ||
887 | CanAbandonParcelCheckFunctions.Remove(delegateFunc); | ||
888 | } | ||
889 | 913 | ||
890 | public bool ExternalChecksCanAbandonParcel(LLUUID user, ILandObject parcel) | 914 | public void removeCheckAbandonParcel(CanAbandonParcel delegateFunc) |
915 | { | ||
916 | if (CanAbandonParcelCheckFunctions.Contains(delegateFunc)) | ||
917 | CanAbandonParcelCheckFunctions.Remove(delegateFunc); | ||
918 | } | ||
919 | |||
920 | public bool ExternalChecksCanAbandonParcel(LLUUID user, ILandObject parcel) | ||
921 | { | ||
922 | foreach (CanAbandonParcel check in CanAbandonParcelCheckFunctions) | ||
891 | { | 923 | { |
892 | foreach (CanAbandonParcel check in CanAbandonParcelCheckFunctions) | 924 | if (check(user, parcel, m_scene) == false) |
893 | { | 925 | { |
894 | if (check(user, parcel, m_scene) == false) | 926 | return false; |
895 | { | ||
896 | return false; | ||
897 | } | ||
898 | } | 927 | } |
899 | return true; | ||
900 | } | 928 | } |
901 | #endregion | 929 | return true; |
930 | } | ||
931 | #endregion | ||
902 | 932 | ||
903 | public delegate bool CanReclaimParcel(LLUUID user, ILandObject parcel, Scene scene); | 933 | public delegate bool CanReclaimParcel(LLUUID user, ILandObject parcel, Scene scene); |
904 | private List<CanReclaimParcel> CanReclaimParcelCheckFunctions = new List<CanReclaimParcel>(); | 934 | private List<CanReclaimParcel> CanReclaimParcelCheckFunctions = new List<CanReclaimParcel>(); |
905 | 935 | ||
906 | public void addCheckReclaimParcel(CanReclaimParcel delegateFunc) | 936 | public void addCheckReclaimParcel(CanReclaimParcel delegateFunc) |
907 | { | 937 | { |
908 | if (!CanReclaimParcelCheckFunctions.Contains(delegateFunc)) | 938 | if (!CanReclaimParcelCheckFunctions.Contains(delegateFunc)) |
909 | CanReclaimParcelCheckFunctions.Add(delegateFunc); | 939 | CanReclaimParcelCheckFunctions.Add(delegateFunc); |
910 | } | 940 | } |
911 | public void removeCheckReclaimParcel(CanReclaimParcel delegateFunc) | ||
912 | { | ||
913 | if (CanReclaimParcelCheckFunctions.Contains(delegateFunc)) | ||
914 | CanReclaimParcelCheckFunctions.Remove(delegateFunc); | ||
915 | } | ||
916 | 941 | ||
917 | public bool ExternalChecksCanReclaimParcel(LLUUID user, ILandObject parcel) | 942 | public void removeCheckReclaimParcel(CanReclaimParcel delegateFunc) |
943 | { | ||
944 | if (CanReclaimParcelCheckFunctions.Contains(delegateFunc)) | ||
945 | CanReclaimParcelCheckFunctions.Remove(delegateFunc); | ||
946 | } | ||
947 | |||
948 | public bool ExternalChecksCanReclaimParcel(LLUUID user, ILandObject parcel) | ||
949 | { | ||
950 | foreach (CanReclaimParcel check in CanReclaimParcelCheckFunctions) | ||
918 | { | 951 | { |
919 | foreach (CanReclaimParcel check in CanReclaimParcelCheckFunctions) | 952 | if (check(user, parcel, m_scene) == false) |
920 | { | 953 | { |
921 | if (check(user, parcel, m_scene) == false) | 954 | return false; |
922 | { | ||
923 | return false; | ||
924 | } | ||
925 | } | 955 | } |
926 | return true; | ||
927 | } | 956 | } |
928 | public delegate bool CanBuyLand(LLUUID user, ILandObject parcel, Scene scene); | 957 | return true; |
929 | private List<CanBuyLand> CanBuyLandCheckFunctions = new List<CanBuyLand>(); | 958 | } |
959 | public delegate bool CanBuyLand(LLUUID user, ILandObject parcel, Scene scene); | ||
960 | private List<CanBuyLand> CanBuyLandCheckFunctions = new List<CanBuyLand>(); | ||
930 | 961 | ||
931 | public void addCheckCanBuyLand(CanBuyLand delegateFunc) | 962 | public void addCheckCanBuyLand(CanBuyLand delegateFunc) |
932 | { | 963 | { |
933 | if (!CanBuyLandCheckFunctions.Contains(delegateFunc)) | 964 | if (!CanBuyLandCheckFunctions.Contains(delegateFunc)) |
934 | CanBuyLandCheckFunctions.Add(delegateFunc); | 965 | CanBuyLandCheckFunctions.Add(delegateFunc); |
935 | } | 966 | } |
936 | public void removeCheckCanBuyLand(CanBuyLand delegateFunc) | ||
937 | { | ||
938 | if (CanBuyLandCheckFunctions.Contains(delegateFunc)) | ||
939 | CanBuyLandCheckFunctions.Remove(delegateFunc); | ||
940 | } | ||
941 | 967 | ||
942 | public bool ExternalChecksCanBuyLand(LLUUID user, ILandObject parcel) | 968 | public void removeCheckCanBuyLand(CanBuyLand delegateFunc) |
969 | { | ||
970 | if (CanBuyLandCheckFunctions.Contains(delegateFunc)) | ||
971 | CanBuyLandCheckFunctions.Remove(delegateFunc); | ||
972 | } | ||
973 | |||
974 | public bool ExternalChecksCanBuyLand(LLUUID user, ILandObject parcel) | ||
975 | { | ||
976 | foreach (CanBuyLand check in CanBuyLandCheckFunctions) | ||
943 | { | 977 | { |
944 | foreach (CanBuyLand check in CanBuyLandCheckFunctions) | 978 | if (check(user, parcel, m_scene) == false) |
945 | { | 979 | { |
946 | if (check(user, parcel, m_scene) == false) | 980 | return false; |
947 | { | ||
948 | return false; | ||
949 | } | ||
950 | } | 981 | } |
951 | return true; | ||
952 | } | 982 | } |
983 | return true; | ||
984 | } | ||
953 | 985 | ||
954 | public delegate bool CanLinkObject(LLUUID user, LLUUID objectID); | 986 | public delegate bool CanLinkObject(LLUUID user, LLUUID objectID); |
955 | private List<CanLinkObject> CanLinkObjectCheckFunctions = new List<CanLinkObject>(); | 987 | private List<CanLinkObject> CanLinkObjectCheckFunctions = new List<CanLinkObject>(); |
956 | 988 | ||
957 | public void addCheckCanLinkObject(CanLinkObject delegateFunc) | 989 | public void addCheckCanLinkObject(CanLinkObject delegateFunc) |
958 | { | 990 | { |
959 | if (!CanLinkObjectCheckFunctions.Contains(delegateFunc)) | 991 | if (!CanLinkObjectCheckFunctions.Contains(delegateFunc)) |
960 | CanLinkObjectCheckFunctions.Add(delegateFunc); | 992 | CanLinkObjectCheckFunctions.Add(delegateFunc); |
961 | } | 993 | } |
962 | public void removeCheckCanLinkObject(CanLinkObject delegateFunc) | 994 | |
963 | { | 995 | public void removeCheckCanLinkObject(CanLinkObject delegateFunc) |
964 | if (CanLinkObjectCheckFunctions.Contains(delegateFunc)) | 996 | { |
965 | CanLinkObjectCheckFunctions.Remove(delegateFunc); | 997 | if (CanLinkObjectCheckFunctions.Contains(delegateFunc)) |
966 | } | 998 | CanLinkObjectCheckFunctions.Remove(delegateFunc); |
999 | } | ||
967 | 1000 | ||
968 | public bool ExternalChecksCanLinkObject(LLUUID user, LLUUID objectID) | 1001 | public bool ExternalChecksCanLinkObject(LLUUID user, LLUUID objectID) |
969 | { | 1002 | { |
970 | foreach (CanLinkObject check in CanLinkObjectCheckFunctions) | 1003 | foreach (CanLinkObject check in CanLinkObjectCheckFunctions) |
971 | { | 1004 | { |
@@ -977,137 +1010,141 @@ namespace OpenSim.Region.Environment.Scenes | |||
977 | return true; | 1010 | return true; |
978 | } | 1011 | } |
979 | 1012 | ||
980 | public delegate bool CanDelinkObject(LLUUID user, LLUUID objectID); | 1013 | public delegate bool CanDelinkObject(LLUUID user, LLUUID objectID); |
981 | private List<CanDelinkObject> CanDelinkObjectCheckFunctions = new List<CanDelinkObject>(); | 1014 | private List<CanDelinkObject> CanDelinkObjectCheckFunctions = new List<CanDelinkObject>(); |
982 | 1015 | ||
983 | public void addCheckCanDelinkObject(CanDelinkObject delegateFunc) | 1016 | public void addCheckCanDelinkObject(CanDelinkObject delegateFunc) |
984 | { | 1017 | { |
985 | if (!CanDelinkObjectCheckFunctions.Contains(delegateFunc)) | 1018 | if (!CanDelinkObjectCheckFunctions.Contains(delegateFunc)) |
986 | CanDelinkObjectCheckFunctions.Add(delegateFunc); | 1019 | CanDelinkObjectCheckFunctions.Add(delegateFunc); |
987 | } | 1020 | } |
988 | public void removeCheckCanDelinkObject(CanDelinkObject delegateFunc) | 1021 | |
989 | { | 1022 | public void removeCheckCanDelinkObject(CanDelinkObject delegateFunc) |
990 | if (CanDelinkObjectCheckFunctions.Contains(delegateFunc)) | 1023 | { |
991 | CanDelinkObjectCheckFunctions.Remove(delegateFunc); | 1024 | if (CanDelinkObjectCheckFunctions.Contains(delegateFunc)) |
992 | } | 1025 | CanDelinkObjectCheckFunctions.Remove(delegateFunc); |
1026 | } | ||
993 | 1027 | ||
994 | public bool ExternalChecksCanDelinkObject(LLUUID user, LLUUID objectID) | 1028 | public bool ExternalChecksCanDelinkObject(LLUUID user, LLUUID objectID) |
1029 | { | ||
1030 | foreach (CanDelinkObject check in CanDelinkObjectCheckFunctions) | ||
995 | { | 1031 | { |
996 | foreach (CanDelinkObject check in CanDelinkObjectCheckFunctions) | 1032 | if (check(user, objectID) == false) |
997 | { | 1033 | { |
998 | if (check(user, objectID) == false) | 1034 | return false; |
999 | { | ||
1000 | return false; | ||
1001 | } | ||
1002 | } | 1035 | } |
1003 | return true; | ||
1004 | } | 1036 | } |
1037 | return true; | ||
1038 | } | ||
1005 | 1039 | ||
1006 | #endregion | 1040 | #endregion |
1007 | 1041 | ||
1008 | public delegate bool CanCreateInventory(uint invType, LLUUID objectID, LLUUID userID); | 1042 | public delegate bool CanCreateInventory(uint invType, LLUUID objectID, LLUUID userID); |
1009 | private List<CanCreateInventory> CanCreateInventoryCheckFunctions = new List<CanCreateInventory>(); | 1043 | private List<CanCreateInventory> CanCreateInventoryCheckFunctions = new List<CanCreateInventory>(); |
1010 | 1044 | ||
1011 | public void addCheckCanCreateInventory(CanCreateInventory delegateFunc) | 1045 | public void addCheckCanCreateInventory(CanCreateInventory delegateFunc) |
1012 | { | 1046 | { |
1013 | if (!CanCreateInventoryCheckFunctions.Contains(delegateFunc)) | 1047 | if (!CanCreateInventoryCheckFunctions.Contains(delegateFunc)) |
1014 | CanCreateInventoryCheckFunctions.Add(delegateFunc); | 1048 | CanCreateInventoryCheckFunctions.Add(delegateFunc); |
1015 | } | 1049 | } |
1016 | public void removeCheckCanCreateInventory(CanCreateInventory delegateFunc) | ||
1017 | { | ||
1018 | if (CanCreateInventoryCheckFunctions.Contains(delegateFunc)) | ||
1019 | CanCreateInventoryCheckFunctions.Remove(delegateFunc); | ||
1020 | } | ||
1021 | 1050 | ||
1022 | public bool ExternalChecksCanCreateInventory(uint invType, LLUUID objectID, LLUUID userID) | 1051 | public void removeCheckCanCreateInventory(CanCreateInventory delegateFunc) |
1052 | { | ||
1053 | if (CanCreateInventoryCheckFunctions.Contains(delegateFunc)) | ||
1054 | CanCreateInventoryCheckFunctions.Remove(delegateFunc); | ||
1055 | } | ||
1056 | |||
1057 | public bool ExternalChecksCanCreateInventory(uint invType, LLUUID objectID, LLUUID userID) | ||
1058 | { | ||
1059 | foreach (CanCreateInventory check in CanCreateInventoryCheckFunctions) | ||
1023 | { | 1060 | { |
1024 | foreach (CanCreateInventory check in CanCreateInventoryCheckFunctions) | 1061 | if (check(invType, objectID, userID) == false) |
1025 | { | 1062 | { |
1026 | if (check(invType, objectID, userID) == false) | 1063 | return false; |
1027 | { | ||
1028 | return false; | ||
1029 | } | ||
1030 | } | 1064 | } |
1031 | return true; | ||
1032 | } | 1065 | } |
1066 | return true; | ||
1067 | } | ||
1033 | 1068 | ||
1034 | public delegate bool CanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID); | 1069 | public delegate bool CanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID); |
1035 | private List<CanCopyInventory> CanCopyInventoryCheckFunctions = new List<CanCopyInventory>(); | 1070 | private List<CanCopyInventory> CanCopyInventoryCheckFunctions = new List<CanCopyInventory>(); |
1036 | 1071 | ||
1037 | public void addCheckCanCopyInventory(CanCopyInventory delegateFunc) | 1072 | public void addCheckCanCopyInventory(CanCopyInventory delegateFunc) |
1038 | { | 1073 | { |
1039 | if (!CanCopyInventoryCheckFunctions.Contains(delegateFunc)) | 1074 | if (!CanCopyInventoryCheckFunctions.Contains(delegateFunc)) |
1040 | CanCopyInventoryCheckFunctions.Add(delegateFunc); | 1075 | CanCopyInventoryCheckFunctions.Add(delegateFunc); |
1041 | } | 1076 | } |
1042 | public void removeCheckCanCopyInventory(CanCopyInventory delegateFunc) | 1077 | |
1043 | { | 1078 | public void removeCheckCanCopyInventory(CanCopyInventory delegateFunc) |
1044 | if (CanCopyInventoryCheckFunctions.Contains(delegateFunc)) | 1079 | { |
1045 | CanCopyInventoryCheckFunctions.Remove(delegateFunc); | 1080 | if (CanCopyInventoryCheckFunctions.Contains(delegateFunc)) |
1046 | } | 1081 | CanCopyInventoryCheckFunctions.Remove(delegateFunc); |
1082 | } | ||
1047 | 1083 | ||
1048 | public bool ExternalChecksCanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) | 1084 | public bool ExternalChecksCanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) |
1085 | { | ||
1086 | foreach (CanCopyInventory check in CanCopyInventoryCheckFunctions) | ||
1049 | { | 1087 | { |
1050 | foreach (CanCopyInventory check in CanCopyInventoryCheckFunctions) | 1088 | if (check(itemID, objectID, userID) == false) |
1051 | { | 1089 | { |
1052 | if (check(itemID, objectID, userID) == false) | 1090 | return false; |
1053 | { | ||
1054 | return false; | ||
1055 | } | ||
1056 | } | 1091 | } |
1057 | return true; | ||
1058 | } | 1092 | } |
1093 | return true; | ||
1094 | } | ||
1059 | 1095 | ||
1060 | public delegate bool CanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID); | 1096 | public delegate bool CanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID); |
1061 | private List<CanDeleteInventory> CanDeleteInventoryCheckFunctions = new List<CanDeleteInventory>(); | 1097 | private List<CanDeleteInventory> CanDeleteInventoryCheckFunctions = new List<CanDeleteInventory>(); |
1062 | 1098 | ||
1063 | public void addCheckCanDeleteInventory(CanDeleteInventory delegateFunc) | 1099 | public void addCheckCanDeleteInventory(CanDeleteInventory delegateFunc) |
1064 | { | 1100 | { |
1065 | if (!CanDeleteInventoryCheckFunctions.Contains(delegateFunc)) | 1101 | if (!CanDeleteInventoryCheckFunctions.Contains(delegateFunc)) |
1066 | CanDeleteInventoryCheckFunctions.Add(delegateFunc); | 1102 | CanDeleteInventoryCheckFunctions.Add(delegateFunc); |
1067 | } | 1103 | } |
1068 | public void removeCheckCanDeleteInventory(CanDeleteInventory delegateFunc) | ||
1069 | { | ||
1070 | if (CanDeleteInventoryCheckFunctions.Contains(delegateFunc)) | ||
1071 | CanDeleteInventoryCheckFunctions.Remove(delegateFunc); | ||
1072 | } | ||
1073 | 1104 | ||
1074 | public bool ExternalChecksCanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) | 1105 | public void removeCheckCanDeleteInventory(CanDeleteInventory delegateFunc) |
1106 | { | ||
1107 | if (CanDeleteInventoryCheckFunctions.Contains(delegateFunc)) | ||
1108 | CanDeleteInventoryCheckFunctions.Remove(delegateFunc); | ||
1109 | } | ||
1110 | |||
1111 | public bool ExternalChecksCanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) | ||
1112 | { | ||
1113 | foreach (CanDeleteInventory check in CanDeleteInventoryCheckFunctions) | ||
1075 | { | 1114 | { |
1076 | foreach (CanDeleteInventory check in CanDeleteInventoryCheckFunctions) | 1115 | if (check(itemID, objectID, userID) == false) |
1077 | { | 1116 | { |
1078 | if (check(itemID, objectID, userID) == false) | 1117 | return false; |
1079 | { | ||
1080 | return false; | ||
1081 | } | ||
1082 | } | 1118 | } |
1083 | return true; | ||
1084 | } | 1119 | } |
1120 | return true; | ||
1121 | } | ||
1085 | 1122 | ||
1086 | public delegate bool CanTeleport(LLUUID userID); | 1123 | public delegate bool CanTeleport(LLUUID userID); |
1087 | private List<CanTeleport> CanTeleportCheckFunctions = new List<CanTeleport>(); | 1124 | private List<CanTeleport> CanTeleportCheckFunctions = new List<CanTeleport>(); |
1088 | 1125 | ||
1089 | public void addCheckCanTeleport(CanTeleport delegateFunc) | 1126 | public void addCheckCanTeleport(CanTeleport delegateFunc) |
1090 | { | 1127 | { |
1091 | if (!CanTeleportCheckFunctions.Contains(delegateFunc)) | 1128 | if (!CanTeleportCheckFunctions.Contains(delegateFunc)) |
1092 | CanTeleportCheckFunctions.Add(delegateFunc); | 1129 | CanTeleportCheckFunctions.Add(delegateFunc); |
1093 | } | 1130 | } |
1094 | public void removeCheckCanTeleport(CanTeleport delegateFunc) | ||
1095 | { | ||
1096 | if (CanTeleportCheckFunctions.Contains(delegateFunc)) | ||
1097 | CanTeleportCheckFunctions.Remove(delegateFunc); | ||
1098 | } | ||
1099 | 1131 | ||
1100 | public bool ExternalChecksCanTeleport(LLUUID userID) | 1132 | public void removeCheckCanTeleport(CanTeleport delegateFunc) |
1133 | { | ||
1134 | if (CanTeleportCheckFunctions.Contains(delegateFunc)) | ||
1135 | CanTeleportCheckFunctions.Remove(delegateFunc); | ||
1136 | } | ||
1137 | |||
1138 | public bool ExternalChecksCanTeleport(LLUUID userID) | ||
1139 | { | ||
1140 | foreach (CanTeleport check in CanTeleportCheckFunctions) | ||
1101 | { | 1141 | { |
1102 | foreach (CanTeleport check in CanTeleportCheckFunctions) | 1142 | if (check(userID) == false) |
1103 | { | 1143 | { |
1104 | if (check(userID) == false) | 1144 | return false; |
1105 | { | ||
1106 | return false; | ||
1107 | } | ||
1108 | } | 1145 | } |
1109 | return true; | ||
1110 | } | 1146 | } |
1147 | return true; | ||
1148 | } | ||
1111 | } | 1149 | } |
1112 | } | 1150 | } |
1113 | |||
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs index cc4891f..032d673 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs | |||
@@ -39,7 +39,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
39 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 39 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
40 | 40 | ||
41 | /// <summary> | 41 | /// <summary> |
42 | /// Force all task inventories of prims in the scene object to persist | 42 | /// Force all task inventories of prims in the scene object to persist |
43 | /// </summary> | 43 | /// </summary> |
44 | public void ForceInventoryPersistence() | 44 | public void ForceInventoryPersistence() |
45 | { | 45 | { |
@@ -49,9 +49,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
49 | { | 49 | { |
50 | part.ForceInventoryPersistence(); | 50 | part.ForceInventoryPersistence(); |
51 | } | 51 | } |
52 | } | 52 | } |
53 | } | 53 | } |
54 | 54 | ||
55 | /// <summary> | 55 | /// <summary> |
56 | /// Start the scripts contained in all the prims in this group. | 56 | /// Start the scripts contained in all the prims in this group. |
57 | /// </summary> | 57 | /// </summary> |
@@ -161,7 +161,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
161 | // taskItem.SalePrice = item.SalePrice; | 161 | // taskItem.SalePrice = item.SalePrice; |
162 | // taskItem.SaleType = item.SaleType; | 162 | // taskItem.SaleType = item.SaleType; |
163 | taskItem.CreationDate = (uint)item.CreationDate; | 163 | taskItem.CreationDate = (uint)item.CreationDate; |
164 | 164 | ||
165 | part.AddInventoryItem(taskItem); | 165 | part.AddInventoryItem(taskItem); |
166 | 166 | ||
167 | return true; | 167 | return true; |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 2a1b8c5..9c3d6a7 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -94,7 +94,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
94 | /// since the group's last persistent backup | 94 | /// since the group's last persistent backup |
95 | /// </summary> | 95 | /// </summary> |
96 | public bool HasGroupChanged = false; | 96 | public bool HasGroupChanged = false; |
97 | 97 | ||
98 | public float scriptScore = 0f; | 98 | public float scriptScore = 0f; |
99 | 99 | ||
100 | private LLVector3 lastPhysGroupPos; | 100 | private LLVector3 lastPhysGroupPos; |
@@ -115,7 +115,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
115 | private bool m_scriptListens_notAtTarget = false; | 115 | private bool m_scriptListens_notAtTarget = false; |
116 | 116 | ||
117 | #region Properties | 117 | #region Properties |
118 | 118 | ||
119 | /// <summary> | 119 | /// <summary> |
120 | /// The name of an object grouping is always the same as its root part | 120 | /// The name of an object grouping is always the same as its root part |
121 | /// </summary> | 121 | /// </summary> |
@@ -123,7 +123,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
123 | { | 123 | { |
124 | get { return RootPart.Name; } | 124 | get { return RootPart.Name; } |
125 | set { RootPart.Name = value; } | 125 | set { RootPart.Name = value; } |
126 | } | 126 | } |
127 | 127 | ||
128 | /// <summary> | 128 | /// <summary> |
129 | /// Added because the Parcel code seems to use it | 129 | /// Added because the Parcel code seems to use it |
@@ -445,13 +445,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
445 | } | 445 | } |
446 | more = !reader.EOF; | 446 | more = !reader.EOF; |
447 | } | 447 | } |
448 | 448 | ||
449 | reader.Close(); | 449 | reader.Close(); |
450 | sr.Close(); | 450 | sr.Close(); |
451 | 451 | ||
452 | UpdateParentIDs(); | 452 | UpdateParentIDs(); |
453 | } | 453 | } |
454 | 454 | ||
455 | /// <summary> | 455 | /// <summary> |
456 | /// | 456 | /// |
457 | /// </summary> | 457 | /// </summary> |
@@ -468,14 +468,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
468 | newPart.LinkNum = 0; | 468 | newPart.LinkNum = 0; |
469 | m_parts.Add(newPart.UUID, newPart); | 469 | m_parts.Add(newPart.UUID, newPart); |
470 | SetPartAsRoot(newPart); | 470 | SetPartAsRoot(newPart); |
471 | 471 | ||
472 | // one of these is a proxy. | 472 | // one of these is a proxy. |
473 | if (shape.PCode != (byte)PCode.None && shape.PCode != (byte)PCode.ParticleSystem) | 473 | if (shape.PCode != (byte)PCode.None && shape.PCode != (byte)PCode.ParticleSystem) |
474 | AttachToBackup(); | 474 | AttachToBackup(); |
475 | 475 | ||
476 | //ApplyPhysics(scene.m_physicalPrim); | 476 | //ApplyPhysics(scene.m_physicalPrim); |
477 | } | 477 | } |
478 | 478 | ||
479 | /// <summary> | 479 | /// <summary> |
480 | /// | 480 | /// |
481 | /// </summary> | 481 | /// </summary> |
@@ -754,7 +754,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
754 | m_rootPart.ScheduleFullUpdate(); | 754 | m_rootPart.ScheduleFullUpdate(); |
755 | m_rootPart.ClearUndoState(); | 755 | m_rootPart.ClearUndoState(); |
756 | } | 756 | } |
757 | 757 | ||
758 | public void DetachToInventoryPrep() | 758 | public void DetachToInventoryPrep() |
759 | { | 759 | { |
760 | ScenePresence avatar = m_scene.GetScenePresence(m_rootPart.AttachedAvatar); | 760 | ScenePresence avatar = m_scene.GetScenePresence(m_rootPart.AttachedAvatar); |
@@ -873,11 +873,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
873 | return m_scene.MaxUndoCount; | 873 | return m_scene.MaxUndoCount; |
874 | return 5; | 874 | return 5; |
875 | } | 875 | } |
876 | 876 | ||
877 | // justincc: I don't believe this hack is needed any longer, especially since the physics | 877 | // justincc: I don't believe this hack is needed any longer, especially since the physics |
878 | // parts of set AbsolutePosition were already commented out. By changing HasGroupChanged to false | 878 | // parts of set AbsolutePosition were already commented out. By changing HasGroupChanged to false |
879 | // this method was preventing proper reload of scene objects. | 879 | // this method was preventing proper reload of scene objects. |
880 | // dahlia: I had to uncomment it, without it meshing was failing on some prims and objects | 880 | // dahlia: I had to uncomment it, without it meshing was failing on some prims and objects |
881 | // at region startup | 881 | // at region startup |
882 | public void ResetChildPrimPhysicsPositions() | 882 | public void ResetChildPrimPhysicsPositions() |
883 | { | 883 | { |
@@ -926,20 +926,20 @@ namespace OpenSim.Region.Environment.Scenes | |||
926 | /// </summary> | 926 | /// </summary> |
927 | public void DeleteGroup() | 927 | public void DeleteGroup() |
928 | { | 928 | { |
929 | // We need to keep track of this state in case this group is still queued for backup. | 929 | // We need to keep track of this state in case this group is still queued for backup. |
930 | // FIXME: This is a poor temporary solution, since it still leaves plenty of scope for race | 930 | // FIXME: This is a poor temporary solution, since it still leaves plenty of scope for race |
931 | // conditions where a user deletes an entity while it is being stored. Really, the update | 931 | // conditions where a user deletes an entity while it is being stored. Really, the update |
932 | // code needs a redesign. | 932 | // code needs a redesign. |
933 | m_isDeleted = true; | 933 | m_isDeleted = true; |
934 | 934 | ||
935 | DetachFromBackup(this); | 935 | DetachFromBackup(this); |
936 | 936 | ||
937 | lock (m_parts) | 937 | lock (m_parts) |
938 | { | 938 | { |
939 | foreach (SceneObjectPart part in m_parts.Values) | 939 | foreach (SceneObjectPart part in m_parts.Values) |
940 | { | 940 | { |
941 | part.RemoveScriptInstances(); | 941 | part.RemoveScriptInstances(); |
942 | 942 | ||
943 | List<ScenePresence> avatars = Scene.GetScenePresences(); | 943 | List<ScenePresence> avatars = Scene.GetScenePresences(); |
944 | for (int i = 0; i < avatars.Count; i++) | 944 | for (int i = 0; i < avatars.Count; i++) |
945 | { | 945 | { |
@@ -951,12 +951,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
951 | avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId); | 951 | avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId); |
952 | } | 952 | } |
953 | } | 953 | } |
954 | 954 | ||
955 | m_rootPart = null; | 955 | m_rootPart = null; |
956 | m_parts.Clear(); | 956 | m_parts.Clear(); |
957 | } | 957 | } |
958 | } | 958 | } |
959 | 959 | ||
960 | public void FakeDeleteGroup() | 960 | public void FakeDeleteGroup() |
961 | { | 961 | { |
962 | foreach (SceneObjectPart part in m_parts.Values) | 962 | foreach (SceneObjectPart part in m_parts.Values) |
@@ -1034,7 +1034,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1034 | lock (m_targets) | 1034 | lock (m_targets) |
1035 | m_targets.Clear(); | 1035 | m_targets.Clear(); |
1036 | } | 1036 | } |
1037 | 1037 | ||
1038 | ScheduleGroupForFullUpdate(); | 1038 | ScheduleGroupForFullUpdate(); |
1039 | } | 1039 | } |
1040 | 1040 | ||
@@ -1067,7 +1067,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1067 | { | 1067 | { |
1068 | part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_physicalPrim); | 1068 | part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_physicalPrim); |
1069 | } | 1069 | } |
1070 | 1070 | ||
1071 | // Hack to get the physics scene geometries in the right spot | 1071 | // Hack to get the physics scene geometries in the right spot |
1072 | ResetChildPrimPhysicsPositions(); | 1072 | ResetChildPrimPhysicsPositions(); |
1073 | } | 1073 | } |
@@ -1102,14 +1102,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
1102 | /// </summary> | 1102 | /// </summary> |
1103 | /// <param name="datastore"></param> | 1103 | /// <param name="datastore"></param> |
1104 | public void ProcessBackup(IRegionDataStore datastore) | 1104 | public void ProcessBackup(IRegionDataStore datastore) |
1105 | { | 1105 | { |
1106 | if (HasGroupChanged) | 1106 | if (HasGroupChanged) |
1107 | { | 1107 | { |
1108 | // don't backup while it's selected or you're asking for changes mid stream. | 1108 | // don't backup while it's selected or you're asking for changes mid stream. |
1109 | if ((!IsSelected) && (RootPart != null)) | 1109 | if ((!IsSelected) && (RootPart != null)) |
1110 | { | 1110 | { |
1111 | m_log.InfoFormat( | 1111 | m_log.InfoFormat( |
1112 | "[SCENE]: Storing object {0}, {1} in {2}", | 1112 | "[SCENE]: Storing object {0}, {1} in {2}", |
1113 | Name, UUID, m_scene.RegionInfo.RegionName); | 1113 | Name, UUID, m_scene.RegionInfo.RegionName); |
1114 | 1114 | ||
1115 | SceneObjectGroup backup_group = Copy(OwnerID, GroupID, false); | 1115 | SceneObjectGroup backup_group = Copy(OwnerID, GroupID, false); |
@@ -1236,7 +1236,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1236 | 1236 | ||
1237 | dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true); | 1237 | dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true); |
1238 | } | 1238 | } |
1239 | 1239 | ||
1240 | // Now we've made a copy that replaces this one, we need to | 1240 | // Now we've made a copy that replaces this one, we need to |
1241 | // switch the owner to the person who did the copying | 1241 | // switch the owner to the person who did the copying |
1242 | // Second Life copies an object and duplicates the first one in it's place | 1242 | // Second Life copies an object and duplicates the first one in it's place |
@@ -1267,7 +1267,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1267 | dupe.UpdateParentIDs(); | 1267 | dupe.UpdateParentIDs(); |
1268 | dupe.HasGroupChanged = true; | 1268 | dupe.HasGroupChanged = true; |
1269 | dupe.AttachToBackup(); | 1269 | dupe.AttachToBackup(); |
1270 | 1270 | ||
1271 | ScheduleGroupForFullUpdate(); | 1271 | ScheduleGroupForFullUpdate(); |
1272 | } | 1272 | } |
1273 | 1273 | ||
@@ -1673,7 +1673,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1673 | { | 1673 | { |
1674 | return true; | 1674 | return true; |
1675 | } | 1675 | } |
1676 | 1676 | ||
1677 | return false; | 1677 | return false; |
1678 | } | 1678 | } |
1679 | 1679 | ||
@@ -1695,7 +1695,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1695 | } | 1695 | } |
1696 | } | 1696 | } |
1697 | } | 1697 | } |
1698 | 1698 | ||
1699 | return false; | 1699 | return false; |
1700 | } | 1700 | } |
1701 | 1701 | ||
@@ -2042,7 +2042,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2042 | public void UpdatePrimFlags(uint localID, ushort type, bool inUse, byte[] data) | 2042 | public void UpdatePrimFlags(uint localID, ushort type, bool inUse, byte[] data) |
2043 | { | 2043 | { |
2044 | SceneObjectPart selectionPart = GetChildPart(localID); | 2044 | SceneObjectPart selectionPart = GetChildPart(localID); |
2045 | 2045 | ||
2046 | if (selectionPart != null) | 2046 | if (selectionPart != null) |
2047 | { | 2047 | { |
2048 | lock (m_parts) | 2048 | lock (m_parts) |
@@ -2164,7 +2164,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2164 | m_scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor); | 2164 | m_scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor); |
2165 | } | 2165 | } |
2166 | //if (part.UUID != m_rootPart.UUID) | 2166 | //if (part.UUID != m_rootPart.UUID) |
2167 | 2167 | ||
2168 | HasGroupChanged = true; | 2168 | HasGroupChanged = true; |
2169 | ScheduleGroupForFullUpdate(); | 2169 | ScheduleGroupForFullUpdate(); |
2170 | 2170 | ||
@@ -2332,10 +2332,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
2332 | } | 2332 | } |
2333 | 2333 | ||
2334 | AbsolutePosition = pos; | 2334 | AbsolutePosition = pos; |
2335 | 2335 | ||
2336 | HasGroupChanged = true; | 2336 | HasGroupChanged = true; |
2337 | } | 2337 | } |
2338 | 2338 | ||
2339 | //we need to do a terse update even if the move wasn't allowed | 2339 | //we need to do a terse update even if the move wasn't allowed |
2340 | // so that the position is reset in the client (the object snaps back) | 2340 | // so that the position is reset in the client (the object snaps back) |
2341 | ScheduleGroupForTerseUpdate(); | 2341 | ScheduleGroupForTerseUpdate(); |
@@ -2349,7 +2349,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2349 | public void UpdateSinglePosition(LLVector3 pos, uint localID) | 2349 | public void UpdateSinglePosition(LLVector3 pos, uint localID) |
2350 | { | 2350 | { |
2351 | SceneObjectPart part = GetChildPart(localID); | 2351 | SceneObjectPart part = GetChildPart(localID); |
2352 | 2352 | ||
2353 | if (part != null) | 2353 | if (part != null) |
2354 | { | 2354 | { |
2355 | if (part.UUID == m_rootPart.UUID) | 2355 | if (part.UUID == m_rootPart.UUID) |
@@ -2360,7 +2360,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2360 | { | 2360 | { |
2361 | part.UpdateOffSet(pos); | 2361 | part.UpdateOffSet(pos); |
2362 | } | 2362 | } |
2363 | 2363 | ||
2364 | HasGroupChanged = true; | 2364 | HasGroupChanged = true; |
2365 | } | 2365 | } |
2366 | } | 2366 | } |
@@ -2398,7 +2398,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2398 | } | 2398 | } |
2399 | 2399 | ||
2400 | AbsolutePosition = newPos; | 2400 | AbsolutePosition = newPos; |
2401 | 2401 | ||
2402 | HasGroupChanged = true; | 2402 | HasGroupChanged = true; |
2403 | ScheduleGroupForTerseUpdate(); | 2403 | ScheduleGroupForTerseUpdate(); |
2404 | } | 2404 | } |
@@ -2426,7 +2426,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2426 | m_rootPart.RotationOffset.Z); | 2426 | m_rootPart.RotationOffset.Z); |
2427 | m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); | 2427 | m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); |
2428 | } | 2428 | } |
2429 | 2429 | ||
2430 | HasGroupChanged = true; | 2430 | HasGroupChanged = true; |
2431 | ScheduleGroupForTerseUpdate(); | 2431 | ScheduleGroupForTerseUpdate(); |
2432 | } | 2432 | } |
@@ -2447,7 +2447,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2447 | m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); | 2447 | m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); |
2448 | } | 2448 | } |
2449 | AbsolutePosition = pos; | 2449 | AbsolutePosition = pos; |
2450 | 2450 | ||
2451 | HasGroupChanged = true; | 2451 | HasGroupChanged = true; |
2452 | ScheduleGroupForTerseUpdate(); | 2452 | ScheduleGroupForTerseUpdate(); |
2453 | } | 2453 | } |
@@ -2684,7 +2684,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2684 | } | 2684 | } |
2685 | } | 2685 | } |
2686 | } | 2686 | } |
2687 | 2687 | ||
2688 | /// <summary> | 2688 | /// <summary> |
2689 | /// Set the user group to which this scene object belongs. | 2689 | /// Set the user group to which this scene object belongs. |
2690 | /// </summary> | 2690 | /// </summary> |
@@ -2698,10 +2698,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
2698 | { | 2698 | { |
2699 | part.SetGroup(GroupID, client); | 2699 | part.SetGroup(GroupID, client); |
2700 | } | 2700 | } |
2701 | 2701 | ||
2702 | HasGroupChanged = true; | 2702 | HasGroupChanged = true; |
2703 | } | 2703 | } |
2704 | 2704 | ||
2705 | ScheduleGroupForFullUpdate(); | 2705 | ScheduleGroupForFullUpdate(); |
2706 | } | 2706 | } |
2707 | 2707 | ||
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs index 480c030..0ac20e2 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs | |||
@@ -43,7 +43,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
43 | 43 | ||
44 | private string m_inventoryFileName = String.Empty; | 44 | private string m_inventoryFileName = String.Empty; |
45 | private int m_inventoryFileNameSerial = 0; | 45 | private int m_inventoryFileNameSerial = 0; |
46 | 46 | ||
47 | /// <summary> | 47 | /// <summary> |
48 | /// Serial count for inventory file , used to tell if inventory has changed | 48 | /// Serial count for inventory file , used to tell if inventory has changed |
49 | /// no need for this to be part of Database backup | 49 | /// no need for this to be part of Database backup |
@@ -53,13 +53,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
53 | /// <summary> | 53 | /// <summary> |
54 | /// Holds in memory prim inventory | 54 | /// Holds in memory prim inventory |
55 | /// </summary> | 55 | /// </summary> |
56 | protected TaskInventoryDictionary m_taskInventory = new TaskInventoryDictionary(); | 56 | protected TaskInventoryDictionary m_taskInventory = new TaskInventoryDictionary(); |
57 | 57 | ||
58 | /// <summary> | 58 | /// <summary> |
59 | /// Tracks whether inventory has changed since the last persistent backup | 59 | /// Tracks whether inventory has changed since the last persistent backup |
60 | /// </summary> | 60 | /// </summary> |
61 | protected bool HasInventoryChanged; | 61 | protected bool HasInventoryChanged; |
62 | 62 | ||
63 | /// <summary> | 63 | /// <summary> |
64 | /// Force the task inventory of this prim to persist at the next update sweep | 64 | /// Force the task inventory of this prim to persist at the next update sweep |
65 | /// </summary> | 65 | /// </summary> |
@@ -308,7 +308,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
308 | { | 308 | { |
309 | if (i.InvType == (int)InventoryType.LSL) | 309 | if (i.InvType == (int)InventoryType.LSL) |
310 | RemoveScriptInstance(i.ItemID); | 310 | RemoveScriptInstance(i.ItemID); |
311 | 311 | ||
312 | RemoveInventoryItem(i.ItemID); | 312 | RemoveInventoryItem(i.ItemID); |
313 | break; | 313 | break; |
314 | } | 314 | } |
@@ -316,7 +316,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
316 | 316 | ||
317 | AddInventoryItem(item.Name, item); | 317 | AddInventoryItem(item.Name, item); |
318 | } | 318 | } |
319 | 319 | ||
320 | /// <summary> | 320 | /// <summary> |
321 | /// Add an item to this prim's inventory. | 321 | /// Add an item to this prim's inventory. |
322 | /// </summary> | 322 | /// </summary> |
@@ -329,7 +329,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
329 | { | 329 | { |
330 | item.ParentID = UUID; | 330 | item.ParentID = UUID; |
331 | item.ParentPartID = UUID; | 331 | item.ParentPartID = UUID; |
332 | 332 | ||
333 | lock (m_taskInventory) | 333 | lock (m_taskInventory) |
334 | { | 334 | { |
335 | m_taskInventory.Add(item.ItemID, item); | 335 | m_taskInventory.Add(item.ItemID, item); |
@@ -339,7 +339,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
339 | m_inventorySerial++; | 339 | m_inventorySerial++; |
340 | //m_inventorySerial += 2; | 340 | //m_inventorySerial += 2; |
341 | HasInventoryChanged = true; | 341 | HasInventoryChanged = true; |
342 | ParentGroup.HasGroupChanged = true; | 342 | ParentGroup.HasGroupChanged = true; |
343 | } | 343 | } |
344 | 344 | ||
345 | /// <summary> | 345 | /// <summary> |
@@ -369,10 +369,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
369 | /// <param name="itemID"></param> | 369 | /// <param name="itemID"></param> |
370 | /// <returns>null if the item does not exist</returns> | 370 | /// <returns>null if the item does not exist</returns> |
371 | public TaskInventoryItem GetInventoryItem(LLUUID itemId) | 371 | public TaskInventoryItem GetInventoryItem(LLUUID itemId) |
372 | { | 372 | { |
373 | TaskInventoryItem item; | 373 | TaskInventoryItem item; |
374 | m_taskInventory.TryGetValue(itemId, out item); | 374 | m_taskInventory.TryGetValue(itemId, out item); |
375 | 375 | ||
376 | return item; | 376 | return item; |
377 | } | 377 | } |
378 | 378 | ||
@@ -450,12 +450,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
450 | } | 450 | } |
451 | 451 | ||
452 | } | 452 | } |
453 | 453 | ||
454 | if (scriptcount <= 0) | 454 | if (scriptcount <= 0) |
455 | { | 455 | { |
456 | RemFlag(LLObject.ObjectFlags.Scripted); | 456 | RemFlag(LLObject.ObjectFlags.Scripted); |
457 | } | 457 | } |
458 | 458 | ||
459 | ScheduleFullUpdate(); | 459 | ScheduleFullUpdate(); |
460 | 460 | ||
461 | return type; | 461 | return type; |
@@ -603,7 +603,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
603 | public void ProcessInventoryBackup(IRegionDataStore datastore) | 603 | public void ProcessInventoryBackup(IRegionDataStore datastore) |
604 | { | 604 | { |
605 | if (HasInventoryChanged) | 605 | if (HasInventoryChanged) |
606 | { | 606 | { |
607 | lock (TaskInventory) | 607 | lock (TaskInventory) |
608 | { | 608 | { |
609 | datastore.StorePrimInventory(UUID, TaskInventory.Values); | 609 | datastore.StorePrimInventory(UUID, TaskInventory.Values); |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 1432912..517114f 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |||
@@ -141,7 +141,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
141 | public uint AttachmentPoint = (byte)0; | 141 | public uint AttachmentPoint = (byte)0; |
142 | [XmlIgnore] | 142 | [XmlIgnore] |
143 | public PhysicsVector RotationAxis = new PhysicsVector(1f,1f,1f); | 143 | public PhysicsVector RotationAxis = new PhysicsVector(1f,1f,1f); |
144 | 144 | ||
145 | [XmlIgnore] | 145 | [XmlIgnore] |
146 | public bool Undoing = false; | 146 | public bool Undoing = false; |
147 | 147 | ||
@@ -196,11 +196,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
196 | protected LLVector3 m_velocity; | 196 | protected LLVector3 m_velocity; |
197 | 197 | ||
198 | // TODO: Those have to be changed into persistent properties at some later point, | 198 | // TODO: Those have to be changed into persistent properties at some later point, |
199 | // or sit-camera on vehicles will break on sim-crossing. | 199 | // or sit-camera on vehicles will break on sim-crossing. |
200 | private LLVector3 m_cameraEyeOffset = new LLVector3(0.0f, 0.0f, 0.0f); | 200 | private LLVector3 m_cameraEyeOffset = new LLVector3(0.0f, 0.0f, 0.0f); |
201 | private LLVector3 m_cameraAtOffset = new LLVector3(0.0f, 0.0f, 0.0f); | 201 | private LLVector3 m_cameraAtOffset = new LLVector3(0.0f, 0.0f, 0.0f); |
202 | private bool m_forceMouselook = false; | 202 | private bool m_forceMouselook = false; |
203 | 203 | ||
204 | #endregion Fields | 204 | #endregion Fields |
205 | 205 | ||
206 | #region Constructors | 206 | #region Constructors |
@@ -352,13 +352,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
352 | private uint _everyoneMask = (uint)PermissionMask.None; | 352 | private uint _everyoneMask = (uint)PermissionMask.None; |
353 | private uint _nextOwnerMask = (uint)PermissionMask.All; | 353 | private uint _nextOwnerMask = (uint)PermissionMask.All; |
354 | private LLObject.ObjectFlags _flags = LLObject.ObjectFlags.None; | 354 | private LLObject.ObjectFlags _flags = LLObject.ObjectFlags.None; |
355 | 355 | ||
356 | public LLUUID CreatorID { | 356 | public LLUUID CreatorID { |
357 | get | 357 | get |
358 | { | 358 | { |
359 | return _creatorID; | 359 | return _creatorID; |
360 | } | 360 | } |
361 | set | 361 | set |
362 | { | 362 | { |
363 | _creatorID = value; | 363 | _creatorID = value; |
364 | } | 364 | } |
@@ -390,26 +390,26 @@ namespace OpenSim.Region.Environment.Scenes | |||
390 | { | 390 | { |
391 | get { return (uint)_flags; } | 391 | get { return (uint)_flags; } |
392 | set { _flags = (LLObject.ObjectFlags)value; } | 392 | set { _flags = (LLObject.ObjectFlags)value; } |
393 | } | 393 | } |
394 | 394 | ||
395 | public LLUUID UUID | 395 | public LLUUID UUID |
396 | { | 396 | { |
397 | get { return m_uuid; } | 397 | get { return m_uuid; } |
398 | set { m_uuid = value; } | 398 | set { m_uuid = value; } |
399 | } | 399 | } |
400 | 400 | ||
401 | public uint LocalId | 401 | public uint LocalId |
402 | { | 402 | { |
403 | get { return m_localId; } | 403 | get { return m_localId; } |
404 | set { m_localId = value; } | 404 | set { m_localId = value; } |
405 | } | 405 | } |
406 | 406 | ||
407 | public virtual string Name | 407 | public virtual string Name |
408 | { | 408 | { |
409 | get { return m_name; } | 409 | get { return m_name; } |
410 | set { m_name = value; } | 410 | set { m_name = value; } |
411 | } | 411 | } |
412 | 412 | ||
413 | public byte Material | 413 | public byte Material |
414 | { | 414 | { |
415 | get { return (byte) m_material; } | 415 | get { return (byte) m_material; } |
@@ -607,13 +607,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
607 | /// <summary></summary> | 607 | /// <summary></summary> |
608 | public LLVector3 AngularVelocity | 608 | public LLVector3 AngularVelocity |
609 | { | 609 | { |
610 | get | 610 | get |
611 | { | 611 | { |
612 | if ((PhysActor != null) && PhysActor.IsPhysical) | 612 | if ((PhysActor != null) && PhysActor.IsPhysical) |
613 | { | 613 | { |
614 | m_angularVelocity.FromBytes(PhysActor.RotationalVelocity.GetBytes(), 0); | 614 | m_angularVelocity.FromBytes(PhysActor.RotationalVelocity.GetBytes(), 0); |
615 | } | 615 | } |
616 | return m_angularVelocity; | 616 | return m_angularVelocity; |
617 | } | 617 | } |
618 | set { m_angularVelocity = value; } | 618 | set { m_angularVelocity = value; } |
619 | } | 619 | } |
@@ -631,7 +631,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
631 | get { return m_description; } | 631 | get { return m_description; } |
632 | set { m_description = value; } | 632 | set { m_description = value; } |
633 | } | 633 | } |
634 | 634 | ||
635 | public Color Color | 635 | public Color Color |
636 | { | 636 | { |
637 | get { return m_color; } | 637 | get { return m_color; } |
@@ -702,7 +702,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
702 | // set of attributes on shape change. For instance, | 702 | // set of attributes on shape change. For instance, |
703 | // changing the lighting on a shape shouldn't cause | 703 | // changing the lighting on a shape shouldn't cause |
704 | // this. | 704 | // this. |
705 | if (m_shape != null) | 705 | if (m_shape != null) |
706 | shape_changed = true; | 706 | shape_changed = true; |
707 | 707 | ||
708 | m_shape = value; | 708 | m_shape = value; |
@@ -740,7 +740,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
740 | } | 740 | } |
741 | 741 | ||
742 | #endregion | 742 | #endregion |
743 | 743 | ||
744 | //--------------- | 744 | //--------------- |
745 | 745 | ||
746 | 746 | ||
@@ -771,7 +771,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
771 | get { return m_parentGroup; } | 771 | get { return m_parentGroup; } |
772 | } | 772 | } |
773 | 773 | ||
774 | 774 | ||
775 | 775 | ||
776 | public scriptEvents ScriptEvents | 776 | public scriptEvents ScriptEvents |
777 | { | 777 | { |
@@ -802,8 +802,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
802 | 802 | ||
803 | public LLQuaternion SitTargetOrientationLL | 803 | public LLQuaternion SitTargetOrientationLL |
804 | { | 804 | { |
805 | get | 805 | get |
806 | { | 806 | { |
807 | return new LLQuaternion( | 807 | return new LLQuaternion( |
808 | m_sitTargetOrientation.x, | 808 | m_sitTargetOrientation.x, |
809 | m_sitTargetOrientation.y, | 809 | m_sitTargetOrientation.y, |
@@ -830,97 +830,97 @@ namespace OpenSim.Region.Environment.Scenes | |||
830 | } | 830 | } |
831 | } | 831 | } |
832 | 832 | ||
833 | public uint ParentID | 833 | public uint ParentID |
834 | { | 834 | { |
835 | get { return _parentID; } | 835 | get { return _parentID; } |
836 | set { _parentID = value; } | 836 | set { _parentID = value; } |
837 | } | 837 | } |
838 | 838 | ||
839 | public int CreationDate | 839 | public int CreationDate |
840 | { | 840 | { |
841 | get { return _creationDate; } | 841 | get { return _creationDate; } |
842 | set { _creationDate = value; } | 842 | set { _creationDate = value; } |
843 | } | 843 | } |
844 | 844 | ||
845 | public uint Category | 845 | public uint Category |
846 | { | 846 | { |
847 | get { return _category; } | 847 | get { return _category; } |
848 | set { _category = value; } | 848 | set { _category = value; } |
849 | } | 849 | } |
850 | 850 | ||
851 | public int SalePrice | 851 | public int SalePrice |
852 | { | 852 | { |
853 | get { return _salePrice; } | 853 | get { return _salePrice; } |
854 | set { _salePrice = value; } | 854 | set { _salePrice = value; } |
855 | } | 855 | } |
856 | 856 | ||
857 | public byte ObjectSaleType | 857 | public byte ObjectSaleType |
858 | { | 858 | { |
859 | get { return _objectSaleType; } | 859 | get { return _objectSaleType; } |
860 | set { _objectSaleType = value; } | 860 | set { _objectSaleType = value; } |
861 | } | 861 | } |
862 | 862 | ||
863 | public int OwnershipCost | 863 | public int OwnershipCost |
864 | { | 864 | { |
865 | get { return _ownershipCost; } | 865 | get { return _ownershipCost; } |
866 | set { _ownershipCost = value; } | 866 | set { _ownershipCost = value; } |
867 | } | 867 | } |
868 | 868 | ||
869 | public LLUUID GroupID | 869 | public LLUUID GroupID |
870 | { | 870 | { |
871 | get { return _groupID; } | 871 | get { return _groupID; } |
872 | set { _groupID = value; } | 872 | set { _groupID = value; } |
873 | } | 873 | } |
874 | 874 | ||
875 | public LLUUID OwnerID | 875 | public LLUUID OwnerID |
876 | { | 876 | { |
877 | get { return _ownerID; } | 877 | get { return _ownerID; } |
878 | set { _ownerID = value; } | 878 | set { _ownerID = value; } |
879 | } | 879 | } |
880 | 880 | ||
881 | public LLUUID LastOwnerID | 881 | public LLUUID LastOwnerID |
882 | { | 882 | { |
883 | get { return _lastOwnerID; } | 883 | get { return _lastOwnerID; } |
884 | set { _lastOwnerID = value; } | 884 | set { _lastOwnerID = value; } |
885 | } | 885 | } |
886 | 886 | ||
887 | public uint BaseMask | 887 | public uint BaseMask |
888 | { | 888 | { |
889 | get { return _baseMask; } | 889 | get { return _baseMask; } |
890 | set { _baseMask = value; } | 890 | set { _baseMask = value; } |
891 | } | 891 | } |
892 | 892 | ||
893 | public uint OwnerMask | 893 | public uint OwnerMask |
894 | { | 894 | { |
895 | get { return _ownerMask; } | 895 | get { return _ownerMask; } |
896 | set { _ownerMask = value; } | 896 | set { _ownerMask = value; } |
897 | } | 897 | } |
898 | 898 | ||
899 | public uint GroupMask | 899 | public uint GroupMask |
900 | { | 900 | { |
901 | get { return _groupMask; } | 901 | get { return _groupMask; } |
902 | set { _groupMask = value; } | 902 | set { _groupMask = value; } |
903 | } | 903 | } |
904 | 904 | ||
905 | public uint EveryoneMask | 905 | public uint EveryoneMask |
906 | { | 906 | { |
907 | get { return _everyoneMask; } | 907 | get { return _everyoneMask; } |
908 | set { _everyoneMask = value; } | 908 | set { _everyoneMask = value; } |
909 | } | 909 | } |
910 | 910 | ||
911 | public uint NextOwnerMask | 911 | public uint NextOwnerMask |
912 | { | 912 | { |
913 | get { return _nextOwnerMask; } | 913 | get { return _nextOwnerMask; } |
914 | set { _nextOwnerMask = value; } | 914 | set { _nextOwnerMask = value; } |
915 | } | 915 | } |
916 | 916 | ||
917 | public libsecondlife.LLObject.ObjectFlags Flags | 917 | public libsecondlife.LLObject.ObjectFlags Flags |
918 | { | 918 | { |
919 | get { return _flags; } | 919 | get { return _flags; } |
920 | set { _flags = value; } | 920 | set { _flags = value; } |
921 | } | 921 | } |
922 | 922 | ||
923 | public LLUUID SitTargetAvatar | 923 | public LLUUID SitTargetAvatar |
924 | { | 924 | { |
925 | get { return m_sitTargetAvatar; } | 925 | get { return m_sitTargetAvatar; } |
926 | set { m_sitTargetAvatar = value; } | 926 | set { m_sitTargetAvatar = value; } |
@@ -929,8 +929,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
929 | [XmlIgnore] | 929 | [XmlIgnore] |
930 | public virtual LLUUID RegionID | 930 | public virtual LLUUID RegionID |
931 | { | 931 | { |
932 | get | 932 | get |
933 | { | 933 | { |
934 | if (ParentGroup != null && ParentGroup.Scene != null) | 934 | if (ParentGroup != null && ParentGroup.Scene != null) |
935 | return ParentGroup.Scene.RegionInfo.RegionID; | 935 | return ParentGroup.Scene.RegionInfo.RegionID; |
936 | else | 936 | else |
@@ -943,9 +943,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
943 | [XmlIgnore] | 943 | [XmlIgnore] |
944 | public LLUUID ParentUUID | 944 | public LLUUID ParentUUID |
945 | { | 945 | { |
946 | get | 946 | get |
947 | { | 947 | { |
948 | if (ParentGroup != null) | 948 | if (ParentGroup != null) |
949 | { | 949 | { |
950 | _parentUUID = ParentGroup.UUID; | 950 | _parentUUID = ParentGroup.UUID; |
951 | } | 951 | } |
@@ -953,7 +953,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
953 | } | 953 | } |
954 | set { _parentUUID = value; } | 954 | set { _parentUUID = value; } |
955 | } | 955 | } |
956 | 956 | ||
957 | #endregion Public Properties with only Get | 957 | #endregion Public Properties with only Get |
958 | 958 | ||
959 | #region Private Methods | 959 | #region Private Methods |
@@ -2460,7 +2460,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2460 | return; | 2460 | return; |
2461 | } | 2461 | } |
2462 | } | 2462 | } |
2463 | 2463 | ||
2464 | 2464 | ||
2465 | 2465 | ||
2466 | if (m_parentGroup.GetSceneMaxUndo() > 0) | 2466 | if (m_parentGroup.GetSceneMaxUndo() > 0) |
@@ -2914,7 +2914,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2914 | ScaleOffset = Math.Abs(ScaleOffset); | 2914 | ScaleOffset = Math.Abs(ScaleOffset); |
2915 | Vector3 offset = returnresult.normal * ScaleOffset; | 2915 | Vector3 offset = returnresult.normal * ScaleOffset; |
2916 | returnresult.ipoint = AXpos + offset; | 2916 | returnresult.ipoint = AXpos + offset; |
2917 | 2917 | ||
2918 | ///pos = (intersectionpoint + offset); | 2918 | ///pos = (intersectionpoint + offset); |
2919 | } | 2919 | } |
2920 | else | 2920 | else |
@@ -3354,27 +3354,27 @@ namespace OpenSim.Region.Environment.Scenes | |||
3354 | public void SetCameraAtOffset(LLVector3 v) { | 3354 | public void SetCameraAtOffset(LLVector3 v) { |
3355 | m_cameraAtOffset = v; | 3355 | m_cameraAtOffset = v; |
3356 | } | 3356 | } |
3357 | 3357 | ||
3358 | public void SetCameraEyeOffset(LLVector3 v) { | 3358 | public void SetCameraEyeOffset(LLVector3 v) { |
3359 | m_cameraEyeOffset = v; | 3359 | m_cameraEyeOffset = v; |
3360 | } | 3360 | } |
3361 | 3361 | ||
3362 | public void SetForceMouselook(bool force) { | 3362 | public void SetForceMouselook(bool force) { |
3363 | m_forceMouselook = force; | 3363 | m_forceMouselook = force; |
3364 | } | 3364 | } |
3365 | 3365 | ||
3366 | public LLVector3 GetCameraAtOffset() { | 3366 | public LLVector3 GetCameraAtOffset() { |
3367 | return m_cameraAtOffset; | 3367 | return m_cameraAtOffset; |
3368 | } | 3368 | } |
3369 | 3369 | ||
3370 | public LLVector3 GetCameraEyeOffset() { | 3370 | public LLVector3 GetCameraEyeOffset() { |
3371 | return m_cameraEyeOffset; | 3371 | return m_cameraEyeOffset; |
3372 | } | 3372 | } |
3373 | 3373 | ||
3374 | public bool GetForceMouselook() { | 3374 | public bool GetForceMouselook() { |
3375 | return m_forceMouselook; | 3375 | return m_forceMouselook; |
3376 | } | 3376 | } |
3377 | 3377 | ||
3378 | #endregion Public Methods | 3378 | #endregion Public Methods |
3379 | } | 3379 | } |
3380 | } | 3380 | } |
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index cad2496..5669af6 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -1198,7 +1198,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1198 | RemoveFromPhysicalScene(); | 1198 | RemoveFromPhysicalScene(); |
1199 | } | 1199 | } |
1200 | } | 1200 | } |
1201 | 1201 | ||
1202 | cameraAtOffset = part.GetCameraAtOffset(); | 1202 | cameraAtOffset = part.GetCameraAtOffset(); |
1203 | cameraEyeOffset = part.GetCameraEyeOffset(); | 1203 | cameraEyeOffset = part.GetCameraEyeOffset(); |
1204 | forceMouselook = part.GetForceMouselook(); | 1204 | forceMouselook = part.GetForceMouselook(); |
@@ -1347,7 +1347,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1347 | 1347 | ||
1348 | RemoveAnimation(animID); | 1348 | RemoveAnimation(animID); |
1349 | } | 1349 | } |
1350 | 1350 | ||
1351 | public LLUUID[] GetAnimationArray() | 1351 | public LLUUID[] GetAnimationArray() |
1352 | { | 1352 | { |
1353 | LLUUID[] animIDs; | 1353 | LLUUID[] animIDs; |
@@ -1696,7 +1696,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1696 | 1696 | ||
1697 | 1697 | ||
1698 | /// <summary> | 1698 | /// <summary> |
1699 | /// Do everything required once a client completes its movement into a region | 1699 | /// Do everything required once a client completes its movement into a region |
1700 | /// </summary> | 1700 | /// </summary> |
1701 | public void SendInitialData() | 1701 | public void SendInitialData() |
1702 | { | 1702 | { |
@@ -1898,7 +1898,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1898 | { | 1898 | { |
1899 | if (IsChildAgent) | 1899 | if (IsChildAgent) |
1900 | return; | 1900 | return; |
1901 | 1901 | ||
1902 | LLVector3 pos2 = AbsolutePosition; | 1902 | LLVector3 pos2 = AbsolutePosition; |
1903 | LLVector3 vel = Velocity; | 1903 | LLVector3 vel = Velocity; |
1904 | 1904 | ||
@@ -1968,9 +1968,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
1968 | // This means we need to remove the current caps handler here and possibly compensate later, | 1968 | // This means we need to remove the current caps handler here and possibly compensate later, |
1969 | // in case both scenes are being hosted on the same region server. Messy | 1969 | // in case both scenes are being hosted on the same region server. Messy |
1970 | m_scene.RemoveCapsHandler(UUID); | 1970 | m_scene.RemoveCapsHandler(UUID); |
1971 | newpos = newpos + (vel); | 1971 | newpos = newpos + (vel); |
1972 | 1972 | ||
1973 | CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(UUID); | 1973 | CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(UUID); |
1974 | if (userInfo != null) | 1974 | if (userInfo != null) |
1975 | { | 1975 | { |
1976 | userInfo.DropInventory(); | 1976 | userInfo.DropInventory(); |
@@ -1978,11 +1978,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
1978 | else | 1978 | else |
1979 | { | 1979 | { |
1980 | m_log.WarnFormat("[SCENE PRESENCE]: No cached user info found for {0} {1} on leaving region", Name, UUID); | 1980 | m_log.WarnFormat("[SCENE PRESENCE]: No cached user info found for {0} {1} on leaving region", Name, UUID); |
1981 | } | 1981 | } |
1982 | 1982 | ||
1983 | bool crossingSuccessful = | 1983 | bool crossingSuccessful = |
1984 | m_scene.InformNeighbourOfCrossing(neighbourHandle, m_controllingClient.AgentId, newpos, | 1984 | m_scene.InformNeighbourOfCrossing(neighbourHandle, m_controllingClient.AgentId, newpos, |
1985 | m_physicsActor.Flying); | 1985 | m_physicsActor.Flying); |
1986 | if (crossingSuccessful) | 1986 | if (crossingSuccessful) |
1987 | { | 1987 | { |
1988 | AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo(); | 1988 | AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo(); |
@@ -1998,8 +1998,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
1998 | m_controllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint, | 1998 | m_controllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint, |
1999 | capsPath); | 1999 | capsPath); |
2000 | MakeChildAgent(); | 2000 | MakeChildAgent(); |
2001 | CrossAttachmentsIntoNewRegion(neighbourHandle); | 2001 | CrossAttachmentsIntoNewRegion(neighbourHandle); |
2002 | 2002 | ||
2003 | m_scene.SendKillObject(m_localId); | 2003 | m_scene.SendKillObject(m_localId); |
2004 | m_scene.NotifyMyCoarseLocationChange(); | 2004 | m_scene.NotifyMyCoarseLocationChange(); |
2005 | // the user may change thier profile information in other region, | 2005 | // the user may change thier profile information in other region, |
@@ -2010,7 +2010,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2010 | else | 2010 | else |
2011 | { | 2011 | { |
2012 | // Restore the user structures that we needed to delete before asking the receiving region to complete the crossing | 2012 | // Restore the user structures that we needed to delete before asking the receiving region to complete the crossing |
2013 | m_scene.CommsManager.UserProfileCacheService.RequestInventoryForUser(UUID); | 2013 | m_scene.CommsManager.UserProfileCacheService.RequestInventoryForUser(UUID); |
2014 | m_scene.AddCapsHandler(UUID); | 2014 | m_scene.AddCapsHandler(UUID); |
2015 | } | 2015 | } |
2016 | } | 2016 | } |
@@ -2825,7 +2825,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2825 | } | 2825 | } |
2826 | } | 2826 | } |
2827 | } | 2827 | } |
2828 | 2828 | ||
2829 | LastCommands = allflags; | 2829 | LastCommands = allflags; |
2830 | } | 2830 | } |
2831 | 2831 | ||
diff --git a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs index f46aba4..0e551cb 100644 --- a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs | |||
@@ -126,7 +126,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
126 | m_report.Interval = statsUpdatesEveryMS; | 126 | m_report.Interval = statsUpdatesEveryMS; |
127 | m_report.Elapsed += new ElapsedEventHandler(statsHeartBeat); | 127 | m_report.Elapsed += new ElapsedEventHandler(statsHeartBeat); |
128 | m_report.Enabled = true; | 128 | m_report.Enabled = true; |
129 | 129 | ||
130 | if (StatsManager.SimExtraStats != null) | 130 | if (StatsManager.SimExtraStats != null) |
131 | OnSendStatsResult += StatsManager.SimExtraStats.ReceiveClassicSimStatsPacket; | 131 | OnSendStatsResult += StatsManager.SimExtraStats.ReceiveClassicSimStatsPacket; |
132 | } | 132 | } |
diff --git a/OpenSim/Region/Environment/Scenes/UndoState.cs b/OpenSim/Region/Environment/Scenes/UndoState.cs index 5d1f6a0..fdbfa8c 100644 --- a/OpenSim/Region/Environment/Scenes/UndoState.cs +++ b/OpenSim/Region/Environment/Scenes/UndoState.cs | |||
@@ -41,7 +41,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
41 | Rotation = rot; | 41 | Rotation = rot; |
42 | Scale = scale; | 42 | Scale = scale; |
43 | } | 43 | } |
44 | 44 | ||
45 | public UndoState(SceneObjectPart part) | 45 | public UndoState(SceneObjectPart part) |
46 | { | 46 | { |
47 | if (part != null) | 47 | if (part != null) |
@@ -50,7 +50,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
50 | { | 50 | { |
51 | Position = part.AbsolutePosition; | 51 | Position = part.AbsolutePosition; |
52 | Rotation = part.RotationOffset; | 52 | Rotation = part.RotationOffset; |
53 | 53 | ||
54 | } | 54 | } |
55 | else | 55 | else |
56 | { | 56 | { |
@@ -90,7 +90,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
90 | if (part != null) | 90 | if (part != null) |
91 | { | 91 | { |
92 | part.Undoing = true; | 92 | part.Undoing = true; |
93 | 93 | ||
94 | if (part.ParentID == 0) | 94 | if (part.ParentID == 0) |
95 | { | 95 | { |
96 | part.ParentGroup.AbsolutePosition = Position; | 96 | part.ParentGroup.AbsolutePosition = Position; |
@@ -105,7 +105,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
105 | part.ScheduleTerseUpdate(); | 105 | part.ScheduleTerseUpdate(); |
106 | } | 106 | } |
107 | part.Undoing = false; | 107 | part.Undoing = false; |
108 | 108 | ||
109 | } | 109 | } |
110 | } | 110 | } |
111 | 111 | ||