diff options
author | Mic Bowman | 2011-07-22 09:02:32 -0700 |
---|---|---|
committer | Mic Bowman | 2011-07-22 09:02:32 -0700 |
commit | 4cbc912375ad0d2891231bc3a3ad26112ff6ed05 (patch) | |
tree | abb8b31c71a83d5934eabde7ceac7f67abf2904e /OpenSim/Region | |
parent | Merge branch 'bulletsim' of ssh://opensimulator.org/var/git/opensim into bull... (diff) | |
parent | Thank you, Michelle Argus, for a patch that adds reading the agent limit (diff) | |
download | opensim-SC_OLD-4cbc912375ad0d2891231bc3a3ad26112ff6ed05.zip opensim-SC_OLD-4cbc912375ad0d2891231bc3a3ad26112ff6ed05.tar.gz opensim-SC_OLD-4cbc912375ad0d2891231bc3a3ad26112ff6ed05.tar.bz2 opensim-SC_OLD-4cbc912375ad0d2891231bc3a3ad26112ff6ed05.tar.xz |
Merge branch 'master' into bulletsim
Diffstat (limited to 'OpenSim/Region')
3 files changed, 39 insertions, 30 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 75dbeb8..995a552 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -210,7 +210,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
210 | changed = sp.Appearance.SetVisualParams(visualParams); | 210 | changed = sp.Appearance.SetVisualParams(visualParams); |
211 | if (sp.Appearance.AvatarHeight > 0) | 211 | if (sp.Appearance.AvatarHeight > 0) |
212 | sp.SetHeight(sp.Appearance.AvatarHeight); | 212 | sp.SetHeight(sp.Appearance.AvatarHeight); |
213 | } | 213 | } |
214 | 214 | ||
215 | // Process the baked texture array | 215 | // Process the baked texture array |
216 | if (textureEntry != null) | 216 | if (textureEntry != null) |
@@ -224,12 +224,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
224 | // update transaction. In theory, we should be able to do an immediate | 224 | // update transaction. In theory, we should be able to do an immediate |
225 | // appearance send and save here. | 225 | // appearance send and save here. |
226 | 226 | ||
227 | // save only if there were changes, send no matter what (doesn't hurt to send twice) | ||
228 | if (changed) | ||
229 | QueueAppearanceSave(client.AgentId); | ||
230 | |||
231 | QueueAppearanceSend(client.AgentId); | ||
232 | } | 227 | } |
228 | // save only if there were changes, send no matter what (doesn't hurt to send twice) | ||
229 | if (changed) | ||
230 | QueueAppearanceSave(client.AgentId); | ||
231 | |||
232 | QueueAppearanceSend(client.AgentId); | ||
233 | } | 233 | } |
234 | 234 | ||
235 | // m_log.WarnFormat("[AVFACTORY]: complete SetAppearance for {0}:\n{1}",client.AgentId,sp.Appearance.ToString()); | 235 | // m_log.WarnFormat("[AVFACTORY]: complete SetAppearance for {0}:\n{1}",client.AgentId,sp.Appearance.ToString()); |
@@ -387,11 +387,11 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
387 | // m_log.WarnFormat("[AVFACTORY]: AvatarIsWearing called for {0}", client.AgentId); | 387 | // m_log.WarnFormat("[AVFACTORY]: AvatarIsWearing called for {0}", client.AgentId); |
388 | 388 | ||
389 | // we need to clean out the existing textures | 389 | // we need to clean out the existing textures |
390 | sp.Appearance.ResetAppearance(); | 390 | sp.Appearance.ResetAppearance(); |
391 | 391 | ||
392 | // operate on a copy of the appearance so we don't have to lock anything | 392 | // operate on a copy of the appearance so we don't have to lock anything yet |
393 | AvatarAppearance avatAppearance = new AvatarAppearance(sp.Appearance, false); | 393 | AvatarAppearance avatAppearance = new AvatarAppearance(sp.Appearance, false); |
394 | 394 | ||
395 | foreach (AvatarWearingArgs.Wearable wear in e.NowWearing) | 395 | foreach (AvatarWearingArgs.Wearable wear in e.NowWearing) |
396 | { | 396 | { |
397 | if (wear.Type < AvatarWearable.MAX_WEARABLES) | 397 | if (wear.Type < AvatarWearable.MAX_WEARABLES) |
@@ -403,12 +403,19 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
403 | // This could take awhile since it needs to pull inventory | 403 | // This could take awhile since it needs to pull inventory |
404 | SetAppearanceAssets(sp.UUID, ref avatAppearance); | 404 | SetAppearanceAssets(sp.UUID, ref avatAppearance); |
405 | 405 | ||
406 | // could get fancier with the locks here, but in the spirit of "last write wins" | 406 | lock (m_setAppearanceLock) |
407 | // this should work correctly, also, we don't need to send the appearance here | 407 | { |
408 | // since the "iswearing" will trigger a new set of visual param and baked texture changes | 408 | // Update only those fields that we have changed. This is important because the viewer |
409 | // when those complete, the new appearance will be sent | 409 | // often sends AvatarIsWearing and SetAppearance packets at once, and AvatarIsWearing |
410 | sp.Appearance = avatAppearance; | 410 | // shouldn't overwrite the changes made in SetAppearance. |
411 | QueueAppearanceSave(client.AgentId); | 411 | sp.Appearance.Wearables = avatAppearance.Wearables; |
412 | sp.Appearance.Texture = avatAppearance.Texture; | ||
413 | |||
414 | // We don't need to send the appearance here since the "iswearing" will trigger a new set | ||
415 | // of visual param and baked texture changes. When those complete, the new appearance will be sent | ||
416 | |||
417 | QueueAppearanceSave(client.AgentId); | ||
418 | } | ||
412 | } | 419 | } |
413 | 420 | ||
414 | private void SetAppearanceAssets(UUID userID, ref AvatarAppearance appearance) | 421 | private void SetAppearanceAssets(UUID userID, ref AvatarAppearance appearance) |
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index 6e142bb..fac2dab 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | |||
@@ -1110,14 +1110,12 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1110 | if (data == null) | 1110 | if (data == null) |
1111 | return; | 1111 | return; |
1112 | 1112 | ||
1113 | UUID lastMapRegionUUID = m_scene.RegionInfo.RegionSettings.TerrainImageID; | ||
1114 | |||
1115 | m_log.Debug("[WORLDMAP]: STORING MAPTILE IMAGE"); | 1113 | m_log.Debug("[WORLDMAP]: STORING MAPTILE IMAGE"); |
1116 | 1114 | ||
1117 | m_scene.RegionInfo.RegionSettings.TerrainImageID = UUID.Random(); | 1115 | UUID terrainImageID = UUID.Random(); |
1118 | 1116 | ||
1119 | AssetBase asset = new AssetBase( | 1117 | AssetBase asset = new AssetBase( |
1120 | m_scene.RegionInfo.RegionSettings.TerrainImageID, | 1118 | terrainImageID, |
1121 | "terrainImage_" + m_scene.RegionInfo.RegionID.ToString(), | 1119 | "terrainImage_" + m_scene.RegionInfo.RegionID.ToString(), |
1122 | (sbyte)AssetType.Texture, | 1120 | (sbyte)AssetType.Texture, |
1123 | m_scene.RegionInfo.RegionID.ToString()); | 1121 | m_scene.RegionInfo.RegionID.ToString()); |
@@ -1129,6 +1127,10 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1129 | // Store the new one | 1127 | // Store the new one |
1130 | m_log.DebugFormat("[WORLDMAP]: Storing map tile {0}", asset.ID); | 1128 | m_log.DebugFormat("[WORLDMAP]: Storing map tile {0}", asset.ID); |
1131 | m_scene.AssetService.Store(asset); | 1129 | m_scene.AssetService.Store(asset); |
1130 | |||
1131 | // Switch to the new one | ||
1132 | UUID lastMapRegionUUID = m_scene.RegionInfo.RegionSettings.TerrainImageID; | ||
1133 | m_scene.RegionInfo.RegionSettings.TerrainImageID = terrainImageID; | ||
1132 | m_scene.RegionInfo.RegionSettings.Save(); | 1134 | m_scene.RegionInfo.RegionSettings.Save(); |
1133 | 1135 | ||
1134 | // Delete the old one | 1136 | // Delete the old one |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 6e66632..32a2887 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1672,20 +1672,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
1672 | 1672 | ||
1673 | m_sceneGridService.SetScene(this); | 1673 | m_sceneGridService.SetScene(this); |
1674 | 1674 | ||
1675 | // If we generate maptiles internally at all, the maptile generator | 1675 | GridRegion region = new GridRegion(RegionInfo); |
1676 | // will register the region. If not, do it here | 1676 | string error = GridService.RegisterRegion(RegionInfo.ScopeID, region); |
1677 | if (m_generateMaptiles) | 1677 | if (error != String.Empty) |
1678 | { | 1678 | { |
1679 | RegenerateMaptile(null, null); | 1679 | throw new Exception(error); |
1680 | } | 1680 | } |
1681 | else | 1681 | |
1682 | // Generate the maptile asynchronously, because sometimes it can be very slow and we | ||
1683 | // don't want this to delay starting the region. | ||
1684 | if (m_generateMaptiles) | ||
1682 | { | 1685 | { |
1683 | GridRegion region = new GridRegion(RegionInfo); | 1686 | Util.FireAndForget(delegate { |
1684 | string error = GridService.RegisterRegion(RegionInfo.ScopeID, region); | 1687 | RegenerateMaptile(null, null); |
1685 | if (error != String.Empty) | 1688 | }); |
1686 | { | ||
1687 | throw new Exception(error); | ||
1688 | } | ||
1689 | } | 1689 | } |
1690 | } | 1690 | } |
1691 | 1691 | ||