From 728fd0b1b8e1c80f6961ec06efb34727645fdc3e Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 10 Sep 2011 01:09:17 +0100 Subject: lock attachments when enumerating through them in ScenePresence.CopyTo(). May have some effect on http://opensimulator.org/mantis/view.php?id=5644 --- OpenSim/Framework/ChildAgentDataUpdate.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index 53ec166..5a4811e 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs @@ -441,7 +441,6 @@ namespace OpenSim.Framework args["controllers"] = controls; } - if ((CallbackURI != null) && (!CallbackURI.Equals(""))) args["callback_uri"] = OSD.FromString(CallbackURI); -- cgit v1.1 From dab6387bba7a7388e3cdb4ad1eeea646bc03a287 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 12 Sep 2011 21:05:26 +0100 Subject: lock AvatarAppearance.m_attachments when we use it This is partly to address http://opensimulator.org/mantis/view.php?id=5644, though something more thorough is needed. --- OpenSim/Framework/AvatarAppearance.cs | 91 ++++++++++++++++++++++------------- 1 file changed, 58 insertions(+), 33 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index cce44b0..c69dde3 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs @@ -391,10 +391,14 @@ namespace OpenSim.Framework public List GetAttachments() { List alist = new List(); - foreach (KeyValuePair> kvp in m_attachments) + + lock (m_attachments) { - foreach (AvatarAttachment attach in kvp.Value) - alist.Add(new AvatarAttachment(attach)); + foreach (KeyValuePair> kvp in m_attachments) + { + foreach (AvatarAttachment attach in kvp.Value) + alist.Add(new AvatarAttachment(attach)); + } } return alist; @@ -406,10 +410,13 @@ namespace OpenSim.Framework // "[AVATAR APPEARNCE]: Appending itemID={0}, assetID={1} at {2}", // attach.ItemID, attach.AssetID, attach.AttachPoint); - if (!m_attachments.ContainsKey(attach.AttachPoint)) - m_attachments[attach.AttachPoint] = new List(); - - m_attachments[attach.AttachPoint].Add(attach); + lock (m_attachments) + { + if (!m_attachments.ContainsKey(attach.AttachPoint)) + m_attachments[attach.AttachPoint] = new List(); + + m_attachments[attach.AttachPoint].Add(attach); + } } internal void ReplaceAttachment(AvatarAttachment attach) @@ -418,8 +425,11 @@ namespace OpenSim.Framework // "[AVATAR APPEARANCE]: Replacing itemID={0}, assetID={1} at {2}", // attach.ItemID, attach.AssetID, attach.AttachPoint); - m_attachments[attach.AttachPoint] = new List(); - m_attachments[attach.AttachPoint].Add(attach); + lock (m_attachments) + { + m_attachments[attach.AttachPoint] = new List(); + m_attachments[attach.AttachPoint].Add(attach); + } } /// @@ -448,10 +458,13 @@ namespace OpenSim.Framework if (item == UUID.Zero) { - if (m_attachments.ContainsKey(attachpoint)) + lock (m_attachments) { - m_attachments.Remove(attachpoint); - return true; + if (m_attachments.ContainsKey(attachpoint)) + { + m_attachments.Remove(attachpoint); + return true; + } } return false; @@ -494,11 +507,14 @@ namespace OpenSim.Framework /// Returns null if this item is not attached. public AvatarAttachment GetAttachmentForItem(UUID itemID) { - foreach (KeyValuePair> kvp in m_attachments) + lock (m_attachments) { - int index = kvp.Value.FindIndex(delegate(AvatarAttachment a) { return a.ItemID == itemID; }); - if (index >= 0) - return kvp.Value[index]; + foreach (KeyValuePair> kvp in m_attachments) + { + int index = kvp.Value.FindIndex(delegate(AvatarAttachment a) { return a.ItemID == itemID; }); + if (index >= 0) + return kvp.Value[index]; + } } return null; @@ -506,11 +522,14 @@ namespace OpenSim.Framework public int GetAttachpoint(UUID itemID) { - foreach (KeyValuePair> kvp in m_attachments) + lock (m_attachments) { - int index = kvp.Value.FindIndex(delegate(AvatarAttachment a) { return a.ItemID == itemID; }); - if (index >= 0) - return kvp.Key; + foreach (KeyValuePair> kvp in m_attachments) + { + int index = kvp.Value.FindIndex(delegate(AvatarAttachment a) { return a.ItemID == itemID; }); + if (index >= 0) + return kvp.Key; + } } return 0; @@ -518,27 +537,32 @@ namespace OpenSim.Framework public bool DetachAttachment(UUID itemID) { - foreach (KeyValuePair> kvp in m_attachments) + lock (m_attachments) { - int index = kvp.Value.FindIndex(delegate(AvatarAttachment a) { return a.ItemID == itemID; }); - if (index >= 0) + foreach (KeyValuePair> kvp in m_attachments) { - // Remove it from the list of attachments at that attach point - m_attachments[kvp.Key].RemoveAt(index); - - // And remove the list if there are no more attachments here - if (m_attachments[kvp.Key].Count == 0) - m_attachments.Remove(kvp.Key); - - return true; + int index = kvp.Value.FindIndex(delegate(AvatarAttachment a) { return a.ItemID == itemID; }); + if (index >= 0) + { + // Remove it from the list of attachments at that attach point + m_attachments[kvp.Key].RemoveAt(index); + + // And remove the list if there are no more attachments here + if (m_attachments[kvp.Key].Count == 0) + m_attachments.Remove(kvp.Key); + + return true; + } } } + return false; } public void ClearAttachments() { - m_attachments.Clear(); + lock (m_attachments) + m_attachments.Clear(); } #region Packing Functions @@ -576,7 +600,8 @@ namespace OpenSim.Framework data["visualparams"] = visualparams; // Attachments - OSDArray attachs = new OSDArray(m_attachments.Count); + List attachments = GetAttachments(); + OSDArray attachs = new OSDArray(attachments.Count); foreach (AvatarAttachment attach in GetAttachments()) attachs.Add(attach.Pack()); data["attachments"] = attachs; -- cgit v1.1 From 306af9934aac2aaf7fe9baa156b3cc57ff3f3f56 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 13 Sep 2011 17:13:42 +0100 Subject: In an object return message, send a null-terminated empty string in binary bucket to prevent a viewer 3 crash. This is the message sent to the client when the object is returned. We were sending byte[0] in the binary bucket. This didn't kill viewer 1 but did terminate viewer 3 (don't know about viewer 2). So sending "\0" instead. This is to address http://opensimulator.org/mantis/view.php?id=5683 --- OpenSim/Framework/Util.cs | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 745da17..c4fc643 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -1372,11 +1372,30 @@ namespace OpenSim.Framework return (ipaddr1 != null) ? "http://" + ipaddr1.ToString() + ":" + port1 : uri; } + /// + /// Convert a string to a byte format suitable for transport in an LLUDP packet. The output is truncated to 256 bytes if necessary. + /// + /// + /// If null or empty, then an bytes[0] is returned. + /// Using "\0" will return a conversion of the null character to a byte. This is not the same as bytes[0] + /// + /// + /// Arguments to substitute into the string via the {} mechanism. + /// + /// public static byte[] StringToBytes256(string str, params object[] args) { return StringToBytes256(string.Format(str, args)); } - + + /// + /// Convert a string to a byte format suitable for transport in an LLUDP packet. The output is truncated to 256 bytes if necessary. + /// + /// + /// If null or empty, then an bytes[0] is returned. + /// Using "\0" will return a conversion of the null character to a byte. This is not the same as bytes[0] + /// + /// public static byte[] StringToBytes256(string str) { if (String.IsNullOrEmpty(str)) { return Utils.EmptyBytes; } @@ -1395,11 +1414,30 @@ namespace OpenSim.Framework return data; } + /// + /// Convert a string to a byte format suitable for transport in an LLUDP packet. The output is truncated to 1024 bytes if necessary. + /// + /// + /// If null or empty, then an bytes[0] is returned. + /// Using "\0" will return a conversion of the null character to a byte. This is not the same as bytes[0] + /// + /// + /// Arguments to substitute into the string via the {} mechanism. + /// + /// public static byte[] StringToBytes1024(string str, params object[] args) { return StringToBytes1024(string.Format(str, args)); } - + + /// + /// Convert a string to a byte format suitable for transport in an LLUDP packet. The output is truncated to 1024 bytes if necessary. + /// + /// + /// If null or empty, then an bytes[0] is returned. + /// Using "\0" will return a conversion of the null character to a byte. This is not the same as bytes[0] + /// + /// public static byte[] StringToBytes1024(string str) { if (String.IsNullOrEmpty(str)) { return Utils.EmptyBytes; } -- cgit v1.1 From 923f2459cfa8106c6de52dc694c700ab07d8109b Mon Sep 17 00:00:00 2001 From: Kevin Houlihan Date: Wed, 14 Sep 2011 22:10:43 +0100 Subject: Passwords could be revealed in console by pressing backspace. Pressing backspace causes hidden input (such as passwords) to be revealed on the console. The echo state was not being taken into account when handling a backspace key press. --- OpenSim/Framework/Console/LocalConsole.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Console/LocalConsole.cs b/OpenSim/Framework/Console/LocalConsole.cs index eda41b8..05a3aee 100644 --- a/OpenSim/Framework/Console/LocalConsole.cs +++ b/OpenSim/Framework/Console/LocalConsole.cs @@ -417,7 +417,10 @@ namespace OpenSim.Framework.Console SetCursorLeft(0); y = SetCursorTop(y); - System.Console.Write("{0}{1} ", prompt, cmdline); + if (echo) + System.Console.Write("{0}{1} ", prompt, cmdline); + else + System.Console.Write("{0}", prompt); break; case ConsoleKey.End: -- cgit v1.1 From 903d5c02cb372af3fef5884d95312110229fbc1e Mon Sep 17 00:00:00 2001 From: Kevin Houlihan Date: Wed, 14 Sep 2011 23:02:35 +0100 Subject: Updated some variables to be closer to the coding standards (and easier to understand). There were a few variables in LocalConsole with single character names, and the class fields did not use the m_ prefix. I also removed a redundant variable, h. It was being set to 1 in a couple of places, and incremented in another, but never actually used. --- OpenSim/Framework/Console/LocalConsole.cs | 179 +++++++++++++++--------------- 1 file changed, 88 insertions(+), 91 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Console/LocalConsole.cs b/OpenSim/Framework/Console/LocalConsole.cs index 05a3aee..7c8626d 100644 --- a/OpenSim/Framework/Console/LocalConsole.cs +++ b/OpenSim/Framework/Console/LocalConsole.cs @@ -46,12 +46,11 @@ namespace OpenSim.Framework.Console // private readonly object m_syncRoot = new object(); private const string LOGLEVEL_NONE = "(none)"; - private int y = -1; - private int cp = 0; - private int h = 1; - private StringBuilder cmdline = new StringBuilder(); - private bool echo = true; - private List history = new List(); + private int m_cursorYPosition = -1; + private int m_cursorXPosition = 0; + private StringBuilder m_commandLine = new StringBuilder(); + private bool m_echo = true; + private List m_history = new List(); private static readonly ConsoleColor[] Colors = { // the dark colors don't seem to be visible on some black background terminals like putty :( @@ -81,10 +80,10 @@ namespace OpenSim.Framework.Console private void AddToHistory(string text) { - while (history.Count >= 100) - history.RemoveAt(0); + while (m_history.Count >= 100) + m_history.RemoveAt(0); - history.Add(text); + m_history.Add(text); } /// @@ -111,11 +110,11 @@ namespace OpenSim.Framework.Console } else { - int bw = System.Console.BufferWidth; + int bufferWidth = System.Console.BufferWidth; // On Mono 2.4.2.3 (and possibly above), the buffer value is sometimes erroneously zero (Mantis 4657) - if (bw > 0 && left >= bw) - System.Console.CursorLeft = bw - 1; + if (bufferWidth > 0 && left >= bufferWidth) + System.Console.CursorLeft = bufferWidth - 1; } if (top < 0) @@ -124,11 +123,11 @@ namespace OpenSim.Framework.Console } else { - int bh = System.Console.BufferHeight; + int bufferHeight = System.Console.BufferHeight; // On Mono 2.4.2.3 (and possibly above), the buffer value is sometimes erroneously zero (Mantis 4657) - if (bh > 0 && top >= bh) - top = bh - 1; + if (bufferHeight > 0 && top >= bufferHeight) + top = bufferHeight - 1; } System.Console.CursorTop = top; @@ -160,10 +159,10 @@ namespace OpenSim.Framework.Console } else { - int bh = System.Console.BufferHeight; + int bufferHeight = System.Console.BufferHeight; // On Mono 2.4.2.3 (and possibly above), the buffer value is sometimes erroneously zero (Mantis 4657) - if (bh > 0 && top >= bh) - System.Console.CursorTop = bh - 1; + if (bufferHeight > 0 && top >= bufferHeight) + System.Console.CursorTop = bufferHeight - 1; } if (left < 0) @@ -172,11 +171,11 @@ namespace OpenSim.Framework.Console } else { - int bw = System.Console.BufferWidth; + int bufferWidth = System.Console.BufferWidth; // On Mono 2.4.2.3 (and possibly above), the buffer value is sometimes erroneously zero (Mantis 4657) - if (bw > 0 && left >= bw) - left = bw - 1; + if (bufferWidth > 0 && left >= bufferWidth) + left = bufferWidth - 1; } System.Console.CursorLeft = left; @@ -186,31 +185,30 @@ namespace OpenSim.Framework.Console private void Show() { - lock (cmdline) + lock (m_commandLine) { - if (y == -1 || System.Console.BufferWidth == 0) + if (m_cursorYPosition == -1 || System.Console.BufferWidth == 0) return; - int xc = prompt.Length + cp; + int xc = prompt.Length + m_cursorXPosition; int new_x = xc % System.Console.BufferWidth; - int new_y = y + xc / System.Console.BufferWidth; - int end_y = y + (cmdline.Length + prompt.Length) / System.Console.BufferWidth; - if (end_y / System.Console.BufferWidth >= h) - h++; + int new_y = m_cursorYPosition + xc / System.Console.BufferWidth; + int end_y = m_cursorYPosition + (m_commandLine.Length + prompt.Length) / System.Console.BufferWidth; + if (end_y >= System.Console.BufferHeight) // wrap { - y--; + m_cursorYPosition--; new_y--; SetCursorLeft(0); SetCursorTop(System.Console.BufferHeight - 1); System.Console.WriteLine(" "); } - y = SetCursorTop(y); + m_cursorYPosition = SetCursorTop(m_cursorYPosition); SetCursorLeft(0); - if (echo) - System.Console.Write("{0}{1}", prompt, cmdline); + if (m_echo) + System.Console.Write("{0}{1}", prompt, m_commandLine); else System.Console.Write("{0}", prompt); @@ -221,20 +219,20 @@ namespace OpenSim.Framework.Console public override void LockOutput() { - Monitor.Enter(cmdline); + Monitor.Enter(m_commandLine); try { - if (y != -1) + if (m_cursorYPosition != -1) { - y = SetCursorTop(y); + m_cursorYPosition = SetCursorTop(m_cursorYPosition); System.Console.CursorLeft = 0; - int count = cmdline.Length + prompt.Length; + int count = m_commandLine.Length + prompt.Length; while (count-- > 0) System.Console.Write(" "); - y = SetCursorTop(y); + m_cursorYPosition = SetCursorTop(m_cursorYPosition); SetCursorLeft(0); } } @@ -245,12 +243,12 @@ namespace OpenSim.Framework.Console public override void UnlockOutput() { - if (y != -1) + if (m_cursorYPosition != -1) { - y = System.Console.CursorTop; + m_cursorYPosition = System.Console.CursorTop; Show(); } - Monitor.Exit(cmdline); + Monitor.Exit(m_commandLine); } private void WriteColorText(ConsoleColor color, string sender) @@ -317,29 +315,29 @@ namespace OpenSim.Framework.Console public override void Output(string text, string level) { - lock (cmdline) + lock (m_commandLine) { - if (y == -1) + if (m_cursorYPosition == -1) { WriteLocalText(text, level); return; } - y = SetCursorTop(y); + m_cursorYPosition = SetCursorTop(m_cursorYPosition); SetCursorLeft(0); - int count = cmdline.Length + prompt.Length; + int count = m_commandLine.Length + prompt.Length; while (count-- > 0) System.Console.Write(" "); - y = SetCursorTop(y); + m_cursorYPosition = SetCursorTop(m_cursorYPosition); SetCursorLeft(0); WriteLocalText(text, level); - y = System.Console.CursorTop; + m_cursorYPosition = System.Console.CursorTop; Show(); } @@ -347,9 +345,9 @@ namespace OpenSim.Framework.Console private bool ContextHelp() { - string[] words = Parser.Parse(cmdline.ToString()); + string[] words = Parser.Parse(m_commandLine.ToString()); - bool trailingSpace = cmdline.ToString().EndsWith(" "); + bool trailingSpace = m_commandLine.ToString().EndsWith(" "); // Allow ? through while typing a URI // @@ -368,19 +366,18 @@ namespace OpenSim.Framework.Console public override string ReadLine(string p, bool isCommand, bool e) { - h = 1; - cp = 0; + m_cursorXPosition = 0; prompt = p; - echo = e; - int historyLine = history.Count; + m_echo = e; + int historyLine = m_history.Count; SetCursorLeft(0); // Needed for mono System.Console.Write(" "); // Needed for mono - lock (cmdline) + lock (m_commandLine) { - y = System.Console.CursorTop; - cmdline.Remove(0, cmdline.Length); + m_cursorYPosition = System.Console.CursorTop; + m_commandLine.Remove(0, m_commandLine.Length); } while (true) @@ -388,95 +385,95 @@ namespace OpenSim.Framework.Console Show(); ConsoleKeyInfo key = System.Console.ReadKey(true); - char c = key.KeyChar; + char enteredChar = key.KeyChar; - if (!Char.IsControl(c)) + if (!Char.IsControl(enteredChar)) { - if (cp >= 318) + if (m_cursorXPosition >= 318) continue; - if (c == '?' && isCommand) + if (enteredChar == '?' && isCommand) { if (ContextHelp()) continue; } - cmdline.Insert(cp, c); - cp++; + m_commandLine.Insert(m_cursorXPosition, enteredChar); + m_cursorXPosition++; } else { switch (key.Key) { case ConsoleKey.Backspace: - if (cp == 0) + if (m_cursorXPosition == 0) break; - cmdline.Remove(cp-1, 1); - cp--; + m_commandLine.Remove(m_cursorXPosition-1, 1); + m_cursorXPosition--; SetCursorLeft(0); - y = SetCursorTop(y); + m_cursorYPosition = SetCursorTop(m_cursorYPosition); - if (echo) - System.Console.Write("{0}{1} ", prompt, cmdline); + if (m_echo) + System.Console.Write("{0}{1} ", prompt, m_commandLine); else System.Console.Write("{0}", prompt); break; case ConsoleKey.End: - cp = cmdline.Length; + m_cursorXPosition = m_commandLine.Length; break; case ConsoleKey.Home: - cp = 0; + m_cursorXPosition = 0; break; case ConsoleKey.UpArrow: if (historyLine < 1) break; historyLine--; LockOutput(); - cmdline.Remove(0, cmdline.Length); - cmdline.Append(history[historyLine]); - cp = cmdline.Length; + m_commandLine.Remove(0, m_commandLine.Length); + m_commandLine.Append(m_history[historyLine]); + m_cursorXPosition = m_commandLine.Length; UnlockOutput(); break; case ConsoleKey.DownArrow: - if (historyLine >= history.Count) + if (historyLine >= m_history.Count) break; historyLine++; LockOutput(); - if (historyLine == history.Count) + if (historyLine == m_history.Count) { - cmdline.Remove(0, cmdline.Length); + m_commandLine.Remove(0, m_commandLine.Length); } else { - cmdline.Remove(0, cmdline.Length); - cmdline.Append(history[historyLine]); + m_commandLine.Remove(0, m_commandLine.Length); + m_commandLine.Append(m_history[historyLine]); } - cp = cmdline.Length; + m_cursorXPosition = m_commandLine.Length; UnlockOutput(); break; case ConsoleKey.LeftArrow: - if (cp > 0) - cp--; + if (m_cursorXPosition > 0) + m_cursorXPosition--; break; case ConsoleKey.RightArrow: - if (cp < cmdline.Length) - cp++; + if (m_cursorXPosition < m_commandLine.Length) + m_cursorXPosition++; break; case ConsoleKey.Enter: SetCursorLeft(0); - y = SetCursorTop(y); + m_cursorYPosition = SetCursorTop(m_cursorYPosition); System.Console.WriteLine(); //Show(); - lock (cmdline) + lock (m_commandLine) { - y = -1; + m_cursorYPosition = -1; } - string commandLine = cmdline.ToString(); + string commandLine = m_commandLine.ToString(); if (isCommand) { @@ -484,12 +481,12 @@ namespace OpenSim.Framework.Console if (cmd.Length != 0) { - int i; + int index; - for (i=0 ; i < cmd.Length ; i++) + for (index=0 ; index < cmd.Length ; index++) { - if (cmd[i].Contains(" ")) - cmd[i] = "\"" + cmd[i] + "\""; + if (cmd[index].Contains(" ")) + cmd[index] = "\"" + cmd[index] + "\""; } AddToHistory(String.Join(" ", cmd)); return String.Empty; @@ -497,7 +494,7 @@ namespace OpenSim.Framework.Console } // If we're not echoing to screen (e.g. a password) then we probably don't want it in history - if (echo && commandLine != "") + if (m_echo && commandLine != "") AddToHistory(commandLine); return commandLine; -- cgit v1.1 From d358125cac4e01194dae4b1f0bc9afc87e463f76 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 22 Sep 2011 00:16:05 +0100 Subject: Reinstate option to land an npc when it reaches a target. This is moved into ScenePresence for now as a general facility --- OpenSim/Framework/IClientAPI.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 150ff1b..47e79d1 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -935,7 +935,7 @@ namespace OpenSim.Framework event ScriptReset OnScriptReset; event GetScriptRunning OnGetScriptRunning; event SetScriptRunning OnSetScriptRunning; - event Action OnAutoPilotGo; + event Action OnAutoPilotGo; event TerrainUnacked OnUnackedTerrain; event ActivateGesture OnActivateGesture; -- cgit v1.1 From c8304b7f84b1a8d9fb978cae510f684e36419deb Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 23 Sep 2011 02:59:33 +0100 Subject: Fix avatar parameter updating for viewer 3 and maybe 2. When a slider parameter is changed, the viewer uploads a new shape (or other asset) and the item is updated to point to it. Viewer 1 uploaded the data in the initial request itself, so the asset references was almost always correctly updated. However, viewer 3/2 always uploads data in a subsequent xfer, which exposed a race condition where the viewer would make the item update before the asset had uploaded. This commit shuffles the order of operations to avoid this race, the item is updated with the new asset id instead of the old one while the upload was still taking place. A second race had to be fixed where avatar appearance would also be updated with the old asset id rather than the new one. This was fixed by updating the avatar appearance ids when the appearance was actually saved, rather than when the wearables update was made. --- OpenSim/Framework/AssetBase.cs | 1 + OpenSim/Framework/AvatarAppearance.cs | 2 ++ 2 files changed, 3 insertions(+) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/AssetBase.cs b/OpenSim/Framework/AssetBase.cs index e8c85c9..d2c6c57 100644 --- a/OpenSim/Framework/AssetBase.cs +++ b/OpenSim/Framework/AssetBase.cs @@ -167,6 +167,7 @@ namespace OpenSim.Framework get { return m_metadata.FullID; } set { m_metadata.FullID = value; } } + /// /// Asset MetaData ID (transferring from UUID to string ID) /// diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index c69dde3..72b580b 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs @@ -225,6 +225,8 @@ namespace OpenSim.Framework /// public virtual void ResetAppearance() { +// m_log.WarnFormat("[AVATAR APPEARANCE]: Reset appearance"); + m_serial = 0; SetDefaultTexture(); -- cgit v1.1