diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index c01d66ab57..a0ff151a92 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs @@ -196,10 +196,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory public void UpdateDatabase(UUID user, AvatarAppearance appearance) { - m_log.DebugFormat("[APPEARANCE]: UpdateDatabase"); + //m_log.DebugFormat("[APPEARANCE]: UpdateDatabase"); AvatarData adata = new AvatarData(appearance); m_scene.AvatarService.SetAvatar(user, adata); - } private static byte[] GetDefaultVisualParams() diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs index bd2d8cbc09..227c37fcac 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs @@ -281,7 +281,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation return false; // Try local first - if (m_localBackend.CreateObject(destination, sog, true)) + if (m_localBackend.CreateObject(destination, sog, isLocalCall)) { //m_log.Debug("[REST COMMS]: LocalBackEnd SendCreateObject succeeded"); return true; diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 70aea75850..62a831e23e 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -2358,7 +2358,7 @@ namespace OpenSim.Region.Framework.Scenes InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); item = InventoryService.GetItem(item); - presence.Appearance.SetAttachment((int)AttachmentPt, itemID, /*item.AssetID*/ att.UUID); + presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); } return att.UUID; } @@ -2403,7 +2403,7 @@ namespace OpenSim.Region.Framework.Scenes // XXYY!! InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); item = InventoryService.GetItem(item); - presence.Appearance.SetAttachment((int)AttachmentPt, itemID, /*item.AssetID*/ att.UUID); + presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /* att.UUID */); if (m_AvatarFactory != null) { diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 4bbea161d7..206e2f8dc0 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2553,6 +2553,9 @@ namespace OpenSim.Region.Framework.Scenes return false; } + + sceneObject.SetScene(this); + // Force allocation of new LocalId // foreach (SceneObjectPart p in sceneObject.Children.Values) diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 1e7f54aa1e..63719acea0 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs @@ -414,7 +414,7 @@ namespace OpenSim.Region.Framework.Scenes /// Create the necessary child agents List cagents = new List(); foreach (GridRegion neighbour in neighbours) - { + { if (neighbour.RegionHandle != avatar.Scene.RegionInfo.RegionHandle) { @@ -446,7 +446,6 @@ namespace OpenSim.Region.Framework.Scenes if (avatar.Scene.CapsModule != null) { - // These two are the same thing! avatar.Scene.CapsModule.SetChildrenSeed(avatar.UUID, seeds); } avatar.KnownRegions = seeds; @@ -516,8 +515,6 @@ namespace OpenSim.Region.Framework.Scenes agent.InventoryFolder = UUID.Zero; agent.startpos = new Vector3(128, 128, 70); agent.child = true; - if (avatar.Appearance == null) - m_log.Debug("XXX Appearance is null!!!!"); agent.Appearance = avatar.Appearance; InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync; @@ -1450,17 +1447,17 @@ namespace OpenSim.Region.Framework.Scenes return m_scene.GridService.GetRegionsByName(UUID.Zero, name, maxNumber); } - //private void Dump(string msg, List handles) - //{ - // m_log.InfoFormat("-------------- HANDLE DUMP ({0}) ---------", msg); - // foreach (ulong handle in handles) - // { - // uint x, y; - // Utils.LongToUInts(handle, out x, out y); - // x = x / Constants.RegionSize; - // y = y / Constants.RegionSize; - // m_log.InfoFormat("({0}, {1})", x, y); - // } - //} + private void Dump(string msg, List handles) + { + m_log.InfoFormat("-------------- HANDLE DUMP ({0}) ---------", msg); + foreach (ulong handle in handles) + { + uint x, y; + Utils.LongToUInts(handle, out x, out y); + x = x / Constants.RegionSize; + y = y / Constants.RegionSize; + m_log.InfoFormat("({0}, {1})", x, y); + } + } } } diff --git a/OpenSim/Server/Base/ServerUtils.cs b/OpenSim/Server/Base/ServerUtils.cs index a5d28a413d..e00eb2a725 100644 --- a/OpenSim/Server/Base/ServerUtils.cs +++ b/OpenSim/Server/Base/ServerUtils.cs @@ -278,6 +278,9 @@ namespace OpenSim.Server.Base { foreach (KeyValuePair kvp in data) { + if (kvp.Value == null) + continue; + XmlElement elem = parent.OwnerDocument.CreateElement("", kvp.Key, ""); diff --git a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs index 926c195b6e..d180bbb749 100644 --- a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs @@ -65,7 +65,7 @@ namespace OpenSim.Server.Handlers.Presence body = body.Trim(); //m_log.DebugFormat("[XXX]: query String: {0}", body); - + string method = string.Empty; try { Dictionary request = @@ -74,7 +74,7 @@ namespace OpenSim.Server.Handlers.Presence if (!request.ContainsKey("METHOD")) return FailureResult(); - string method = request["METHOD"].ToString(); + method = request["METHOD"].ToString(); switch (method) { @@ -97,7 +97,7 @@ namespace OpenSim.Server.Handlers.Presence } catch (Exception e) { - m_log.Debug("[PRESENCE HANDLER]: Exception {0}" + e); + m_log.DebugFormat("[PRESENCE HANDLER]: Exception in method {0}: {1}", method, e); } return FailureResult(); @@ -188,9 +188,11 @@ namespace OpenSim.Server.Handlers.Presence if (request.ContainsKey("lookAt")) Vector3.TryParse(request["lookAt"].ToString(), out look); - + if (m_PresenceService.ReportAgent(session, region, position, look)) + { return SuccessResult(); + } return FailureResult(); } diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index 782034b8ff..da9c0155f3 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs @@ -61,11 +61,11 @@ namespace OpenSim.Server.Handlers.Simulation { //m_log.Debug("[CONNECTION DEBUGGING]: AgentHandler Called"); - m_log.Debug("---------------------------"); - m_log.Debug(" >> uri=" + request["uri"]); - m_log.Debug(" >> content-type=" + request["content-type"]); - m_log.Debug(" >> http-method=" + request["http-method"]); - m_log.Debug("---------------------------\n"); + //m_log.Debug("---------------------------"); + //m_log.Debug(" >> uri=" + request["uri"]); + //m_log.Debug(" >> content-type=" + request["content-type"]); + //m_log.Debug(" >> http-method=" + request["http-method"]); + //m_log.Debug("---------------------------\n"); Hashtable responsedata = new Hashtable(); responsedata["content_type"] = "text/html"; @@ -320,7 +320,7 @@ namespace OpenSim.Server.Handlers.Simulation responsedata["int_response_code"] = HttpStatusCode.OK; responsedata["str_response_string"] = "OpenSim agent " + id.ToString(); - m_log.Debug("[AGENT HANDLER]: Agent Deleted."); + m_log.Debug("[AGENT HANDLER]: Agent Released/Deleted."); } } diff --git a/OpenSim/Server/Handlers/Simulation/ObjectHandlers.cs b/OpenSim/Server/Handlers/Simulation/ObjectHandlers.cs index 995a3c404e..b6eabe318d 100644 --- a/OpenSim/Server/Handlers/Simulation/ObjectHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/ObjectHandlers.cs @@ -59,13 +59,13 @@ namespace OpenSim.Server.Handlers.Simulation public Hashtable Handler(Hashtable request) { - m_log.Debug("[CONNECTION DEBUGGING]: ObjectHandler Called"); + //m_log.Debug("[CONNECTION DEBUGGING]: ObjectHandler Called"); - m_log.Debug("---------------------------"); - m_log.Debug(" >> uri=" + request["uri"]); - m_log.Debug(" >> content-type=" + request["content-type"]); - m_log.Debug(" >> http-method=" + request["http-method"]); - m_log.Debug("---------------------------\n"); + //m_log.Debug("---------------------------"); + //m_log.Debug(" >> uri=" + request["uri"]); + //m_log.Debug(" >> content-type=" + request["content-type"]); + //m_log.Debug(" >> http-method=" + request["http-method"]); + //m_log.Debug("---------------------------\n"); Hashtable responsedata = new Hashtable(); responsedata["content_type"] = "text/html"; @@ -75,7 +75,7 @@ namespace OpenSim.Server.Handlers.Simulation string action; if (!Utils.GetParams((string)request["uri"], out objectID, out regionID, out action)) { - m_log.InfoFormat("[REST COMMS]: Invalid parameters for object message {0}", request["uri"]); + m_log.InfoFormat("[OBJECT HANDLER]: Invalid parameters for object message {0}", request["uri"]); responsedata["int_response_code"] = 404; responsedata["str_response_string"] = "false"; @@ -101,7 +101,7 @@ namespace OpenSim.Server.Handlers.Simulation //} else { - m_log.InfoFormat("[REST COMMS]: method {0} not supported in object message", method); + m_log.InfoFormat("[OBJECT HANDLER]: method {0} not supported in object message", method); responsedata["int_response_code"] = HttpStatusCode.MethodNotAllowed; responsedata["str_response_string"] = "Mthod not allowed"; @@ -148,13 +148,13 @@ namespace OpenSim.Server.Handlers.Simulation ISceneObject sog = null; try { - //sog = SceneObjectSerializer.FromXml2Format(sogXmlStr); + //m_log.DebugFormat("[OBJECT HANDLER]: received {0}", sogXmlStr); sog = s.DeserializeObject(sogXmlStr); sog.ExtraFromXmlString(extraStr); } catch (Exception ex) { - m_log.InfoFormat("[REST COMMS]: exception on deserializing scene object {0}", ex.Message); + m_log.InfoFormat("[OBJECT HANDLER]: exception on deserializing scene object {0}", ex.Message); responsedata["int_response_code"] = HttpStatusCode.BadRequest; responsedata["str_response_string"] = "Bad request"; return; @@ -171,13 +171,22 @@ namespace OpenSim.Server.Handlers.Simulation } catch (Exception ex) { - m_log.InfoFormat("[REST COMMS]: exception on setting state for scene object {0}", ex.Message); + m_log.InfoFormat("[OBJECT HANDLER]: exception on setting state for scene object {0}", ex.Message); // ignore and continue } } } - // This is the meaning of POST object - bool result = m_SimulationService.CreateObject(destination, sog, false); + + bool result = false; + try + { + // This is the meaning of POST object + result = m_SimulationService.CreateObject(destination, sog, false); + } + catch (Exception e) + { + m_log.DebugFormat("[OBJECT HANDLER]: Exception in CreateObject: {0}", e.StackTrace); + } responsedata["int_response_code"] = HttpStatusCode.OK; responsedata["str_response_string"] = result.ToString(); diff --git a/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs index b54b63e4e1..6a82165134 100644 --- a/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs +++ b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs @@ -68,7 +68,7 @@ namespace OpenSim.Server.Handlers.UserAccounts //httpRequest.Headers["authorization"] ... //m_log.DebugFormat("[XXX]: query String: {0}", body); - + string method = string.Empty; try { Dictionary request = @@ -77,7 +77,7 @@ namespace OpenSim.Server.Handlers.UserAccounts if (!request.ContainsKey("METHOD")) return FailureResult(); - string method = request["METHOD"].ToString(); + method = request["METHOD"].ToString(); switch (method) { @@ -88,11 +88,11 @@ namespace OpenSim.Server.Handlers.UserAccounts case "setaccount": return StoreAccount(request); } - m_log.DebugFormat("[PRESENCE HANDLER]: unknown method request: {0}", method); + m_log.DebugFormat("[USER SERVICE HANDLER]: unknown method request: {0}", method); } catch (Exception e) { - m_log.Debug("[PRESENCE HANDLER]: Exception {0}" + e); + m_log.DebugFormat("[USER SERVICE HANDLER]: Exception in method {0}: {1}", method, e); } return FailureResult(); @@ -134,7 +134,9 @@ namespace OpenSim.Server.Handlers.UserAccounts if (account == null) result["result"] = "null"; else + { result["result"] = account.ToKeyValuePairs(); + } return ResultToBytes(result); } @@ -247,7 +249,6 @@ namespace OpenSim.Server.Handlers.UserAccounts private byte[] ResultToBytes(Dictionary result) { string xmlString = ServerUtils.BuildXmlResponse(result); - //m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString); UTF8Encoding encoding = new UTF8Encoding(); return encoding.GetBytes(xmlString); } diff --git a/OpenSim/Services/Connectors/Avatar/AvatarServiceConnector.cs b/OpenSim/Services/Connectors/Avatar/AvatarServiceConnector.cs index 6d9fc602ed..82ceaaf55f 100644 --- a/OpenSim/Services/Connectors/Avatar/AvatarServiceConnector.cs +++ b/OpenSim/Services/Connectors/Avatar/AvatarServiceConnector.cs @@ -148,7 +148,7 @@ namespace OpenSim.Services.Connectors string reqString = ServerUtils.BuildQueryString(sendData); - // m_log.DebugFormat("[AVATAR CONNECTOR]: queryString = {0}", reqString); + m_log.DebugFormat("[AVATAR CONNECTOR]: queryString = {0}", reqString); try { string reply = SynchronousRestFormsRequester.MakeRequest("POST", diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index bd72570111..6d588dec7d 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -231,7 +231,7 @@ namespace OpenSim.Services.Connectors.Simulation m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent update. Reason: " + e.Message); return false; } - Console.WriteLine(" >>> DoAgentUpdateCall <<< " + uri); + //Console.WriteLine(" >>> DoAgentUpdateCall <<< " + uri); HttpWebRequest ChildUpdateRequest = (HttpWebRequest)WebRequest.Create(uri); ChildUpdateRequest.Method = "PUT"; @@ -478,7 +478,7 @@ namespace OpenSim.Services.Connectors.Simulation { string uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + "/object/" + sog.UUID + "/"; - //m_log.Debug(" >>> DoCreateChildAgentCall <<< " + uri); + //m_log.Debug(" >>> DoCreateObjectCall <<< " + uri); WebRequest ObjectCreateRequest = WebRequest.Create(uri); ObjectCreateRequest.Method = "POST"; diff --git a/OpenSim/Services/Interfaces/IUserAccountService.cs b/OpenSim/Services/Interfaces/IUserAccountService.cs index 942174cf1a..3dacf53453 100644 --- a/OpenSim/Services/Interfaces/IUserAccountService.cs +++ b/OpenSim/Services/Interfaces/IUserAccountService.cs @@ -98,11 +98,11 @@ namespace OpenSim.Services.Interfaces string str = kvp["ServiceURLs"].ToString(); if (str != string.Empty) { - string[] parts = str.Split(new char[] { '#' }); + string[] parts = str.Split(new char[] { ';' }); Dictionary dic = new Dictionary(); foreach (string s in parts) { - string[] parts2 = s.Split(new char[] { '=' }); + string[] parts2 = s.Split(new char[] { '*' }); if (parts2.Length == 2) ServiceURLs[parts2[0]] = parts2[1]; } @@ -119,14 +119,14 @@ namespace OpenSim.Services.Interfaces result["PrincipalID"] = PrincipalID.ToString(); result["ScopeID"] = ScopeID.ToString(); result["Created"] = Created.ToString(); - result["UserLavel"] = UserLevel.ToString(); + result["UserLevel"] = UserLevel.ToString(); result["UserFlags"] = UserFlags.ToString(); result["UserTitle"] = UserTitle; string str = string.Empty; foreach (KeyValuePair kvp in ServiceURLs) { - str += kvp.Key + "=" + kvp.Value + "#"; + str += kvp.Key + "*" + (kvp.Value == null ? "" : kvp.Value) + ";"; } result["ServiceURLs"] = str; diff --git a/OpenSim/Services/PresenceService/PresenceService.cs b/OpenSim/Services/PresenceService/PresenceService.cs index 34a315425c..350eac8730 100644 --- a/OpenSim/Services/PresenceService/PresenceService.cs +++ b/OpenSim/Services/PresenceService/PresenceService.cs @@ -121,7 +121,7 @@ namespace OpenSim.Services.PresenceService public bool ReportAgent(UUID sessionID, UUID regionID, Vector3 position, Vector3 lookAt) { - //m_log.DebugFormat("[PRESENCE SERVICE]: ReportAgent with session {0} in region {1}", sessionID, regionID); + m_log.DebugFormat("[PRESENCE SERVICE]: ReportAgent with session {0} in region {1}", sessionID, regionID); try { PresenceData pdata = m_Database.Get(sessionID); diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index 90077d8eb6..a1dbb1e1fc 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs @@ -119,6 +119,10 @@ namespace OpenSim.Services.UserAccountService u.ScopeID = d.ScopeID; u.Email = d.Data["Email"].ToString(); u.Created = Convert.ToInt32(d.Data["Created"].ToString()); + if (d.Data["UserTitle"] != null) + u.UserTitle = d.Data["UserTitle"].ToString(); + else + u.UserTitle = string.Empty; string[] URLs = d.Data["ServiceURLs"].ToString().Split(new char[] { ' ' }); u.ServiceURLs = new Dictionary();