aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMatt Lehmann2014-04-30 19:12:52 -0700
committerJustin Clark-Casey (justincc)2014-05-06 18:48:42 +0100
commit8b3c2f7d0c655d72bbca9dcbd092d3ab275d47c5 (patch)
tree9aa25b0d7e8956a93fa87da33dd479be92350b14
parentfix infinite recursion loop in SendGridInstantMessageViaXMLRPCAsync() (diff)
downloadopensim-SC_OLD-8b3c2f7d0c655d72bbca9dcbd092d3ab275d47c5.zip
opensim-SC_OLD-8b3c2f7d0c655d72bbca9dcbd092d3ab275d47c5.tar.gz
opensim-SC_OLD-8b3c2f7d0c655d72bbca9dcbd092d3ab275d47c5.tar.bz2
opensim-SC_OLD-8b3c2f7d0c655d72bbca9dcbd092d3ab275d47c5.tar.xz
updated version of default user switch for load oar :q :q
-rw-r--r--OpenSim/Region/Application/OpenSim.cs1
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs22
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs26
3 files changed, 43 insertions, 6 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 544accf..cc505f8 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -272,6 +272,7 @@ namespace OpenSim
272 + " [--no-objects]" 272 + " [--no-objects]"
273 + " [--rotation degrees] [--rotation-center \"<x,y,z>\"]" 273 + " [--rotation degrees] [--rotation-center \"<x,y,z>\"]"
274 + " [--displacement \"<x,y,z>\"]" 274 + " [--displacement \"<x,y,z>\"]"
275 + " [--default-user \"User Name\"]"
275 + " [<OAR path>]", 276 + " [<OAR path>]",
276 "Load a region's data from an OAR archive.", 277 "Load a region's data from an OAR archive.",
277 "--merge will merge the OAR with the existing scene (suppresses terrain and parcel info loading)." + Environment.NewLine 278 "--merge will merge the OAR with the existing scene (suppresses terrain and parcel info loading)." + Environment.NewLine
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
index a1629fb..fe87350 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 {
@@ -562,16 +574,16 @@ namespace OpenSim.Region.CoreModules.World.Archiver
562 if (string.IsNullOrEmpty(part.CreatorData)) 574 if (string.IsNullOrEmpty(part.CreatorData))
563 { 575 {
564 if (!ResolveUserUuid(scene, part.CreatorID)) 576 if (!ResolveUserUuid(scene, part.CreatorID))
565 part.CreatorID = scene.RegionInfo.EstateSettings.EstateOwner; 577 part.CreatorID = m_defaultUser;
566 } 578 }
567 if (UserManager != null) 579 if (UserManager != null)
568 UserManager.AddUser(part.CreatorID, part.CreatorData); 580 UserManager.AddUser(part.CreatorID, part.CreatorData);
569 581
570 if (!(ResolveUserUuid(scene, part.OwnerID) || ResolveGroupUuid(part.OwnerID))) 582 if (!(ResolveUserUuid(scene, part.OwnerID) || ResolveGroupUuid(part.OwnerID)))
571 part.OwnerID = scene.RegionInfo.EstateSettings.EstateOwner; 583 part.OwnerID = m_defaultUser;
572 584
573 if (!(ResolveUserUuid(scene, part.LastOwnerID) || ResolveGroupUuid(part.LastOwnerID))) 585 if (!(ResolveUserUuid(scene, part.LastOwnerID) || ResolveGroupUuid(part.LastOwnerID)))
574 part.LastOwnerID = scene.RegionInfo.EstateSettings.EstateOwner; 586 part.LastOwnerID = m_defaultUser;
575 587
576 if (!ResolveGroupUuid(part.GroupID)) 588 if (!ResolveGroupUuid(part.GroupID))
577 part.GroupID = UUID.Zero; 589 part.GroupID = UUID.Zero;
@@ -590,13 +602,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver
590 { 602 {
591 if (!(ResolveUserUuid(scene, kvp.Value.OwnerID) || ResolveGroupUuid(kvp.Value.OwnerID))) 603 if (!(ResolveUserUuid(scene, kvp.Value.OwnerID) || ResolveGroupUuid(kvp.Value.OwnerID)))
592 { 604 {
593 kvp.Value.OwnerID = scene.RegionInfo.EstateSettings.EstateOwner; 605 kvp.Value.OwnerID = m_defaultUser;
594 } 606 }
595 607
596 if (string.IsNullOrEmpty(kvp.Value.CreatorData)) 608 if (string.IsNullOrEmpty(kvp.Value.CreatorData))
597 { 609 {
598 if (!ResolveUserUuid(scene, kvp.Value.CreatorID)) 610 if (!ResolveUserUuid(scene, kvp.Value.CreatorID))
599 kvp.Value.CreatorID = scene.RegionInfo.EstateSettings.EstateOwner; 611 kvp.Value.CreatorID = m_defaultUser;
600 } 612 }
601 613
602 if (UserManager != null) 614 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);