diff options
author | Diva Canto | 2014-05-07 17:00:12 -0700 |
---|---|---|
committer | Diva Canto | 2014-05-07 17:00:12 -0700 |
commit | f4cba27105f68914de455cf6a27b9126e086cea1 (patch) | |
tree | d87599f942f1e839dc4262f18c946564528314be /OpenSim/Region/CoreModules | |
parent | Allow Tools.Configger to take -inifile as argument (diff) | |
parent | Add GridUserService service config to [UserAccountService] in Robust[.HG].ini... (diff) | |
download | opensim-SC-f4cba27105f68914de455cf6a27b9126e086cea1.zip opensim-SC-f4cba27105f68914de455cf6a27b9126e086cea1.tar.gz opensim-SC-f4cba27105f68914de455cf6a27b9126e086cea1.tar.bz2 opensim-SC-f4cba27105f68914de455cf6a27b9126e086cea1.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/CoreModules')
4 files changed, 112 insertions, 12 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 0b10dd8..c632798 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | |||
@@ -180,8 +180,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
180 | "[INVENTORY TRANSFER]: Inserting original folder {0} into agent {1}'s inventory", | 180 | "[INVENTORY TRANSFER]: Inserting original folder {0} into agent {1}'s inventory", |
181 | folderID, new UUID(im.toAgentID)); | 181 | folderID, new UUID(im.toAgentID)); |
182 | 182 | ||
183 | InventoryFolderBase folderCopy | 183 | InventoryFolderBase folderCopy |
184 | = scene.GiveInventoryFolder(receipientID, client.AgentId, folderID, UUID.Zero); | 184 | = scene.GiveInventoryFolder(client, receipientID, client.AgentId, folderID, UUID.Zero); |
185 | 185 | ||
186 | if (folderCopy == null) | 186 | if (folderCopy == null) |
187 | { | 187 | { |
@@ -217,13 +217,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
217 | "into agent {1}'s inventory", | 217 | "into agent {1}'s inventory", |
218 | itemID, new UUID(im.toAgentID)); | 218 | itemID, new UUID(im.toAgentID)); |
219 | 219 | ||
220 | InventoryItemBase itemCopy = scene.GiveInventoryItem( | 220 | string message; |
221 | new UUID(im.toAgentID), | 221 | InventoryItemBase itemCopy = scene.GiveInventoryItem(new UUID(im.toAgentID), client.AgentId, itemID, out message); |
222 | client.AgentId, itemID); | ||
223 | 222 | ||
224 | if (itemCopy == null) | 223 | if (itemCopy == null) |
225 | { | 224 | { |
226 | client.SendAgentAlertMessage("Can't find item to give. Nothing given.", false); | 225 | client.SendAgentAlertMessage(message, false); |
227 | return; | 226 | return; |
228 | } | 227 | } |
229 | 228 | ||
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index a1629fb..e9c6fb6 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -160,10 +160,22 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
160 | private IAssetService m_assetService = null; | 160 | private IAssetService m_assetService = null; |
161 | 161 | ||
162 | 162 | ||
163 | private UUID m_defaultUser; | ||
164 | |||
163 | public ArchiveReadRequest(Scene scene, string loadPath, Guid requestId, Dictionary<string,object>options) | 165 | public ArchiveReadRequest(Scene scene, string loadPath, Guid requestId, Dictionary<string,object>options) |
164 | { | 166 | { |
165 | m_rootScene = scene; | 167 | m_rootScene = scene; |
166 | 168 | ||
169 | if (options.ContainsKey("default-user")) | ||
170 | { | ||
171 | m_defaultUser = (UUID)options["default-user"]; | ||
172 | m_log.InfoFormat("Using User {0} as default user", m_defaultUser.ToString()); | ||
173 | } | ||
174 | else | ||
175 | { | ||
176 | m_defaultUser = scene.RegionInfo.EstateSettings.EstateOwner; | ||
177 | } | ||
178 | |||
167 | m_loadPath = loadPath; | 179 | m_loadPath = loadPath; |
168 | try | 180 | try |
169 | { | 181 | { |
@@ -206,6 +218,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
206 | m_merge = options.ContainsKey("merge"); | 218 | m_merge = options.ContainsKey("merge"); |
207 | m_requestId = requestId; | 219 | m_requestId = requestId; |
208 | 220 | ||
221 | m_defaultUser = scene.RegionInfo.EstateSettings.EstateOwner; | ||
222 | |||
209 | // Zero can never be a valid user id | 223 | // Zero can never be a valid user id |
210 | m_validUserUuids[UUID.Zero] = false; | 224 | m_validUserUuids[UUID.Zero] = false; |
211 | 225 | ||
@@ -562,16 +576,16 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
562 | if (string.IsNullOrEmpty(part.CreatorData)) | 576 | if (string.IsNullOrEmpty(part.CreatorData)) |
563 | { | 577 | { |
564 | if (!ResolveUserUuid(scene, part.CreatorID)) | 578 | if (!ResolveUserUuid(scene, part.CreatorID)) |
565 | part.CreatorID = scene.RegionInfo.EstateSettings.EstateOwner; | 579 | part.CreatorID = m_defaultUser; |
566 | } | 580 | } |
567 | if (UserManager != null) | 581 | if (UserManager != null) |
568 | UserManager.AddUser(part.CreatorID, part.CreatorData); | 582 | UserManager.AddUser(part.CreatorID, part.CreatorData); |
569 | 583 | ||
570 | if (!(ResolveUserUuid(scene, part.OwnerID) || ResolveGroupUuid(part.OwnerID))) | 584 | if (!(ResolveUserUuid(scene, part.OwnerID) || ResolveGroupUuid(part.OwnerID))) |
571 | part.OwnerID = scene.RegionInfo.EstateSettings.EstateOwner; | 585 | part.OwnerID = m_defaultUser; |
572 | 586 | ||
573 | if (!(ResolveUserUuid(scene, part.LastOwnerID) || ResolveGroupUuid(part.LastOwnerID))) | 587 | if (!(ResolveUserUuid(scene, part.LastOwnerID) || ResolveGroupUuid(part.LastOwnerID))) |
574 | part.LastOwnerID = scene.RegionInfo.EstateSettings.EstateOwner; | 588 | part.LastOwnerID = m_defaultUser; |
575 | 589 | ||
576 | if (!ResolveGroupUuid(part.GroupID)) | 590 | if (!ResolveGroupUuid(part.GroupID)) |
577 | part.GroupID = UUID.Zero; | 591 | part.GroupID = UUID.Zero; |
@@ -590,13 +604,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
590 | { | 604 | { |
591 | if (!(ResolveUserUuid(scene, kvp.Value.OwnerID) || ResolveGroupUuid(kvp.Value.OwnerID))) | 605 | if (!(ResolveUserUuid(scene, kvp.Value.OwnerID) || ResolveGroupUuid(kvp.Value.OwnerID))) |
592 | { | 606 | { |
593 | kvp.Value.OwnerID = scene.RegionInfo.EstateSettings.EstateOwner; | 607 | kvp.Value.OwnerID = m_defaultUser; |
594 | } | 608 | } |
595 | 609 | ||
596 | if (string.IsNullOrEmpty(kvp.Value.CreatorData)) | 610 | if (string.IsNullOrEmpty(kvp.Value.CreatorData)) |
597 | { | 611 | { |
598 | if (!ResolveUserUuid(scene, kvp.Value.CreatorID)) | 612 | if (!ResolveUserUuid(scene, kvp.Value.CreatorID)) |
599 | kvp.Value.CreatorID = scene.RegionInfo.EstateSettings.EstateOwner; | 613 | kvp.Value.CreatorID = m_defaultUser; |
600 | } | 614 | } |
601 | 615 | ||
602 | if (UserManager != null) | 616 | if (UserManager != null) |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs index 2b2da6f..6a09caf 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs | |||
@@ -108,6 +108,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
108 | bool forceParcels = false; | 108 | bool forceParcels = false; |
109 | bool noObjects = false; | 109 | bool noObjects = false; |
110 | Vector3 displacement = new Vector3(0f, 0f, 0f); | 110 | Vector3 displacement = new Vector3(0f, 0f, 0f); |
111 | String defaultUser = ""; | ||
111 | float rotation = 0f; | 112 | float rotation = 0f; |
112 | Vector3 rotationCenter = new Vector3(Constants.RegionSize / 2f, Constants.RegionSize / 2f, 0); | 113 | Vector3 rotationCenter = new Vector3(Constants.RegionSize / 2f, Constants.RegionSize / 2f, 0); |
113 | 114 | ||
@@ -119,6 +120,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
119 | options.Add("force-parcels", delegate (string v) { forceParcels = (v != null); }); | 120 | options.Add("force-parcels", delegate (string v) { forceParcels = (v != null); }); |
120 | options.Add("forceparcels", delegate (string v) { forceParcels = (v != null); }); // downward compatibility | 121 | options.Add("forceparcels", delegate (string v) { forceParcels = (v != null); }); // downward compatibility |
121 | options.Add("no-objects", delegate (string v) { noObjects = (v != null); }); | 122 | options.Add("no-objects", delegate (string v) { noObjects = (v != null); }); |
123 | options.Add("default-user=", delegate(string v) { defaultUser = (v == null) ? "" : v; }); | ||
122 | options.Add("displacement=", delegate (string v) { | 124 | options.Add("displacement=", delegate (string v) { |
123 | try | 125 | try |
124 | { | 126 | { |
@@ -131,7 +133,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
131 | return; | 133 | return; |
132 | } | 134 | } |
133 | }); | 135 | }); |
134 | options.Add("rotation=", delegate (string v) { | 136 | options.Add("rotation=", delegate(string v) |
137 | { | ||
135 | try | 138 | try |
136 | { | 139 | { |
137 | rotation = v == null ? 0f : float.Parse(v); | 140 | rotation = v == null ? 0f : float.Parse(v); |
@@ -181,6 +184,27 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
181 | if (forceTerrain) archiveOptions.Add("force-terrain", null); | 184 | if (forceTerrain) archiveOptions.Add("force-terrain", null); |
182 | if (forceParcels) archiveOptions.Add("force-parcels", null); | 185 | if (forceParcels) archiveOptions.Add("force-parcels", null); |
183 | if (noObjects) archiveOptions.Add("no-objects", null); | 186 | if (noObjects) archiveOptions.Add("no-objects", null); |
187 | if (defaultUser != "") | ||
188 | { | ||
189 | UUID defaultUserUUID = UUID.Zero; | ||
190 | try | ||
191 | { | ||
192 | defaultUserUUID = Scene.UserManagementModule.GetUserIdByName(defaultUser); | ||
193 | } | ||
194 | catch | ||
195 | { | ||
196 | m_log.ErrorFormat("[ARCHIVER MODULE] default user must be in format \"First Last\"", defaultUser); | ||
197 | } | ||
198 | if (defaultUserUUID == UUID.Zero) | ||
199 | { | ||
200 | m_log.ErrorFormat("[ARCHIVER MODULE] cannot find specified default user {0}", defaultUser); | ||
201 | return; | ||
202 | } | ||
203 | else | ||
204 | { | ||
205 | archiveOptions.Add("default-user", defaultUserUUID); | ||
206 | } | ||
207 | } | ||
184 | archiveOptions.Add("displacement", displacement); | 208 | archiveOptions.Add("displacement", displacement); |
185 | archiveOptions.Add("rotation", rotation); | 209 | archiveOptions.Add("rotation", rotation); |
186 | archiveOptions.Add("rotation-center", rotationCenter); | 210 | archiveOptions.Add("rotation-center", rotationCenter); |
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 54a7302..a032bc7 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -313,6 +313,69 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
313 | return response; | 313 | return response; |
314 | } | 314 | } |
315 | 315 | ||
316 | public string SetRegionEstate(RegionInfo regionInfo, int estateID) | ||
317 | { | ||
318 | string response; | ||
319 | |||
320 | if (regionInfo.EstateSettings.EstateID == estateID) | ||
321 | { | ||
322 | response = String.Format("\"{0}\" is already part of estate {1}", regionInfo.RegionName, estateID); | ||
323 | } | ||
324 | else | ||
325 | { | ||
326 | // get the current settings from DB | ||
327 | EstateSettings dbSettings = Scene.EstateDataService.LoadEstateSettings(estateID); | ||
328 | if (dbSettings.EstateID == 0) | ||
329 | { | ||
330 | response = String.Format("No estate found with ID {0}", estateID); | ||
331 | } | ||
332 | else if (Scene.EstateDataService.LinkRegion(regionInfo.RegionID, estateID)) | ||
333 | { | ||
334 | // make sure there's a log entry to document the change | ||
335 | m_log.InfoFormat("[ESTATE]: Region {0} ({1}) moved to Estate {2} ({3}).", regionInfo.RegionID, regionInfo.RegionName, estateID, dbSettings.EstateName); | ||
336 | |||
337 | // propagate the change | ||
338 | ChangeDelegate change = OnEstateInfoChange; | ||
339 | |||
340 | if (change != null) | ||
341 | change(regionInfo.RegionID); | ||
342 | |||
343 | response = String.Empty; | ||
344 | } | ||
345 | else | ||
346 | { | ||
347 | response = String.Format("Could not move \"{0}\" to estate {1}", regionInfo.RegionName, estateID); | ||
348 | } | ||
349 | } | ||
350 | return response; | ||
351 | } | ||
352 | |||
353 | public string CreateEstate(string estateName, UUID ownerID) | ||
354 | { | ||
355 | string response; | ||
356 | if (string.IsNullOrEmpty(estateName)) | ||
357 | { | ||
358 | response = "No estate name specified."; | ||
359 | } | ||
360 | else | ||
361 | { | ||
362 | List<int> estates = Scene.EstateDataService.GetEstates(estateName); | ||
363 | if (estates.Count() > 0) | ||
364 | { | ||
365 | response = String.Format("An estate named \"{0}\" already exists.", estateName); | ||
366 | } | ||
367 | else | ||
368 | { | ||
369 | EstateSettings settings = Scene.EstateDataService.CreateNewEstate(); | ||
370 | settings.EstateOwner = ownerID; | ||
371 | settings.EstateName = estateName; | ||
372 | settings.Save(); | ||
373 | response = String.Empty; | ||
374 | } | ||
375 | } | ||
376 | return response; | ||
377 | } | ||
378 | |||
316 | #endregion | 379 | #endregion |
317 | 380 | ||
318 | #region Packet Data Responders | 381 | #region Packet Data Responders |