diff options
Diffstat (limited to 'OpenSim/Region')
19 files changed, 400 insertions, 336 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 74ad168..904a50c 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -327,8 +327,8 @@ namespace OpenSim | |||
327 | //regionInfo.originRegionID = regionInfo.RegionID; | 327 | //regionInfo.originRegionID = regionInfo.RegionID; |
328 | 328 | ||
329 | // set initial ServerURI | 329 | // set initial ServerURI |
330 | regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName + ":" + regionInfo.InternalEndPoint.Port; | ||
331 | regionInfo.HttpPort = m_httpServerPort; | 330 | regionInfo.HttpPort = m_httpServerPort; |
331 | regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort.ToString() + "/"; | ||
332 | 332 | ||
333 | regionInfo.osSecret = m_osSecret; | 333 | regionInfo.osSecret = m_osSecret; |
334 | 334 | ||
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 74ad485..14f923d 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -79,7 +79,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
79 | public event DeRezObject OnDeRezObject; | 79 | public event DeRezObject OnDeRezObject; |
80 | public event ModifyTerrain OnModifyTerrain; | 80 | public event ModifyTerrain OnModifyTerrain; |
81 | public event Action<IClientAPI> OnRegionHandShakeReply; | 81 | public event Action<IClientAPI> OnRegionHandShakeReply; |
82 | public event GenericCall2 OnRequestWearables; | 82 | public event GenericCall1 OnRequestWearables; |
83 | public event SetAppearance OnSetAppearance; | 83 | public event SetAppearance OnSetAppearance; |
84 | public event AvatarNowWearing OnAvatarNowWearing; | 84 | public event AvatarNowWearing OnAvatarNowWearing; |
85 | public event RezSingleAttachmentFromInv OnRezSingleAttachmentFromInv; | 85 | public event RezSingleAttachmentFromInv OnRezSingleAttachmentFromInv; |
@@ -5647,11 +5647,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5647 | 5647 | ||
5648 | private bool HandlerAgentWearablesRequest(IClientAPI sender, Packet Pack) | 5648 | private bool HandlerAgentWearablesRequest(IClientAPI sender, Packet Pack) |
5649 | { | 5649 | { |
5650 | GenericCall2 handlerRequestWearables = OnRequestWearables; | 5650 | GenericCall1 handlerRequestWearables = OnRequestWearables; |
5651 | 5651 | ||
5652 | if (handlerRequestWearables != null) | 5652 | if (handlerRequestWearables != null) |
5653 | { | 5653 | { |
5654 | handlerRequestWearables(); | 5654 | handlerRequestWearables(sender); |
5655 | } | 5655 | } |
5656 | 5656 | ||
5657 | Action<IClientAPI> handlerRequestAvatarsData = OnRequestAvatarsData; | 5657 | Action<IClientAPI> handlerRequestAvatarsData = OnRequestAvatarsData; |
@@ -5694,7 +5694,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5694 | if (appear.ObjectData.TextureEntry.Length > 1) | 5694 | if (appear.ObjectData.TextureEntry.Length > 1) |
5695 | te = new Primitive.TextureEntry(appear.ObjectData.TextureEntry, 0, appear.ObjectData.TextureEntry.Length); | 5695 | te = new Primitive.TextureEntry(appear.ObjectData.TextureEntry, 0, appear.ObjectData.TextureEntry.Length); |
5696 | 5696 | ||
5697 | handlerSetAppearance(te, visualparams); | 5697 | handlerSetAppearance(sender, te, visualparams); |
5698 | } | 5698 | } |
5699 | catch (Exception e) | 5699 | catch (Exception e) |
5700 | { | 5700 | { |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index cb298fd..624814a 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | |||
@@ -631,7 +631,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
631 | IClientAPI client; | 631 | IClientAPI client; |
632 | if (!m_scene.TryGetClient(address, out client) || !(client is LLClientView)) | 632 | if (!m_scene.TryGetClient(address, out client) || !(client is LLClientView)) |
633 | { | 633 | { |
634 | //m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet from an unrecognized source: " + address + " in " + m_scene.RegionInfo.RegionName); | 634 | m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet from an unrecognized source: " + address + " in " + m_scene.RegionInfo.RegionName); |
635 | return; | 635 | return; |
636 | } | 636 | } |
637 | 637 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 2a0c0b1..ad6b1de 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -124,13 +124,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
124 | 124 | ||
125 | // Save avatar attachment information | 125 | // Save avatar attachment information |
126 | ScenePresence presence; | 126 | ScenePresence presence; |
127 | if (m_scene.AvatarFactory != null && m_scene.TryGetScenePresence(remoteClient.AgentId, out presence)) | 127 | if (m_scene.AvatarService != null && m_scene.TryGetScenePresence(remoteClient.AgentId, out presence)) |
128 | { | 128 | { |
129 | m_log.Info( | 129 | m_log.Info( |
130 | "[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId | 130 | "[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId |
131 | + ", AttachmentPoint: " + AttachmentPt); | 131 | + ", AttachmentPoint: " + AttachmentPt); |
132 | 132 | ||
133 | m_scene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); | 133 | m_scene.AvatarService.SetAppearance(remoteClient.AgentId, presence.Appearance); |
134 | } | 134 | } |
135 | } | 135 | } |
136 | } | 136 | } |
@@ -382,8 +382,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
382 | item = m_scene.InventoryService.GetItem(item); | 382 | item = m_scene.InventoryService.GetItem(item); |
383 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /* att.UUID */); | 383 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /* att.UUID */); |
384 | 384 | ||
385 | if (m_scene.AvatarFactory != null) | 385 | if (m_scene.AvatarService != null) |
386 | m_scene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); | 386 | m_scene.AvatarService.SetAppearance(remoteClient.AgentId, presence.Appearance); |
387 | } | 387 | } |
388 | } | 388 | } |
389 | 389 | ||
@@ -405,10 +405,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
405 | presence.Appearance.DetachAttachment(itemID); | 405 | presence.Appearance.DetachAttachment(itemID); |
406 | 406 | ||
407 | // Save avatar attachment information | 407 | // Save avatar attachment information |
408 | if (m_scene.AvatarFactory != null) | 408 | if (m_scene.AvatarService != null) |
409 | { | 409 | { |
410 | m_log.Debug("[ATTACHMENTS MODULE]: Detaching from UserID: " + remoteClient.AgentId + ", ItemID: " + itemID); | 410 | m_log.Debug("[ATTACHMENTS MODULE]: Detaching from UserID: " + remoteClient.AgentId + ", ItemID: " + itemID); |
411 | m_scene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); | 411 | m_scene.AvatarService.SetAppearance(remoteClient.AgentId, presence.Appearance); |
412 | } | 412 | } |
413 | } | 413 | } |
414 | 414 | ||
@@ -435,9 +435,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
435 | 435 | ||
436 | presence.Appearance.DetachAttachment(itemID); | 436 | presence.Appearance.DetachAttachment(itemID); |
437 | 437 | ||
438 | if (m_scene.AvatarFactory != null) | 438 | if (m_scene.AvatarService != null) |
439 | { | 439 | { |
440 | m_scene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); | 440 | m_scene.AvatarService.SetAppearance(remoteClient.AgentId, presence.Appearance); |
441 | } | 441 | } |
442 | part.ParentGroup.DetachToGround(); | 442 | part.ParentGroup.DetachToGround(); |
443 | 443 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 22c8937..5f8b4f6 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -32,58 +32,56 @@ using Nini.Config; | |||
32 | using OpenMetaverse; | 32 | using OpenMetaverse; |
33 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | 34 | ||
35 | using System.Threading; | ||
36 | using System.Timers; | ||
37 | using System.Collections.Generic; | ||
38 | |||
35 | using OpenSim.Region.Framework.Interfaces; | 39 | using OpenSim.Region.Framework.Interfaces; |
36 | using OpenSim.Region.Framework.Scenes; | 40 | using OpenSim.Region.Framework.Scenes; |
37 | using OpenSim.Services.Interfaces; | 41 | using OpenSim.Services.Interfaces; |
38 | 42 | ||
39 | namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | 43 | namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory |
40 | { | 44 | { |
41 | public class AvatarFactoryModule : IAvatarFactory, IRegionModule | 45 | public class AvatarFactoryModule : IRegionModule |
42 | { | 46 | { |
43 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
48 | private static readonly byte[] BAKE_INDICES = new byte[] { 8, 9, 10, 11, 19, 20 }; | ||
44 | private Scene m_scene = null; | 49 | private Scene m_scene = null; |
45 | private static readonly AvatarAppearance def = new AvatarAppearance(); | ||
46 | 50 | ||
47 | public bool TryGetAvatarAppearance(UUID avatarId, out AvatarAppearance appearance) | 51 | private int m_savetime = 5; // seconds to wait before saving changed appearance |
48 | { | 52 | private int m_sendtime = 2; // seconds to wait before sending changed appearance |
49 | AvatarData avatar = m_scene.AvatarService.GetAvatar(avatarId); | ||
50 | //if ((profile != null) && (profile.RootFolder != null)) | ||
51 | if (avatar != null) | ||
52 | { | ||
53 | appearance = avatar.ToAvatarAppearance(avatarId); | ||
54 | return true; | ||
55 | } | ||
56 | 53 | ||
57 | m_log.ErrorFormat("[APPEARANCE]: Appearance not found for {0}, creating default", avatarId); | 54 | private int m_checkTime = 500; // milliseconds to wait between checks for appearance updates |
58 | appearance = CreateDefault(avatarId); | 55 | private System.Timers.Timer m_updateTimer = new System.Timers.Timer(); |
59 | return false; | 56 | private Dictionary<UUID,long> m_savequeue = new Dictionary<UUID,long>(); |
60 | } | 57 | private Dictionary<UUID,long> m_sendqueue = new Dictionary<UUID,long>(); |
61 | 58 | ||
62 | private AvatarAppearance CreateDefault(UUID avatarId) | 59 | #region RegionModule Members |
63 | { | ||
64 | AvatarAppearance appearance = null; | ||
65 | AvatarWearable[] wearables; | ||
66 | byte[] visualParams; | ||
67 | GetDefaultAvatarAppearance(out wearables, out visualParams); | ||
68 | appearance = new AvatarAppearance(avatarId, wearables, visualParams); | ||
69 | |||
70 | return appearance; | ||
71 | } | ||
72 | 60 | ||
73 | public void Initialise(Scene scene, IConfigSource source) | 61 | public void Initialise(Scene scene, IConfigSource config) |
74 | { | 62 | { |
75 | scene.RegisterModuleInterface<IAvatarFactory>(this); | ||
76 | scene.EventManager.OnNewClient += NewClient; | 63 | scene.EventManager.OnNewClient += NewClient; |
77 | 64 | ||
78 | if (m_scene == null) | 65 | if (config != null) |
79 | { | 66 | { |
80 | m_scene = scene; | 67 | IConfig sconfig = config.Configs["Startup"]; |
68 | if (sconfig != null) | ||
69 | { | ||
70 | m_savetime = Convert.ToInt32(sconfig.GetString("DelayBeforeAppearanceSave",Convert.ToString(m_savetime))); | ||
71 | m_sendtime = Convert.ToInt32(sconfig.GetString("DelayBeforeAppearanceSend",Convert.ToString(m_sendtime))); | ||
72 | } | ||
81 | } | 73 | } |
82 | 74 | ||
75 | if (m_scene == null) | ||
76 | m_scene = scene; | ||
83 | } | 77 | } |
84 | 78 | ||
85 | public void PostInitialise() | 79 | public void PostInitialise() |
86 | { | 80 | { |
81 | m_updateTimer.Enabled = false; | ||
82 | m_updateTimer.AutoReset = true; | ||
83 | m_updateTimer.Interval = m_checkTime; // 500 milliseconds wait to start async ops | ||
84 | m_updateTimer.Elapsed += new ElapsedEventHandler(HandleAppearanceUpdateTimer); | ||
87 | } | 85 | } |
88 | 86 | ||
89 | public void Close() | 87 | public void Close() |
@@ -102,6 +100,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
102 | 100 | ||
103 | public void NewClient(IClientAPI client) | 101 | public void NewClient(IClientAPI client) |
104 | { | 102 | { |
103 | client.OnRequestWearables += SendWearables; | ||
104 | client.OnSetAppearance += SetAppearance; | ||
105 | client.OnAvatarNowWearing += AvatarIsWearing; | 105 | client.OnAvatarNowWearing += AvatarIsWearing; |
106 | } | 106 | } |
107 | 107 | ||
@@ -110,42 +110,211 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
110 | // client.OnAvatarNowWearing -= AvatarIsWearing; | 110 | // client.OnAvatarNowWearing -= AvatarIsWearing; |
111 | } | 111 | } |
112 | 112 | ||
113 | public void SetAppearanceAssets(UUID userID, ref AvatarAppearance appearance) | 113 | #endregion |
114 | |||
115 | /// <summary> | ||
116 | /// Set appearance data (textureentry and slider settings) received from the client | ||
117 | /// </summary> | ||
118 | /// <param name="texture"></param> | ||
119 | /// <param name="visualParam"></param> | ||
120 | public void SetAppearance(IClientAPI client, Primitive.TextureEntry textureEntry, byte[] visualParams) | ||
114 | { | 121 | { |
115 | IInventoryService invService = m_scene.InventoryService; | 122 | // DEBUG ON |
123 | m_log.WarnFormat("[AVFACTORY] SetAppearance for {0}",client.AgentId); | ||
124 | // DEBUG OFF | ||
116 | 125 | ||
117 | if (invService.GetRootFolder(userID) != null) | 126 | ScenePresence sp = m_scene.GetScenePresence(client.AgentId); |
127 | if (sp == null) | ||
118 | { | 128 | { |
119 | for (int i = 0; i < 13; i++) | 129 | m_log.WarnFormat("[AVFACTORY] SetAppearance unable to find presence for {0}",client.AgentId); |
130 | return; | ||
131 | } | ||
132 | |||
133 | bool changed = false; | ||
134 | |||
135 | // Process the texture entry | ||
136 | if (textureEntry != null) | ||
137 | { | ||
138 | changed = sp.Appearance.SetTextureEntries(textureEntry); | ||
139 | |||
140 | for (int i = 0; i < BAKE_INDICES.Length; i++) | ||
120 | { | 141 | { |
121 | if (appearance.Wearables[i].ItemID == UUID.Zero) | 142 | int idx = BAKE_INDICES[i]; |
143 | Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[idx]; | ||
144 | if (face != null && face.TextureID != AppearanceManager.DEFAULT_AVATAR_TEXTURE) | ||
145 | Util.FireAndForget(delegate(object o) { CheckBakedTextureAssets(client,face.TextureID,idx); }); | ||
146 | } | ||
147 | } | ||
148 | |||
149 | // Process the visual params, this may change height as well | ||
150 | if (visualParams != null) | ||
151 | { | ||
152 | if (sp.Appearance.SetVisualParams(visualParams)) | ||
153 | { | ||
154 | changed = true; | ||
155 | if (sp.Appearance.AvatarHeight > 0) | ||
156 | sp.SetHeight(sp.Appearance.AvatarHeight); | ||
157 | } | ||
158 | } | ||
159 | |||
160 | // If something changed in the appearance then queue an appearance save | ||
161 | if (changed) | ||
162 | QueueAppearanceSave(client.AgentId); | ||
163 | |||
164 | // And always queue up an appearance update to send out | ||
165 | QueueAppearanceSend(client.AgentId); | ||
166 | |||
167 | // Send the appearance back to the avatar | ||
168 | AvatarAppearance avp = sp.Appearance; | ||
169 | sp.ControllingClient.SendAvatarDataImmediate(sp); | ||
170 | sp.ControllingClient.SendAppearance(avp.Owner,avp.VisualParams,avp.Texture.GetBytes()); | ||
171 | } | ||
172 | |||
173 | /// <summary> | ||
174 | /// Checks for the existance of a baked texture asset and | ||
175 | /// requests the viewer rebake if the asset is not found | ||
176 | /// </summary> | ||
177 | /// <param name="client"></param> | ||
178 | /// <param name="textureID"></param> | ||
179 | /// <param name="idx"></param> | ||
180 | private void CheckBakedTextureAssets(IClientAPI client, UUID textureID, int idx) | ||
181 | { | ||
182 | if (m_scene.AssetService.Get(textureID.ToString()) == null) | ||
183 | { | ||
184 | m_log.WarnFormat("[AVFACTORY]: Missing baked texture {0} ({1}) for avatar {2}", | ||
185 | textureID,idx,client.Name); | ||
186 | client.SendRebakeAvatarTextures(textureID); | ||
187 | } | ||
188 | } | ||
189 | |||
190 | #region UpdateAppearanceTimer | ||
191 | |||
192 | public void QueueAppearanceSend(UUID agentid) | ||
193 | { | ||
194 | // DEBUG ON | ||
195 | m_log.WarnFormat("[AVFACTORY] Queue appearance send for {0}",agentid); | ||
196 | // DEBUG OFF | ||
197 | |||
198 | // 100 nanoseconds (ticks) we should wait | ||
199 | long timestamp = DateTime.Now.Ticks + Convert.ToInt64(m_sendtime * 10000000); | ||
200 | lock (m_sendqueue) | ||
201 | { | ||
202 | m_sendqueue[agentid] = timestamp; | ||
203 | m_updateTimer.Start(); | ||
204 | } | ||
205 | } | ||
206 | |||
207 | public void QueueAppearanceSave(UUID agentid) | ||
208 | { | ||
209 | // DEBUG ON | ||
210 | m_log.WarnFormat("[AVFACTORY] Queue appearance save for {0}",agentid); | ||
211 | // DEBUG OFF | ||
212 | |||
213 | // 100 nanoseconds (ticks) we should wait | ||
214 | long timestamp = DateTime.Now.Ticks + Convert.ToInt64(m_savetime * 10000000); | ||
215 | lock (m_savequeue) | ||
216 | { | ||
217 | m_savequeue[agentid] = timestamp; | ||
218 | m_updateTimer.Start(); | ||
219 | } | ||
220 | } | ||
221 | |||
222 | private void HandleAppearanceSend(UUID agentid) | ||
223 | { | ||
224 | ScenePresence sp = m_scene.GetScenePresence(agentid); | ||
225 | if (sp == null) | ||
226 | { | ||
227 | m_log.WarnFormat("[AVFACTORY] Agent {0} no longer in the scene",agentid); | ||
228 | return; | ||
229 | } | ||
230 | |||
231 | // DEBUG ON | ||
232 | m_log.WarnFormat("[AVFACTORY] Handle appearance send for {0}\n{1}",agentid,sp.Appearance.ToString()); | ||
233 | // DEBUG OFF | ||
234 | |||
235 | // Send the appearance to everyone in the scene | ||
236 | sp.SendAppearanceToAllOtherAgents(); | ||
237 | |||
238 | // Send the appearance back to the avatar | ||
239 | AvatarAppearance avp = sp.Appearance; | ||
240 | sp.ControllingClient.SendAvatarDataImmediate(sp); | ||
241 | sp.ControllingClient.SendAppearance(avp.Owner,avp.VisualParams,avp.Texture.GetBytes()); | ||
242 | |||
243 | /* | ||
244 | // this needs to be fixed, the flag should be on scene presence not the region module | ||
245 | // Start the animations if necessary | ||
246 | if (!m_startAnimationSet) | ||
247 | { | ||
248 | sp.Animator.UpdateMovementAnimations(); | ||
249 | m_startAnimationSet = true; | ||
250 | } | ||
251 | */ | ||
252 | } | ||
253 | |||
254 | private void HandleAppearanceSave(UUID agentid) | ||
255 | { | ||
256 | ScenePresence sp = m_scene.GetScenePresence(agentid); | ||
257 | if (sp == null) | ||
258 | { | ||
259 | m_log.WarnFormat("[AVFACTORY] Agent {0} no longer in the scene",agentid); | ||
260 | return; | ||
261 | } | ||
262 | |||
263 | m_scene.AvatarService.SetAppearance(agentid, sp.Appearance); | ||
264 | } | ||
265 | |||
266 | private void HandleAppearanceUpdateTimer(object sender, EventArgs ea) | ||
267 | { | ||
268 | long now = DateTime.Now.Ticks; | ||
269 | |||
270 | lock (m_sendqueue) | ||
271 | { | ||
272 | Dictionary<UUID,long> sends = new Dictionary<UUID,long>(m_sendqueue); | ||
273 | foreach (KeyValuePair<UUID,long> kvp in sends) | ||
274 | { | ||
275 | if (kvp.Value < now) | ||
122 | { | 276 | { |
123 | appearance.Wearables[i].AssetID = UUID.Zero; | 277 | Util.FireAndForget(delegate(object o) { HandleAppearanceSend(kvp.Key); }); |
278 | m_sendqueue.Remove(kvp.Key); | ||
124 | } | 279 | } |
125 | else | 280 | } |
126 | { | 281 | } |
127 | InventoryItemBase baseItem = new InventoryItemBase(appearance.Wearables[i].ItemID, userID); | ||
128 | baseItem = invService.GetItem(baseItem); | ||
129 | 282 | ||
130 | if (baseItem != null) | 283 | lock (m_savequeue) |
131 | { | 284 | { |
132 | appearance.Wearables[i].AssetID = baseItem.AssetID; | 285 | Dictionary<UUID,long> saves = new Dictionary<UUID,long>(m_savequeue); |
133 | } | 286 | foreach (KeyValuePair<UUID,long> kvp in saves) |
134 | else | 287 | { |
135 | { | 288 | if (kvp.Value < now) |
136 | m_log.ErrorFormat( | 289 | { |
137 | "[APPEARANCE]: Can't find inventory item {0} for {1}, setting to default", | 290 | Util.FireAndForget(delegate(object o) { HandleAppearanceSave(kvp.Key); }); |
138 | appearance.Wearables[i].ItemID, (WearableType)i); | 291 | m_savequeue.Remove(kvp.Key); |
139 | |||
140 | appearance.Wearables[i].AssetID = def.Wearables[i].AssetID; | ||
141 | } | ||
142 | } | 292 | } |
143 | } | 293 | } |
144 | } | 294 | } |
145 | else | 295 | |
296 | if (m_savequeue.Count == 0 && m_sendqueue.Count == 0) | ||
297 | m_updateTimer.Stop(); | ||
298 | } | ||
299 | |||
300 | #endregion | ||
301 | |||
302 | /// <summary> | ||
303 | /// Tell the client for this scene presence what items it should be wearing now | ||
304 | /// </summary> | ||
305 | public void SendWearables(IClientAPI client) | ||
306 | { | ||
307 | ScenePresence sp = m_scene.GetScenePresence(client.AgentId); | ||
308 | if (sp == null) | ||
146 | { | 309 | { |
147 | m_log.WarnFormat("[APPEARANCE]: user {0} has no inventory, appearance isn't going to work", userID); | 310 | m_log.WarnFormat("[AVFACTORY] SendWearables unable to find presence for {0}",client.AgentId); |
311 | return; | ||
148 | } | 312 | } |
313 | |||
314 | // DEBUG ON | ||
315 | m_log.WarnFormat("[AVFACTORY]: Received request for wearables of {0}", client.AgentId); | ||
316 | // DEBUG OFF | ||
317 | client.SendWearables(sp.Appearance.Wearables,sp.Appearance.Serial++); | ||
149 | } | 318 | } |
150 | 319 | ||
151 | /// <summary> | 320 | /// <summary> |
@@ -153,65 +322,81 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
153 | /// </summary> | 322 | /// </summary> |
154 | /// <param name="sender"></param> | 323 | /// <param name="sender"></param> |
155 | /// <param name="e"></param> | 324 | /// <param name="e"></param> |
156 | public void AvatarIsWearing(Object sender, AvatarWearingArgs e) | 325 | public void AvatarIsWearing(IClientAPI client, AvatarWearingArgs e) |
157 | { | 326 | { |
158 | m_log.DebugFormat("[APPEARANCE]: AvatarIsWearing"); | 327 | ScenePresence sp = m_scene.GetScenePresence(client.AgentId); |
159 | 328 | if (sp == null) | |
160 | IClientAPI clientView = (IClientAPI)sender; | ||
161 | ScenePresence sp = m_scene.GetScenePresence(clientView.AgentId); | ||
162 | |||
163 | if (sp == null) | ||
164 | { | 329 | { |
165 | m_log.Error("[APPEARANCE]: Avatar is child agent, ignoring AvatarIsWearing event"); | 330 | m_log.WarnFormat("[AVFACTORY] AvatarIsWearing unable to find presence for {0}",client.AgentId); |
166 | return; | 331 | return; |
167 | } | 332 | } |
333 | |||
334 | // DEBUG ON | ||
335 | m_log.WarnFormat("[AVFACTORY]: AvatarIsWearing called for {0}",client.AgentId); | ||
336 | // DEBUG OFF | ||
337 | |||
338 | AvatarAppearance avatAppearance = new AvatarAppearance(sp.Appearance); | ||
168 | 339 | ||
169 | AvatarAppearance avatAppearance = sp.Appearance; | 340 | //if (!TryGetAvatarAppearance(client.AgentId, out avatAppearance)) |
170 | //if (!TryGetAvatarAppearance(clientView.AgentId, out avatAppearance)) | ||
171 | //{ | 341 | //{ |
172 | // m_log.Warn("[APPEARANCE]: We didn't seem to find the appearance, falling back to ScenePresence"); | 342 | // m_log.Warn("[AVFACTORY]: We didn't seem to find the appearance, falling back to ScenePresence"); |
173 | // avatAppearance = sp.Appearance; | 343 | // avatAppearance = sp.Appearance; |
174 | //} | 344 | //} |
175 | 345 | ||
176 | //m_log.DebugFormat("[APPEARANCE]: Received wearables for {0}", clientView.Name); | 346 | //m_log.DebugFormat("[AVFACTORY]: Received wearables for {0}", client.Name); |
177 | 347 | ||
178 | foreach (AvatarWearingArgs.Wearable wear in e.NowWearing) | 348 | foreach (AvatarWearingArgs.Wearable wear in e.NowWearing) |
179 | { | 349 | { |
180 | if (wear.Type < 13) | 350 | if (wear.Type < AvatarWearable.MAX_WEARABLES) |
181 | { | 351 | { |
182 | avatAppearance.Wearables[wear.Type].ItemID = wear.ItemID; | 352 | AvatarWearable newWearable = new AvatarWearable(wear.ItemID,UUID.Zero); |
353 | avatAppearance.SetWearable(wear.Type, newWearable); | ||
183 | } | 354 | } |
184 | } | 355 | } |
185 | 356 | ||
186 | SetAppearanceAssets(sp.UUID, ref avatAppearance); | 357 | SetAppearanceAssets(sp.UUID, ref avatAppearance); |
187 | AvatarData adata = new AvatarData(avatAppearance); | ||
188 | m_scene.AvatarService.SetAvatar(clientView.AgentId, adata); | ||
189 | 358 | ||
359 | m_scene.AvatarService.SetAppearance(client.AgentId, avatAppearance); | ||
190 | sp.Appearance = avatAppearance; | 360 | sp.Appearance = avatAppearance; |
191 | } | 361 | } |
192 | 362 | ||
193 | public static void GetDefaultAvatarAppearance(out AvatarWearable[] wearables, out byte[] visualParams) | 363 | private void SetAppearanceAssets(UUID userID, ref AvatarAppearance appearance) |
194 | { | 364 | { |
195 | visualParams = GetDefaultVisualParams(); | 365 | IInventoryService invService = m_scene.InventoryService; |
196 | wearables = AvatarWearable.DefaultWearables; | ||
197 | } | ||
198 | 366 | ||
199 | public void UpdateDatabase(UUID user, AvatarAppearance appearance) | 367 | if (invService.GetRootFolder(userID) != null) |
200 | { | 368 | { |
201 | //m_log.DebugFormat("[APPEARANCE]: UpdateDatabase"); | 369 | for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++) |
202 | AvatarData adata = new AvatarData(appearance); | 370 | { |
203 | m_scene.AvatarService.SetAvatar(user, adata); | 371 | if (appearance.Wearables[i].ItemID == UUID.Zero) |
204 | } | 372 | { |
373 | appearance.Wearables[i].AssetID = UUID.Zero; | ||
374 | } | ||
375 | else | ||
376 | { | ||
377 | InventoryItemBase baseItem = new InventoryItemBase(appearance.Wearables[i].ItemID, userID); | ||
378 | baseItem = invService.GetItem(baseItem); | ||
205 | 379 | ||
206 | private static byte[] GetDefaultVisualParams() | 380 | if (baseItem != null) |
207 | { | 381 | { |
208 | byte[] visualParams; | 382 | appearance.Wearables[i].AssetID = baseItem.AssetID; |
209 | visualParams = new byte[218]; | 383 | } |
210 | for (int i = 0; i < 218; i++) | 384 | else |
385 | { | ||
386 | m_log.ErrorFormat( | ||
387 | "[AVFACTORY]: Can't find inventory item {0} for {1}, setting to default", | ||
388 | appearance.Wearables[i].ItemID, (WearableType)i); | ||
389 | |||
390 | appearance.Wearables[i].ItemID = UUID.Zero; | ||
391 | appearance.Wearables[i].AssetID = UUID.Zero; | ||
392 | } | ||
393 | } | ||
394 | } | ||
395 | } | ||
396 | else | ||
211 | { | 397 | { |
212 | visualParams[i] = 100; | 398 | m_log.WarnFormat("[AVFACTORY]: user {0} has no inventory, appearance isn't going to work", userID); |
213 | } | 399 | } |
214 | return visualParams; | ||
215 | } | 400 | } |
216 | } | 401 | } |
217 | } | 402 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs index 918fa04..fdc48c6 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs | |||
@@ -599,7 +599,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
599 | try | 599 | try |
600 | { | 600 | { |
601 | 601 | ||
602 | XmlRpcResponse GridResp = GridReq.Send("http://" + reginfo.ExternalHostName + ":" + reginfo.HttpPort, 3000); | 602 | XmlRpcResponse GridResp = GridReq.Send(reginfo.ServerURI, 3000); |
603 | 603 | ||
604 | Hashtable responseData = (Hashtable)GridResp.Value; | 604 | Hashtable responseData = (Hashtable)GridResp.Value; |
605 | 605 | ||
@@ -621,8 +621,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
621 | } | 621 | } |
622 | catch (WebException e) | 622 | catch (WebException e) |
623 | { | 623 | { |
624 | m_log.ErrorFormat("[GRID INSTANT MESSAGE]: Error sending message to http://{0}:{1} the host didn't respond ({2})", | 624 | m_log.ErrorFormat("[GRID INSTANT MESSAGE]: Error sending message to {0}} the host didn't respond ({2})", |
625 | reginfo.ExternalHostName, reginfo.HttpPort, e.Message); | 625 | reginfo.ServerURI, e.Message); |
626 | } | 626 | } |
627 | 627 | ||
628 | return false; | 628 | return false; |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 38fff1c..925af3f 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -197,8 +197,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
197 | sp.ControllingClient.SendTeleportFailed("Problem at destination"); | 197 | sp.ControllingClient.SendTeleportFailed("Problem at destination"); |
198 | return; | 198 | return; |
199 | } | 199 | } |
200 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Final destination is x={0} y={1} uuid={2}", | 200 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Final destination is x={0} y={1} {2}@{3}", |
201 | finalDestination.RegionLocX / Constants.RegionSize, finalDestination.RegionLocY / Constants.RegionSize, finalDestination.RegionID); | 201 | finalDestination.RegionLocX / Constants.RegionSize, finalDestination.RegionLocY / Constants.RegionSize, finalDestination.RegionID, finalDestination.ServerURI); |
202 | 202 | ||
203 | // Check that these are not the same coordinates | 203 | // Check that these are not the same coordinates |
204 | if (finalDestination.RegionLocX == sp.Scene.RegionInfo.RegionLocX && | 204 | if (finalDestination.RegionLocX == sp.Scene.RegionInfo.RegionLocX && |
@@ -254,8 +254,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
254 | } | 254 | } |
255 | 255 | ||
256 | m_log.DebugFormat( | 256 | m_log.DebugFormat( |
257 | "[ENTITY TRANSFER MODULE]: Request Teleport to {0}:{1}:{2}/{3}", | 257 | "[ENTITY TRANSFER MODULE]: Request Teleport to {0} ({1}) {2}/{3}", |
258 | reg.ExternalHostName, reg.HttpPort, finalDestination.RegionName, position); | 258 | reg.ServerURI, finalDestination.ServerURI, finalDestination.RegionName, position); |
259 | 259 | ||
260 | uint newRegionX = (uint)(reg.RegionHandle >> 40); | 260 | uint newRegionX = (uint)(reg.RegionHandle >> 40); |
261 | uint newRegionY = (((uint)(reg.RegionHandle)) >> 8); | 261 | uint newRegionY = (((uint)(reg.RegionHandle)) >> 8); |
@@ -327,43 +327,21 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
327 | 327 | ||
328 | // OK, it got this agent. Let's close some child agents | 328 | // OK, it got this agent. Let's close some child agents |
329 | sp.CloseChildAgents(newRegionX, newRegionY); | 329 | sp.CloseChildAgents(newRegionX, newRegionY); |
330 | 330 | IClientIPEndpoint ipepClient; | |
331 | if (NeedsNewAgent(oldRegionX, newRegionX, oldRegionY, newRegionY)) | 331 | if (NeedsNewAgent(oldRegionX, newRegionX, oldRegionY, newRegionY)) |
332 | { | 332 | { |
333 | //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Creating agent..."); | 333 | //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Creating agent..."); |
334 | |||
335 | #region IP Translation for NAT | 334 | #region IP Translation for NAT |
336 | IClientIPEndpoint ipepClient; | 335 | // Uses ipepClient above |
337 | if (sp.ClientView.TryGet(out ipepClient)) | 336 | if (sp.ClientView.TryGet(out ipepClient)) |
338 | { | 337 | { |
339 | capsPath | 338 | endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address); |
340 | = "http://" | ||
341 | + NetworkUtil.GetHostFor(ipepClient.EndPoint, finalDestination.ExternalHostName) | ||
342 | + ":" | ||
343 | + finalDestination.HttpPort | ||
344 | + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); | ||
345 | } | ||
346 | else | ||
347 | { | ||
348 | capsPath | ||
349 | = "http://" | ||
350 | + finalDestination.ExternalHostName | ||
351 | + ":" | ||
352 | + finalDestination.HttpPort | ||
353 | + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); | ||
354 | } | 339 | } |
355 | #endregion | 340 | #endregion |
341 | capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); | ||
356 | 342 | ||
357 | if (eq != null) | 343 | if (eq != null) |
358 | { | 344 | { |
359 | #region IP Translation for NAT | ||
360 | // Uses ipepClient above | ||
361 | if (sp.ClientView.TryGet(out ipepClient)) | ||
362 | { | ||
363 | endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address); | ||
364 | } | ||
365 | #endregion | ||
366 | |||
367 | eq.EnableSimulator(destinationHandle, endPoint, sp.UUID); | 345 | eq.EnableSimulator(destinationHandle, endPoint, sp.UUID); |
368 | 346 | ||
369 | // ES makes the client send a UseCircuitCode message to the destination, | 347 | // ES makes the client send a UseCircuitCode message to the destination, |
@@ -382,8 +360,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
382 | else | 360 | else |
383 | { | 361 | { |
384 | agentCircuit.CapsPath = sp.Scene.CapsModule.GetChildSeed(sp.UUID, reg.RegionHandle); | 362 | agentCircuit.CapsPath = sp.Scene.CapsModule.GetChildSeed(sp.UUID, reg.RegionHandle); |
385 | capsPath = "http://" + finalDestination.ExternalHostName + ":" + finalDestination.HttpPort | 363 | capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); |
386 | + "/CAPS/" + agentCircuit.CapsPath + "0000/"; | ||
387 | } | 364 | } |
388 | 365 | ||
389 | // Expect avatar crossing is a heavy-duty function at the destination. | 366 | // Expect avatar crossing is a heavy-duty function at the destination. |
@@ -516,8 +493,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
516 | 493 | ||
517 | protected virtual void SetCallbackURL(AgentData agent, RegionInfo region) | 494 | protected virtual void SetCallbackURL(AgentData agent, RegionInfo region) |
518 | { | 495 | { |
519 | agent.CallbackURI = "http://" + region.ExternalHostName + ":" + region.HttpPort + | 496 | agent.CallbackURI = region.ServerURI + "agent/" + agent.AgentID.ToString() + "/" + region.RegionID.ToString() + "/release/"; |
520 | "/agent/" + agent.AgentID.ToString() + "/" + region.RegionID.ToString() + "/release/"; | 497 | m_log.Debug("Set callback URL to " + agent.CallbackURI); |
521 | 498 | ||
522 | } | 499 | } |
523 | 500 | ||
@@ -842,8 +819,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
842 | cAgent.Position = pos; | 819 | cAgent.Position = pos; |
843 | if (isFlying) | 820 | if (isFlying) |
844 | cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; | 821 | cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; |
845 | cAgent.CallbackURI = "http://" + m_scene.RegionInfo.ExternalHostName + ":" + m_scene.RegionInfo.HttpPort + | 822 | cAgent.CallbackURI = m_scene.RegionInfo.ServerURI + |
846 | "/agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/"; | 823 | "agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/"; |
847 | 824 | ||
848 | if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent)) | 825 | if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent)) |
849 | { | 826 | { |
@@ -868,10 +845,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
868 | neighbourRegion.RegionHandle); | 845 | neighbourRegion.RegionHandle); |
869 | return agent; | 846 | return agent; |
870 | } | 847 | } |
871 | // TODO Should construct this behind a method | 848 | string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps); |
872 | string capsPath = | ||
873 | "http://" + neighbourRegion.ExternalHostName + ":" + neighbourRegion.HttpPort | ||
874 | + "/CAPS/" + agentcaps /*circuitdata.CapsPath*/ + "0000/"; | ||
875 | 849 | ||
876 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID); | 850 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID); |
877 | 851 | ||
@@ -1190,8 +1164,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1190 | y = y / Constants.RegionSize; | 1164 | y = y / Constants.RegionSize; |
1191 | m_log.Info("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint.ToString() + ")"); | 1165 | m_log.Info("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint.ToString() + ")"); |
1192 | 1166 | ||
1193 | string capsPath = "http://" + reg.ExternalHostName + ":" + reg.HttpPort | 1167 | string capsPath = reg.ServerURI + CapsUtil.GetCapsSeedPath(a.CapsPath); |
1194 | + "/CAPS/" + a.CapsPath + "0000/"; | ||
1195 | 1168 | ||
1196 | string reason = String.Empty; | 1169 | string reason = String.Empty; |
1197 | 1170 | ||
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index 1ac7508..7796a08 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | |||
@@ -123,7 +123,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
123 | if ((flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0) | 123 | if ((flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0) |
124 | { | 124 | { |
125 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Destination region {0} is hyperlink", region.RegionID); | 125 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Destination region {0} is hyperlink", region.RegionID); |
126 | return m_GatekeeperConnector.GetHyperlinkRegion(region, region.RegionID); | 126 | GridRegion real_destination = m_GatekeeperConnector.GetHyperlinkRegion(region, region.RegionID); |
127 | m_log.Debug("GetfinalDestination serveruri -> " + real_destination.ServerURI); | ||
128 | return real_destination; | ||
127 | } | 129 | } |
128 | return region; | 130 | return region; |
129 | } | 131 | } |
@@ -149,6 +151,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
149 | 151 | ||
150 | protected override bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout) | 152 | protected override bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout) |
151 | { | 153 | { |
154 | m_log.Debug("CreateAgent " + reg.ServerURI + " " + finalDestination.ServerURI); | ||
152 | reason = string.Empty; | 155 | reason = string.Empty; |
153 | logout = false; | 156 | logout = false; |
154 | int flags = m_aScene.GridService.GetRegionFlags(m_aScene.RegionInfo.ScopeID, reg.RegionID); | 157 | int flags = m_aScene.GridService.GetRegionFlags(m_aScene.RegionInfo.ScopeID, reg.RegionID); |
@@ -235,6 +238,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
235 | string url = aCircuit.ServiceURLs["HomeURI"].ToString(); | 238 | string url = aCircuit.ServiceURLs["HomeURI"].ToString(); |
236 | IUserAgentService security = new UserAgentServiceConnector(url); | 239 | IUserAgentService security = new UserAgentServiceConnector(url); |
237 | return security.VerifyClient(aCircuit.SessionID, token); | 240 | return security.VerifyClient(aCircuit.SessionID, token); |
241 | } else { | ||
242 | m_log.Debug("this gent does not have a HomeURI OH NO"); | ||
238 | } | 243 | } |
239 | 244 | ||
240 | return false; | 245 | return false; |
diff --git a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs index fd0e879..2dd7767 100644 --- a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs +++ b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs | |||
@@ -595,12 +595,12 @@ namespace OpenSim.Region.CoreModules.InterGrid | |||
595 | // DEPRECATED | 595 | // DEPRECATED |
596 | responseMap["seed_capability"] | 596 | responseMap["seed_capability"] |
597 | = OSD.FromString( | 597 | = OSD.FromString( |
598 | regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + CapsUtil.GetCapsSeedPath(userCap.CapsObjectPath)); | 598 | regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + "/" + CapsUtil.GetCapsSeedPath(userCap.CapsObjectPath)); |
599 | 599 | ||
600 | // REPLACEMENT | 600 | // REPLACEMENT |
601 | responseMap["region_seed_capability"] | 601 | responseMap["region_seed_capability"] |
602 | = OSD.FromString( | 602 | = OSD.FromString( |
603 | regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + CapsUtil.GetCapsSeedPath(userCap.CapsObjectPath)); | 603 | regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + "/" + CapsUtil.GetCapsSeedPath(userCap.CapsObjectPath)); |
604 | 604 | ||
605 | responseMap["rez_avatar"] = OSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath); | 605 | responseMap["rez_avatar"] = OSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath); |
606 | responseMap["rez_avatar/rez"] = OSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath); | 606 | responseMap["rez_avatar/rez"] = OSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Avatar/LocalAvatarServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Avatar/LocalAvatarServiceConnector.cs index 47f19a3..9ee19f8 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Avatar/LocalAvatarServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Avatar/LocalAvatarServiceConnector.cs | |||
@@ -30,6 +30,7 @@ using System.Collections.Generic; | |||
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using log4net; | 31 | using log4net; |
32 | using Nini.Config; | 32 | using Nini.Config; |
33 | using OpenSim.Framework; | ||
33 | using OpenSim.Region.Framework.Interfaces; | 34 | using OpenSim.Region.Framework.Interfaces; |
34 | using OpenSim.Region.Framework.Scenes; | 35 | using OpenSim.Region.Framework.Scenes; |
35 | using OpenSim.Server.Base; | 36 | using OpenSim.Server.Base; |
@@ -137,6 +138,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Avatar | |||
137 | 138 | ||
138 | #region IAvatarService | 139 | #region IAvatarService |
139 | 140 | ||
141 | public AvatarAppearance GetAppearance(UUID userID) | ||
142 | { | ||
143 | return m_AvatarService.GetAppearance(userID); | ||
144 | } | ||
145 | |||
146 | public bool SetAppearance(UUID userID, AvatarAppearance appearance) | ||
147 | { | ||
148 | return m_AvatarService.SetAppearance(userID,appearance); | ||
149 | } | ||
150 | |||
140 | public AvatarData GetAvatar(UUID userID) | 151 | public AvatarData GetAvatar(UUID userID) |
141 | { | 152 | { |
142 | return m_AvatarService.GetAvatar(userID); | 153 | return m_AvatarService.GetAvatar(userID); |
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index a182eea..fdbbccf 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | |||
@@ -147,7 +147,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
147 | 147 | ||
148 | string regionimage = "regionImage" + m_scene.RegionInfo.RegionID.ToString(); | 148 | string regionimage = "regionImage" + m_scene.RegionInfo.RegionID.ToString(); |
149 | regionimage = regionimage.Replace("-", ""); | 149 | regionimage = regionimage.Replace("-", ""); |
150 | m_log.Info("[WORLD MAP]: JPEG Map location: http://" + m_scene.RegionInfo.ExternalEndPoint.Address.ToString() + ":" + m_scene.RegionInfo.HttpPort.ToString() + "/index.php?method=" + regionimage); | 150 | m_log.Info("[WORLD MAP]: JPEG Map location: " + m_scene.RegionInfo.ServerURI + "/index.php?method=" + regionimage); |
151 | 151 | ||
152 | MainServer.Instance.AddHTTPHandler(regionimage, OnHTTPGetMapImage); | 152 | MainServer.Instance.AddHTTPHandler(regionimage, OnHTTPGetMapImage); |
153 | MainServer.Instance.AddLLSDHandler( | 153 | MainServer.Instance.AddLLSDHandler( |
@@ -579,7 +579,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
579 | 579 | ||
580 | if (mreg != null) | 580 | if (mreg != null) |
581 | { | 581 | { |
582 | httpserver = "http://" + mreg.ExternalEndPoint.Address.ToString() + ":" + mreg.HttpPort + "/MAP/MapItems/" + regionhandle.ToString(); | 582 | httpserver = mreg.ServerURI + "MAP/MapItems/" + regionhandle.ToString(); |
583 | lock (m_cachedRegionMapItemsAddress) | 583 | lock (m_cachedRegionMapItemsAddress) |
584 | { | 584 | { |
585 | if (!m_cachedRegionMapItemsAddress.ContainsKey(regionhandle)) | 585 | if (!m_cachedRegionMapItemsAddress.ContainsKey(regionhandle)) |
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 268612e..f128aa2 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs | |||
@@ -82,7 +82,7 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
82 | 82 | ||
83 | public event DeRezObject OnDeRezObject; | 83 | public event DeRezObject OnDeRezObject; |
84 | public event Action<IClientAPI> OnRegionHandShakeReply; | 84 | public event Action<IClientAPI> OnRegionHandShakeReply; |
85 | public event GenericCall2 OnRequestWearables; | 85 | public event GenericCall1 OnRequestWearables; |
86 | public event GenericCall1 OnCompleteMovementToRegion; | 86 | public event GenericCall1 OnCompleteMovementToRegion; |
87 | public event UpdateAgent OnPreAgentUpdate; | 87 | public event UpdateAgent OnPreAgentUpdate; |
88 | public event UpdateAgent OnAgentUpdate; | 88 | public event UpdateAgent OnAgentUpdate; |
diff --git a/OpenSim/Region/Framework/Interfaces/IAvatarFactory.cs b/OpenSim/Region/Framework/Interfaces/IAvatarFactory.cs deleted file mode 100644 index c967f30..0000000 --- a/OpenSim/Region/Framework/Interfaces/IAvatarFactory.cs +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
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 | |||
28 | using OpenMetaverse; | ||
29 | using OpenSim.Framework; | ||
30 | |||
31 | namespace OpenSim.Region.Framework.Interfaces | ||
32 | { | ||
33 | public interface IAvatarFactory | ||
34 | { | ||
35 | bool TryGetAvatarAppearance(UUID avatarId, out AvatarAppearance appearance); | ||
36 | void UpdateDatabase(UUID userID, AvatarAppearance avatAppearance); | ||
37 | } | ||
38 | } | ||
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index f0ae45e..f77fb2c 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -119,7 +119,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
119 | 119 | ||
120 | protected IXMLRPC m_xmlrpcModule; | 120 | protected IXMLRPC m_xmlrpcModule; |
121 | protected IWorldComm m_worldCommModule; | 121 | protected IWorldComm m_worldCommModule; |
122 | protected IAvatarFactory m_AvatarFactory; | ||
123 | protected IConfigSource m_config; | 122 | protected IConfigSource m_config; |
124 | protected IRegionSerialiserModule m_serialiser; | 123 | protected IRegionSerialiserModule m_serialiser; |
125 | protected IDialogModule m_dialogModule; | 124 | protected IDialogModule m_dialogModule; |
@@ -399,11 +398,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
399 | 398 | ||
400 | public IAttachmentsModule AttachmentsModule { get; set; } | 399 | public IAttachmentsModule AttachmentsModule { get; set; } |
401 | 400 | ||
402 | public IAvatarFactory AvatarFactory | ||
403 | { | ||
404 | get { return m_AvatarFactory; } | ||
405 | } | ||
406 | |||
407 | public ICapabilitiesModule CapsModule | 401 | public ICapabilitiesModule CapsModule |
408 | { | 402 | { |
409 | get { return m_capsModule; } | 403 | get { return m_capsModule; } |
@@ -1159,7 +1153,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1159 | m_xmlrpcModule = RequestModuleInterface<IXMLRPC>(); | 1153 | m_xmlrpcModule = RequestModuleInterface<IXMLRPC>(); |
1160 | m_worldCommModule = RequestModuleInterface<IWorldComm>(); | 1154 | m_worldCommModule = RequestModuleInterface<IWorldComm>(); |
1161 | XferManager = RequestModuleInterface<IXfer>(); | 1155 | XferManager = RequestModuleInterface<IXfer>(); |
1162 | m_AvatarFactory = RequestModuleInterface<IAvatarFactory>(); | ||
1163 | AttachmentsModule = RequestModuleInterface<IAttachmentsModule>(); | 1156 | AttachmentsModule = RequestModuleInterface<IAttachmentsModule>(); |
1164 | m_serialiser = RequestModuleInterface<IRegionSerialiserModule>(); | 1157 | m_serialiser = RequestModuleInterface<IRegionSerialiserModule>(); |
1165 | m_dialogModule = RequestModuleInterface<IDialogModule>(); | 1158 | m_dialogModule = RequestModuleInterface<IDialogModule>(); |
@@ -3756,9 +3749,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
3756 | 3749 | ||
3757 | // We have to wait until the viewer contacts this region after receiving EAC. | 3750 | // We have to wait until the viewer contacts this region after receiving EAC. |
3758 | // That calls AddNewClient, which finally creates the ScenePresence | 3751 | // That calls AddNewClient, which finally creates the ScenePresence |
3752 | m_log.Debug("ICADU -> pre wait"); | ||
3759 | ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID); | 3753 | ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID); |
3754 | m_log.Debug("ICADU -> post wait"); | ||
3760 | if (childAgentUpdate != null) | 3755 | if (childAgentUpdate != null) |
3761 | { | 3756 | { |
3757 | m_log.Debug("ICADU -> not child agent!"); | ||
3762 | childAgentUpdate.ChildAgentDataUpdate(cAgentData); | 3758 | childAgentUpdate.ChildAgentDataUpdate(cAgentData); |
3763 | return true; | 3759 | return true; |
3764 | } | 3760 | } |
@@ -3774,7 +3770,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3774 | /// <returns>true if we handled it.</returns> | 3770 | /// <returns>true if we handled it.</returns> |
3775 | public virtual bool IncomingChildAgentDataUpdate(AgentPosition cAgentData) | 3771 | public virtual bool IncomingChildAgentDataUpdate(AgentPosition cAgentData) |
3776 | { | 3772 | { |
3777 | //m_log.Debug(" XXX Scene IncomingChildAgentDataUpdate POSITION in " + RegionInfo.RegionName); | 3773 | m_log.Debug(" XXX Scene IncomingChildAgentDataUpdate POSITION in " + RegionInfo.RegionName); |
3778 | ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID); | 3774 | ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID); |
3779 | if (childAgentUpdate != null) | 3775 | if (childAgentUpdate != null) |
3780 | { | 3776 | { |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 13d9964..1abd134 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -75,7 +75,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
75 | 75 | ||
76 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 76 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
77 | 77 | ||
78 | private static readonly byte[] BAKE_INDICES = new byte[] { 8, 9, 10, 11, 19, 20 }; | ||
79 | // private static readonly byte[] DEFAULT_TEXTURE = AvatarAppearance.GetDefaultTexture().GetBytes(); | 78 | // private static readonly byte[] DEFAULT_TEXTURE = AvatarAppearance.GetDefaultTexture().GetBytes(); |
80 | private static readonly Array DIR_CONTROL_FLAGS = Enum.GetValues(typeof(Dir_ControlFlags)); | 79 | private static readonly Array DIR_CONTROL_FLAGS = Enum.GetValues(typeof(Dir_ControlFlags)); |
81 | private static readonly Vector3 HEAD_ADJUSTMENT = new Vector3(0f, 0f, 0.3f); | 80 | private static readonly Vector3 HEAD_ADJUSTMENT = new Vector3(0f, 0f, 0.3f); |
@@ -137,8 +136,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
137 | 136 | ||
138 | private SendCourseLocationsMethod m_sendCourseLocationsMethod; | 137 | private SendCourseLocationsMethod m_sendCourseLocationsMethod; |
139 | 138 | ||
140 | private bool m_startAnimationSet; | ||
141 | |||
142 | //private Vector3 m_requestedSitOffset = new Vector3(); | 139 | //private Vector3 m_requestedSitOffset = new Vector3(); |
143 | 140 | ||
144 | private Vector3 m_LastFinitePos; | 141 | private Vector3 m_LastFinitePos; |
@@ -713,13 +710,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
713 | SetDirectionVectors(); | 710 | SetDirectionVectors(); |
714 | } | 711 | } |
715 | 712 | ||
713 | /* | ||
716 | public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, byte[] visualParams, | 714 | public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, byte[] visualParams, |
717 | AvatarWearable[] wearables) | 715 | AvatarWearable[] wearables) |
718 | : this(client, world, reginfo) | 716 | : this(client, world, reginfo) |
719 | { | 717 | { |
720 | m_appearance = new AvatarAppearance(m_uuid, wearables, visualParams); | 718 | m_appearance = new AvatarAppearance(m_uuid, wearables, visualParams); |
721 | } | 719 | } |
722 | 720 | */ | |
723 | public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, AvatarAppearance appearance) | 721 | public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, AvatarAppearance appearance) |
724 | : this(client, world, reginfo) | 722 | : this(client, world, reginfo) |
725 | { | 723 | { |
@@ -733,8 +731,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
733 | 731 | ||
734 | public void RegisterToEvents() | 732 | public void RegisterToEvents() |
735 | { | 733 | { |
736 | m_controllingClient.OnRequestWearables += SendWearables; | ||
737 | m_controllingClient.OnSetAppearance += SetAppearance; | ||
738 | m_controllingClient.OnCompleteMovementToRegion += CompleteMovement; | 734 | m_controllingClient.OnCompleteMovementToRegion += CompleteMovement; |
739 | //m_controllingClient.OnCompleteMovementToRegion += SendInitialData; | 735 | //m_controllingClient.OnCompleteMovementToRegion += SendInitialData; |
740 | m_controllingClient.OnAgentUpdate += HandleAgentUpdate; | 736 | m_controllingClient.OnAgentUpdate += HandleAgentUpdate; |
@@ -1068,7 +1064,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1068 | /// <summary> | 1064 | /// <summary> |
1069 | /// Sets avatar height in the phyiscs plugin | 1065 | /// Sets avatar height in the phyiscs plugin |
1070 | /// </summary> | 1066 | /// </summary> |
1071 | internal void SetHeight(float height) | 1067 | public void SetHeight(float height) |
1072 | { | 1068 | { |
1073 | m_avHeight = height; | 1069 | m_avHeight = height; |
1074 | if (PhysicsActor != null && !IsChildAgent) | 1070 | if (PhysicsActor != null && !IsChildAgent) |
@@ -1133,7 +1129,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1133 | if (friendsModule != null) | 1129 | if (friendsModule != null) |
1134 | friendsModule.SendFriendsOnlineIfNeeded(ControllingClient); | 1130 | friendsModule.SendFriendsOnlineIfNeeded(ControllingClient); |
1135 | } | 1131 | } |
1136 | |||
1137 | } | 1132 | } |
1138 | 1133 | ||
1139 | /// <summary> | 1134 | /// <summary> |
@@ -2392,9 +2387,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2392 | if (m_appearance.Texture == null) | 2387 | if (m_appearance.Texture == null) |
2393 | return; | 2388 | return; |
2394 | 2389 | ||
2395 | Vector3 pos = m_pos; | 2390 | if (IsChildAgent) |
2396 | pos.Z += m_appearance.HipOffset; | 2391 | { |
2397 | 2392 | m_log.WarnFormat("[SCENEPRESENCE] A child agent is attempting to send out avatar data"); | |
2393 | return; | ||
2394 | } | ||
2395 | |||
2398 | remoteAvatar.m_controllingClient.SendAvatarDataImmediate(this); | 2396 | remoteAvatar.m_controllingClient.SendAvatarDataImmediate(this); |
2399 | m_scene.StatsReporter.AddAgentUpdates(1); | 2397 | m_scene.StatsReporter.AddAgentUpdates(1); |
2400 | } | 2398 | } |
@@ -2437,6 +2435,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2437 | m_perfMonMS = Util.EnvironmentTickCount(); | 2435 | m_perfMonMS = Util.EnvironmentTickCount(); |
2438 | 2436 | ||
2439 | // only send update from root agents to other clients; children are only "listening posts" | 2437 | // only send update from root agents to other clients; children are only "listening posts" |
2438 | if (IsChildAgent) | ||
2439 | { | ||
2440 | m_log.Warn("[SCENEPRESENCE] attempt to send update from a childagent"); | ||
2441 | return; | ||
2442 | } | ||
2443 | |||
2440 | int count = 0; | 2444 | int count = 0; |
2441 | m_scene.ForEachScenePresence(delegate(ScenePresence sp) | 2445 | m_scene.ForEachScenePresence(delegate(ScenePresence sp) |
2442 | { | 2446 | { |
@@ -2460,29 +2464,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
2460 | // the inventory arrives | 2464 | // the inventory arrives |
2461 | // m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance); | 2465 | // m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance); |
2462 | 2466 | ||
2463 | Vector3 pos = m_pos; | ||
2464 | pos.Z += m_appearance.HipOffset; | ||
2465 | |||
2466 | m_controllingClient.SendAvatarDataImmediate(this); | 2467 | m_controllingClient.SendAvatarDataImmediate(this); |
2468 | m_controllingClient.SendAppearance(m_appearance.Owner,m_appearance.VisualParams,m_appearance.Texture.GetBytes()); | ||
2467 | 2469 | ||
2468 | SendInitialFullUpdateToAllClients(); | 2470 | SendInitialFullUpdateToAllClients(); |
2469 | } | 2471 | } |
2470 | 2472 | ||
2471 | /// <summary> | 2473 | /// <summary> |
2472 | /// Tell the client for this scene presence what items it should be wearing now | ||
2473 | /// </summary> | ||
2474 | public void SendWearables() | ||
2475 | { | ||
2476 | m_log.DebugFormat("[SCENE]: Received request for wearables of {0}", Name); | ||
2477 | |||
2478 | ControllingClient.SendWearables(m_appearance.Wearables, m_appearance.Serial++); | ||
2479 | } | ||
2480 | |||
2481 | /// <summary> | ||
2482 | /// | 2474 | /// |
2483 | /// </summary> | 2475 | /// </summary> |
2484 | public void SendAppearanceToAllOtherAgents() | 2476 | public void SendAppearanceToAllOtherAgents() |
2485 | { | 2477 | { |
2478 | // DEBUG ON | ||
2479 | m_log.WarnFormat("[SP] Send appearance from {0} to all other agents",m_uuid); | ||
2480 | // DEBUG OFF | ||
2486 | m_perfMonMS = Util.EnvironmentTickCount(); | 2481 | m_perfMonMS = Util.EnvironmentTickCount(); |
2487 | 2482 | ||
2488 | m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) | 2483 | m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) |
@@ -2502,87 +2497,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2502 | /// <param name="avatar"></param> | 2497 | /// <param name="avatar"></param> |
2503 | public void SendAppearanceToOtherAgent(ScenePresence avatar) | 2498 | public void SendAppearanceToOtherAgent(ScenePresence avatar) |
2504 | { | 2499 | { |
2500 | // DEBUG ON | ||
2501 | m_log.WarnFormat("[SP] Send appearance from {0} to {1}",m_uuid,avatar.ControllingClient.AgentId); | ||
2502 | // DEBUG OFF | ||
2505 | avatar.ControllingClient.SendAppearance( | 2503 | avatar.ControllingClient.SendAppearance( |
2506 | m_appearance.Owner, m_appearance.VisualParams, m_appearance.Texture.GetBytes()); | 2504 | m_appearance.Owner, m_appearance.VisualParams, m_appearance.Texture.GetBytes()); |
2507 | } | 2505 | } |
2508 | 2506 | ||
2509 | /// <summary> | ||
2510 | /// Set appearance data (textureentry and slider settings) received from the client | ||
2511 | /// </summary> | ||
2512 | /// <param name="texture"></param> | ||
2513 | /// <param name="visualParam"></param> | ||
2514 | public void SetAppearance(Primitive.TextureEntry textureEntry, byte[] visualParams) | ||
2515 | { | ||
2516 | if (m_physicsActor != null) | ||
2517 | { | ||
2518 | if (!IsChildAgent) | ||
2519 | { | ||
2520 | // This may seem like it's redundant, remove the avatar from the physics scene | ||
2521 | // just to add it back again, but it saves us from having to update | ||
2522 | // 3 variables 10 times a second. | ||
2523 | bool flyingTemp = m_physicsActor.Flying; | ||
2524 | RemoveFromPhysicalScene(); | ||
2525 | //m_scene.PhysicsScene.RemoveAvatar(m_physicsActor); | ||
2526 | |||
2527 | //PhysicsActor = null; | ||
2528 | |||
2529 | AddToPhysicalScene(flyingTemp); | ||
2530 | } | ||
2531 | } | ||
2532 | |||
2533 | #region Bake Cache Check | ||
2534 | |||
2535 | if (textureEntry != null) | ||
2536 | { | ||
2537 | for (int i = 0; i < BAKE_INDICES.Length; i++) | ||
2538 | { | ||
2539 | int j = BAKE_INDICES[i]; | ||
2540 | Primitive.TextureEntryFace face = textureEntry.FaceTextures[j]; | ||
2541 | |||
2542 | if (face != null && face.TextureID != AppearanceManager.DEFAULT_AVATAR_TEXTURE) | ||
2543 | { | ||
2544 | if (m_scene.AssetService.Get(face.TextureID.ToString()) == null) | ||
2545 | { | ||
2546 | m_log.Warn("[APPEARANCE]: Missing baked texture " + face.TextureID + " (" + j + ") for avatar " + this.Name); | ||
2547 | this.ControllingClient.SendRebakeAvatarTextures(face.TextureID); | ||
2548 | } | ||
2549 | } | ||
2550 | } | ||
2551 | |||
2552 | } | ||
2553 | |||
2554 | |||
2555 | #endregion Bake Cache Check | ||
2556 | |||
2557 | m_appearance.SetAppearance(textureEntry, visualParams); | ||
2558 | if (m_appearance.AvatarHeight > 0) | ||
2559 | SetHeight(m_appearance.AvatarHeight); | ||
2560 | |||
2561 | // This is not needed, because only the transient data changed | ||
2562 | //AvatarData adata = new AvatarData(m_appearance); | ||
2563 | //m_scene.AvatarService.SetAvatar(m_controllingClient.AgentId, adata); | ||
2564 | |||
2565 | SendAppearanceToAllOtherAgents(); | ||
2566 | if (!m_startAnimationSet) | ||
2567 | { | ||
2568 | Animator.UpdateMovementAnimations(); | ||
2569 | m_startAnimationSet = true; | ||
2570 | } | ||
2571 | |||
2572 | Vector3 pos = m_pos; | ||
2573 | pos.Z += m_appearance.HipOffset; | ||
2574 | |||
2575 | m_controllingClient.SendAvatarDataImmediate(this); | ||
2576 | } | ||
2577 | |||
2578 | public void SetWearable(int wearableId, AvatarWearable wearable) | ||
2579 | { | ||
2580 | m_appearance.SetWearable(wearableId, wearable); | ||
2581 | AvatarData adata = new AvatarData(m_appearance); | ||
2582 | m_scene.AvatarService.SetAvatar(m_controllingClient.AgentId, adata); | ||
2583 | m_controllingClient.SendWearables(m_appearance.Wearables, m_appearance.Serial++); | ||
2584 | } | ||
2585 | |||
2586 | // Because appearance setting is in a module, we actually need | 2507 | // Because appearance setting is in a module, we actually need |
2587 | // to give it access to our appearance directly, otherwise we | 2508 | // to give it access to our appearance directly, otherwise we |
2588 | // get a synchronization issue. | 2509 | // get a synchronization issue. |
@@ -2925,7 +2846,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2925 | 2846 | ||
2926 | public void ChildAgentDataUpdate(AgentData cAgentData) | 2847 | public void ChildAgentDataUpdate(AgentData cAgentData) |
2927 | { | 2848 | { |
2928 | //m_log.Debug(" >>> ChildAgentDataUpdate <<< " + Scene.RegionInfo.RegionName); | 2849 | m_log.Debug(" >>> ChildAgentDataUpdate <<< " + Scene.RegionInfo.RegionName); |
2929 | if (!IsChildAgent) | 2850 | if (!IsChildAgent) |
2930 | return; | 2851 | return; |
2931 | 2852 | ||
@@ -2976,6 +2897,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2976 | 2897 | ||
2977 | public void CopyTo(AgentData cAgent) | 2898 | public void CopyTo(AgentData cAgent) |
2978 | { | 2899 | { |
2900 | cAgent.CallbackURI = m_callbackURI; | ||
2901 | |||
2979 | cAgent.AgentID = UUID; | 2902 | cAgent.AgentID = UUID; |
2980 | cAgent.RegionID = Scene.RegionInfo.RegionID; | 2903 | cAgent.RegionID = Scene.RegionInfo.RegionID; |
2981 | 2904 | ||
@@ -3015,6 +2938,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
3015 | 2938 | ||
3016 | cAgent.AlwaysRun = m_setAlwaysRun; | 2939 | cAgent.AlwaysRun = m_setAlwaysRun; |
3017 | 2940 | ||
2941 | cAgent.Appearance = new AvatarAppearance(m_appearance); | ||
2942 | |||
2943 | /* | ||
3018 | try | 2944 | try |
3019 | { | 2945 | { |
3020 | // We might not pass the Wearables in all cases... | 2946 | // We might not pass the Wearables in all cases... |
@@ -3054,14 +2980,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
3054 | { | 2980 | { |
3055 | //m_log.DebugFormat("[SCENE PRESENCE]: attachments {0}", attPoints.Count); | 2981 | //m_log.DebugFormat("[SCENE PRESENCE]: attachments {0}", attPoints.Count); |
3056 | int i = 0; | 2982 | int i = 0; |
3057 | AttachmentData[] attachs = new AttachmentData[attPoints.Count]; | 2983 | AvatarAttachment[] attachs = new AvatarAttachment[attPoints.Count]; |
3058 | foreach (int point in attPoints) | 2984 | foreach (int point in attPoints) |
3059 | { | 2985 | { |
3060 | attachs[i++] = new AttachmentData(point, m_appearance.GetAttachedItem(point), m_appearance.GetAttachedAsset(point)); | 2986 | attachs[i++] = new AvatarAttachment(point, m_appearance.GetAttachedItem(point), m_appearance.GetAttachedAsset(point)); |
3061 | } | 2987 | } |
3062 | cAgent.Attachments = attachs; | 2988 | cAgent.Attachments = attachs; |
3063 | } | 2989 | } |
3064 | 2990 | */ | |
3065 | lock (scriptedcontrols) | 2991 | lock (scriptedcontrols) |
3066 | { | 2992 | { |
3067 | ControllerData[] controls = new ControllerData[scriptedcontrols.Count]; | 2993 | ControllerData[] controls = new ControllerData[scriptedcontrols.Count]; |
@@ -3088,6 +3014,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
3088 | 3014 | ||
3089 | public void CopyFrom(AgentData cAgent) | 3015 | public void CopyFrom(AgentData cAgent) |
3090 | { | 3016 | { |
3017 | // DEBUG ON | ||
3018 | m_log.ErrorFormat("[SCENEPRESENCE] CALLING COPYFROM"); | ||
3019 | // DEBUG OFF | ||
3091 | m_originRegionID = cAgent.RegionID; | 3020 | m_originRegionID = cAgent.RegionID; |
3092 | 3021 | ||
3093 | m_callbackURI = cAgent.CallbackURI; | 3022 | m_callbackURI = cAgent.CallbackURI; |
@@ -3113,6 +3042,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
3113 | m_godLevel = cAgent.GodLevel; | 3042 | m_godLevel = cAgent.GodLevel; |
3114 | m_setAlwaysRun = cAgent.AlwaysRun; | 3043 | m_setAlwaysRun = cAgent.AlwaysRun; |
3115 | 3044 | ||
3045 | m_appearance = new AvatarAppearance(cAgent.Appearance); | ||
3046 | |||
3047 | /* | ||
3116 | uint i = 0; | 3048 | uint i = 0; |
3117 | try | 3049 | try |
3118 | { | 3050 | { |
@@ -3125,15 +3057,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
3125 | UUID assetId = cAgent.Wearables[n + 1]; | 3057 | UUID assetId = cAgent.Wearables[n + 1]; |
3126 | wears[i++] = new AvatarWearable(itemId, assetId); | 3058 | wears[i++] = new AvatarWearable(itemId, assetId); |
3127 | } | 3059 | } |
3128 | m_appearance.Wearables = wears; | 3060 | // m_appearance.Wearables = wears; |
3129 | Primitive.TextureEntry te; | 3061 | Primitive.TextureEntry textures = null; |
3130 | if (cAgent.AgentTextures != null && cAgent.AgentTextures.Length > 1) | 3062 | if (cAgent.AgentTextures != null && cAgent.AgentTextures.Length > 1) |
3131 | te = new Primitive.TextureEntry(cAgent.AgentTextures, 0, cAgent.AgentTextures.Length); | 3063 | textures = new Primitive.TextureEntry(cAgent.AgentTextures, 0, cAgent.AgentTextures.Length); |
3132 | else | 3064 | |
3133 | te = AvatarAppearance.GetDefaultTexture(); | 3065 | byte[] visuals = null; |
3134 | if ((cAgent.VisualParams == null) || (cAgent.VisualParams.Length < AvatarAppearance.VISUALPARAM_COUNT)) | 3066 | |
3135 | cAgent.VisualParams = AvatarAppearance.GetDefaultVisualParams(); | 3067 | if ((cAgent.VisualParams != null) && (cAgent.VisualParams.Length < AvatarAppearance.VISUALPARAM_COUNT)) |
3136 | m_appearance.SetAppearance(te, (byte[])cAgent.VisualParams.Clone()); | 3068 | visuals = (byte[])cAgent.VisualParams.Clone(); |
3069 | |||
3070 | m_appearance = new AvatarAppearance(cAgent.AgentID,wears,textures,visuals); | ||
3137 | } | 3071 | } |
3138 | catch (Exception e) | 3072 | catch (Exception e) |
3139 | { | 3073 | { |
@@ -3146,14 +3080,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
3146 | if (cAgent.Attachments != null) | 3080 | if (cAgent.Attachments != null) |
3147 | { | 3081 | { |
3148 | m_appearance.ClearAttachments(); | 3082 | m_appearance.ClearAttachments(); |
3149 | foreach (AttachmentData att in cAgent.Attachments) | 3083 | foreach (AvatarAttachment att in cAgent.Attachments) |
3150 | { | 3084 | { |
3151 | m_appearance.SetAttachment(att.AttachPoint, att.ItemID, att.AssetID); | 3085 | m_appearance.SetAttachment(att.AttachPoint, att.ItemID, att.AssetID); |
3152 | } | 3086 | } |
3153 | } | 3087 | } |
3154 | } | 3088 | } |
3155 | catch { } | 3089 | catch { } |
3156 | 3090 | */ | |
3157 | try | 3091 | try |
3158 | { | 3092 | { |
3159 | lock (scriptedcontrols) | 3093 | lock (scriptedcontrols) |
@@ -3722,15 +3656,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
3722 | return; | 3656 | return; |
3723 | } | 3657 | } |
3724 | 3658 | ||
3725 | List<int> attPoints = m_appearance.GetAttachedPoints(); | 3659 | List<AvatarAttachment> attachments = m_appearance.GetAttachments(); |
3726 | foreach (int p in attPoints) | 3660 | foreach (AvatarAttachment attach in attachments) |
3727 | { | 3661 | { |
3728 | if (m_isDeleted) | 3662 | if (m_isDeleted) |
3729 | return; | 3663 | return; |
3730 | 3664 | ||
3731 | UUID itemID = m_appearance.GetAttachedItem(p); | 3665 | int p = attach.AttachPoint; |
3666 | UUID itemID = attach.ItemID; | ||
3732 | 3667 | ||
3733 | //UUID assetID = m_appearance.GetAttachedAsset(p); | 3668 | //UUID assetID = attach.AssetID; |
3734 | // For some reason assetIDs are being written as Zero's in the DB -- need to track tat down | 3669 | // For some reason assetIDs are being written as Zero's in the DB -- need to track tat down |
3735 | // But they're not used anyway, the item is being looked up for now, so let's proceed. | 3670 | // But they're not used anyway, the item is being looked up for now, so let's proceed. |
3736 | //if (UUID.Zero == assetID) | 3671 | //if (UUID.Zero == assetID) |
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 159af79..fc17192 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs | |||
@@ -676,7 +676,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
676 | public event TeleportLandmarkRequest OnTeleportLandmarkRequest; | 676 | public event TeleportLandmarkRequest OnTeleportLandmarkRequest; |
677 | public event DeRezObject OnDeRezObject; | 677 | public event DeRezObject OnDeRezObject; |
678 | public event Action<IClientAPI> OnRegionHandShakeReply; | 678 | public event Action<IClientAPI> OnRegionHandShakeReply; |
679 | public event GenericCall2 OnRequestWearables; | 679 | public event GenericCall1 OnRequestWearables; |
680 | public event GenericCall1 OnCompleteMovementToRegion; | 680 | public event GenericCall1 OnCompleteMovementToRegion; |
681 | public event UpdateAgent OnPreAgentUpdate; | 681 | public event UpdateAgent OnPreAgentUpdate; |
682 | public event UpdateAgent OnAgentUpdate; | 682 | public event UpdateAgent OnAgentUpdate; |
@@ -899,7 +899,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
899 | Scene scene = (Scene)Scene; | 899 | Scene scene = (Scene)Scene; |
900 | AvatarAppearance appearance; | 900 | AvatarAppearance appearance; |
901 | scene.GetAvatarAppearance(this, out appearance); | 901 | scene.GetAvatarAppearance(this, out appearance); |
902 | OnSetAppearance(appearance.Texture, (byte[])appearance.VisualParams.Clone()); | 902 | OnSetAppearance(this, appearance.Texture, (byte[])appearance.VisualParams.Clone()); |
903 | } | 903 | } |
904 | 904 | ||
905 | public void SendRegionHandshake(RegionInfo regionInfo, RegionHandshakeArgs args) | 905 | public void SendRegionHandshake(RegionInfo regionInfo, RegionHandshakeArgs args) |
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs index 0786bd9..922eaaf 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs | |||
@@ -29,6 +29,7 @@ using System.Collections; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Security; | 30 | using System.Security; |
31 | using OpenMetaverse; | 31 | using OpenMetaverse; |
32 | using OpenSim.Framework; | ||
32 | using OpenSim.Region.Framework.Scenes; | 33 | using OpenSim.Region.Framework.Scenes; |
33 | using OpenSim.Region.Framework.Interfaces; | 34 | using OpenSim.Region.Framework.Interfaces; |
34 | 35 | ||
@@ -81,16 +82,12 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
81 | get { | 82 | get { |
82 | List<IAvatarAttachment> attachments = new List<IAvatarAttachment>(); | 83 | List<IAvatarAttachment> attachments = new List<IAvatarAttachment>(); |
83 | 84 | ||
84 | Hashtable internalAttachments = GetSP().Appearance.GetAttachments(); | 85 | List<AvatarAttachment> internalAttachments = GetSP().Appearance.GetAttachments(); |
85 | if (internalAttachments != null) | 86 | foreach (AvatarAttachment attach in internalAttachments) |
86 | { | 87 | { |
87 | foreach (DictionaryEntry element in internalAttachments) | 88 | attachments.Add(new SPAvatarAttachment(m_rootScene, this, attach.AttachPoint, |
88 | { | 89 | new UUID(attach.ItemID), |
89 | Hashtable attachInfo = (Hashtable)element.Value; | 90 | new UUID(attach.AssetID), m_security)); |
90 | attachments.Add(new SPAvatarAttachment(m_rootScene, this, (int) element.Key, | ||
91 | new UUID((string) attachInfo["item"]), | ||
92 | new UUID((string) attachInfo["asset"]), m_security)); | ||
93 | } | ||
94 | } | 91 | } |
95 | 92 | ||
96 | return attachments.ToArray(); | 93 | return attachments.ToArray(); |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index fae12b6..6928c4e 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | |||
@@ -188,7 +188,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
188 | 188 | ||
189 | public event DeRezObject OnDeRezObject; | 189 | public event DeRezObject OnDeRezObject; |
190 | public event Action<IClientAPI> OnRegionHandShakeReply; | 190 | public event Action<IClientAPI> OnRegionHandShakeReply; |
191 | public event GenericCall2 OnRequestWearables; | 191 | public event GenericCall1 OnRequestWearables; |
192 | public event GenericCall1 OnCompleteMovementToRegion; | 192 | public event GenericCall1 OnCompleteMovementToRegion; |
193 | public event UpdateAgent OnPreAgentUpdate; | 193 | public event UpdateAgent OnPreAgentUpdate; |
194 | public event UpdateAgent OnAgentUpdate; | 194 | public event UpdateAgent OnAgentUpdate; |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index ab0be77..c471636 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | |||
@@ -64,15 +64,13 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
64 | if (m_appearanceCache.ContainsKey(target)) | 64 | if (m_appearanceCache.ContainsKey(target)) |
65 | return m_appearanceCache[target]; | 65 | return m_appearanceCache[target]; |
66 | 66 | ||
67 | AvatarData adata = scene.AvatarService.GetAvatar(target); | 67 | AvatarAppearance appearance = scene.AvatarService.GetAppearance(target); |
68 | if (adata != null) | 68 | if (appearance != null) |
69 | { | 69 | { |
70 | AvatarAppearance x = adata.ToAvatarAppearance(target); | 70 | m_appearanceCache.Add(target, appearance); |
71 | 71 | return appearance; | |
72 | m_appearanceCache.Add(target, x); | ||
73 | |||
74 | return x; | ||
75 | } | 72 | } |
73 | |||
76 | return new AvatarAppearance(); | 74 | return new AvatarAppearance(); |
77 | } | 75 | } |
78 | 76 | ||
@@ -169,7 +167,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
169 | { | 167 | { |
170 | AvatarAppearance x = GetAppearance(p_cloneAppearanceFrom, p_scene); | 168 | AvatarAppearance x = GetAppearance(p_cloneAppearanceFrom, p_scene); |
171 | 169 | ||
172 | sp.SetAppearance(x.Texture, (byte[])x.VisualParams.Clone()); | 170 | sp.Appearance.SetTextureEntries(x.Texture); |
171 | sp.Appearance.SetVisualParams((byte[])x.VisualParams.Clone()); | ||
172 | sp.SendAppearanceToAllOtherAgents(); | ||
173 | } | 173 | } |
174 | 174 | ||
175 | m_avatars.Add(npcAvatar.AgentId, npcAvatar); | 175 | m_avatars.Add(npcAvatar.AgentId, npcAvatar); |