diff options
author | Diva Canto | 2012-09-21 17:58:44 -0700 |
---|---|---|
committer | Diva Canto | 2012-09-21 17:58:44 -0700 |
commit | 21a6ef5bb63e56612b8e03002dbee9ff1fcdc4c0 (patch) | |
tree | d2d6c2e55e7894e5d129621d7f0145768bd8dadb /OpenSim/Region/CoreModules/Framework/EntityTransfer | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-21a6ef5bb63e56612b8e03002dbee9ff1fcdc4c0.zip opensim-SC_OLD-21a6ef5bb63e56612b8e03002dbee9ff1fcdc4c0.tar.gz opensim-SC_OLD-21a6ef5bb63e56612b8e03002dbee9ff1fcdc4c0.tar.bz2 opensim-SC_OLD-21a6ef5bb63e56612b8e03002dbee9ff1fcdc4c0.tar.xz |
This fixes HG attachments' missing assets (textures, etc).
Also, further improvements on HGUuidGatherer: if the assets are already in this grid don't fetch them again.
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/EntityTransfer')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index 0b386d3..a6698e6 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | |||
@@ -150,6 +150,34 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
150 | 150 | ||
151 | if (m_Enabled) | 151 | if (m_Enabled) |
152 | scene.RegisterModuleInterface<IUserAgentVerificationModule>(this); | 152 | scene.RegisterModuleInterface<IUserAgentVerificationModule>(this); |
153 | |||
154 | scene.EventManager.OnIncomingSceneObject += OnIncomingSceneObject; | ||
155 | } | ||
156 | |||
157 | void OnIncomingSceneObject(SceneObjectGroup so) | ||
158 | { | ||
159 | if (!so.IsAttachment) | ||
160 | return; | ||
161 | |||
162 | if (so.Scene.UserManagementModule.IsLocalGridUser(so.AttachedAvatar)) | ||
163 | return; | ||
164 | |||
165 | // foreign user | ||
166 | AgentCircuitData aCircuit = so.Scene.AuthenticateHandler.GetAgentCircuitData(so.AttachedAvatar); | ||
167 | if (aCircuit != null && (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0) | ||
168 | { | ||
169 | if (aCircuit.ServiceURLs != null && aCircuit.ServiceURLs.ContainsKey("AssetServerURI")) | ||
170 | { | ||
171 | string url = aCircuit.ServiceURLs["AssetServerURI"].ToString(); | ||
172 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Incoming attachement {0} for HG user {1} with asset server {2}", so.Name, so.AttachedAvatar, url); | ||
173 | Dictionary<UUID, AssetType> ids = new Dictionary<UUID, AssetType>(); | ||
174 | HGUuidGatherer uuidGatherer = new HGUuidGatherer(so.Scene.AssetService, url); | ||
175 | uuidGatherer.GatherAssetUuids(so, ids); | ||
176 | |||
177 | foreach (KeyValuePair<UUID, AssetType> kvp in ids) | ||
178 | uuidGatherer.FetchAsset(kvp.Key); | ||
179 | } | ||
180 | } | ||
153 | } | 181 | } |
154 | 182 | ||
155 | protected override void OnNewClient(IClientAPI client) | 183 | protected override void OnNewClient(IClientAPI client) |