aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Framework/Console/LocalConsole.cs11
-rw-r--r--OpenSim/Framework/Util.cs8
-rw-r--r--OpenSim/Region/Application/OpenSim.cs138
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs23
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs127
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs9
6 files changed, 212 insertions, 104 deletions
diff --git a/OpenSim/Framework/Console/LocalConsole.cs b/OpenSim/Framework/Console/LocalConsole.cs
index 5f2f404..eda41b8 100644
--- a/OpenSim/Framework/Console/LocalConsole.cs
+++ b/OpenSim/Framework/Console/LocalConsole.cs
@@ -473,9 +473,11 @@ namespace OpenSim.Framework.Console
473 y = -1; 473 y = -1;
474 } 474 }
475 475
476 string commandLine = cmdline.ToString();
477
476 if (isCommand) 478 if (isCommand)
477 { 479 {
478 string[] cmd = Commands.Resolve(Parser.Parse(cmdline.ToString())); 480 string[] cmd = Commands.Resolve(Parser.Parse(commandLine));
479 481
480 if (cmd.Length != 0) 482 if (cmd.Length != 0)
481 { 483 {
@@ -491,8 +493,11 @@ namespace OpenSim.Framework.Console
491 } 493 }
492 } 494 }
493 495
494 //AddToHistory(cmdline.ToString()); 496 // If we're not echoing to screen (e.g. a password) then we probably don't want it in history
495 return cmdline.ToString(); 497 if (echo && commandLine != "")
498 AddToHistory(commandLine);
499
500 return commandLine;
496 default: 501 default:
497 break; 502 break;
498 } 503 }
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index f1d622e..6bee4be 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -451,6 +451,14 @@ namespace OpenSim.Framework
451 return (x + y - (min >> 1) - (min >> 2) + (min >> 4)); 451 return (x + y - (min >> 1) - (min >> 2) + (min >> 4));
452 } 452 }
453 453
454 /// <summary>
455 /// Are the co-ordinates of the new region visible from the old region?
456 /// </summary>
457 /// <param name="oldx">Old region x-coord</param>
458 /// <param name="newx">New region x-coord</param>
459 /// <param name="oldy">Old region y-coord</param>
460 /// <param name="newy">New region y-coord</param>
461 /// <returns></returns>
454 public static bool IsOutsideView(uint oldx, uint newx, uint oldy, uint newy) 462 public static bool IsOutsideView(uint oldx, uint newx, uint oldy, uint newy)
455 { 463 {
456 // Eventually this will be a function of the draw distance / camera position too. 464 // Eventually this will be a function of the draw distance / camera position too.
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 5969be0..58ece34 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -30,6 +30,7 @@ using System.Collections;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.IO; 31using System.IO;
32using System.Reflection; 32using System.Reflection;
33using System.Text;
33using System.Timers; 34using System.Timers;
34using log4net; 35using log4net;
35using Nini.Config; 36using Nini.Config;
@@ -285,16 +286,15 @@ namespace OpenSim
285 286
286 m_console.Commands.AddCommand("region", false, "show users", 287 m_console.Commands.AddCommand("region", false, "show users",
287 "show users [full]", 288 "show users [full]",
288 "Show user data", HandleShow); 289 "Show user data for users currently on the region",
290 "Without the 'full' option, only users actually on the region are shown."
291 + " With the 'full' option child agents of users in neighbouring regions are also shown.",
292 HandleShow);
289 293
290 m_console.Commands.AddCommand("region", false, "show connections", 294 m_console.Commands.AddCommand("region", false, "show connections",
291 "show connections", 295 "show connections",
292 "Show connection data", HandleShow); 296 "Show connection data", HandleShow);
293 297
294 m_console.Commands.AddCommand("region", false, "show users full",
295 "show users full",
296 String.Empty, HandleShow);
297
298 m_console.Commands.AddCommand("region", false, "show modules", 298 m_console.Commands.AddCommand("region", false, "show modules",
299 "show modules", 299 "show modules",
300 "Show module data", HandleShow); 300 "Show module data", HandleShow);
@@ -304,8 +304,12 @@ namespace OpenSim
304 "Show region data", HandleShow); 304 "Show region data", HandleShow);
305 305
306 m_console.Commands.AddCommand("region", false, "show queues", 306 m_console.Commands.AddCommand("region", false, "show queues",
307 "show queues", 307 "show queues [full]",
308 "Show queue data", HandleShow); 308 "Show queue data for each client",
309 "Without the 'full' option, only users actually on the region are shown."
310 + " With the 'full' option child agents of users in neighbouring regions are also shown.",
311 HandleShow);
312
309 m_console.Commands.AddCommand("region", false, "show ratings", 313 m_console.Commands.AddCommand("region", false, "show ratings",
310 "show ratings", 314 "show ratings",
311 "Show rating data", HandleShow); 315 "Show rating data", HandleShow);
@@ -876,7 +880,7 @@ namespace OpenSim
876 { 880 {
877 agents = m_sceneManager.GetCurrentSceneAvatars(); 881 agents = m_sceneManager.GetCurrentSceneAvatars();
878 } 882 }
879 883
880 MainConsole.Instance.Output(String.Format("\nAgents connected: {0}\n", agents.Count)); 884 MainConsole.Instance.Output(String.Format("\nAgents connected: {0}\n", agents.Count));
881 885
882 MainConsole.Instance.Output( 886 MainConsole.Instance.Output(
@@ -953,7 +957,7 @@ namespace OpenSim
953 break; 957 break;
954 958
955 case "queues": 959 case "queues":
956 Notice(GetQueuesReport()); 960 Notice(GetQueuesReport(showParams));
957 break; 961 break;
958 962
959 case "ratings": 963 case "ratings":
@@ -983,43 +987,91 @@ namespace OpenSim
983 } 987 }
984 988
985 /// <summary> 989 /// <summary>
986 /// print UDP Queue data for each client 990 /// Generate UDP Queue data report for each client
987 /// </summary> 991 /// </summary>
992 /// <param name="showParams"></param>
988 /// <returns></returns> 993 /// <returns></returns>
989 private string GetQueuesReport() 994 private string GetQueuesReport(string[] showParams)
990 { 995 {
991 string report = String.Empty; 996 bool showChildren = false;
992 997
993 m_sceneManager.ForEachScene(delegate(Scene scene) 998 if (showParams.Length > 1 && showParams[1] == "full")
994 { 999 showChildren = true;
995 scene.ForEachClient(delegate(IClientAPI client) 1000
996 { 1001 StringBuilder report = new StringBuilder();
997 if (client is IStatsCollector) 1002
998 { 1003 int columnPadding = 2;
999 report = report + client.FirstName + 1004 int maxNameLength = 18;
1000 " " + client.LastName; 1005 int maxRegionNameLength = 14;
1001 1006 int maxTypeLength = 4;
1002 IStatsCollector stats = 1007 int totalInfoFieldsLength = maxNameLength + columnPadding + maxRegionNameLength + columnPadding + maxTypeLength + columnPadding;
1003 (IStatsCollector) client; 1008
1004 1009 report.AppendFormat("{0,-" + maxNameLength + "}{1,-" + columnPadding + "}", "User", "");
1005 report = report + string.Format("{0,7} {1,7} {2,7} {3,7} {4,7} {5,7} {6,7} {7,7} {8,7} {9,7}\n", 1010 report.AppendFormat("{0,-" + maxRegionNameLength + "}{1,-" + columnPadding + "}", "Region", "");
1006 "Send", 1011 report.AppendFormat("{0,-" + maxTypeLength + "}{1,-" + columnPadding + "}", "Type", "");
1007 "In", 1012
1008 "Out", 1013 report.AppendFormat(
1009 "Resend", 1014 "{0,9} {1,9} {2,9} {3,8} {4,7} {5,7} {6,7} {7,7} {8,9} {9,7} {10,7}\n",
1010 "Land", 1015 "Packets",
1011 "Wind", 1016 "Packets",
1012 "Cloud", 1017 "Bytes",
1013 "Task", 1018 "Bytes",
1014 "Texture", 1019 "Bytes",
1015 "Asset"); 1020 "Bytes",
1016 report = report + stats.Report() + 1021 "Bytes",
1017 "\n"; 1022 "Bytes",
1018 } 1023 "Bytes",
1019 }); 1024 "Bytes",
1020 }); 1025 "Bytes");
1021 1026
1022 return report; 1027 report.AppendFormat("{0,-" + totalInfoFieldsLength + "}", "");
1028 report.AppendFormat(
1029 "{0,9} {1,9} {2,9} {3,8} {4,7} {5,7} {6,7} {7,7} {8,9} {9,7} {10,7}\n",
1030 "Out",
1031 "In",
1032 "Unacked",
1033 "Resend",
1034 "Land",
1035 "Wind",
1036 "Cloud",
1037 "Task",
1038 "Texture",
1039 "Asset",
1040 "State");
1041
1042 m_sceneManager.ForEachScene(
1043 delegate(Scene scene)
1044 {
1045 scene.ForEachClient(
1046 delegate(IClientAPI client)
1047 {
1048 if (client is IStatsCollector)
1049 {
1050 bool isChild = scene.PresenceChildStatus(client.AgentId);
1051 if (isChild && !showChildren)
1052 return;
1053
1054 string name = client.Name;
1055 string regionName = scene.RegionInfo.RegionName;
1056
1057 report.AppendFormat(
1058 "{0,-" + maxNameLength + "}{1,-" + columnPadding + "}",
1059 name.Length > maxNameLength ? name.Substring(0, maxNameLength) : name, "");
1060 report.AppendFormat(
1061 "{0,-" + maxRegionNameLength + "}{1,-" + columnPadding + "}",
1062 regionName.Length > maxRegionNameLength ? regionName.Substring(0, maxRegionNameLength) : regionName, "");
1063 report.AppendFormat(
1064 "{0,-" + maxTypeLength + "}{1,-" + columnPadding + "}",
1065 isChild ? "Cd" : "Rt", "");
1066
1067 IStatsCollector stats = (IStatsCollector)client;
1068
1069 report.AppendLine(stats.Report());
1070 }
1071 });
1072 });
1073
1074 return report.ToString();
1023 } 1075 }
1024 1076
1025 /// <summary> 1077 /// <summary>
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
index a4738ff..ed0e60d 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
@@ -247,11 +247,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP
247 throw new NotImplementedException(); 247 throw new NotImplementedException();
248 } 248 }
249 249
250 /// <summary>
251 /// Return statistics information about client packet queues.
252 /// </summary>
253 ///
254 /// FIXME: This should really be done in a more sensible manner rather than sending back a formatted string.
255 ///
256 /// <returns></returns>
250 public string GetStats() 257 public string GetStats()
251 { 258 {
252 // TODO: ??? 259 return string.Format(
253 return string.Format("{0,7} {1,7} {2,7} {3,7} {4,7} {5,7} {6,7} {7,7} {8,7} {9,7}", 260 "{0,9} {1,9} {2,9} {3,8} {4,7} {5,7} {6,7} {7,7} {8,9} {9,7} {10,7}",
254 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); 261 PacketsSent,
262 PacketsReceived,
263 UnackedBytes,
264 m_throttleCategories[(int)ThrottleOutPacketType.Resend].Content,
265 m_throttleCategories[(int)ThrottleOutPacketType.Land].Content,
266 m_throttleCategories[(int)ThrottleOutPacketType.Wind].Content,
267 m_throttleCategories[(int)ThrottleOutPacketType.Cloud].Content,
268 m_throttleCategories[(int)ThrottleOutPacketType.Task].Content,
269 m_throttleCategories[(int)ThrottleOutPacketType.Texture].Content,
270 m_throttleCategories[(int)ThrottleOutPacketType.Asset].Content,
271 m_throttleCategories[(int)ThrottleOutPacketType.State].Content);
255 } 272 }
256 273
257 public void SendPacketStats() 274 public void SendPacketStats()
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
index 2dd444d..0df4585 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
@@ -55,6 +55,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
55 private Dictionary<UUID,long> m_savequeue = new Dictionary<UUID,long>(); 55 private Dictionary<UUID,long> m_savequeue = new Dictionary<UUID,long>();
56 private Dictionary<UUID,long> m_sendqueue = new Dictionary<UUID,long>(); 56 private Dictionary<UUID,long> m_sendqueue = new Dictionary<UUID,long>();
57 57
58 private object m_setAppearanceLock = new object();
59
58 #region RegionModule Members 60 #region RegionModule Members
59 61
60 public void Initialise(Scene scene, IConfigSource config) 62 public void Initialise(Scene scene, IConfigSource config)
@@ -69,6 +71,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
69 { 71 {
70 m_savetime = Convert.ToInt32(sconfig.GetString("DelayBeforeAppearanceSave",Convert.ToString(m_savetime))); 72 m_savetime = Convert.ToInt32(sconfig.GetString("DelayBeforeAppearanceSave",Convert.ToString(m_savetime)));
71 m_sendtime = Convert.ToInt32(sconfig.GetString("DelayBeforeAppearanceSend",Convert.ToString(m_sendtime))); 73 m_sendtime = Convert.ToInt32(sconfig.GetString("DelayBeforeAppearanceSend",Convert.ToString(m_sendtime)));
74 // m_log.InfoFormat("[AVFACTORY] configured for {0} save and {1} send",m_savetime,m_sendtime);
72 } 75 }
73 } 76 }
74 77
@@ -117,26 +120,28 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
117 ScenePresence sp = m_scene.GetScenePresence(client.AgentId); 120 ScenePresence sp = m_scene.GetScenePresence(client.AgentId);
118 if (sp == null) 121 if (sp == null)
119 { 122 {
120 m_log.WarnFormat("[AVATAR FACTORY MODULE]: SetAppearance unable to find presence for {0}", client.AgentId); 123 m_log.WarnFormat("[AVFACTORY]: SetAppearance unable to find presence for {0}", client.AgentId);
121 return false; 124 return false;
122 } 125 }
123 126
124 bool cached = true; 127 bool defonly = true; // are we only using default textures
125 128
126 // Process the texture entry 129 // Process the texture entry
127 for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++) 130 for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++)
128 { 131 {
129 int idx = AvatarAppearance.BAKE_INDICES[i]; 132 int idx = AvatarAppearance.BAKE_INDICES[i];
130 Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[idx]; 133 Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[idx];
131 if (face != null && face.TextureID != AppearanceManager.DEFAULT_AVATAR_TEXTURE) 134 if (face == null || face.TextureID != AppearanceManager.DEFAULT_AVATAR_TEXTURE)
132 if (! CheckBakedTextureAsset(client,face.TextureID,idx)) 135 continue;
133 { 136
134 sp.Appearance.Texture.FaceTextures[idx] = null; 137 defonly = false; // found a non-default texture reference
135 cached = false; 138
136 } 139 if (! CheckBakedTextureAsset(client,face.TextureID,idx))
140 return false;
137 } 141 }
138 142
139 return cached; 143 // If we only found default textures, then the appearance is not cached
144 return (defonly ? false : true);
140 } 145 }
141 146
142 /// <summary> 147 /// <summary>
@@ -146,44 +151,59 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
146 /// <param name="visualParam"></param> 151 /// <param name="visualParam"></param>
147 public void SetAppearance(IClientAPI client, Primitive.TextureEntry textureEntry, byte[] visualParams) 152 public void SetAppearance(IClientAPI client, Primitive.TextureEntry textureEntry, byte[] visualParams)
148 { 153 {
149// m_log.WarnFormat("[AVATAR FACTORY MODULE]: SetAppearance for {0}",client.AgentId);
150
151 ScenePresence sp = m_scene.GetScenePresence(client.AgentId); 154 ScenePresence sp = m_scene.GetScenePresence(client.AgentId);
152 if (sp == null) 155 if (sp == null)
153 { 156 {
154 m_log.WarnFormat("[AVATAR FACTORY MODULE]: SetAppearance unable to find presence for {0}",client.AgentId); 157 m_log.WarnFormat("[AVFACTORY]: SetAppearance unable to find presence for {0}",client.AgentId);
155 return; 158 return;
156 } 159 }
157 160
161 // m_log.WarnFormat("[AVFACTORY]: Start SetAppearance for {0}",client.AgentId);
162
158 bool changed = false; 163 bool changed = false;
159 164
160 // Process the texture entry 165 // Process the texture entry transactionally, this doesn't guarantee that Appearance is
161 if (textureEntry != null) 166 // going to be handled correctly but it does serialize the updates to the appearance
167 lock (m_setAppearanceLock)
162 { 168 {
163 changed = sp.Appearance.SetTextureEntries(textureEntry); 169 if (textureEntry != null)
164
165 for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++)
166 { 170 {
167 int idx = AvatarAppearance.BAKE_INDICES[i]; 171 changed = sp.Appearance.SetTextureEntries(textureEntry);
168 Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[idx]; 172
169 if (face != null && face.TextureID != AppearanceManager.DEFAULT_AVATAR_TEXTURE) 173 // m_log.WarnFormat("[AVFACTORY]: Prepare to check textures for {0}",client.AgentId);
170 Util.FireAndForget(delegate(object o) { 174
171 if (! CheckBakedTextureAsset(client,face.TextureID,idx)) 175 for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++)
172 client.SendRebakeAvatarTextures(face.TextureID); 176 {
173 }); 177 int idx = AvatarAppearance.BAKE_INDICES[i];
178 Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[idx];
179 if (face != null && face.TextureID != AppearanceManager.DEFAULT_AVATAR_TEXTURE)
180 Util.FireAndForget(delegate(object o) {
181 if (! CheckBakedTextureAsset(client,face.TextureID,idx))
182 client.SendRebakeAvatarTextures(face.TextureID);
183 });
184 }
185
186 // m_log.WarnFormat("[AVFACTORY]: Complete texture check for {0}",client.AgentId);
174 } 187 }
175 }
176 188
177 // Process the visual params, this may change height as well 189 // Process the visual params, this may change height as well
178 if (visualParams != null) 190 if (visualParams != null)
179 {
180 if (sp.Appearance.SetVisualParams(visualParams))
181 { 191 {
182 changed = true; 192 if (sp.Appearance.SetVisualParams(visualParams))
183 if (sp.Appearance.AvatarHeight > 0) 193 {
184 sp.SetHeight(sp.Appearance.AvatarHeight); 194 changed = true;
195 if (sp.Appearance.AvatarHeight > 0)
196 sp.SetHeight(sp.Appearance.AvatarHeight);
197 }
185 } 198 }
199
200 // Send the appearance back to the avatar, not clear that this is needed
201 sp.ControllingClient.SendAvatarDataImmediate(sp);
202 // AvatarAppearance avp = sp.Appearance;
203 // sp.ControllingClient.SendAppearance(avp.Owner,avp.VisualParams,avp.Texture.GetBytes());
204
186 } 205 }
206
187 207
188 // If something changed in the appearance then queue an appearance save 208 // If something changed in the appearance then queue an appearance save
189 if (changed) 209 if (changed)
@@ -192,10 +212,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
192 // And always queue up an appearance update to send out 212 // And always queue up an appearance update to send out
193 QueueAppearanceSend(client.AgentId); 213 QueueAppearanceSend(client.AgentId);
194 214
195 // Send the appearance back to the avatar 215 // m_log.WarnFormat("[AVFACTORY]: Complete SetAppearance for {0}:\n{1}",client.AgentId,sp.Appearance.ToString());
196 // AvatarAppearance avp = sp.Appearance;
197 // sp.ControllingClient.SendAvatarDataImmediate(sp);
198 // sp.ControllingClient.SendAppearance(avp.Owner,avp.VisualParams,avp.Texture.GetBytes());
199 } 216 }
200 217
201 /// <summary> 218 /// <summary>
@@ -209,7 +226,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
209 { 226 {
210 if (m_scene.AssetService.Get(textureID.ToString()) == null) 227 if (m_scene.AssetService.Get(textureID.ToString()) == null)
211 { 228 {
212 m_log.WarnFormat("[AVATAR FACTORY MODULE]: Missing baked texture {0} ({1}) for avatar {2}", 229 m_log.WarnFormat("[AVFACTORY]: Missing baked texture {0} ({1}) for avatar {2}",
213 textureID, idx, client.Name); 230 textureID, idx, client.Name);
214 return false; 231 return false;
215 } 232 }
@@ -220,10 +237,10 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
220 237
221 public void QueueAppearanceSend(UUID agentid) 238 public void QueueAppearanceSend(UUID agentid)
222 { 239 {
223// m_log.WarnFormat("[AVATAR FACTORY MODULE]: Queue appearance send for {0}", agentid); 240 // m_log.WarnFormat("[AVFACTORY]: Queue appearance send for {0}", agentid);
224 241
225 // 100 nanoseconds (ticks) we should wait 242 // 10000 ticks per millisecond, 1000 milliseconds per second
226 long timestamp = DateTime.Now.Ticks + Convert.ToInt64(m_sendtime * 10000000); 243 long timestamp = DateTime.Now.Ticks + Convert.ToInt64(m_sendtime * 1000 * 10000);
227 lock (m_sendqueue) 244 lock (m_sendqueue)
228 { 245 {
229 m_sendqueue[agentid] = timestamp; 246 m_sendqueue[agentid] = timestamp;
@@ -233,10 +250,10 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
233 250
234 public void QueueAppearanceSave(UUID agentid) 251 public void QueueAppearanceSave(UUID agentid)
235 { 252 {
236// m_log.WarnFormat("[AVATAR FACTORY MODULE]: Queue appearance save for {0}", agentid); 253 // m_log.WarnFormat("[AVFACTORY]: Queue appearance save for {0}", agentid);
237 254
238 // 100 nanoseconds (ticks) we should wait 255 // 10000 ticks per millisecond, 1000 milliseconds per second
239 long timestamp = DateTime.Now.Ticks + Convert.ToInt64(m_savetime * 10000000); 256 long timestamp = DateTime.Now.Ticks + Convert.ToInt64(m_savetime * 1000 * 10000);
240 lock (m_savequeue) 257 lock (m_savequeue)
241 { 258 {
242 m_savequeue[agentid] = timestamp; 259 m_savequeue[agentid] = timestamp;
@@ -249,15 +266,15 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
249 ScenePresence sp = m_scene.GetScenePresence(agentid); 266 ScenePresence sp = m_scene.GetScenePresence(agentid);
250 if (sp == null) 267 if (sp == null)
251 { 268 {
252 m_log.WarnFormat("[AVATAR FACTORY MODULE]: Agent {0} no longer in the scene", agentid); 269 m_log.WarnFormat("[AVFACTORY]: Agent {0} no longer in the scene", agentid);
253 return; 270 return;
254 } 271 }
255 272
256// m_log.WarnFormat("[AVATAR FACTORY MODULE]: Handle appearance send for {0}", agentid); 273 // m_log.WarnFormat("[AVFACTORY]: Handle appearance send for {0}", agentid);
257 274
258 // Send the appearance to everyone in the scene 275 // Send the appearance to everyone in the scene
259 sp.SendAppearanceToAllOtherAgents(); 276 sp.SendAppearanceToAllOtherAgents();
260 sp.ControllingClient.SendAvatarDataImmediate(sp); 277 // sp.ControllingClient.SendAvatarDataImmediate(sp);
261 278
262 // Send the appearance back to the avatar 279 // Send the appearance back to the avatar
263 // AvatarAppearance avp = sp.Appearance; 280 // AvatarAppearance avp = sp.Appearance;
@@ -279,10 +296,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
279 ScenePresence sp = m_scene.GetScenePresence(agentid); 296 ScenePresence sp = m_scene.GetScenePresence(agentid);
280 if (sp == null) 297 if (sp == null)
281 { 298 {
282 m_log.WarnFormat("[AVATAR FACTORY MODULE]: Agent {0} no longer in the scene", agentid); 299 m_log.WarnFormat("[AVFACTORY]: Agent {0} no longer in the scene", agentid);
283 return; 300 return;
284 } 301 }
285 302
303 // m_log.WarnFormat("[AVFACTORY] avatar {0} save appearance",agentid);
304
286 m_scene.AvatarService.SetAppearance(agentid, sp.Appearance); 305 m_scene.AvatarService.SetAppearance(agentid, sp.Appearance);
287 } 306 }
288 307
@@ -330,11 +349,11 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
330 ScenePresence sp = m_scene.GetScenePresence(client.AgentId); 349 ScenePresence sp = m_scene.GetScenePresence(client.AgentId);
331 if (sp == null) 350 if (sp == null)
332 { 351 {
333 m_log.WarnFormat("[AVATAR FACTORY MODULE]: SendWearables unable to find presence for {0}", client.AgentId); 352 m_log.WarnFormat("[AVFACTORY]: SendWearables unable to find presence for {0}", client.AgentId);
334 return; 353 return;
335 } 354 }
336 355
337// m_log.WarnFormat("[AVATAR FACTORY MODULE]: Received request for wearables of {0}", client.AgentId); 356 // m_log.WarnFormat("[AVFACTORY]: Received request for wearables of {0}", client.AgentId);
338 357
339 client.SendWearables(sp.Appearance.Wearables, sp.Appearance.Serial++); 358 client.SendWearables(sp.Appearance.Wearables, sp.Appearance.Serial++);
340 } 359 }
@@ -349,11 +368,11 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
349 ScenePresence sp = m_scene.GetScenePresence(client.AgentId); 368 ScenePresence sp = m_scene.GetScenePresence(client.AgentId);
350 if (sp == null) 369 if (sp == null)
351 { 370 {
352 m_log.WarnFormat("[AVATAR FACTORY MODULE]: AvatarIsWearing unable to find presence for {0}", client.AgentId); 371 m_log.WarnFormat("[AVFACTORY]: AvatarIsWearing unable to find presence for {0}", client.AgentId);
353 return; 372 return;
354 } 373 }
355 374
356// m_log.WarnFormat("[AVATAR FACTORY MODULE]: AvatarIsWearing called for {0}", client.AgentId); 375 // m_log.WarnFormat("[AVFACTORY]: AvatarIsWearing called for {0}", client.AgentId);
357 376
358 AvatarAppearance avatAppearance = new AvatarAppearance(sp.Appearance, false); 377 AvatarAppearance avatAppearance = new AvatarAppearance(sp.Appearance, false);
359 378
@@ -368,6 +387,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
368 // This could take awhile since it needs to pull inventory 387 // This could take awhile since it needs to pull inventory
369 SetAppearanceAssets(sp.UUID, ref avatAppearance); 388 SetAppearanceAssets(sp.UUID, ref avatAppearance);
370 389
390 // could get fancier with the locks here, but in the spirit of "last write wins"
391 // this should work correctly
371 sp.Appearance = avatAppearance; 392 sp.Appearance = avatAppearance;
372 m_scene.AvatarService.SetAppearance(client.AgentId, sp.Appearance); 393 m_scene.AvatarService.SetAppearance(client.AgentId, sp.Appearance);
373 } 394 }
@@ -398,7 +419,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
398 else 419 else
399 { 420 {
400 m_log.ErrorFormat( 421 m_log.ErrorFormat(
401 "[AVATAR FACTORY MODULE]: Can't find inventory item {0} for {1}, setting to default", 422 "[AVFACTORY]: Can't find inventory item {0} for {1}, setting to default",
402 appearance.Wearables[i][j].ItemID, (WearableType)i); 423 appearance.Wearables[i][j].ItemID, (WearableType)i);
403 424
404 appearance.Wearables[i].RemoveItem(appearance.Wearables[i][j].ItemID); 425 appearance.Wearables[i].RemoveItem(appearance.Wearables[i][j].ItemID);
@@ -408,7 +429,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
408 } 429 }
409 else 430 else
410 { 431 {
411 m_log.WarnFormat("[AVATAR FACTORY MODULE]: user {0} has no inventory, appearance isn't going to work", userID); 432 m_log.WarnFormat("[AVFACTORY]: user {0} has no inventory, appearance isn't going to work", userID);
412 } 433 }
413 } 434 }
414 } 435 }
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 3c7638d..81d6f70 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -1255,11 +1255,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1255 } 1255 }
1256 1256
1257 m_log.Debug("[ENTITY TRANSFER MODULE]: Completed inform client about neighbour " + endPoint.ToString()); 1257 m_log.Debug("[ENTITY TRANSFER MODULE]: Completed inform client about neighbour " + endPoint.ToString());
1258
1259 } 1258 }
1260
1261 } 1259 }
1262 1260
1261 /// <summary>
1262 /// Return the list of regions that are considered to be neighbours to the given scene.
1263 /// </summary>
1264 /// <param name="pScene"></param>
1265 /// <param name="pRegionLocX"></param>
1266 /// <param name="pRegionLocY"></param>
1267 /// <returns></returns>
1263 protected List<GridRegion> RequestNeighbours(Scene pScene, uint pRegionLocX, uint pRegionLocY) 1268 protected List<GridRegion> RequestNeighbours(Scene pScene, uint pRegionLocX, uint pRegionLocY)
1264 { 1269 {
1265 RegionInfo m_regionInfo = pScene.RegionInfo; 1270 RegionInfo m_regionInfo = pScene.RegionInfo;