aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Application/OpenSim.cs5
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs22
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs12
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs77
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs22
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs13
-rw-r--r--OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs64
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs4
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs4
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs4
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs7
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs19
-rw-r--r--OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs98
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs20
16 files changed, 185 insertions, 190 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index edbae59..5969be0 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -264,9 +264,10 @@ namespace OpenSim
264 LoadOar); 264 LoadOar);
265 265
266 m_console.Commands.AddCommand("region", false, "save oar", 266 m_console.Commands.AddCommand("region", false, "save oar",
267 "save oar [<OAR path>]", 267 "save oar [-v|version=N] [<OAR path>]",
268 "Save a region's data to an OAR archive.", 268 "Save a region's data to an OAR archive.",
269 "The OAR path must be a filesystem path." 269 "-v|version=N generates scene objects as per older versions of the serialization (e.g. -v=0)" + Environment.NewLine
270 + "The OAR path must be a filesystem path."
270 + " If this is not given then the oar is saved to region.oar in the current directory.", 271 + " If this is not given then the oar is saved to region.oar in the current directory.",
271 SaveOar); 272 SaveOar);
272 273
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index b532cd4..4c9011a 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -3417,20 +3417,29 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3417 aw.AgentData.SerialNum = (uint)serial; 3417 aw.AgentData.SerialNum = (uint)serial;
3418 aw.AgentData.SessionID = m_sessionId; 3418 aw.AgentData.SessionID = m_sessionId;
3419 3419
3420 int count = 0;
3421 for (int i = 0; i < wearables.Length; i++)
3422 count += wearables[i].Count;
3423
3420 // TODO: don't create new blocks if recycling an old packet 3424 // TODO: don't create new blocks if recycling an old packet
3421 aw.WearableData = new AgentWearablesUpdatePacket.WearableDataBlock[13]; 3425 aw.WearableData = new AgentWearablesUpdatePacket.WearableDataBlock[count];
3422 AgentWearablesUpdatePacket.WearableDataBlock awb; 3426 AgentWearablesUpdatePacket.WearableDataBlock awb;
3427 int idx = 0;
3423 for (int i = 0; i < wearables.Length; i++) 3428 for (int i = 0; i < wearables.Length; i++)
3424 { 3429 {
3425 awb = new AgentWearablesUpdatePacket.WearableDataBlock(); 3430 for (int j = 0; j < wearables[i].Count; j++)
3426 awb.WearableType = (byte)i; 3431 {
3427 awb.AssetID = wearables[i].AssetID; 3432 awb = new AgentWearablesUpdatePacket.WearableDataBlock();
3428 awb.ItemID = wearables[i].ItemID; 3433 awb.WearableType = (byte)i;
3429 aw.WearableData[i] = awb; 3434 awb.AssetID = wearables[i][j].AssetID;
3435 awb.ItemID = wearables[i][j].ItemID;
3436 aw.WearableData[idx] = awb;
3437 idx++;
3430 3438
3431// m_log.DebugFormat( 3439// m_log.DebugFormat(
3432// "[APPEARANCE]: Sending wearable item/asset {0} {1} (index {2}) for {3}", 3440// "[APPEARANCE]: Sending wearable item/asset {0} {1} (index {2}) for {3}",
3433// awb.ItemID, awb.AssetID, i, Name); 3441// awb.ItemID, awb.AssetID, i, Name);
3442 }
3434 } 3443 }
3435 3444
3436 OutPacket(aw, ThrottleOutPacketType.Task); 3445 OutPacket(aw, ThrottleOutPacketType.Task);
@@ -5759,6 +5768,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5759 AvatarWearingArgs wearingArgs = new AvatarWearingArgs(); 5768 AvatarWearingArgs wearingArgs = new AvatarWearingArgs();
5760 for (int i = 0; i < nowWearing.WearableData.Length; i++) 5769 for (int i = 0; i < nowWearing.WearableData.Length; i++)
5761 { 5770 {
5771 m_log.DebugFormat("[XXX]: Wearable type {0} item {1}", nowWearing.WearableData[i].WearableType, nowWearing.WearableData[i].ItemID);
5762 AvatarWearingArgs.Wearable wearable = 5772 AvatarWearingArgs.Wearable wearable =
5763 new AvatarWearingArgs.Wearable(nowWearing.WearableData[i].ItemID, 5773 new AvatarWearingArgs.Wearable(nowWearing.WearableData[i].ItemID,
5764 nowWearing.WearableData[i].WearableType); 5774 nowWearing.WearableData[i].WearableType);
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
index e2cda6d..b8c692f 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
@@ -183,7 +183,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
183 IConfig config = configSource.Configs["ClientStack.LindenUDP"]; 183 IConfig config = configSource.Configs["ClientStack.LindenUDP"];
184 if (config != null) 184 if (config != null)
185 { 185 {
186 m_asyncPacketHandling = config.GetBoolean("async_packet_handling", false); 186 m_asyncPacketHandling = config.GetBoolean("async_packet_handling", true);
187 m_recvBufferSize = config.GetInt("client_socket_rcvbuf_size", 0); 187 m_recvBufferSize = config.GetInt("client_socket_rcvbuf_size", 0);
188 sceneThrottleBps = config.GetInt("scene_throttle_max_bps", 0); 188 sceneThrottleBps = config.GetInt("scene_throttle_max_bps", 0);
189 189
@@ -615,8 +615,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
615 615
616 // UseCircuitCode handling 616 // UseCircuitCode handling
617 if (packet.Type == PacketType.UseCircuitCode) 617 if (packet.Type == PacketType.UseCircuitCode)
618 { 618 {
619 m_log.Debug("[LLUDPSERVER]: Handling UseCircuitCode packet from " + buffer.RemoteEndPoint);
620 object[] array = new object[] { buffer, packet }; 619 object[] array = new object[] { buffer, packet };
621 620
622 if (m_asyncPacketHandling) 621 if (m_asyncPacketHandling)
@@ -827,9 +826,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
827 826
828 private void HandleUseCircuitCode(object o) 827 private void HandleUseCircuitCode(object o)
829 { 828 {
829 DateTime startTime = DateTime.Now;
830 object[] array = (object[])o; 830 object[] array = (object[])o;
831 UDPPacketBuffer buffer = (UDPPacketBuffer)array[0]; 831 UDPPacketBuffer buffer = (UDPPacketBuffer)array[0];
832 UseCircuitCodePacket packet = (UseCircuitCodePacket)array[1]; 832 UseCircuitCodePacket packet = (UseCircuitCodePacket)array[1];
833
834 m_log.DebugFormat("[LLUDPSERVER]: Handling UseCircuitCode request from {0}", buffer.RemoteEndPoint);
833 835
834 IPEndPoint remoteEndPoint = (IPEndPoint)buffer.RemoteEndPoint; 836 IPEndPoint remoteEndPoint = (IPEndPoint)buffer.RemoteEndPoint;
835 837
@@ -838,6 +840,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
838 840
839 // Acknowledge the UseCircuitCode packet 841 // Acknowledge the UseCircuitCode packet
840 SendAckImmediate(remoteEndPoint, packet.Header.Sequence); 842 SendAckImmediate(remoteEndPoint, packet.Header.Sequence);
843
844 m_log.DebugFormat(
845 "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms",
846 buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds);
841 } 847 }
842 848
843 private void SendAckImmediate(IPEndPoint remoteEndpoint, uint sequenceNumber) 849 private void SendAckImmediate(IPEndPoint remoteEndpoint, uint sequenceNumber)
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
index bfbbcf8..7f482cb 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
@@ -117,7 +117,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
117 ScenePresence sp = m_scene.GetScenePresence(client.AgentId); 117 ScenePresence sp = m_scene.GetScenePresence(client.AgentId);
118 if (sp == null) 118 if (sp == null)
119 { 119 {
120 m_log.WarnFormat("[AVFACTORY] SetAppearance unable to find presence for {0}",client.AgentId); 120 m_log.WarnFormat("[AVATAR FACTORY MODULE]: SetAppearance unable to find presence for {0}", client.AgentId);
121 return false; 121 return false;
122 } 122 }
123 123
@@ -147,14 +147,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
147 /// <param name="visualParam"></param> 147 /// <param name="visualParam"></param>
148 public void SetAppearance(IClientAPI client, Primitive.TextureEntry textureEntry, byte[] visualParams) 148 public void SetAppearance(IClientAPI client, Primitive.TextureEntry textureEntry, byte[] visualParams)
149 { 149 {
150// DEBUG ON 150// m_log.WarnFormat("[AVATAR FACTORY MODULE]: SetAppearance for {0}",client.AgentId);
151 m_log.WarnFormat("[AVFACTORY] SetAppearance for {0}",client.AgentId);
152// DEBUG OFF
153 151
154 ScenePresence sp = m_scene.GetScenePresence(client.AgentId); 152 ScenePresence sp = m_scene.GetScenePresence(client.AgentId);
155 if (sp == null) 153 if (sp == null)
156 { 154 {
157 m_log.WarnFormat("[AVFACTORY] SetAppearance unable to find presence for {0}",client.AgentId); 155 m_log.WarnFormat("[AVATAR FACTORY MODULE]: SetAppearance unable to find presence for {0}",client.AgentId);
158 return; 156 return;
159 } 157 }
160 158
@@ -212,8 +210,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
212 { 210 {
213 if (m_scene.AssetService.Get(textureID.ToString()) == null) 211 if (m_scene.AssetService.Get(textureID.ToString()) == null)
214 { 212 {
215 m_log.WarnFormat("[AVFACTORY]: Missing baked texture {0} ({1}) for avatar {2}", 213 m_log.WarnFormat("[AVATAR FACTORY MODULE]: Missing baked texture {0} ({1}) for avatar {2}",
216 textureID,idx,client.Name); 214 textureID, idx, client.Name);
217 return false; 215 return false;
218 } 216 }
219 return true; 217 return true;
@@ -223,9 +221,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
223 221
224 public void QueueAppearanceSend(UUID agentid) 222 public void QueueAppearanceSend(UUID agentid)
225 { 223 {
226// DEBUG ON 224// m_log.WarnFormat("[AVATAR FACTORY MODULE]: Queue appearance send for {0}",agentid);
227 m_log.WarnFormat("[AVFACTORY] Queue appearance send for {0}",agentid);
228// DEBUG OFF
229 225
230 // 100 nanoseconds (ticks) we should wait 226 // 100 nanoseconds (ticks) we should wait
231 long timestamp = DateTime.Now.Ticks + Convert.ToInt64(m_sendtime * 10000000); 227 long timestamp = DateTime.Now.Ticks + Convert.ToInt64(m_sendtime * 10000000);
@@ -238,9 +234,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
238 234
239 public void QueueAppearanceSave(UUID agentid) 235 public void QueueAppearanceSave(UUID agentid)
240 { 236 {
241// DEBUG ON 237// m_log.WarnFormat("[AVATAR FACTORY MODULE]: Queue appearance save for {0}",agentid);
242 m_log.WarnFormat("[AVFACTORY] Queue appearance save for {0}",agentid);
243// DEBUG OFF
244 238
245 // 100 nanoseconds (ticks) we should wait 239 // 100 nanoseconds (ticks) we should wait
246 long timestamp = DateTime.Now.Ticks + Convert.ToInt64(m_savetime * 10000000); 240 long timestamp = DateTime.Now.Ticks + Convert.ToInt64(m_savetime * 10000000);
@@ -256,13 +250,11 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
256 ScenePresence sp = m_scene.GetScenePresence(agentid); 250 ScenePresence sp = m_scene.GetScenePresence(agentid);
257 if (sp == null) 251 if (sp == null)
258 { 252 {
259 m_log.WarnFormat("[AVFACTORY] Agent {0} no longer in the scene",agentid); 253 m_log.WarnFormat("[AVATAR FACTORY MODULE]: Agent {0} no longer in the scene", agentid);
260 return; 254 return;
261 } 255 }
262 256
263// DEBUG ON 257// m_log.WarnFormat("[AVATAR FACTORY MODULE]: Handle appearance send for {0}", agentid);
264 m_log.WarnFormat("[AVFACTORY] Handle appearance send for {0}",agentid);
265// DEBUG OFF
266 258
267 // Send the appearance to everyone in the scene 259 // Send the appearance to everyone in the scene
268 sp.SendAppearanceToAllOtherAgents(); 260 sp.SendAppearanceToAllOtherAgents();
@@ -288,7 +280,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
288 ScenePresence sp = m_scene.GetScenePresence(agentid); 280 ScenePresence sp = m_scene.GetScenePresence(agentid);
289 if (sp == null) 281 if (sp == null)
290 { 282 {
291 m_log.WarnFormat("[AVFACTORY] Agent {0} no longer in the scene",agentid); 283 m_log.WarnFormat("[AVATAR FACTORY MODULE]: Agent {0} no longer in the scene", agentid);
292 return; 284 return;
293 } 285 }
294 286
@@ -339,13 +331,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
339 ScenePresence sp = m_scene.GetScenePresence(client.AgentId); 331 ScenePresence sp = m_scene.GetScenePresence(client.AgentId);
340 if (sp == null) 332 if (sp == null)
341 { 333 {
342 m_log.WarnFormat("[AVFACTORY] SendWearables unable to find presence for {0}",client.AgentId); 334 m_log.WarnFormat("[AVATAR FACTORY MODULE]: SendWearables unable to find presence for {0}", client.AgentId);
343 return; 335 return;
344 } 336 }
345 337
346// DEBUG ON 338// m_log.WarnFormat("[AVATAR FACTORY MODULE]: Received request for wearables of {0}", client.AgentId);
347 m_log.WarnFormat("[AVFACTORY]: Received request for wearables of {0}", client.AgentId); 339
348// DEBUG OFF
349 client.SendWearables(sp.Appearance.Wearables,sp.Appearance.Serial++); 340 client.SendWearables(sp.Appearance.Wearables,sp.Appearance.Serial++);
350 } 341 }
351 342
@@ -359,25 +350,22 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
359 ScenePresence sp = m_scene.GetScenePresence(client.AgentId); 350 ScenePresence sp = m_scene.GetScenePresence(client.AgentId);
360 if (sp == null) 351 if (sp == null)
361 { 352 {
362 m_log.WarnFormat("[AVFACTORY] AvatarIsWearing unable to find presence for {0}",client.AgentId); 353 m_log.WarnFormat("[AVATAR FACTORY MODULE]: AvatarIsWearing unable to find presence for {0}", client.AgentId);
363 return; 354 return;
364 } 355 }
365 356
366// DEBUG ON 357// m_log.WarnFormat("[AVATAR FACTORY MODULE]: AvatarIsWearing called for {0}",client.AgentId);
367 m_log.WarnFormat("[AVFACTORY]: AvatarIsWearing called for {0}",client.AgentId);
368// DEBUG OFF
369 358
370 AvatarAppearance avatAppearance = new AvatarAppearance(sp.Appearance); 359 AvatarAppearance avatAppearance = new AvatarAppearance(sp.Appearance, false);
371 360
372 foreach (AvatarWearingArgs.Wearable wear in e.NowWearing) 361 foreach (AvatarWearingArgs.Wearable wear in e.NowWearing)
373 { 362 {
374 if (wear.Type < AvatarWearable.MAX_WEARABLES) 363 if (wear.Type < AvatarWearable.MAX_WEARABLES)
375 { 364 avatAppearance.Wearables[wear.Type].Add(wear.ItemID,UUID.Zero);
376 AvatarWearable newWearable = new AvatarWearable(wear.ItemID,UUID.Zero);
377 avatAppearance.SetWearable(wear.Type, newWearable);
378 }
379 } 365 }
380 366
367 avatAppearance.GetAssetsFrom(sp.Appearance);
368
381 // This could take awhile since it needs to pull inventory 369 // This could take awhile since it needs to pull inventory
382 SetAppearanceAssets(sp.UUID, ref avatAppearance); 370 SetAppearanceAssets(sp.UUID, ref avatAppearance);
383 371
@@ -393,34 +381,35 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
393 { 381 {
394 for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++) 382 for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++)
395 { 383 {
396 if (appearance.Wearables[i].ItemID == UUID.Zero) 384 for (int j = 0 ; j < appearance.Wearables[j].Count ; j ++ )
397 {
398 appearance.Wearables[i].AssetID = UUID.Zero;
399 }
400 else
401 { 385 {
402 InventoryItemBase baseItem = new InventoryItemBase(appearance.Wearables[i].ItemID, userID); 386 if (appearance.Wearables[i][j].ItemID == UUID.Zero)
387 continue;
388
389 // Ignore ruth's assets
390 if (appearance.Wearables[i][j].ItemID == AvatarWearable.DefaultWearables[i][0].ItemID)
391 continue;
392 InventoryItemBase baseItem = new InventoryItemBase(appearance.Wearables[i][j].ItemID, userID);
403 baseItem = invService.GetItem(baseItem); 393 baseItem = invService.GetItem(baseItem);
404 394
405 if (baseItem != null) 395 if (baseItem != null)
406 { 396 {
407 appearance.Wearables[i].AssetID = baseItem.AssetID; 397 appearance.Wearables[i].Add(appearance.Wearables[i][j].ItemID, baseItem.AssetID);
408 } 398 }
409 else 399 else
410 { 400 {
411 m_log.ErrorFormat( 401 m_log.ErrorFormat(
412 "[AVFACTORY]: Can't find inventory item {0} for {1}, setting to default", 402 "[AVATAR FACTORY MODULE]: Can't find inventory item {0} for {1}, setting to default",
413 appearance.Wearables[i].ItemID, (WearableType)i); 403 appearance.Wearables[i][j].ItemID, (WearableType)i);
414 404
415 appearance.Wearables[i].ItemID = UUID.Zero; 405 appearance.Wearables[i].RemoveItem(appearance.Wearables[i][j].ItemID);
416 appearance.Wearables[i].AssetID = UUID.Zero;
417 } 406 }
418 } 407 }
419 } 408 }
420 } 409 }
421 else 410 else
422 { 411 {
423 m_log.WarnFormat("[AVFACTORY]: user {0} has no inventory, appearance isn't going to work", userID); 412 m_log.WarnFormat("[AVATAR FACTORY MODULE]: user {0} has no inventory, appearance isn't going to work", userID);
424 } 413 }
425 } 414 }
426 } 415 }
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
index 9080e1c..d81703a 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
@@ -173,28 +173,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
173 173
174 InventoryCollection contents 174 InventoryCollection contents
175 = m_scene.InventoryService.GetFolderContent(inventoryFolder.Owner, inventoryFolder.ID); 175 = m_scene.InventoryService.GetFolderContent(inventoryFolder.Owner, inventoryFolder.ID);
176 //List<InventoryFolderImpl> childFolders = inventoryFolder.RequestListOfFolderImpls();
177 //List<InventoryItemBase> items = inventoryFolder.RequestListOfItems();
178
179 /*
180 Dictionary identicalFolderNames = new Dictionary<string, int>();
181
182 foreach (InventoryFolderImpl folder in inventories)
183 {
184 if (!identicalFolderNames.ContainsKey(folder.Name))
185 identicalFolderNames[folder.Name] = 0;
186 else
187 identicalFolderNames[folder.Name] = identicalFolderNames[folder.Name]++;
188
189 int folderNameNumber = identicalFolderName[folder.Name];
190
191 SaveInvDir(
192 folder,
193 string.Format(
194 "{0}{1}{2}/",
195 path, ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR, folderNameNumber));
196 }
197 */
198 176
199 foreach (InventoryFolderBase childFolder in contents.Folders) 177 foreach (InventoryFolderBase childFolder in contents.Folders)
200 { 178 {
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 2921b0d..3c7638d 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -193,10 +193,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
193 GridRegion finalDestination = GetFinalDestination(reg); 193 GridRegion finalDestination = GetFinalDestination(reg);
194 if (finalDestination == null) 194 if (finalDestination == null)
195 { 195 {
196 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Final destination is having problems. Unable to teleport agent."); 196 m_log.WarnFormat("[ENTITY TRANSFER MODULE]: Final destination is having problems. Unable to teleport agent.");
197 sp.ControllingClient.SendTeleportFailed("Problem at destination"); 197 sp.ControllingClient.SendTeleportFailed("Problem at destination");
198 return; 198 return;
199 } 199 }
200
200 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Final destination is x={0} y={1} uuid={2}", 201 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Final destination is x={0} y={1} uuid={2}",
201 finalDestination.RegionLocX / Constants.RegionSize, finalDestination.RegionLocY / Constants.RegionSize, finalDestination.RegionID); 202 finalDestination.RegionLocX / Constants.RegionSize, finalDestination.RegionLocY / Constants.RegionSize, finalDestination.RegionID);
202 203
@@ -240,7 +241,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
240 } 241 }
241 catch (Exception e) 242 catch (Exception e)
242 { 243 {
243 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Exception on teleport: {0}\n{1}", e.Message, e.StackTrace); 244 m_log.WarnFormat("[ENTITY TRANSFER MODULE]: Exception on teleport: {0}\n{1}", e.Message, e.StackTrace);
244 sp.ControllingClient.SendTeleportFailed("Internal error"); 245 sp.ControllingClient.SendTeleportFailed("Internal error");
245 } 246 }
246 } 247 }
@@ -421,7 +422,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
421 m_log.DebugFormat( 422 m_log.DebugFormat(
422 "[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, sp.UUID); 423 "[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, sp.UUID);
423 424
424
425 if (eq != null) 425 if (eq != null)
426 { 426 {
427 eq.TeleportFinishEvent(destinationHandle, 13, endPoint, 427 eq.TeleportFinishEvent(destinationHandle, 13, endPoint,
@@ -594,7 +594,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
594 client.SendTeleportFailed("Your home region could not be found."); 594 client.SendTeleportFailed("Your home region could not be found.");
595 return false; 595 return false;
596 } 596 }
597 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: User's home region is {0} {1} ({2}-{3})", 597
598 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: User's home region is {0} {1} ({2}-{3})",
598 regionInfo.RegionName, regionInfo.RegionID, regionInfo.RegionLocX / Constants.RegionSize, regionInfo.RegionLocY / Constants.RegionSize); 599 regionInfo.RegionName, regionInfo.RegionID, regionInfo.RegionLocX / Constants.RegionSize, regionInfo.RegionLocY / Constants.RegionSize);
599 600
600 // a little eekie that this goes back to Scene and with a forced cast, will fix that at some point... 601 // a little eekie that this goes back to Scene and with a forced cast, will fix that at some point...
@@ -1217,7 +1218,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1217 Utils.LongToUInts(reg.RegionHandle, out x, out y); 1218 Utils.LongToUInts(reg.RegionHandle, out x, out y);
1218 x = x / Constants.RegionSize; 1219 x = x / Constants.RegionSize;
1219 y = y / Constants.RegionSize; 1220 y = y / Constants.RegionSize;
1220 m_log.Info("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint.ToString() + ")"); 1221 m_log.Debug("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint.ToString() + ")");
1221 1222
1222 string capsPath = "http://" + reg.ExternalHostName + ":" + reg.HttpPort 1223 string capsPath = "http://" + reg.ExternalHostName + ":" + reg.HttpPort
1223 + "/CAPS/" + a.CapsPath + "0000/"; 1224 + "/CAPS/" + a.CapsPath + "0000/";
@@ -1253,7 +1254,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1253 // TODO: make Event Queue disablable! 1254 // TODO: make Event Queue disablable!
1254 } 1255 }
1255 1256
1256 m_log.Info("[ENTITY TRANSFER MODULE]: Completed inform client about neighbour " + endPoint.ToString()); 1257 m_log.Debug("[ENTITY TRANSFER MODULE]: Completed inform client about neighbour " + endPoint.ToString());
1257 1258
1258 } 1259 }
1259 1260
diff --git a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs
index c23cea5..ed3e516 100644
--- a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs
@@ -176,44 +176,44 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL
176 stream = response.GetResponseStream(); 176 stream = response.GetResponseStream();
177 if (stream != null) 177 if (stream != null)
178 { 178 {
179 Bitmap image = new Bitmap(stream);
180 Size newsize;
181
182 // TODO: make this a bit less hard coded
183 if ((image.Height < 64) && (image.Width < 64))
184 {
185 newsize = new Size(32, 32);
186 }
187 else if ((image.Height < 128) && (image.Width < 128))
188 {
189 newsize = new Size(64, 64);
190 }
191 else if ((image.Height < 256) && (image.Width < 256))
192 {
193 newsize = new Size(128, 128);
194 }
195 else if ((image.Height < 512 && image.Width < 512))
196 {
197 newsize = new Size(256, 256);
198 }
199 else if ((image.Height < 1024 && image.Width < 1024))
200 {
201 newsize = new Size(512, 512);
202 }
203 else
204 {
205 newsize = new Size(1024, 1024);
206 }
207
208 Bitmap resize = new Bitmap(image, newsize);
209
210 try 179 try
211 { 180 {
181 Bitmap image = new Bitmap(stream);
182 Size newsize;
183
184 // TODO: make this a bit less hard coded
185 if ((image.Height < 64) && (image.Width < 64))
186 {
187 newsize = new Size(32, 32);
188 }
189 else if ((image.Height < 128) && (image.Width < 128))
190 {
191 newsize = new Size(64, 64);
192 }
193 else if ((image.Height < 256) && (image.Width < 256))
194 {
195 newsize = new Size(128, 128);
196 }
197 else if ((image.Height < 512 && image.Width < 512))
198 {
199 newsize = new Size(256, 256);
200 }
201 else if ((image.Height < 1024 && image.Width < 1024))
202 {
203 newsize = new Size(512, 512);
204 }
205 else
206 {
207 newsize = new Size(1024, 1024);
208 }
209
210 Bitmap resize = new Bitmap(image, newsize);
211
212 imageJ2000 = OpenJPEG.EncodeFromImage(resize, true); 212 imageJ2000 = OpenJPEG.EncodeFromImage(resize, true);
213 } 213 }
214 catch (Exception) 214 catch (Exception)
215 { 215 {
216 m_log.Error("[LOADIMAGEURLMODULE]: OpenJpeg Encode Failed. Empty byte data returned!"); 216 m_log.Error("[LOADIMAGEURLMODULE]: OpenJpeg Conversion Failed. Empty byte data returned!");
217 } 217 }
218 } 218 }
219 else 219 else
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs
index a64f785..6543845 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
@@ -65,7 +65,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser
65 65
66 public void OnMakeRootAgent(ScenePresence sp) 66 public void OnMakeRootAgent(ScenePresence sp)
67 { 67 {
68 m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected root presence {0} in {1}", sp.UUID, sp.Scene.RegionInfo.RegionName); 68// m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected root presence {0} in {1}", sp.UUID, sp.Scene.RegionInfo.RegionName);
69 m_GridUserService.SetLastPosition(sp.UUID.ToString(), UUID.Zero, sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat); 69 m_GridUserService.SetLastPosition(sp.UUID.ToString(), UUID.Zero, sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat);
70 } 70 }
71 71
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs
index 34205e3..bd01bb9 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs
@@ -261,7 +261,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
261 261
262 public InventoryItemBase GetItem(InventoryItemBase item) 262 public InventoryItemBase GetItem(InventoryItemBase item)
263 { 263 {
264 m_log.DebugFormat("[XINVENTORY CONNECTOR]: GetItem {0}", item.ID); 264 //m_log.DebugFormat("[XINVENTORY CONNECTOR]: GetItem {0}", item.ID);
265 if (item == null) 265 if (item == null)
266 return null; 266 return null;
267 267
@@ -272,7 +272,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
272 272
273 public InventoryFolderBase GetFolder(InventoryFolderBase folder) 273 public InventoryFolderBase GetFolder(InventoryFolderBase folder)
274 { 274 {
275 m_log.DebugFormat("[XINVENTORY CONNECTOR]: GetFolder {0}", folder.ID); 275 //m_log.DebugFormat("[XINVENTORY CONNECTOR]: GetFolder {0}", folder.ID);
276 if (folder == null) 276 if (folder == null)
277 return null; 277 return null;
278 278
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs
index 62b8278..fa5b873 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
@@ -71,7 +71,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
71 71
72 public void OnMakeRootAgent(ScenePresence sp) 72 public void OnMakeRootAgent(ScenePresence sp)
73 { 73 {
74 m_log.DebugFormat("[PRESENCE DETECTOR]: Detected root presence {0} in {1}", sp.UUID, sp.Scene.RegionInfo.RegionName); 74// m_log.DebugFormat("[PRESENCE DETECTOR]: Detected root presence {0} in {1}", sp.UUID, sp.Scene.RegionInfo.RegionName);
75 m_PresenceService.ReportAgent(sp.ControllingClient.SessionId, sp.Scene.RegionInfo.RegionID); 75 m_PresenceService.ReportAgent(sp.ControllingClient.SessionId, sp.Scene.RegionInfo.RegionID);
76 } 76 }
77 77
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs
index c062833..f8a599a 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs
@@ -137,16 +137,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver
137 137
138 m_log.InfoFormat("[ARCHIVER]: Added terrain information to archive."); 138 m_log.InfoFormat("[ARCHIVER]: Added terrain information to archive.");
139 139
140 Dictionary<string, object> serializationOptions = new Dictionary<string, object>(); 140
141// if (m_options.ContainsKey("version") && (string)m_options["version"] == "0")
142// serializationOptions["old-guids"] = true;
143
144 // Write out scene object metadata 141 // Write out scene object metadata
145 foreach (SceneObjectGroup sceneObject in m_sceneObjects) 142 foreach (SceneObjectGroup sceneObject in m_sceneObjects)
146 { 143 {
147 //m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType()); 144 //m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType());
148 145
149 string serializedObject = m_serialiser.SerializeGroupToXml2(sceneObject, serializationOptions); 146 string serializedObject = m_serialiser.SerializeGroupToXml2(sceneObject, m_options);
150 m_archiveWriter.WriteFile(ArchiveHelpers.CreateObjectPath(sceneObject), serializedObject); 147 m_archiveWriter.WriteFile(ArchiveHelpers.CreateObjectPath(sceneObject), serializedObject);
151 } 148 }
152 149
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
index 3182079..0567a82 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
@@ -187,20 +187,17 @@ namespace OpenSim.Region.CoreModules.World.Archiver
187 /// <returns></returns> 187 /// <returns></returns>
188 public static string Create0p2ControlFile(Dictionary<string, object> options) 188 public static string Create0p2ControlFile(Dictionary<string, object> options)
189 { 189 {
190 int majorVersion = 0, minorVersion = 4; 190 int majorVersion = 0, minorVersion = 5;
191 191
192 /* 192 if (options.ContainsKey("version"))
193 if (options.ContainsKey("version") && (string)options["version"] == "0")
194 {
195 majorVersion = 0;
196 minorVersion = 3;
197 }
198 else
199 { 193 {
200 majorVersion = 1;
201 minorVersion = 0; 194 minorVersion = 0;
195 string[] parts = options["version"].ToString().Split('.');
196 if (parts.Length >= 1)
197 majorVersion = Int32.Parse(parts[0]);
198 if (parts.Length >= 2)
199 minorVersion = Int32.Parse(parts[1]);
202 } 200 }
203 */
204 201
205 m_log.InfoFormat("[ARCHIVER]: Creating version {0}.{1} OAR", majorVersion, minorVersion); 202 m_log.InfoFormat("[ARCHIVER]: Creating version {0}.{1} OAR", majorVersion, minorVersion);
206// if (majorVersion == 1) 203// if (majorVersion == 1)
diff --git a/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs
index 00b506e..6eb57eb 100644
--- a/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs
+++ b/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs
@@ -355,7 +355,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
355 if (renderMesh == null) 355 if (renderMesh == null)
356 return; 356 return;
357 357
358 warp_Vector primPos = ConvertVector(prim.AbsolutePosition); 358 warp_Vector primPos = ConvertVector(prim.GetWorldPosition());
359 warp_Quaternion primRot = ConvertQuaternion(prim.RotationOffset); 359 warp_Quaternion primRot = ConvertQuaternion(prim.RotationOffset);
360 360
361 warp_Matrix m = warp_Matrix.quaternionMatrix(primRot); 361 warp_Matrix m = warp_Matrix.quaternionMatrix(primRot);
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index a182eea..3e478b0 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -324,7 +324,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
324 if (threadrunning) return; 324 if (threadrunning) return;
325 threadrunning = true; 325 threadrunning = true;
326 326
327 m_log.Debug("[WORLD MAP]: Starting remote MapItem request thread"); 327// m_log.Debug("[WORLD MAP]: Starting remote MapItem request thread");
328 328
329 Watchdog.StartThread(process, "MapItemRequestThread", ThreadPriority.BelowNormal, true); 329 Watchdog.StartThread(process, "MapItemRequestThread", ThreadPriority.BelowNormal, true);
330 } 330 }
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index dafc1af..2a48be9 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -177,7 +177,6 @@ namespace OpenSim.Region.Framework.Scenes
177 private float m_health = 100f; 177 private float m_health = 100f;
178 178
179 // Default AV Height 179 // Default AV Height
180 private float m_avHeight = 127.0f;
181 180
182 protected RegionInfo m_regionInfo; 181 protected RegionInfo m_regionInfo;
183 protected ulong crossingFromRegion; 182 protected ulong crossingFromRegion;
@@ -974,9 +973,10 @@ namespace OpenSim.Region.Framework.Scenes
974 } 973 }
975 974
976 float localAVHeight = 1.56f; 975 float localAVHeight = 1.56f;
977 if (m_avHeight != 127.0f) 976 if (m_appearance != null)
978 { 977 {
979 localAVHeight = m_avHeight; 978 if (m_appearance.AvatarHeight > 0)
979 localAVHeight = m_appearance.AvatarHeight;
980 } 980 }
981 981
982 float posZLimit = 0; 982 float posZLimit = 0;
@@ -991,17 +991,6 @@ namespace OpenSim.Region.Framework.Scenes
991 } 991 }
992 AbsolutePosition = pos; 992 AbsolutePosition = pos;
993 993
994 AddToPhysicalScene(isFlying);
995
996 if (m_forceFly)
997 {
998 m_physicsActor.Flying = true;
999 }
1000 else if (m_flyDisabled)
1001 {
1002 m_physicsActor.Flying = false;
1003 }
1004
1005 if (m_appearance != null) 994 if (m_appearance != null)
1006 { 995 {
1007 if (m_appearance.AvatarHeight > 0) 996 if (m_appearance.AvatarHeight > 0)
@@ -1014,6 +1003,23 @@ namespace OpenSim.Region.Framework.Scenes
1014 m_appearance = new AvatarAppearance(UUID); 1003 m_appearance = new AvatarAppearance(UUID);
1015 } 1004 }
1016 1005
1006 AddToPhysicalScene(isFlying);
1007
1008 if (m_appearance != null)
1009 {
1010 if (m_appearance.AvatarHeight > 0)
1011 SetHeight(m_appearance.AvatarHeight);
1012 }
1013
1014 if (m_forceFly)
1015 {
1016 m_physicsActor.Flying = true;
1017 }
1018 else if (m_flyDisabled)
1019 {
1020 m_physicsActor.Flying = false;
1021 }
1022
1017 // Don't send an animation pack here, since on a region crossing this will sometimes cause a flying 1023 // Don't send an animation pack here, since on a region crossing this will sometimes cause a flying
1018 // avatar to return to the standing position in mid-air. On login it looks like this is being sent 1024 // avatar to return to the standing position in mid-air. On login it looks like this is being sent
1019 // elsewhere anyway 1025 // elsewhere anyway
@@ -1200,10 +1206,9 @@ namespace OpenSim.Region.Framework.Scenes
1200 /// </summary> 1206 /// </summary>
1201 public void SetHeight(float height) 1207 public void SetHeight(float height)
1202 { 1208 {
1203 m_avHeight = height;
1204 if (PhysicsActor != null && !IsChildAgent) 1209 if (PhysicsActor != null && !IsChildAgent)
1205 { 1210 {
1206 Vector3 SetSize = new Vector3(0.45f, 0.6f, m_avHeight); 1211 Vector3 SetSize = new Vector3(0.45f, 0.6f, height);
1207 PhysicsActor.Size = SetSize; 1212 PhysicsActor.Size = SetSize;
1208 } 1213 }
1209 } 1214 }
@@ -1215,9 +1220,11 @@ namespace OpenSim.Region.Framework.Scenes
1215 /// </summary> 1220 /// </summary>
1216 public void CompleteMovement(IClientAPI client) 1221 public void CompleteMovement(IClientAPI client)
1217 { 1222 {
1218// DEBUG ON 1223 DateTime startTime = DateTime.Now;
1219 m_log.WarnFormat("[SCENE PRESENCE]: CompleteMovement for {0}",UUID); 1224
1220// DEBUG OFF 1225 m_log.DebugFormat(
1226 "[SCENE PRESENCE]: Completing movement of {0} into region {1}",
1227 client.Name, Scene.RegionInfo.RegionName);
1221 1228
1222 Vector3 look = Velocity; 1229 Vector3 look = Velocity;
1223 if ((look.X == 0) && (look.Y == 0) && (look.Z == 0)) 1230 if ((look.X == 0) && (look.Y == 0) && (look.Z == 0))
@@ -1264,6 +1271,10 @@ namespace OpenSim.Region.Framework.Scenes
1264 if (friendsModule != null) 1271 if (friendsModule != null)
1265 friendsModule.SendFriendsOnlineIfNeeded(ControllingClient); 1272 friendsModule.SendFriendsOnlineIfNeeded(ControllingClient);
1266 } 1273 }
1274
1275 m_log.DebugFormat(
1276 "[SCENE PRESENCE]: Completing movement of {0} into region {1} took {2}ms",
1277 client.Name, Scene.RegionInfo.RegionName, (DateTime.Now - startTime).Milliseconds);
1267 } 1278 }
1268 1279
1269 /// <summary> 1280 /// <summary>
@@ -1859,9 +1870,10 @@ namespace OpenSim.Region.Framework.Scenes
1859 SendFullUpdateToAllClients(); 1870 SendFullUpdateToAllClients();
1860 m_requestedSitTargetID = 0; 1871 m_requestedSitTargetID = 0;
1861 1872
1862 if ((m_physicsActor != null) && (m_avHeight > 0)) 1873 if (m_physicsActor != null && m_appearance != null)
1863 { 1874 {
1864 SetHeight(m_avHeight); 1875 if (m_appearance.AvatarHeight > 0)
1876 SetHeight(m_appearance.AvatarHeight);
1865 } 1877 }
1866 } 1878 }
1867 Animator.TrySetMovementAnimation("STAND"); 1879 Animator.TrySetMovementAnimation("STAND");
@@ -2728,22 +2740,25 @@ namespace OpenSim.Region.Framework.Scenes
2728 if (remoteAvatar == null) 2740 if (remoteAvatar == null)
2729 return; 2741 return;
2730 2742
2731 IClientAPI cl=remoteAvatar.ControllingClient; 2743 IClientAPI cl = remoteAvatar.ControllingClient;
2732 if (cl == null) 2744 if (cl == null)
2733 return; 2745 return;
2734 2746
2735 if (m_appearance.Texture == null) 2747 if (m_appearance.Texture == null)
2736 return; 2748 return;
2737 2749
2738 if (LocalId == remoteAvatar.LocalId) 2750// MT: This is needed for sit. It's legal to send it to oneself, and the name
2739 { 2751// of the method is a misnomer
2740 m_log.WarnFormat("[SP] An agent is attempting to send data to itself; {0}",UUID); 2752//
2741 return; 2753// if (LocalId == remoteAvatar.LocalId)
2742 } 2754// {
2755// m_log.WarnFormat("[SCENEPRESENCE]: An agent is attempting to send avatar data to itself; {0}", UUID);
2756// return;
2757// }
2743 2758
2744 if (IsChildAgent) 2759 if (IsChildAgent)
2745 { 2760 {
2746 m_log.WarnFormat("[SCENEPRESENCE] A child agent is attempting to send out avatar data"); 2761 m_log.WarnFormat("[SCENEPRESENCE]: A child agent is attempting to send out avatar data; {0}", UUID);
2747 return; 2762 return;
2748 } 2763 }
2749 2764
@@ -2826,14 +2841,14 @@ namespace OpenSim.Region.Framework.Scenes
2826 { 2841 {
2827 if (m_scene.AvatarFactory.ValidateBakedTextureCache(m_controllingClient)) 2842 if (m_scene.AvatarFactory.ValidateBakedTextureCache(m_controllingClient))
2828 { 2843 {
2829 m_log.WarnFormat("[SP] baked textures are in the ache for {0}",Name); 2844// m_log.WarnFormat("[SCENEPRESENCE]: baked textures are in the cache for {0}", Name);
2830 m_controllingClient.SendAppearance( 2845 m_controllingClient.SendAppearance(
2831 m_appearance.Owner,m_appearance.VisualParams,m_appearance.Texture.GetBytes()); 2846 m_appearance.Owner,m_appearance.VisualParams,m_appearance.Texture.GetBytes());
2832 } 2847 }
2833 } 2848 }
2834 else 2849 else
2835 { 2850 {
2836 m_log.WarnFormat("[SP] AvatarFactory not set"); 2851 m_log.WarnFormat("[SCENEPRESENCE]: AvatarFactory not set for {0}", Name);
2837 } 2852 }
2838 2853
2839 SendInitialFullUpdateToAllClients(); 2854 SendInitialFullUpdateToAllClients();
@@ -2845,7 +2860,7 @@ namespace OpenSim.Region.Framework.Scenes
2845 public void SendAppearanceToAllOtherAgents() 2860 public void SendAppearanceToAllOtherAgents()
2846 { 2861 {
2847// DEBUG ON 2862// DEBUG ON
2848 m_log.WarnFormat("[SP] Send appearance from {0} to all other agents",m_uuid); 2863// m_log.WarnFormat("[SCENEPRESENCE]: Send appearance from {0} to all other agents", m_uuid);
2849// DEBUG OFF 2864// DEBUG OFF
2850 m_perfMonMS = Util.EnvironmentTickCount(); 2865 m_perfMonMS = Util.EnvironmentTickCount();
2851 2866
@@ -2868,7 +2883,7 @@ namespace OpenSim.Region.Framework.Scenes
2868 { 2883 {
2869 if (LocalId == avatar.LocalId) 2884 if (LocalId == avatar.LocalId)
2870 { 2885 {
2871 m_log.WarnFormat("[SP] An agent is attempting to send data to itself; {0}",UUID); 2886 m_log.WarnFormat("[SCENE PRESENCE]: An agent is attempting to send appearance data to itself; {0}", UUID);
2872 return; 2887 return;
2873 } 2888 }
2874 2889
@@ -2920,7 +2935,7 @@ namespace OpenSim.Region.Framework.Scenes
2920 cadu.ActiveGroupID = UUID.Zero.Guid; 2935 cadu.ActiveGroupID = UUID.Zero.Guid;
2921 cadu.AgentID = UUID.Guid; 2936 cadu.AgentID = UUID.Guid;
2922 cadu.alwaysrun = m_setAlwaysRun; 2937 cadu.alwaysrun = m_setAlwaysRun;
2923 cadu.AVHeight = m_avHeight; 2938 cadu.AVHeight = m_appearance.AvatarHeight;;
2924 Vector3 tempCameraCenter = m_CameraCenter; 2939 Vector3 tempCameraCenter = m_CameraCenter;
2925 cadu.cameraPosition = tempCameraCenter; 2940 cadu.cameraPosition = tempCameraCenter;
2926 cadu.drawdistance = m_DrawDistance; 2941 cadu.drawdistance = m_DrawDistance;
@@ -3256,7 +3271,6 @@ namespace OpenSim.Region.Framework.Scenes
3256 3271
3257 m_CameraCenter = cAgentData.Center + offset; 3272 m_CameraCenter = cAgentData.Center + offset;
3258 3273
3259 m_avHeight = cAgentData.Size.Z;
3260 //SetHeight(cAgentData.AVHeight); 3274 //SetHeight(cAgentData.AVHeight);
3261 3275
3262 if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0) 3276 if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0)
@@ -3281,8 +3295,6 @@ namespace OpenSim.Region.Framework.Scenes
3281 cAgent.Position = AbsolutePosition; 3295 cAgent.Position = AbsolutePosition;
3282 cAgent.Velocity = m_velocity; 3296 cAgent.Velocity = m_velocity;
3283 cAgent.Center = m_CameraCenter; 3297 cAgent.Center = m_CameraCenter;
3284 // Don't copy the size; it is inferred from apearance parameters
3285 //cAgent.Size = new Vector3(0, 0, m_avHeight);
3286 cAgent.AtAxis = m_CameraAtAxis; 3298 cAgent.AtAxis = m_CameraAtAxis;
3287 cAgent.LeftAxis = m_CameraLeftAxis; 3299 cAgent.LeftAxis = m_CameraLeftAxis;
3288 cAgent.UpAxis = m_CameraUpAxis; 3300 cAgent.UpAxis = m_CameraUpAxis;
@@ -3401,7 +3413,6 @@ namespace OpenSim.Region.Framework.Scenes
3401 3413
3402 m_velocity = cAgent.Velocity; 3414 m_velocity = cAgent.Velocity;
3403 m_CameraCenter = cAgent.Center; 3415 m_CameraCenter = cAgent.Center;
3404 //m_avHeight = cAgent.Size.Z;
3405 m_CameraAtAxis = cAgent.AtAxis; 3416 m_CameraAtAxis = cAgent.AtAxis;
3406 m_CameraLeftAxis = cAgent.LeftAxis; 3417 m_CameraLeftAxis = cAgent.LeftAxis;
3407 m_CameraUpAxis = cAgent.UpAxis; 3418 m_CameraUpAxis = cAgent.UpAxis;
@@ -3562,17 +3573,8 @@ if (m_animator.m_jumping) force.Z = m_animator.m_jumpVelocity; // add for ju
3562 3573
3563 Vector3 pVec = AbsolutePosition; 3574 Vector3 pVec = AbsolutePosition;
3564 3575
3565 // Old bug where the height was in centimeters instead of meters 3576 m_physicsActor = scene.AddAvatar(Firstname + "." + Lastname, pVec,
3566 if (m_avHeight == 127.0f) 3577 new Vector3(0f, 0f, m_appearance.AvatarHeight), isFlying);
3567 {
3568 m_physicsActor = scene.AddAvatar(Firstname + "." + Lastname, pVec, new Vector3(0f, 0f, 1.56f),
3569 isFlying);
3570 }
3571 else
3572 {
3573 m_physicsActor = scene.AddAvatar(Firstname + "." + Lastname, pVec,
3574 new Vector3(0f, 0f, m_avHeight), isFlying);
3575 }
3576 scene.AddPhysicsActorTaint(m_physicsActor); 3578 scene.AddPhysicsActorTaint(m_physicsActor);
3577 //m_physicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; 3579 //m_physicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients;
3578 m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; 3580 m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate;
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index 4aadfdb..a398dfd 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -1135,7 +1135,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1135 writer.WriteElementString("GroupMask", sop.GroupMask.ToString()); 1135 writer.WriteElementString("GroupMask", sop.GroupMask.ToString());
1136 writer.WriteElementString("EveryoneMask", sop.EveryoneMask.ToString()); 1136 writer.WriteElementString("EveryoneMask", sop.EveryoneMask.ToString());
1137 writer.WriteElementString("NextOwnerMask", sop.NextOwnerMask.ToString()); 1137 writer.WriteElementString("NextOwnerMask", sop.NextOwnerMask.ToString());
1138 writer.WriteElementString("Flags", sop.Flags.ToString()); 1138 WriteFlags(writer, "Flags", sop.Flags.ToString(), options);
1139 WriteUUID(writer, "CollisionSound", sop.CollisionSound, options); 1139 WriteUUID(writer, "CollisionSound", sop.CollisionSound, options);
1140 writer.WriteElementString("CollisionSoundVolume", sop.CollisionSoundVolume.ToString()); 1140 writer.WriteElementString("CollisionSoundVolume", sop.CollisionSoundVolume.ToString());
1141 if (sop.MediaUrl != null) 1141 if (sop.MediaUrl != null)
@@ -1188,6 +1188,20 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1188 1188
1189 } 1189 }
1190 1190
1191 static void WriteFlags(XmlTextWriter writer, string name, string flagsStr, Dictionary<string, object> options)
1192 {
1193 // Older versions of serialization can't cope with commas
1194 if (options.ContainsKey("version"))
1195 {
1196 float version = 0.5F;
1197 float.TryParse(options["version"].ToString(), out version);
1198 if (version < 0.5)
1199 flagsStr = flagsStr.Replace(",", "");
1200 }
1201
1202 writer.WriteElementString(name, flagsStr);
1203 }
1204
1191 static void WriteTaskInventory(XmlTextWriter writer, TaskInventoryDictionary tinv, Dictionary<string, object> options) 1205 static void WriteTaskInventory(XmlTextWriter writer, TaskInventoryDictionary tinv, Dictionary<string, object> options)
1192 { 1206 {
1193 if (tinv.Count > 0) // otherwise skip this 1207 if (tinv.Count > 0) // otherwise skip this
@@ -1275,8 +1289,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1275 writer.WriteElementString("ProfileHollow", shp.ProfileHollow.ToString()); 1289 writer.WriteElementString("ProfileHollow", shp.ProfileHollow.ToString());
1276 writer.WriteElementString("State", shp.State.ToString()); 1290 writer.WriteElementString("State", shp.State.ToString());
1277 1291
1278 writer.WriteElementString("ProfileShape", shp.ProfileShape.ToString()); 1292 WriteFlags(writer, "ProfileShape", shp.ProfileShape.ToString(), options);
1279 writer.WriteElementString("HollowShape", shp.HollowShape.ToString()); 1293 WriteFlags(writer, "HollowShape", shp.HollowShape.ToString(), options);
1280 1294
1281 WriteUUID(writer, "SculptTexture", shp.SculptTexture, options); 1295 WriteUUID(writer, "SculptTexture", shp.SculptTexture, options);
1282 writer.WriteElementString("SculptType", shp.SculptType.ToString()); 1296 writer.WriteElementString("SculptType", shp.SculptType.ToString());