diff options
author | Jonathan Freedman | 2010-11-21 20:01:48 -0800 |
---|---|---|
committer | Jonathan Freedman | 2010-11-21 20:01:48 -0800 |
commit | b7f5e8284360f92e0e102b9546076573c57d9397 (patch) | |
tree | 132663da8c1882e524241b55a739ef2758ef8958 /OpenSim/Region/CoreModules | |
parent | Merge https://github.com/opensim/opensim into mantis5110 (diff) | |
parent | Merge branch 'master' of /var/git/opensim/ (diff) | |
download | opensim-SC_OLD-b7f5e8284360f92e0e102b9546076573c57d9397.zip opensim-SC_OLD-b7f5e8284360f92e0e102b9546076573c57d9397.tar.gz opensim-SC_OLD-b7f5e8284360f92e0e102b9546076573c57d9397.tar.bz2 opensim-SC_OLD-b7f5e8284360f92e0e102b9546076573c57d9397.tar.xz |
Merge branch 'master-core' into mantis5110
Diffstat (limited to 'OpenSim/Region/CoreModules')
16 files changed, 651 insertions, 194 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 348b8b9..1744fb3 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -273,6 +273,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
273 | 273 | ||
274 | if (objatt != null) | 274 | if (objatt != null) |
275 | { | 275 | { |
276 | // Loading the inventory from XML will have set this, but | ||
277 | // there is no way the object could have changed yet, | ||
278 | // since scripts aren't running yet. So, clear it here. | ||
279 | objatt.HasGroupChanged = false; | ||
276 | bool tainted = false; | 280 | bool tainted = false; |
277 | if (AttachmentPt != 0 && AttachmentPt != objatt.GetAttachmentPoint()) | 281 | if (AttachmentPt != 0 && AttachmentPt != objatt.GetAttachmentPoint()) |
278 | tainted = true; | 282 | tainted = true; |
@@ -470,6 +474,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
470 | m_scene.EventManager.TriggerOnAttach(group.LocalId, itemID, UUID.Zero); | 474 | m_scene.EventManager.TriggerOnAttach(group.LocalId, itemID, UUID.Zero); |
471 | group.DetachToInventoryPrep(); | 475 | group.DetachToInventoryPrep(); |
472 | m_log.Debug("[ATTACHMENTS MODULE]: Saving attachpoint: " + ((uint)group.GetAttachmentPoint()).ToString()); | 476 | m_log.Debug("[ATTACHMENTS MODULE]: Saving attachpoint: " + ((uint)group.GetAttachmentPoint()).ToString()); |
477 | |||
478 | // If an item contains scripts, it's always changed. | ||
479 | // This ensures script state is saved on detach | ||
480 | foreach (SceneObjectPart p in group.Parts) | ||
481 | if (p.Inventory.ContainsScripts()) | ||
482 | group.HasGroupChanged = true; | ||
483 | |||
473 | UpdateKnownItem(remoteClient, group, group.GetFromItemID(), group.OwnerID); | 484 | UpdateKnownItem(remoteClient, group, group.GetFromItemID(), group.OwnerID); |
474 | m_scene.DeleteSceneObject(group, false); | 485 | m_scene.DeleteSceneObject(group, false); |
475 | return; | 486 | return; |
@@ -478,25 +489,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
478 | } | 489 | } |
479 | } | 490 | } |
480 | 491 | ||
481 | public void UpdateAttachmentPosition(IClientAPI client, SceneObjectGroup sog, Vector3 pos) | ||
482 | { | ||
483 | // If this is an attachment, then we need to save the modified | ||
484 | // object back into the avatar's inventory. First we save the | ||
485 | // attachment point information, then we update the relative | ||
486 | // positioning (which caused this method to get driven in the | ||
487 | // first place. Then we have to mark the object as NOT an | ||
488 | // attachment. This is necessary in order to correctly save | ||
489 | // and retrieve GroupPosition information for the attachment. | ||
490 | // Then we save the asset back into the appropriate inventory | ||
491 | // entry. Finally, we restore the object's attachment status. | ||
492 | byte attachmentPoint = sog.GetAttachmentPoint(); | ||
493 | sog.UpdateGroupPosition(pos); | ||
494 | sog.RootPart.IsAttachment = false; | ||
495 | sog.AbsolutePosition = sog.RootPart.AttachedPos; | ||
496 | UpdateKnownItem(client, sog, sog.GetFromItemID(), sog.OwnerID); | ||
497 | sog.SetAttachmentPoint(attachmentPoint); | ||
498 | } | ||
499 | |||
500 | /// <summary> | 492 | /// <summary> |
501 | /// Update the attachment asset for the new sog details if they have changed. | 493 | /// Update the attachment asset for the new sog details if they have changed. |
502 | /// </summary> | 494 | /// </summary> |
@@ -508,7 +500,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
508 | /// <param name="grp"></param> | 500 | /// <param name="grp"></param> |
509 | /// <param name="itemID"></param> | 501 | /// <param name="itemID"></param> |
510 | /// <param name="agentID"></param> | 502 | /// <param name="agentID"></param> |
511 | protected void UpdateKnownItem(IClientAPI remoteClient, SceneObjectGroup grp, UUID itemID, UUID agentID) | 503 | public void UpdateKnownItem(IClientAPI remoteClient, SceneObjectGroup grp, UUID itemID, UUID agentID) |
512 | { | 504 | { |
513 | if (grp != null) | 505 | if (grp != null) |
514 | { | 506 | { |
@@ -523,7 +515,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
523 | grp.UUID, grp.GetAttachmentPoint()); | 515 | grp.UUID, grp.GetAttachmentPoint()); |
524 | 516 | ||
525 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp); | 517 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp); |
526 | |||
527 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); | 518 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
528 | item = m_scene.InventoryService.GetItem(item); | 519 | item = m_scene.InventoryService.GetItem(item); |
529 | 520 | ||
@@ -617,7 +608,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
617 | // In case it is later dropped again, don't let | 608 | // In case it is later dropped again, don't let |
618 | // it get cleaned up | 609 | // it get cleaned up |
619 | so.RootPart.RemFlag(PrimFlags.TemporaryOnRez); | 610 | so.RootPart.RemFlag(PrimFlags.TemporaryOnRez); |
620 | so.HasGroupChanged = false; | ||
621 | } | 611 | } |
622 | } | 612 | } |
623 | } | 613 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 2dd444d..0df4585 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -55,6 +55,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
55 | private Dictionary<UUID,long> m_savequeue = new Dictionary<UUID,long>(); | 55 | private Dictionary<UUID,long> m_savequeue = new Dictionary<UUID,long>(); |
56 | private Dictionary<UUID,long> m_sendqueue = new Dictionary<UUID,long>(); | 56 | private Dictionary<UUID,long> m_sendqueue = new Dictionary<UUID,long>(); |
57 | 57 | ||
58 | private object m_setAppearanceLock = new object(); | ||
59 | |||
58 | #region RegionModule Members | 60 | #region RegionModule Members |
59 | 61 | ||
60 | public void Initialise(Scene scene, IConfigSource config) | 62 | public void Initialise(Scene scene, IConfigSource config) |
@@ -69,6 +71,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
69 | { | 71 | { |
70 | m_savetime = Convert.ToInt32(sconfig.GetString("DelayBeforeAppearanceSave",Convert.ToString(m_savetime))); | 72 | m_savetime = Convert.ToInt32(sconfig.GetString("DelayBeforeAppearanceSave",Convert.ToString(m_savetime))); |
71 | m_sendtime = Convert.ToInt32(sconfig.GetString("DelayBeforeAppearanceSend",Convert.ToString(m_sendtime))); | 73 | m_sendtime = Convert.ToInt32(sconfig.GetString("DelayBeforeAppearanceSend",Convert.ToString(m_sendtime))); |
74 | // m_log.InfoFormat("[AVFACTORY] configured for {0} save and {1} send",m_savetime,m_sendtime); | ||
72 | } | 75 | } |
73 | } | 76 | } |
74 | 77 | ||
@@ -117,26 +120,28 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
117 | ScenePresence sp = m_scene.GetScenePresence(client.AgentId); | 120 | ScenePresence sp = m_scene.GetScenePresence(client.AgentId); |
118 | if (sp == null) | 121 | if (sp == null) |
119 | { | 122 | { |
120 | m_log.WarnFormat("[AVATAR FACTORY MODULE]: SetAppearance unable to find presence for {0}", client.AgentId); | 123 | m_log.WarnFormat("[AVFACTORY]: SetAppearance unable to find presence for {0}", client.AgentId); |
121 | return false; | 124 | return false; |
122 | } | 125 | } |
123 | 126 | ||
124 | bool cached = true; | 127 | bool defonly = true; // are we only using default textures |
125 | 128 | ||
126 | // Process the texture entry | 129 | // Process the texture entry |
127 | for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++) | 130 | for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++) |
128 | { | 131 | { |
129 | int idx = AvatarAppearance.BAKE_INDICES[i]; | 132 | int idx = AvatarAppearance.BAKE_INDICES[i]; |
130 | Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[idx]; | 133 | Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[idx]; |
131 | if (face != null && face.TextureID != AppearanceManager.DEFAULT_AVATAR_TEXTURE) | 134 | if (face == null || face.TextureID != AppearanceManager.DEFAULT_AVATAR_TEXTURE) |
132 | if (! CheckBakedTextureAsset(client,face.TextureID,idx)) | 135 | continue; |
133 | { | 136 | |
134 | sp.Appearance.Texture.FaceTextures[idx] = null; | 137 | defonly = false; // found a non-default texture reference |
135 | cached = false; | 138 | |
136 | } | 139 | if (! CheckBakedTextureAsset(client,face.TextureID,idx)) |
140 | return false; | ||
137 | } | 141 | } |
138 | 142 | ||
139 | return cached; | 143 | // If we only found default textures, then the appearance is not cached |
144 | return (defonly ? false : true); | ||
140 | } | 145 | } |
141 | 146 | ||
142 | /// <summary> | 147 | /// <summary> |
@@ -146,44 +151,59 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
146 | /// <param name="visualParam"></param> | 151 | /// <param name="visualParam"></param> |
147 | public void SetAppearance(IClientAPI client, Primitive.TextureEntry textureEntry, byte[] visualParams) | 152 | public void SetAppearance(IClientAPI client, Primitive.TextureEntry textureEntry, byte[] visualParams) |
148 | { | 153 | { |
149 | // m_log.WarnFormat("[AVATAR FACTORY MODULE]: SetAppearance for {0}",client.AgentId); | ||
150 | |||
151 | ScenePresence sp = m_scene.GetScenePresence(client.AgentId); | 154 | ScenePresence sp = m_scene.GetScenePresence(client.AgentId); |
152 | if (sp == null) | 155 | if (sp == null) |
153 | { | 156 | { |
154 | m_log.WarnFormat("[AVATAR FACTORY MODULE]: SetAppearance unable to find presence for {0}",client.AgentId); | 157 | m_log.WarnFormat("[AVFACTORY]: SetAppearance unable to find presence for {0}",client.AgentId); |
155 | return; | 158 | return; |
156 | } | 159 | } |
157 | 160 | ||
161 | // m_log.WarnFormat("[AVFACTORY]: Start SetAppearance for {0}",client.AgentId); | ||
162 | |||
158 | bool changed = false; | 163 | bool changed = false; |
159 | 164 | ||
160 | // Process the texture entry | 165 | // Process the texture entry transactionally, this doesn't guarantee that Appearance is |
161 | if (textureEntry != null) | 166 | // going to be handled correctly but it does serialize the updates to the appearance |
167 | lock (m_setAppearanceLock) | ||
162 | { | 168 | { |
163 | changed = sp.Appearance.SetTextureEntries(textureEntry); | 169 | if (textureEntry != null) |
164 | |||
165 | for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++) | ||
166 | { | 170 | { |
167 | int idx = AvatarAppearance.BAKE_INDICES[i]; | 171 | changed = sp.Appearance.SetTextureEntries(textureEntry); |
168 | Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[idx]; | 172 | |
169 | if (face != null && face.TextureID != AppearanceManager.DEFAULT_AVATAR_TEXTURE) | 173 | // m_log.WarnFormat("[AVFACTORY]: Prepare to check textures for {0}",client.AgentId); |
170 | Util.FireAndForget(delegate(object o) { | 174 | |
171 | if (! CheckBakedTextureAsset(client,face.TextureID,idx)) | 175 | for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++) |
172 | client.SendRebakeAvatarTextures(face.TextureID); | 176 | { |
173 | }); | 177 | int idx = AvatarAppearance.BAKE_INDICES[i]; |
178 | Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[idx]; | ||
179 | if (face != null && face.TextureID != AppearanceManager.DEFAULT_AVATAR_TEXTURE) | ||
180 | Util.FireAndForget(delegate(object o) { | ||
181 | if (! CheckBakedTextureAsset(client,face.TextureID,idx)) | ||
182 | client.SendRebakeAvatarTextures(face.TextureID); | ||
183 | }); | ||
184 | } | ||
185 | |||
186 | // m_log.WarnFormat("[AVFACTORY]: Complete texture check for {0}",client.AgentId); | ||
174 | } | 187 | } |
175 | } | ||
176 | 188 | ||
177 | // Process the visual params, this may change height as well | 189 | // Process the visual params, this may change height as well |
178 | if (visualParams != null) | 190 | if (visualParams != null) |
179 | { | ||
180 | if (sp.Appearance.SetVisualParams(visualParams)) | ||
181 | { | 191 | { |
182 | changed = true; | 192 | if (sp.Appearance.SetVisualParams(visualParams)) |
183 | if (sp.Appearance.AvatarHeight > 0) | 193 | { |
184 | sp.SetHeight(sp.Appearance.AvatarHeight); | 194 | changed = true; |
195 | if (sp.Appearance.AvatarHeight > 0) | ||
196 | sp.SetHeight(sp.Appearance.AvatarHeight); | ||
197 | } | ||
185 | } | 198 | } |
199 | |||
200 | // Send the appearance back to the avatar, not clear that this is needed | ||
201 | sp.ControllingClient.SendAvatarDataImmediate(sp); | ||
202 | // AvatarAppearance avp = sp.Appearance; | ||
203 | // sp.ControllingClient.SendAppearance(avp.Owner,avp.VisualParams,avp.Texture.GetBytes()); | ||
204 | |||
186 | } | 205 | } |
206 | |||
187 | 207 | ||
188 | // If something changed in the appearance then queue an appearance save | 208 | // If something changed in the appearance then queue an appearance save |
189 | if (changed) | 209 | if (changed) |
@@ -192,10 +212,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
192 | // And always queue up an appearance update to send out | 212 | // And always queue up an appearance update to send out |
193 | QueueAppearanceSend(client.AgentId); | 213 | QueueAppearanceSend(client.AgentId); |
194 | 214 | ||
195 | // Send the appearance back to the avatar | 215 | // m_log.WarnFormat("[AVFACTORY]: Complete SetAppearance for {0}:\n{1}",client.AgentId,sp.Appearance.ToString()); |
196 | // AvatarAppearance avp = sp.Appearance; | ||
197 | // sp.ControllingClient.SendAvatarDataImmediate(sp); | ||
198 | // sp.ControllingClient.SendAppearance(avp.Owner,avp.VisualParams,avp.Texture.GetBytes()); | ||
199 | } | 216 | } |
200 | 217 | ||
201 | /// <summary> | 218 | /// <summary> |
@@ -209,7 +226,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
209 | { | 226 | { |
210 | if (m_scene.AssetService.Get(textureID.ToString()) == null) | 227 | if (m_scene.AssetService.Get(textureID.ToString()) == null) |
211 | { | 228 | { |
212 | m_log.WarnFormat("[AVATAR FACTORY MODULE]: Missing baked texture {0} ({1}) for avatar {2}", | 229 | m_log.WarnFormat("[AVFACTORY]: Missing baked texture {0} ({1}) for avatar {2}", |
213 | textureID, idx, client.Name); | 230 | textureID, idx, client.Name); |
214 | return false; | 231 | return false; |
215 | } | 232 | } |
@@ -220,10 +237,10 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
220 | 237 | ||
221 | public void QueueAppearanceSend(UUID agentid) | 238 | public void QueueAppearanceSend(UUID agentid) |
222 | { | 239 | { |
223 | // m_log.WarnFormat("[AVATAR FACTORY MODULE]: Queue appearance send for {0}", agentid); | 240 | // m_log.WarnFormat("[AVFACTORY]: Queue appearance send for {0}", agentid); |
224 | 241 | ||
225 | // 100 nanoseconds (ticks) we should wait | 242 | // 10000 ticks per millisecond, 1000 milliseconds per second |
226 | long timestamp = DateTime.Now.Ticks + Convert.ToInt64(m_sendtime * 10000000); | 243 | long timestamp = DateTime.Now.Ticks + Convert.ToInt64(m_sendtime * 1000 * 10000); |
227 | lock (m_sendqueue) | 244 | lock (m_sendqueue) |
228 | { | 245 | { |
229 | m_sendqueue[agentid] = timestamp; | 246 | m_sendqueue[agentid] = timestamp; |
@@ -233,10 +250,10 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
233 | 250 | ||
234 | public void QueueAppearanceSave(UUID agentid) | 251 | public void QueueAppearanceSave(UUID agentid) |
235 | { | 252 | { |
236 | // m_log.WarnFormat("[AVATAR FACTORY MODULE]: Queue appearance save for {0}", agentid); | 253 | // m_log.WarnFormat("[AVFACTORY]: Queue appearance save for {0}", agentid); |
237 | 254 | ||
238 | // 100 nanoseconds (ticks) we should wait | 255 | // 10000 ticks per millisecond, 1000 milliseconds per second |
239 | long timestamp = DateTime.Now.Ticks + Convert.ToInt64(m_savetime * 10000000); | 256 | long timestamp = DateTime.Now.Ticks + Convert.ToInt64(m_savetime * 1000 * 10000); |
240 | lock (m_savequeue) | 257 | lock (m_savequeue) |
241 | { | 258 | { |
242 | m_savequeue[agentid] = timestamp; | 259 | m_savequeue[agentid] = timestamp; |
@@ -249,15 +266,15 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
249 | ScenePresence sp = m_scene.GetScenePresence(agentid); | 266 | ScenePresence sp = m_scene.GetScenePresence(agentid); |
250 | if (sp == null) | 267 | if (sp == null) |
251 | { | 268 | { |
252 | m_log.WarnFormat("[AVATAR FACTORY MODULE]: Agent {0} no longer in the scene", agentid); | 269 | m_log.WarnFormat("[AVFACTORY]: Agent {0} no longer in the scene", agentid); |
253 | return; | 270 | return; |
254 | } | 271 | } |
255 | 272 | ||
256 | // m_log.WarnFormat("[AVATAR FACTORY MODULE]: Handle appearance send for {0}", agentid); | 273 | // m_log.WarnFormat("[AVFACTORY]: Handle appearance send for {0}", agentid); |
257 | 274 | ||
258 | // Send the appearance to everyone in the scene | 275 | // Send the appearance to everyone in the scene |
259 | sp.SendAppearanceToAllOtherAgents(); | 276 | sp.SendAppearanceToAllOtherAgents(); |
260 | sp.ControllingClient.SendAvatarDataImmediate(sp); | 277 | // sp.ControllingClient.SendAvatarDataImmediate(sp); |
261 | 278 | ||
262 | // Send the appearance back to the avatar | 279 | // Send the appearance back to the avatar |
263 | // AvatarAppearance avp = sp.Appearance; | 280 | // AvatarAppearance avp = sp.Appearance; |
@@ -279,10 +296,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
279 | ScenePresence sp = m_scene.GetScenePresence(agentid); | 296 | ScenePresence sp = m_scene.GetScenePresence(agentid); |
280 | if (sp == null) | 297 | if (sp == null) |
281 | { | 298 | { |
282 | m_log.WarnFormat("[AVATAR FACTORY MODULE]: Agent {0} no longer in the scene", agentid); | 299 | m_log.WarnFormat("[AVFACTORY]: Agent {0} no longer in the scene", agentid); |
283 | return; | 300 | return; |
284 | } | 301 | } |
285 | 302 | ||
303 | // m_log.WarnFormat("[AVFACTORY] avatar {0} save appearance",agentid); | ||
304 | |||
286 | m_scene.AvatarService.SetAppearance(agentid, sp.Appearance); | 305 | m_scene.AvatarService.SetAppearance(agentid, sp.Appearance); |
287 | } | 306 | } |
288 | 307 | ||
@@ -330,11 +349,11 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
330 | ScenePresence sp = m_scene.GetScenePresence(client.AgentId); | 349 | ScenePresence sp = m_scene.GetScenePresence(client.AgentId); |
331 | if (sp == null) | 350 | if (sp == null) |
332 | { | 351 | { |
333 | m_log.WarnFormat("[AVATAR FACTORY MODULE]: SendWearables unable to find presence for {0}", client.AgentId); | 352 | m_log.WarnFormat("[AVFACTORY]: SendWearables unable to find presence for {0}", client.AgentId); |
334 | return; | 353 | return; |
335 | } | 354 | } |
336 | 355 | ||
337 | // m_log.WarnFormat("[AVATAR FACTORY MODULE]: Received request for wearables of {0}", client.AgentId); | 356 | // m_log.WarnFormat("[AVFACTORY]: Received request for wearables of {0}", client.AgentId); |
338 | 357 | ||
339 | client.SendWearables(sp.Appearance.Wearables, sp.Appearance.Serial++); | 358 | client.SendWearables(sp.Appearance.Wearables, sp.Appearance.Serial++); |
340 | } | 359 | } |
@@ -349,11 +368,11 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
349 | ScenePresence sp = m_scene.GetScenePresence(client.AgentId); | 368 | ScenePresence sp = m_scene.GetScenePresence(client.AgentId); |
350 | if (sp == null) | 369 | if (sp == null) |
351 | { | 370 | { |
352 | m_log.WarnFormat("[AVATAR FACTORY MODULE]: AvatarIsWearing unable to find presence for {0}", client.AgentId); | 371 | m_log.WarnFormat("[AVFACTORY]: AvatarIsWearing unable to find presence for {0}", client.AgentId); |
353 | return; | 372 | return; |
354 | } | 373 | } |
355 | 374 | ||
356 | // m_log.WarnFormat("[AVATAR FACTORY MODULE]: AvatarIsWearing called for {0}", client.AgentId); | 375 | // m_log.WarnFormat("[AVFACTORY]: AvatarIsWearing called for {0}", client.AgentId); |
357 | 376 | ||
358 | AvatarAppearance avatAppearance = new AvatarAppearance(sp.Appearance, false); | 377 | AvatarAppearance avatAppearance = new AvatarAppearance(sp.Appearance, false); |
359 | 378 | ||
@@ -368,6 +387,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
368 | // This could take awhile since it needs to pull inventory | 387 | // This could take awhile since it needs to pull inventory |
369 | SetAppearanceAssets(sp.UUID, ref avatAppearance); | 388 | SetAppearanceAssets(sp.UUID, ref avatAppearance); |
370 | 389 | ||
390 | // could get fancier with the locks here, but in the spirit of "last write wins" | ||
391 | // this should work correctly | ||
371 | sp.Appearance = avatAppearance; | 392 | sp.Appearance = avatAppearance; |
372 | m_scene.AvatarService.SetAppearance(client.AgentId, sp.Appearance); | 393 | m_scene.AvatarService.SetAppearance(client.AgentId, sp.Appearance); |
373 | } | 394 | } |
@@ -398,7 +419,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
398 | else | 419 | else |
399 | { | 420 | { |
400 | m_log.ErrorFormat( | 421 | m_log.ErrorFormat( |
401 | "[AVATAR FACTORY MODULE]: Can't find inventory item {0} for {1}, setting to default", | 422 | "[AVFACTORY]: Can't find inventory item {0} for {1}, setting to default", |
402 | appearance.Wearables[i][j].ItemID, (WearableType)i); | 423 | appearance.Wearables[i][j].ItemID, (WearableType)i); |
403 | 424 | ||
404 | appearance.Wearables[i].RemoveItem(appearance.Wearables[i][j].ItemID); | 425 | appearance.Wearables[i].RemoveItem(appearance.Wearables[i][j].ItemID); |
@@ -408,7 +429,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
408 | } | 429 | } |
409 | else | 430 | else |
410 | { | 431 | { |
411 | m_log.WarnFormat("[AVATAR FACTORY MODULE]: user {0} has no inventory, appearance isn't going to work", userID); | 432 | m_log.WarnFormat("[AVFACTORY]: user {0} has no inventory, appearance isn't going to work", userID); |
412 | } | 433 | } |
413 | } | 434 | } |
414 | } | 435 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs index 25322a1..a5fcb49 100644 --- a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs | |||
@@ -115,10 +115,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule | |||
115 | // Try to find the avatar wielding the killing object | 115 | // Try to find the avatar wielding the killing object |
116 | killingAvatar = deadAvatar.Scene.GetScenePresence(part.OwnerID); | 116 | killingAvatar = deadAvatar.Scene.GetScenePresence(part.OwnerID); |
117 | if (killingAvatar == null) | 117 | if (killingAvatar == null) |
118 | deadAvatarMessage = String.Format("You impaled yourself on {0} owned by {1}!", part.Name, deadAvatar.Scene.GetUserName(part.OwnerID)); | 118 | { |
119 | IUserManagement userManager = deadAvatar.Scene.RequestModuleInterface<IUserManagement>(); | ||
120 | string userName = "Unkown User"; | ||
121 | if (userManager != null) | ||
122 | userName = userManager.GetUserName(part.OwnerID); | ||
123 | deadAvatarMessage = String.Format("You impaled yourself on {0} owned by {1}!", part.Name, userName); | ||
124 | } | ||
119 | else | 125 | else |
120 | { | 126 | { |
121 | // killingAvatarMessage = String.Format("You fragged {0}!", deadAvatar.Name); | 127 | // killingAvatarMessage = String.Format("You fragged {0}!", deadAvatar.Name); |
122 | deadAvatarMessage = String.Format("You got killed by {0}!", killingAvatar.Name); | 128 | deadAvatarMessage = String.Format("You got killed by {0}!", killingAvatar.Name); |
123 | } | 129 | } |
124 | } | 130 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 9ba144d..56aefa5 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -1200,11 +1200,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1200 | } | 1200 | } |
1201 | 1201 | ||
1202 | m_log.Debug("[ENTITY TRANSFER MODULE]: Completed inform client about neighbour " + endPoint.ToString()); | 1202 | m_log.Debug("[ENTITY TRANSFER MODULE]: Completed inform client about neighbour " + endPoint.ToString()); |
1203 | |||
1204 | } | 1203 | } |
1205 | |||
1206 | } | 1204 | } |
1207 | 1205 | ||
1206 | /// <summary> | ||
1207 | /// Return the list of regions that are considered to be neighbours to the given scene. | ||
1208 | /// </summary> | ||
1209 | /// <param name="pScene"></param> | ||
1210 | /// <param name="pRegionLocX"></param> | ||
1211 | /// <param name="pRegionLocY"></param> | ||
1212 | /// <returns></returns> | ||
1208 | protected List<GridRegion> RequestNeighbours(Scene pScene, uint pRegionLocX, uint pRegionLocY) | 1213 | protected List<GridRegion> RequestNeighbours(Scene pScene, uint pRegionLocX, uint pRegionLocY) |
1209 | { | 1214 | { |
1210 | RegionInfo m_regionInfo = pScene.RegionInfo; | 1215 | RegionInfo m_regionInfo = pScene.RegionInfo; |
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 7a175ea..67732ff 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | |||
@@ -370,6 +370,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
370 | 370 | ||
371 | item = new InventoryItemBase(); | 371 | item = new InventoryItemBase(); |
372 | item.CreatorId = objectGroup.RootPart.CreatorID.ToString(); | 372 | item.CreatorId = objectGroup.RootPart.CreatorID.ToString(); |
373 | item.CreatorData = objectGroup.RootPart.CreatorData; | ||
373 | item.ID = UUID.Random(); | 374 | item.ID = UUID.Random(); |
374 | item.InvType = (int)InventoryType.Object; | 375 | item.InvType = (int)InventoryType.Object; |
375 | item.Folder = folder.ID; | 376 | item.Folder = folder.ID; |
@@ -569,12 +570,20 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
569 | { | 570 | { |
570 | group.RootPart.Flags |= PrimFlags.Phantom; | 571 | group.RootPart.Flags |= PrimFlags.Phantom; |
571 | group.RootPart.IsAttachment = true; | 572 | group.RootPart.IsAttachment = true; |
572 | } | ||
573 | 573 | ||
574 | // If we're rezzing an attachment then don't ask AddNewSceneObject() to update the client since | 574 | // If we're rezzing an attachment then don't ask |
575 | // we'll be doing that later on. Scheduling more than one full update during the attachment | 575 | // AddNewSceneObject() to update the client since |
576 | // process causes some clients to fail to display the attachment properly. | 576 | // we'll be doing that later on. Scheduling more |
577 | m_Scene.AddNewSceneObject(group, true, false); | 577 | // than one full update during the attachment |
578 | // process causes some clients to fail to display | ||
579 | // the attachment properly. | ||
580 | // Also, don't persist attachments. | ||
581 | m_Scene.AddNewSceneObject(group, false, false); | ||
582 | } | ||
583 | else | ||
584 | { | ||
585 | m_Scene.AddNewSceneObject(group, true, false); | ||
586 | } | ||
578 | 587 | ||
579 | // m_log.InfoFormat("ray end point for inventory rezz is {0} {1} {2} ", RayEnd.X, RayEnd.Y, RayEnd.Z); | 588 | // m_log.InfoFormat("ray end point for inventory rezz is {0} {1} {2} ", RayEnd.X, RayEnd.Y, RayEnd.Z); |
580 | // if attachment we set it's asset id so object updates can reflect that | 589 | // if attachment we set it's asset id so object updates can reflect that |
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs new file mode 100644 index 0000000..0d94baa --- /dev/null +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | |||
@@ -0,0 +1,310 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | using System; | ||
28 | using System.Collections.Generic; | ||
29 | using System.IO; | ||
30 | using System.Reflection; | ||
31 | |||
32 | using OpenSim.Framework; | ||
33 | |||
34 | using OpenSim.Region.Framework; | ||
35 | using OpenSim.Region.Framework.Interfaces; | ||
36 | using OpenSim.Region.Framework.Scenes; | ||
37 | using OpenSim.Services.Interfaces; | ||
38 | |||
39 | using OpenMetaverse; | ||
40 | using log4net; | ||
41 | using Nini.Config; | ||
42 | |||
43 | namespace OpenSim.Region.CoreModules.Framework.UserManagement | ||
44 | { | ||
45 | struct UserData | ||
46 | { | ||
47 | public UUID Id; | ||
48 | public string FirstName; | ||
49 | public string LastName; | ||
50 | public string ProfileURL; | ||
51 | } | ||
52 | |||
53 | public class UserManagementModule : ISharedRegionModule, IUserManagement | ||
54 | { | ||
55 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
56 | |||
57 | private List<Scene> m_Scenes = new List<Scene>(); | ||
58 | |||
59 | // The cache | ||
60 | Dictionary<UUID, UserData> m_UserCache = new Dictionary<UUID, UserData>(); | ||
61 | |||
62 | #region ISharedRegionModule | ||
63 | |||
64 | public void Initialise(IConfigSource config) | ||
65 | { | ||
66 | //m_Enabled = config.Configs["Modules"].GetBoolean("LibraryModule", m_Enabled); | ||
67 | //if (m_Enabled) | ||
68 | //{ | ||
69 | // IConfig libConfig = config.Configs["LibraryService"]; | ||
70 | // if (libConfig != null) | ||
71 | // { | ||
72 | // string dllName = libConfig.GetString("LocalServiceModule", string.Empty); | ||
73 | // m_log.Debug("[LIBRARY MODULE]: Library service dll is " + dllName); | ||
74 | // if (dllName != string.Empty) | ||
75 | // { | ||
76 | // Object[] args = new Object[] { config }; | ||
77 | // m_Library = ServerUtils.LoadPlugin<ILibraryService>(dllName, args); | ||
78 | // } | ||
79 | // } | ||
80 | //} | ||
81 | } | ||
82 | |||
83 | public bool IsSharedModule | ||
84 | { | ||
85 | get { return true; } | ||
86 | } | ||
87 | |||
88 | public string Name | ||
89 | { | ||
90 | get { return "UserManagement Module"; } | ||
91 | } | ||
92 | |||
93 | public Type ReplaceableInterface | ||
94 | { | ||
95 | get { return null; } | ||
96 | } | ||
97 | |||
98 | public void AddRegion(Scene scene) | ||
99 | { | ||
100 | m_Scenes.Add(scene); | ||
101 | |||
102 | scene.RegisterModuleInterface<IUserManagement>(this); | ||
103 | scene.EventManager.OnNewClient += new EventManager.OnNewClientDelegate(EventManager_OnNewClient); | ||
104 | } | ||
105 | |||
106 | public void RemoveRegion(Scene scene) | ||
107 | { | ||
108 | scene.UnregisterModuleInterface<IUserManagement>(this); | ||
109 | m_Scenes.Remove(scene); | ||
110 | } | ||
111 | |||
112 | public void RegionLoaded(Scene scene) | ||
113 | { | ||
114 | } | ||
115 | |||
116 | public void PostInitialise() | ||
117 | { | ||
118 | foreach (Scene s in m_Scenes) | ||
119 | { | ||
120 | // let's sniff all the user names referenced by objects in the scene | ||
121 | m_log.DebugFormat("[USER MANAGEMENT MODULE]: Caching creators' data from {0} ({1} objects)...", s.RegionInfo.RegionName, s.GetEntities().Length); | ||
122 | s.ForEachSOG(delegate(SceneObjectGroup sog) { CacheCreators(sog); }); | ||
123 | } | ||
124 | } | ||
125 | |||
126 | public void Close() | ||
127 | { | ||
128 | m_Scenes.Clear(); | ||
129 | m_UserCache.Clear(); | ||
130 | } | ||
131 | |||
132 | #endregion ISharedRegionModule | ||
133 | |||
134 | |||
135 | #region Event Handlers | ||
136 | |||
137 | void EventManager_OnNewClient(IClientAPI client) | ||
138 | { | ||
139 | client.OnNameFromUUIDRequest += new UUIDNameRequest(HandleUUIDNameRequest); | ||
140 | } | ||
141 | |||
142 | void HandleUUIDNameRequest(UUID uuid, IClientAPI remote_client) | ||
143 | { | ||
144 | if (m_Scenes[0].LibraryService != null && (m_Scenes[0].LibraryService.LibraryRootFolder.Owner == uuid)) | ||
145 | { | ||
146 | remote_client.SendNameReply(uuid, "Mr", "OpenSim"); | ||
147 | } | ||
148 | else | ||
149 | { | ||
150 | string[] names = GetUserNames(uuid); | ||
151 | if (names.Length == 2) | ||
152 | { | ||
153 | remote_client.SendNameReply(uuid, names[0], names[1]); | ||
154 | } | ||
155 | |||
156 | } | ||
157 | } | ||
158 | |||
159 | #endregion Event Handlers | ||
160 | |||
161 | private void CacheCreators(SceneObjectGroup sog) | ||
162 | { | ||
163 | //m_log.DebugFormat("[USER MANAGEMENT MODULE]: processing {0} {1}; {2}", sog.RootPart.Name, sog.RootPart.CreatorData, sog.RootPart.CreatorIdentification); | ||
164 | AddUser(sog.RootPart.CreatorID, sog.RootPart.CreatorData); | ||
165 | |||
166 | foreach (SceneObjectPart sop in sog.Parts) | ||
167 | { | ||
168 | AddUser(sop.CreatorID, sop.CreatorData); | ||
169 | foreach (TaskInventoryItem item in sop.TaskInventory.Values) | ||
170 | AddUser(item.CreatorID, item.CreatorData); | ||
171 | } | ||
172 | } | ||
173 | |||
174 | |||
175 | private string[] GetUserNames(UUID uuid) | ||
176 | { | ||
177 | string[] returnstring = new string[2]; | ||
178 | |||
179 | if (m_UserCache.ContainsKey(uuid)) | ||
180 | { | ||
181 | returnstring[0] = m_UserCache[uuid].FirstName; | ||
182 | returnstring[1] = m_UserCache[uuid].LastName; | ||
183 | return returnstring; | ||
184 | } | ||
185 | |||
186 | UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, uuid); | ||
187 | |||
188 | if (account != null) | ||
189 | { | ||
190 | returnstring[0] = account.FirstName; | ||
191 | returnstring[1] = account.LastName; | ||
192 | |||
193 | UserData user = new UserData(); | ||
194 | user.FirstName = account.FirstName; | ||
195 | user.LastName = account.LastName; | ||
196 | |||
197 | lock (m_UserCache) | ||
198 | m_UserCache[uuid] = user; | ||
199 | } | ||
200 | else | ||
201 | { | ||
202 | returnstring[0] = "Unknown"; | ||
203 | returnstring[1] = "User"; | ||
204 | } | ||
205 | |||
206 | return returnstring; | ||
207 | } | ||
208 | |||
209 | #region IUserManagement | ||
210 | |||
211 | public string GetUserName(UUID uuid) | ||
212 | { | ||
213 | string[] names = GetUserNames(uuid); | ||
214 | if (names.Length == 2) | ||
215 | { | ||
216 | string firstname = names[0]; | ||
217 | string lastname = names[1]; | ||
218 | |||
219 | return firstname + " " + lastname; | ||
220 | |||
221 | } | ||
222 | return "(hippos)"; | ||
223 | } | ||
224 | |||
225 | public void AddUser(UUID id, string creatorData) | ||
226 | { | ||
227 | if (m_UserCache.ContainsKey(id)) | ||
228 | return; | ||
229 | |||
230 | UserData user = new UserData(); | ||
231 | user.Id = id; | ||
232 | |||
233 | UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, id); | ||
234 | |||
235 | if (account != null) | ||
236 | { | ||
237 | user.FirstName = account.FirstName; | ||
238 | user.LastName = account.LastName; | ||
239 | // user.ProfileURL = we should initialize this to the default | ||
240 | } | ||
241 | else | ||
242 | { | ||
243 | if (creatorData != null && creatorData != string.Empty) | ||
244 | { | ||
245 | //creatorData = <endpoint>;<name> | ||
246 | |||
247 | string[] parts = creatorData.Split(';'); | ||
248 | if (parts.Length >= 1) | ||
249 | { | ||
250 | user.ProfileURL = parts[0]; | ||
251 | try | ||
252 | { | ||
253 | Uri uri = new Uri(parts[0]); | ||
254 | user.LastName = "@" + uri.Authority; | ||
255 | } | ||
256 | catch | ||
257 | { | ||
258 | m_log.DebugFormat("[SCENE]: Unable to parse Uri {0}", parts[0]); | ||
259 | user.LastName = "@unknown"; | ||
260 | } | ||
261 | } | ||
262 | if (parts.Length >= 2) | ||
263 | user.FirstName = parts[1].Replace(' ', '.'); | ||
264 | } | ||
265 | else | ||
266 | { | ||
267 | user.FirstName = "Unknown"; | ||
268 | user.LastName = "User"; | ||
269 | } | ||
270 | } | ||
271 | |||
272 | lock (m_UserCache) | ||
273 | m_UserCache[id] = user; | ||
274 | |||
275 | m_log.DebugFormat("[USER MANAGEMENT MODULE]: Added user {0} {1} {2} {3}", user.Id, user.FirstName, user.LastName, user.ProfileURL); | ||
276 | } | ||
277 | |||
278 | //public void AddUser(UUID uuid, string userData) | ||
279 | //{ | ||
280 | // if (m_UserCache.ContainsKey(uuid)) | ||
281 | // return; | ||
282 | |||
283 | // UserData user = new UserData(); | ||
284 | // user.Id = uuid; | ||
285 | |||
286 | // // userData = <profile url>;<name> | ||
287 | // string[] parts = userData.Split(';'); | ||
288 | // if (parts.Length >= 1) | ||
289 | // user.ProfileURL = parts[0].Trim(); | ||
290 | // if (parts.Length >= 2) | ||
291 | // { | ||
292 | // string[] name = parts[1].Trim().Split(' '); | ||
293 | // if (name.Length >= 1) | ||
294 | // user.FirstName = name[0]; | ||
295 | // if (name.Length >= 2) | ||
296 | // user.LastName = name[1]; | ||
297 | // else | ||
298 | // user.LastName = "?"; | ||
299 | // } | ||
300 | |||
301 | // lock (m_UserCache) | ||
302 | // m_UserCache.Add(uuid, user); | ||
303 | |||
304 | // m_log.DebugFormat("[USER MANAGEMENT MODULE]: Added user {0} {1} {2} {3}", user.Id, user.FirstName, user.LastName, user.ProfileURL); | ||
305 | |||
306 | //} | ||
307 | |||
308 | #endregion IUserManagement | ||
309 | } | ||
310 | } | ||
diff --git a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml index df23eac..cfa4109 100644 --- a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml +++ b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml | |||
@@ -8,6 +8,7 @@ | |||
8 | </Dependencies> | 8 | </Dependencies> |
9 | 9 | ||
10 | <Extension path = "/OpenSim/RegionModules"> | 10 | <Extension path = "/OpenSim/RegionModules"> |
11 | <RegionModule id="UserManagementModule" type="OpenSim.Region.CoreModules.Framework.UserManagement.UserManagementModule" /> | ||
11 | <RegionModule id="EntityTransferModule" type="OpenSim.Region.CoreModules.Framework.EntityTransfer.EntityTransferModule" /> | 12 | <RegionModule id="EntityTransferModule" type="OpenSim.Region.CoreModules.Framework.EntityTransfer.EntityTransferModule" /> |
12 | <RegionModule id="HGEntityTransferModule" type="OpenSim.Region.CoreModules.Framework.EntityTransfer.HGEntityTransferModule" /> | 13 | <RegionModule id="HGEntityTransferModule" type="OpenSim.Region.CoreModules.Framework.EntityTransfer.HGEntityTransferModule" /> |
13 | <RegionModule id="InventoryAccessModule" type="OpenSim.Region.CoreModules.Framework.InventoryAccess.BasicInventoryAccessModule" /> | 14 | <RegionModule id="InventoryAccessModule" type="OpenSim.Region.CoreModules.Framework.InventoryAccess.BasicInventoryAccessModule" /> |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index ab6be50..c7244c8 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | |||
@@ -49,6 +49,21 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
49 | 49 | ||
50 | private IInventoryService m_InventoryService; | 50 | private IInventoryService m_InventoryService; |
51 | 51 | ||
52 | private Scene m_Scene; | ||
53 | |||
54 | private IUserManagement m_UserManager; | ||
55 | private IUserManagement UserManager | ||
56 | { | ||
57 | get | ||
58 | { | ||
59 | if (m_UserManager == null) | ||
60 | { | ||
61 | m_UserManager = m_Scene.RequestModuleInterface<IUserManagement>(); | ||
62 | } | ||
63 | return m_UserManager; | ||
64 | } | ||
65 | } | ||
66 | |||
52 | private bool m_Enabled = false; | 67 | private bool m_Enabled = false; |
53 | 68 | ||
54 | public Type ReplaceableInterface | 69 | public Type ReplaceableInterface |
@@ -115,6 +130,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
115 | return; | 130 | return; |
116 | 131 | ||
117 | scene.RegisterModuleInterface<IInventoryService>(this); | 132 | scene.RegisterModuleInterface<IInventoryService>(this); |
133 | |||
134 | if (m_Scene == null) | ||
135 | m_Scene = scene; | ||
118 | } | 136 | } |
119 | 137 | ||
120 | public void RemoveRegion(Scene scene) | 138 | public void RemoveRegion(Scene scene) |
@@ -163,7 +181,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
163 | 181 | ||
164 | public InventoryCollection GetFolderContent(UUID userID, UUID folderID) | 182 | public InventoryCollection GetFolderContent(UUID userID, UUID folderID) |
165 | { | 183 | { |
166 | return m_InventoryService.GetFolderContent(userID, folderID); | 184 | InventoryCollection invCol = m_InventoryService.GetFolderContent(userID, folderID); |
185 | if (UserManager != null) | ||
186 | foreach (InventoryItemBase item in invCol.Items) | ||
187 | UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); | ||
188 | |||
189 | return invCol; | ||
167 | } | 190 | } |
168 | 191 | ||
169 | public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) | 192 | public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs index 17d80c7..9213132 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs | |||
@@ -47,9 +47,23 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
47 | 47 | ||
48 | private bool m_Enabled = false; | 48 | private bool m_Enabled = false; |
49 | private bool m_Initialized = false; | 49 | private bool m_Initialized = false; |
50 | // private Scene m_Scene; | 50 | private Scene m_Scene; |
51 | private InventoryServicesConnector m_RemoteConnector; | 51 | private InventoryServicesConnector m_RemoteConnector; |
52 | 52 | ||
53 | private IUserManagement m_UserManager; | ||
54 | private IUserManagement UserManager | ||
55 | { | ||
56 | get | ||
57 | { | ||
58 | if (m_UserManager == null) | ||
59 | { | ||
60 | m_UserManager = m_Scene.RequestModuleInterface<IUserManagement>(); | ||
61 | } | ||
62 | return m_UserManager; | ||
63 | } | ||
64 | } | ||
65 | |||
66 | |||
53 | public Type ReplaceableInterface | 67 | public Type ReplaceableInterface |
54 | { | 68 | { |
55 | get { return null; } | 69 | get { return null; } |
@@ -116,6 +130,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
116 | 130 | ||
117 | scene.RegisterModuleInterface<IInventoryService>(this); | 131 | scene.RegisterModuleInterface<IInventoryService>(this); |
118 | m_cache.AddRegion(scene); | 132 | m_cache.AddRegion(scene); |
133 | |||
134 | if (m_Scene == null) | ||
135 | m_Scene = scene; | ||
119 | } | 136 | } |
120 | 137 | ||
121 | public void RemoveRegion(Scene scene) | 138 | public void RemoveRegion(Scene scene) |
@@ -186,7 +203,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
186 | UUID sessionID = GetSessionID(userID); | 203 | UUID sessionID = GetSessionID(userID); |
187 | try | 204 | try |
188 | { | 205 | { |
189 | return m_RemoteConnector.GetFolderContent(userID.ToString(), folderID, sessionID); | 206 | InventoryCollection invCol = m_RemoteConnector.GetFolderContent(userID.ToString(), folderID, sessionID); |
207 | foreach (InventoryItemBase item in invCol.Items) | ||
208 | UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); | ||
209 | return invCol; | ||
190 | } | 210 | } |
191 | catch (Exception e) | 211 | catch (Exception e) |
192 | { | 212 | { |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 117b2fd..3238a81 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -56,7 +56,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
56 | /// The maximum major version of OAR that we can read. Minor versions shouldn't need a max number since version | 56 | /// The maximum major version of OAR that we can read. Minor versions shouldn't need a max number since version |
57 | /// bumps here should be compatible. | 57 | /// bumps here should be compatible. |
58 | /// </summary> | 58 | /// </summary> |
59 | public static int MAX_MAJOR_VERSION = 0; | 59 | public static int MAX_MAJOR_VERSION = 1; |
60 | 60 | ||
61 | protected Scene m_scene; | 61 | protected Scene m_scene; |
62 | protected Stream m_loadStream; | 62 | protected Stream m_loadStream; |
@@ -78,6 +78,19 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
78 | /// </summary> | 78 | /// </summary> |
79 | private IDictionary<UUID, bool> m_validUserUuids = new Dictionary<UUID, bool>(); | 79 | private IDictionary<UUID, bool> m_validUserUuids = new Dictionary<UUID, bool>(); |
80 | 80 | ||
81 | private IUserManagement m_UserMan; | ||
82 | private IUserManagement UserManager | ||
83 | { | ||
84 | get | ||
85 | { | ||
86 | if (m_UserMan == null) | ||
87 | { | ||
88 | m_UserMan = m_scene.RequestModuleInterface<IUserManagement>(); | ||
89 | } | ||
90 | return m_UserMan; | ||
91 | } | ||
92 | } | ||
93 | |||
81 | public ArchiveReadRequest(Scene scene, string loadPath, bool merge, bool skipAssets, Guid requestId) | 94 | public ArchiveReadRequest(Scene scene, string loadPath, bool merge, bool skipAssets, Guid requestId) |
82 | { | 95 | { |
83 | m_scene = scene; | 96 | m_scene = scene; |
@@ -251,8 +264,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
251 | 264 | ||
252 | foreach (SceneObjectPart part in sceneObject.Parts) | 265 | foreach (SceneObjectPart part in sceneObject.Parts) |
253 | { | 266 | { |
254 | if (!ResolveUserUuid(part.CreatorID)) | 267 | if (part.CreatorData == null || part.CreatorData == string.Empty) |
255 | part.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner; | 268 | { |
269 | if (!ResolveUserUuid(part.CreatorID)) | ||
270 | part.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner; | ||
271 | } | ||
272 | if (UserManager != null) | ||
273 | UserManager.AddUser(part.CreatorID, part.CreatorData); | ||
256 | 274 | ||
257 | if (!ResolveUserUuid(part.OwnerID)) | 275 | if (!ResolveUserUuid(part.OwnerID)) |
258 | part.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | 276 | part.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
@@ -276,10 +294,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
276 | { | 294 | { |
277 | kvp.Value.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | 295 | kvp.Value.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
278 | } | 296 | } |
279 | if (!ResolveUserUuid(kvp.Value.CreatorID)) | 297 | if (kvp.Value.CreatorData == null || kvp.Value.CreatorData == string.Empty) |
280 | { | 298 | { |
281 | kvp.Value.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner; | 299 | if (!ResolveUserUuid(kvp.Value.CreatorID)) |
300 | kvp.Value.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner; | ||
282 | } | 301 | } |
302 | if (UserManager != null) | ||
303 | UserManager.AddUser(kvp.Value.CreatorID, kvp.Value.CreatorData); | ||
283 | } | 304 | } |
284 | } | 305 | } |
285 | } | 306 | } |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs index 0567a82..b987b5a 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs | |||
@@ -49,7 +49,17 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
49 | public class ArchiveWriteRequestPreparation | 49 | public class ArchiveWriteRequestPreparation |
50 | { | 50 | { |
51 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 51 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
52 | 52 | ||
53 | /// <summary> | ||
54 | /// The minimum major version of OAR that we can write. | ||
55 | /// </summary> | ||
56 | public static int MIN_MAJOR_VERSION = 0; | ||
57 | |||
58 | /// <summary> | ||
59 | /// The maximum major version of OAR that we can write. | ||
60 | /// </summary> | ||
61 | public static int MAX_MAJOR_VERSION = 1; | ||
62 | |||
53 | protected Scene m_scene; | 63 | protected Scene m_scene; |
54 | protected Stream m_saveStream; | 64 | protected Stream m_saveStream; |
55 | protected Guid m_requestId; | 65 | protected Guid m_requestId; |
@@ -101,110 +111,137 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
101 | /// <exception cref="System.IO.IOException">if there was an io problem with creating the file</exception> | 111 | /// <exception cref="System.IO.IOException">if there was an io problem with creating the file</exception> |
102 | public void ArchiveRegion(Dictionary<string, object> options) | 112 | public void ArchiveRegion(Dictionary<string, object> options) |
103 | { | 113 | { |
104 | Dictionary<UUID, AssetType> assetUuids = new Dictionary<UUID, AssetType>(); | 114 | try |
105 | 115 | { | |
106 | EntityBase[] entities = m_scene.GetEntities(); | 116 | Dictionary<UUID, AssetType> assetUuids = new Dictionary<UUID, AssetType>(); |
107 | List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); | 117 | |
108 | 118 | EntityBase[] entities = m_scene.GetEntities(); | |
109 | /* | 119 | List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); |
110 | foreach (ILandObject lo in m_scene.LandChannel.AllParcels()) | 120 | |
121 | /* | ||
122 | foreach (ILandObject lo in m_scene.LandChannel.AllParcels()) | ||
123 | { | ||
124 | if (name == lo.LandData.Name) | ||
125 | { | ||
126 | // This is the parcel we want | ||
127 | } | ||
128 | } | ||
129 | */ | ||
130 | |||
131 | // Filter entities so that we only have scene objects. | ||
132 | // FIXME: Would be nicer to have this as a proper list in SceneGraph, since lots of methods | ||
133 | // end up having to do this | ||
134 | foreach (EntityBase entity in entities) | ||
111 | { | 135 | { |
112 | if (name == lo.LandData.Name) | 136 | if (entity is SceneObjectGroup) |
113 | { | 137 | { |
114 | // This is the parcel we want | 138 | SceneObjectGroup sceneObject = (SceneObjectGroup)entity; |
139 | |||
140 | if (!sceneObject.IsDeleted && !sceneObject.IsAttachment) | ||
141 | sceneObjects.Add((SceneObjectGroup)entity); | ||
115 | } | 142 | } |
116 | } | 143 | } |
117 | */ | 144 | |
118 | 145 | UuidGatherer assetGatherer = new UuidGatherer(m_scene.AssetService); | |
119 | // Filter entities so that we only have scene objects. | 146 | |
120 | // FIXME: Would be nicer to have this as a proper list in SceneGraph, since lots of methods | 147 | foreach (SceneObjectGroup sceneObject in sceneObjects) |
121 | // end up having to do this | ||
122 | foreach (EntityBase entity in entities) | ||
123 | { | ||
124 | if (entity is SceneObjectGroup) | ||
125 | { | 148 | { |
126 | SceneObjectGroup sceneObject = (SceneObjectGroup)entity; | 149 | assetGatherer.GatherAssetUuids(sceneObject, assetUuids); |
127 | |||
128 | if (!sceneObject.IsDeleted && !sceneObject.IsAttachment) | ||
129 | sceneObjects.Add((SceneObjectGroup)entity); | ||
130 | } | 150 | } |
151 | |||
152 | m_log.DebugFormat( | ||
153 | "[ARCHIVER]: {0} scene objects to serialize requiring save of {1} assets", | ||
154 | sceneObjects.Count, assetUuids.Count); | ||
155 | |||
156 | // Make sure that we also request terrain texture assets | ||
157 | RegionSettings regionSettings = m_scene.RegionInfo.RegionSettings; | ||
158 | |||
159 | if (regionSettings.TerrainTexture1 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_1) | ||
160 | assetUuids[regionSettings.TerrainTexture1] = AssetType.Texture; | ||
161 | |||
162 | if (regionSettings.TerrainTexture2 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_2) | ||
163 | assetUuids[regionSettings.TerrainTexture2] = AssetType.Texture; | ||
164 | |||
165 | if (regionSettings.TerrainTexture3 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_3) | ||
166 | assetUuids[regionSettings.TerrainTexture3] = AssetType.Texture; | ||
167 | |||
168 | if (regionSettings.TerrainTexture4 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_4) | ||
169 | assetUuids[regionSettings.TerrainTexture4] = AssetType.Texture; | ||
170 | |||
171 | TarArchiveWriter archiveWriter = new TarArchiveWriter(m_saveStream); | ||
172 | |||
173 | // Asynchronously request all the assets required to perform this archive operation | ||
174 | ArchiveWriteRequestExecution awre | ||
175 | = new ArchiveWriteRequestExecution( | ||
176 | sceneObjects, | ||
177 | m_scene.RequestModuleInterface<ITerrainModule>(), | ||
178 | m_scene.RequestModuleInterface<IRegionSerialiserModule>(), | ||
179 | m_scene, | ||
180 | archiveWriter, | ||
181 | m_requestId, | ||
182 | options); | ||
183 | |||
184 | m_log.InfoFormat("[ARCHIVER]: Creating archive file. This may take some time."); | ||
185 | |||
186 | // Write out control file. This has to be done first so that subsequent loaders will see this file first | ||
187 | // XXX: I know this is a weak way of doing it since external non-OAR aware tar executables will not do this | ||
188 | archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, CreateControlFile(options)); | ||
189 | m_log.InfoFormat("[ARCHIVER]: Added control file to archive."); | ||
190 | |||
191 | new AssetsRequest( | ||
192 | new AssetsArchiver(archiveWriter), assetUuids, | ||
193 | m_scene.AssetService, awre.ReceivedAllAssets).Execute(); | ||
131 | } | 194 | } |
132 | 195 | catch (Exception) | |
133 | UuidGatherer assetGatherer = new UuidGatherer(m_scene.AssetService); | ||
134 | |||
135 | foreach (SceneObjectGroup sceneObject in sceneObjects) | ||
136 | { | 196 | { |
137 | assetGatherer.GatherAssetUuids(sceneObject, assetUuids); | 197 | m_saveStream.Close(); |
138 | } | 198 | throw; |
139 | 199 | } | |
140 | m_log.DebugFormat( | ||
141 | "[ARCHIVER]: {0} scene objects to serialize requiring save of {1} assets", | ||
142 | sceneObjects.Count, assetUuids.Count); | ||
143 | |||
144 | // Make sure that we also request terrain texture assets | ||
145 | RegionSettings regionSettings = m_scene.RegionInfo.RegionSettings; | ||
146 | |||
147 | if (regionSettings.TerrainTexture1 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_1) | ||
148 | assetUuids[regionSettings.TerrainTexture1] = AssetType.Texture; | ||
149 | |||
150 | if (regionSettings.TerrainTexture2 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_2) | ||
151 | assetUuids[regionSettings.TerrainTexture2] = AssetType.Texture; | ||
152 | |||
153 | if (regionSettings.TerrainTexture3 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_3) | ||
154 | assetUuids[regionSettings.TerrainTexture3] = AssetType.Texture; | ||
155 | |||
156 | if (regionSettings.TerrainTexture4 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_4) | ||
157 | assetUuids[regionSettings.TerrainTexture4] = AssetType.Texture; | ||
158 | |||
159 | TarArchiveWriter archiveWriter = new TarArchiveWriter(m_saveStream); | ||
160 | |||
161 | // Asynchronously request all the assets required to perform this archive operation | ||
162 | ArchiveWriteRequestExecution awre | ||
163 | = new ArchiveWriteRequestExecution( | ||
164 | sceneObjects, | ||
165 | m_scene.RequestModuleInterface<ITerrainModule>(), | ||
166 | m_scene.RequestModuleInterface<IRegionSerialiserModule>(), | ||
167 | m_scene, | ||
168 | archiveWriter, | ||
169 | m_requestId, | ||
170 | options); | ||
171 | |||
172 | m_log.InfoFormat("[ARCHIVER]: Creating archive file. This may take some time."); | ||
173 | |||
174 | // Write out control file. This has to be done first so that subsequent loaders will see this file first | ||
175 | // XXX: I know this is a weak way of doing it since external non-OAR aware tar executables will not do this | ||
176 | archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p2ControlFile(options)); | ||
177 | m_log.InfoFormat("[ARCHIVER]: Added control file to archive."); | ||
178 | |||
179 | new AssetsRequest( | ||
180 | new AssetsArchiver(archiveWriter), assetUuids, | ||
181 | m_scene.AssetService, awre.ReceivedAllAssets).Execute(); | ||
182 | } | 200 | } |
183 | 201 | ||
184 | /// <summary> | 202 | /// <summary> |
185 | /// Create the control file for the most up to date archive | 203 | /// Create the control file for the most up to date archive |
186 | /// </summary> | 204 | /// </summary> |
187 | /// <returns></returns> | 205 | /// <returns></returns> |
188 | public static string Create0p2ControlFile(Dictionary<string, object> options) | 206 | public static string CreateControlFile(Dictionary<string, object> options) |
189 | { | 207 | { |
190 | int majorVersion = 0, minorVersion = 5; | 208 | int majorVersion = MAX_MAJOR_VERSION, minorVersion = 0; |
191 | 209 | ||
192 | if (options.ContainsKey("version")) | 210 | if (options.ContainsKey("version")) |
193 | { | 211 | { |
194 | minorVersion = 0; | ||
195 | string[] parts = options["version"].ToString().Split('.'); | 212 | string[] parts = options["version"].ToString().Split('.'); |
196 | if (parts.Length >= 1) | 213 | if (parts.Length >= 1) |
197 | majorVersion = Int32.Parse(parts[0]); | 214 | { |
198 | if (parts.Length >= 2) | 215 | majorVersion = Int32.Parse(parts[0]); |
199 | minorVersion = Int32.Parse(parts[1]); | 216 | |
217 | if (parts.Length >= 2) | ||
218 | minorVersion = Int32.Parse(parts[1]); | ||
219 | } | ||
200 | } | 220 | } |
201 | 221 | ||
202 | m_log.InfoFormat("[ARCHIVER]: Creating version {0}.{1} OAR", majorVersion, minorVersion); | 222 | if (majorVersion < MIN_MAJOR_VERSION || majorVersion > MAX_MAJOR_VERSION) |
203 | // if (majorVersion == 1) | 223 | { |
204 | // { | 224 | throw new Exception( |
205 | // m_log.WarnFormat("[ARCHIVER]: Please be aware that version 1.0 OARs are not compatible with OpenSim 0.7.0.2 and earlier. Please use the --version=0 option if you want to produce a compatible OAR"); | 225 | string.Format( |
206 | // } | 226 | "OAR version number for save must be between {0} and {1}", |
227 | MIN_MAJOR_VERSION, MAX_MAJOR_VERSION)); | ||
228 | } | ||
229 | else if (majorVersion == MAX_MAJOR_VERSION) | ||
230 | { | ||
231 | // Force 1.0 | ||
232 | minorVersion = 0; | ||
233 | } | ||
234 | else if (majorVersion == MIN_MAJOR_VERSION) | ||
235 | { | ||
236 | // Force 0.4 | ||
237 | minorVersion = 4; | ||
238 | } | ||
207 | 239 | ||
240 | m_log.InfoFormat("[ARCHIVER]: Creating version {0}.{1} OAR", majorVersion, minorVersion); | ||
241 | if (majorVersion == 1) | ||
242 | { | ||
243 | m_log.WarnFormat("[ARCHIVER]: Please be aware that version 1.0 OARs are not compatible with OpenSim 0.7.0.2 and earlier. Please use the --version=0 option if you want to produce a compatible OAR"); | ||
244 | } | ||
208 | 245 | ||
209 | StringWriter sw = new StringWriter(); | 246 | StringWriter sw = new StringWriter(); |
210 | XmlTextWriter xtw = new XmlTextWriter(sw); | 247 | XmlTextWriter xtw = new XmlTextWriter(sw); |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs index e0ad71e..358d0a7 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs | |||
@@ -126,6 +126,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
126 | 126 | ||
127 | OptionSet ops = new OptionSet(); | 127 | OptionSet ops = new OptionSet(); |
128 | ops.Add("v|version=", delegate(string v) { options["version"] = v; }); | 128 | ops.Add("v|version=", delegate(string v) { options["version"] = v; }); |
129 | ops.Add("p|profile=", delegate(string v) { options["profile"] = v; }); | ||
129 | 130 | ||
130 | List<string> mainParams = ops.Parse(cmdparams); | 131 | List<string> mainParams = ops.Parse(cmdparams); |
131 | 132 | ||
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index 04bdc4f..04b6e3d 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs | |||
@@ -122,13 +122,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
122 | } | 122 | } |
123 | 123 | ||
124 | /// <summary> | 124 | /// <summary> |
125 | /// Test saving a V0.2 OpenSim Region Archive. | 125 | /// Test saving an OpenSim Region Archive. |
126 | /// </summary> | 126 | /// </summary> |
127 | [Test] | 127 | [Test] |
128 | public void TestSaveOarV0_2() | 128 | public void TestSaveOar() |
129 | { | 129 | { |
130 | TestHelper.InMethod(); | 130 | TestHelper.InMethod(); |
131 | //log4net.Config.XmlConfigurator.Configure(); | 131 | // log4net.Config.XmlConfigurator.Configure(); |
132 | 132 | ||
133 | SceneObjectPart part1 = CreateSceneObjectPart1(); | 133 | SceneObjectPart part1 = CreateSceneObjectPart1(); |
134 | SceneObjectGroup sog1 = new SceneObjectGroup(part1); | 134 | SceneObjectGroup sog1 = new SceneObjectGroup(part1); |
@@ -212,10 +212,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
212 | } | 212 | } |
213 | 213 | ||
214 | /// <summary> | 214 | /// <summary> |
215 | /// Test loading a V0.2 OpenSim Region Archive. | 215 | /// Test loading an OpenSim Region Archive. |
216 | /// </summary> | 216 | /// </summary> |
217 | [Test] | 217 | [Test] |
218 | public void TestLoadOarV0_2() | 218 | public void TestLoadOar() |
219 | { | 219 | { |
220 | TestHelper.InMethod(); | 220 | TestHelper.InMethod(); |
221 | // log4net.Config.XmlConfigurator.Configure(); | 221 | // log4net.Config.XmlConfigurator.Configure(); |
@@ -230,7 +230,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
230 | // upset load | 230 | // upset load |
231 | tar.WriteDir(ArchiveConstants.TERRAINS_PATH); | 231 | tar.WriteDir(ArchiveConstants.TERRAINS_PATH); |
232 | 232 | ||
233 | tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestPreparation.Create0p2ControlFile(new Dictionary<string, Object>())); | 233 | tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestPreparation.CreateControlFile(new Dictionary<string, Object>())); |
234 | 234 | ||
235 | SceneObjectPart part1 = CreateSceneObjectPart1(); | 235 | SceneObjectPart part1 = CreateSceneObjectPart1(); |
236 | SceneObjectGroup object1 = new SceneObjectGroup(part1); | 236 | SceneObjectGroup object1 = new SceneObjectGroup(part1); |
@@ -317,10 +317,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
317 | } | 317 | } |
318 | 318 | ||
319 | /// <summary> | 319 | /// <summary> |
320 | /// Test loading the region settings of a V0.2 OpenSim Region Archive. | 320 | /// Test loading the region settings of an OpenSim Region Archive. |
321 | /// </summary> | 321 | /// </summary> |
322 | [Test] | 322 | [Test] |
323 | public void TestLoadOarV0_2RegionSettings() | 323 | public void TestLoadOarRegionSettings() |
324 | { | 324 | { |
325 | TestHelper.InMethod(); | 325 | TestHelper.InMethod(); |
326 | //log4net.Config.XmlConfigurator.Configure(); | 326 | //log4net.Config.XmlConfigurator.Configure(); |
@@ -329,7 +329,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
329 | TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); | 329 | TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); |
330 | 330 | ||
331 | tar.WriteDir(ArchiveConstants.TERRAINS_PATH); | 331 | tar.WriteDir(ArchiveConstants.TERRAINS_PATH); |
332 | tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestPreparation.Create0p2ControlFile(new Dictionary<string, Object>())); | 332 | tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestPreparation.CreateControlFile(new Dictionary<string, Object>())); |
333 | 333 | ||
334 | RegionSettings rs = new RegionSettings(); | 334 | RegionSettings rs = new RegionSettings(); |
335 | rs.AgentLimit = 17; | 335 | rs.AgentLimit = 17; |
@@ -409,10 +409,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
409 | } | 409 | } |
410 | 410 | ||
411 | /// <summary> | 411 | /// <summary> |
412 | /// Test merging a V0.2 OpenSim Region Archive into an existing scene | 412 | /// Test merging an OpenSim Region Archive into an existing scene |
413 | /// </summary> | 413 | /// </summary> |
414 | //[Test] | 414 | //[Test] |
415 | public void TestMergeOarV0_2() | 415 | public void TestMergeOar() |
416 | { | 416 | { |
417 | TestHelper.InMethod(); | 417 | TestHelper.InMethod(); |
418 | //XmlConfigurator.Configure(); | 418 | //XmlConfigurator.Configure(); |
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 6844c60..622fc08 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -771,8 +771,14 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
771 | for (int i = 0; i < uuidarr.Length; i++) | 771 | for (int i = 0; i < uuidarr.Length; i++) |
772 | { | 772 | { |
773 | // string lookupname = m_scene.CommsManager.UUIDNameRequestString(uuidarr[i]); | 773 | // string lookupname = m_scene.CommsManager.UUIDNameRequestString(uuidarr[i]); |
774 | m_scene.GetUserName(uuidarr[i]); | 774 | |
775 | IUserManagement userManager = m_scene.RequestModuleInterface<IUserManagement>(); | ||
776 | string userName = "Unkown User"; | ||
777 | if (userManager != null) | ||
778 | userName = userManager.GetUserName(uuidarr[i]); | ||
779 | |||
775 | // we drop it. It gets cached though... so we're ready for the next request. | 780 | // we drop it. It gets cached though... so we're ready for the next request. |
781 | // diva commnent 11/21/2010: uh?!? wft? | ||
776 | } | 782 | } |
777 | } | 783 | } |
778 | #endregion | 784 | #endregion |
diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs index c06ccb2..568ba19 100644 --- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs | |||
@@ -189,6 +189,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell | |||
189 | 189 | ||
190 | InventoryItemBase item = new InventoryItemBase(); | 190 | InventoryItemBase item = new InventoryItemBase(); |
191 | item.CreatorId = part.CreatorID.ToString(); | 191 | item.CreatorId = part.CreatorID.ToString(); |
192 | item.CreatorData = part.CreatorData; | ||
192 | 193 | ||
193 | item.ID = UUID.Random(); | 194 | item.ID = UUID.Random(); |
194 | item.Owner = remoteClient.AgentId; | 195 | item.Owner = remoteClient.AgentId; |
diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs index abd28c8..8df44fe 100644 --- a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs +++ b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs | |||
@@ -106,14 +106,20 @@ namespace OpenSim.Region.CoreModules.World.Sound | |||
106 | { | 106 | { |
107 | SceneObjectPart part = m_scene.GetSceneObjectPart(objectID); | 107 | SceneObjectPart part = m_scene.GetSceneObjectPart(objectID); |
108 | if (part == null) | 108 | if (part == null) |
109 | return; | ||
110 | |||
111 | SceneObjectGroup grp = part.ParentGroup; | ||
112 | |||
113 | if (grp.IsAttachment && grp.GetAttachmentPoint() > 30) | ||
114 | { | 109 | { |
115 | objectID = ownerID; | 110 | ScenePresence sp; |
116 | parentID = ownerID; | 111 | if (!m_scene.TryGetScenePresence(objectID, out sp)) |
112 | return; | ||
113 | } | ||
114 | else | ||
115 | { | ||
116 | SceneObjectGroup grp = part.ParentGroup; | ||
117 | |||
118 | if (grp.IsAttachment && grp.GetAttachmentPoint() > 30) | ||
119 | { | ||
120 | objectID = ownerID; | ||
121 | parentID = ownerID; | ||
122 | } | ||
117 | } | 123 | } |
118 | 124 | ||
119 | m_scene.ForEachScenePresence(delegate(ScenePresence sp) | 125 | m_scene.ForEachScenePresence(delegate(ScenePresence sp) |