From 511751a733ed58c20fc06f39d3a6618784baad78 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 3 Oct 2010 22:36:27 +0100 Subject: I really have to say it again and again: e.Message is NOT enough data for troubleshooting. It MUST be combined with e.StackTrace, or e.ToString() must be used. Fix one more instance of that cr.p --- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index a79dc98..f81c551 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -1073,7 +1073,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { // Catch it and move on. This includes situations where splist has inconsistent info - m_log.WarnFormat("[SCENE]: Problem processing action in ForEachSOG: ", e.Message); + m_log.WarnFormat("[SCENE]: Problem processing action in ForEachSOG: ", e.ToString()); } } } @@ -1114,7 +1114,6 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.Info("[BUG] in " + m_parentScene.RegionInfo.RegionName + ": " + e.ToString()); - m_log.Info("[BUG] Stack Trace: " + e.StackTrace); } } } -- cgit v1.1 From 766ce9a14146dc9814d488364f5c931d0fa96a17 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 4 Oct 2010 00:04:42 +0200 Subject: Add linden prim renderer and update libOMV --- .../LindenUDP/UnackedPacketCollection.cs | 47 ++++++++++++++-------- .../Region/CoreModules/Asset/FlotsamAssetCache.cs | 4 +- .../UserAccounts/UserAccountCache.cs | 4 +- .../SimianUserAccountServiceConnector.cs | 6 +-- 4 files changed, 38 insertions(+), 23 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs b/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs index e43f7cf..c19e6a2 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs @@ -1,4 +1,4 @@ -/* + * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -139,28 +139,43 @@ namespace OpenSim.Region.ClientStack.LindenUDP private void ProcessQueues() { // Process all the pending adds - OutgoingPacket pendingAdd; - while (m_pendingAdds.Dequeue(out pendingAdd)) - m_packets[pendingAdd.SequenceNumber] = pendingAdd; + OutgoingPacket pendingAdd; + if (m_pendingAdds != null) + { + while (m_pendingAdds.TryDequeue(out pendingAdd)) + { + if (pendingAdd != null && m_packets != null) + { + m_packets[pendingAdd.SequenceNumber] = pendingAdd; + } + } + } + // Process all the pending removes, including updating statistics and round-trip times PendingAck pendingRemove; OutgoingPacket ackedPacket; - while (m_pendingRemoves.Dequeue(out pendingRemove)) + if (m_pendingRemoves != null) { - if (m_packets.TryGetValue(pendingRemove.SequenceNumber, out ackedPacket)) + while (m_pendingRemoves.TryDequeue(out pendingRemove)) { - m_packets.Remove(pendingRemove.SequenceNumber); - - // Update stats - System.Threading.Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength); - - if (!pendingRemove.FromResend) + if (m_pendingRemoves != null && m_packets != null) { - // Calculate the round-trip time for this packet and its ACK - int rtt = pendingRemove.RemoveTime - ackedPacket.TickCount; - if (rtt > 0) - ackedPacket.Client.UpdateRoundTrip(rtt); + if (m_packets.TryGetValue(pendingRemove.SequenceNumber, out ackedPacket)) + { + m_packets.Remove(pendingRemove.SequenceNumber); + + // Update stats + System.Threading.Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength); + + if (!pendingRemove.FromResend) + { + // Calculate the round-trip time for this packet and its ACK + int rtt = pendingRemove.RemoveTime - ackedPacket.TickCount; + if (rtt > 0) + ackedPacket.Client.UpdateRoundTrip(rtt); + } + } } } } diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index 9eaa758..6ed4867 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs @@ -252,7 +252,7 @@ namespace Flotsam.RegionModules.AssetCache } else { - m_MemoryCache.AddOrUpdate(key, asset, DateTime.MaxValue); + m_MemoryCache.AddOrUpdate(key, asset, Double.MaxValue); } } } @@ -863,4 +863,4 @@ namespace Flotsam.RegionModules.AssetCache #endregion } -} \ No newline at end of file +} diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs index 7c12b8c..e7cfda1 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs @@ -53,9 +53,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts public void Cache(UUID userID, UserAccount account) { // Cache even null accounts - m_UUIDCache.AddOrUpdate(userID, account, DateTime.Now + TimeSpan.FromSeconds(CACHE_EXPIRATION_SECONDS)); + m_UUIDCache.AddOrUpdate(userID, account, CACHE_EXPIRATION_SECONDS); if (account != null) - m_NameCache.AddOrUpdate(account.Name, account.PrincipalID, DateTime.Now + TimeSpan.FromSeconds(CACHE_EXPIRATION_SECONDS)); + m_NameCache.AddOrUpdate(account.Name, account.PrincipalID, CACHE_EXPIRATION_SECONDS); m_log.DebugFormat("[USER CACHE]: cached user {0}", userID); } diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs index ddd2322..9c150ee 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs @@ -147,7 +147,7 @@ namespace OpenSim.Services.Connectors.SimianGrid if (account == null) { // Store null responses too, to avoid repeated lookups for missing accounts - m_accountCache.AddOrUpdate(userID, null, DateTime.Now + TimeSpan.FromSeconds(CACHE_EXPIRATION_SECONDS)); + m_accountCache.AddOrUpdate(userID, null, CACHE_EXPIRATION_SECONDS); } return account; @@ -225,7 +225,7 @@ namespace OpenSim.Services.Connectors.SimianGrid if (success) { // Cache the user account info - m_accountCache.AddOrUpdate(data.PrincipalID, data, DateTime.Now + TimeSpan.FromSeconds(CACHE_EXPIRATION_SECONDS)); + m_accountCache.AddOrUpdate(data.PrincipalID, data, CACHE_EXPIRATION_SECONDS); } else { @@ -290,7 +290,7 @@ namespace OpenSim.Services.Connectors.SimianGrid GetFirstLastName(response["Name"].AsString(), out account.FirstName, out account.LastName); // Cache the user account info - m_accountCache.AddOrUpdate(account.PrincipalID, account, DateTime.Now + TimeSpan.FromSeconds(CACHE_EXPIRATION_SECONDS)); + m_accountCache.AddOrUpdate(account.PrincipalID, account, CACHE_EXPIRATION_SECONDS); return account; } -- cgit v1.1 From f89dd85f68e3e05c0ca908e5358d935a6ea3a321 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 4 Oct 2010 00:17:48 +0100 Subject: Fix a comment marker --- OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs b/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs index c19e6a2..4cb4aee 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs @@ -1,4 +1,4 @@ - +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * -- cgit v1.1 From 0772e19af25b8524fa2527a4d5f3bac496d07811 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 3 Oct 2010 20:01:59 -0700 Subject: Added viewer's channel, mac, and id0 to agent circuit data. Also moved client ip address to agent circuit data, so that it's always there. --- OpenSim/Framework/AgentCircuitData.cs | 37 +++++++++++++++++++++- .../EntityTransfer/EntityTransferModule.cs | 22 ++++++++++--- .../Server/Handlers/Hypergrid/HomeAgentHandlers.cs | 2 +- OpenSim/Server/Handlers/Login/LLLoginHandlers.cs | 19 +++++++++-- .../Hypergrid/UserAgentServiceConnector.cs | 8 +++-- .../Services/HypergridService/UserAgentService.cs | 6 +++- OpenSim/Services/Interfaces/ILoginService.cs | 3 +- OpenSim/Services/LLLoginService/LLLoginService.cs | 20 ++++++++---- 8 files changed, 97 insertions(+), 20 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/AgentCircuitData.cs b/OpenSim/Framework/AgentCircuitData.cs index 783a833..4f89d78 100644 --- a/OpenSim/Framework/AgentCircuitData.cs +++ b/OpenSim/Framework/AgentCircuitData.cs @@ -108,11 +108,31 @@ namespace OpenSim.Framework public string ServiceSessionID = string.Empty; /// - /// Viewer's version string + /// The client's IP address, as captured by the login service + /// + public string IPAddress; + + /// + /// Viewer's version string as reported by the viewer at login /// public string Viewer; /// + /// The channel strinf sent by the viewer at login + /// + public string Channel; + + /// + /// The Mac address as reported by the viewer at login + /// + public string Mac; + + /// + /// The id0 as reported by the viewer at login + /// + public string Id0; + + /// /// Position the Agent's Avatar starts in the region /// public Vector3 startpos; @@ -179,7 +199,11 @@ namespace OpenSim.Framework args["service_session_id"] = OSD.FromString(ServiceSessionID); args["start_pos"] = OSD.FromString(startpos.ToString()); args["appearance_serial"] = OSD.FromInteger(Appearance.Serial); + args["client_ip"] = OSD.FromString(IPAddress); args["viewer"] = OSD.FromString(Viewer); + args["channel"] = OSD.FromString(Channel); + args["mac"] = OSD.FromString(Mac); + args["id0"] = OSD.FromString(Id0); if (Appearance != null) { @@ -279,8 +303,16 @@ namespace OpenSim.Framework SessionID = args["session_id"].AsUUID(); if (args["service_session_id"] != null) ServiceSessionID = args["service_session_id"].AsString(); + if (args["client_ip"] != null) + IPAddress = args["client_ip"].AsString(); if (args["viewer"] != null) Viewer = args["viewer"].AsString(); + if (args["channel"] != null) + Channel = args["channel"].AsString(); + if (args["mac"] != null) + Mac = args["mac"].AsString(); + if (args["id0"] != null) + Id0 = args["id0"].AsString(); if (args["start_pos"] != null) Vector3.TryParse(args["start_pos"].AsString(), out startpos); @@ -349,6 +381,9 @@ namespace OpenSim.Framework public float startposy; public float startposz; public string Viewer; + public string Channel; + public string Mac; + public string Id0; public sAgentCircuitData() { diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 81f49b6..38fff1c 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -301,7 +301,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer if (currentAgentCircuit != null) { agentCircuit.ServiceURLs = currentAgentCircuit.ServiceURLs; + agentCircuit.IPAddress = currentAgentCircuit.IPAddress; agentCircuit.Viewer = currentAgentCircuit.Viewer; + agentCircuit.Channel = currentAgentCircuit.Channel; + agentCircuit.Mac = currentAgentCircuit.Mac; + agentCircuit.Id0 = currentAgentCircuit.Id0; } if (NeedsNewAgent(oldRegionX, newRegionX, oldRegionY, newRegionY)) @@ -955,16 +959,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer agent.CapsPath = CapsUtil.GetRandomCapsObjectPath(); agent.ChildrenCapSeeds = new Dictionary(sp.Scene.CapsModule.GetChildrenSeeds(sp.UUID)); - m_log.DebugFormat("[XXX] Seeds 1 {0}", agent.ChildrenCapSeeds.Count); + //m_log.DebugFormat("[XXX] Seeds 1 {0}", agent.ChildrenCapSeeds.Count); if (!agent.ChildrenCapSeeds.ContainsKey(sp.Scene.RegionInfo.RegionHandle)) agent.ChildrenCapSeeds.Add(sp.Scene.RegionInfo.RegionHandle, sp.ControllingClient.RequestClientInfo().CapsPath); - m_log.DebugFormat("[XXX] Seeds 2 {0}", agent.ChildrenCapSeeds.Count); + //m_log.DebugFormat("[XXX] Seeds 2 {0}", agent.ChildrenCapSeeds.Count); sp.AddNeighbourRegion(region.RegionHandle, agent.CapsPath); - foreach (ulong h in agent.ChildrenCapSeeds.Keys) - m_log.DebugFormat("[XXX] --> {0}", h); - m_log.DebugFormat("[XXX] Adding {0}", region.RegionHandle); + //foreach (ulong h in agent.ChildrenCapSeeds.Keys) + // m_log.DebugFormat("[XXX] --> {0}", h); + //m_log.DebugFormat("[XXX] Adding {0}", region.RegionHandle); agent.ChildrenCapSeeds.Add(region.RegionHandle, agent.CapsPath); if (sp.Scene.CapsModule != null) @@ -975,7 +979,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer if (currentAgentCircuit != null) { agent.ServiceURLs = currentAgentCircuit.ServiceURLs; + agent.IPAddress = currentAgentCircuit.IPAddress; agent.Viewer = currentAgentCircuit.Viewer; + agent.Channel = currentAgentCircuit.Channel; + agent.Mac = currentAgentCircuit.Mac; + agent.Id0 = currentAgentCircuit.Id0; } InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync; @@ -1064,7 +1072,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer if (currentAgentCircuit != null) { agent.ServiceURLs = currentAgentCircuit.ServiceURLs; + agent.IPAddress = currentAgentCircuit.IPAddress; agent.Viewer = currentAgentCircuit.Viewer; + agent.Channel = currentAgentCircuit.Channel; + agent.Mac = currentAgentCircuit.Mac; + agent.Id0 = currentAgentCircuit.Id0; } if (newRegions.Contains(neighbour.RegionHandle)) diff --git a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs index d10d6fc..21f4f3d 100644 --- a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs +++ b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs @@ -157,7 +157,7 @@ namespace OpenSim.Server.Handlers.Hypergrid // Verify if this caller has authority to send the client IP if (callerIP == m_LoginServerIP) client_ipaddress = new IPEndPoint(IPAddress.Parse(ip_str), 0); - else + else // leaving this for now, but this warning should be removed m_log.WarnFormat("[HOME AGENT HANDLER]: Unauthorized machine {0} tried to set client ip to {1}", callerIP, ip_str); } catch diff --git a/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs b/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs index 30dc65e..48f5f99 100644 --- a/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs +++ b/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs @@ -88,14 +88,26 @@ namespace OpenSim.Server.Handlers.Login startLocation = requestData["start"].ToString(); string clientVersion = "Unknown"; - if (requestData.Contains("version")) + if (requestData.Contains("version") && requestData["version"] != null) clientVersion = requestData["version"].ToString(); // We should do something interesting with the client version... + string channel = "Unknown"; + if (requestData.Contains("channel") && requestData["channel"] != null) + channel = requestData["channel"].ToString(); + + string mac = "Unknown"; + if (requestData.Contains("mac") && requestData["mac"] != null) + mac = requestData["mac"].ToString(); + + string id0 = "Unknown"; + if (requestData.Contains("id0") && requestData["id0"] != null) + id0 = requestData["id0"].ToString(); + //m_log.InfoFormat("[LOGIN]: XMLRPC Login Requested for {0} {1}, starting in {2}, using {3}", first, last, startLocation, clientVersion); LoginResponse reply = null; - reply = m_LocalService.Login(first, last, passwd, startLocation, scopeID, clientVersion, remoteClient); + reply = m_LocalService.Login(first, last, passwd, startLocation, scopeID, clientVersion, channel, mac, id0, remoteClient); XmlRpcResponse response = new XmlRpcResponse(); response.Value = reply.ToHashtable(); @@ -166,7 +178,8 @@ namespace OpenSim.Server.Handlers.Login m_log.Info("[LOGIN]: LLSD Login Requested for: '" + map["first"].AsString() + "' '" + map["last"].AsString() + "' / " + startLocation); LoginResponse reply = null; - reply = m_LocalService.Login(map["first"].AsString(), map["last"].AsString(), map["passwd"].AsString(), startLocation, scopeID, String.Empty, remoteClient); + reply = m_LocalService.Login(map["first"].AsString(), map["last"].AsString(), map["passwd"].AsString(), startLocation, scopeID, + map["version"].AsString(), map["channel"].AsString(), map["mac"].AsString(), map["id0"].AsString(), remoteClient); return reply.ToOSDMap(); } diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs index 6d3c64a..247dd7e 100644 --- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs @@ -238,8 +238,12 @@ namespace OpenSim.Services.Connectors.Hypergrid args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString()); args["destination_name"] = OSD.FromString(destination.RegionName); args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString()); - if (ipaddress != null) - args["client_ip"] = OSD.FromString(ipaddress.Address.ToString()); + + // 10/3/2010 + // I added the client_ip up to the regular AgentCircuitData, so this doesn't need to be here. + // This need cleaning elsewhere... + //if (ipaddress != null) + // args["client_ip"] = OSD.FromString(ipaddress.Address.ToString()); return args; } diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index 8acd618..eb6433c 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs @@ -148,7 +148,6 @@ namespace OpenSim.Services.HypergridService agentCircuit.ServiceSessionID = "http://" + region.ExternalHostName + ":" + region.HttpPort + ";" + UUID.Random(); TravelingAgentInfo old = UpdateTravelInfo(agentCircuit, region); - //bool success = m_GatekeeperConnector.CreateAgent(region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out reason); bool success = false; string myExternalIP = string.Empty; string gridName = "http://" + gatekeeper.ExternalHostName + ":" + gatekeeper.HttpPort; @@ -200,6 +199,11 @@ namespace OpenSim.Services.HypergridService { if (m_TravelingAgents.ContainsKey(agentCircuit.SessionID)) { + // Very important! Override whatever this agent comes with. + // UserAgentService always sets the IP for every new agent + // with the original IP address. + agentCircuit.IPAddress = m_TravelingAgents[agentCircuit.SessionID].ClientIPAddress; + old = m_TravelingAgents[agentCircuit.SessionID]; } diff --git a/OpenSim/Services/Interfaces/ILoginService.cs b/OpenSim/Services/Interfaces/ILoginService.cs index 9e57339..ee9b0b1 100644 --- a/OpenSim/Services/Interfaces/ILoginService.cs +++ b/OpenSim/Services/Interfaces/ILoginService.cs @@ -47,7 +47,8 @@ namespace OpenSim.Services.Interfaces public interface ILoginService { - LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID, string clientVersion, IPEndPoint clientIP); + LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID, + string clientVersion, string channel, string mac, string id0, IPEndPoint clientIP); Hashtable SetLevel(string firstName, string lastName, string passwd, int level, IPEndPoint clientIP); } diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index d30c149..127c4b2 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -208,7 +208,8 @@ namespace OpenSim.Services.LLLoginService return response; } - public LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID, string clientVersion, IPEndPoint clientIP) + public LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID, + string clientVersion, string channel, string mac, string id0, IPEndPoint clientIP) { bool success = false; UUID session = UUID.Random(); @@ -340,7 +341,8 @@ namespace OpenSim.Services.LLLoginService // string reason = string.Empty; GridRegion dest; - AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where, clientVersion, clientIP, out where, out reason, out dest); + AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where, + clientVersion, channel, mac, id0, clientIP, out where, out reason, out dest); destination = dest; if (aCircuit == null) { @@ -600,7 +602,8 @@ namespace OpenSim.Services.LLLoginService } protected AgentCircuitData LaunchAgentAtGrid(GridRegion gatekeeper, GridRegion destination, UserAccount account, AvatarData avatar, - UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, IPEndPoint clientIP, out string where, out string reason, out GridRegion dest) + UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, string channel, string mac, string id0, + IPEndPoint clientIP, out string where, out string reason, out GridRegion dest) { where = currentWhere; ISimulationService simConnector = null; @@ -640,7 +643,7 @@ namespace OpenSim.Services.LLLoginService if (m_UserAgentService == null && simConnector != null) { circuitCode = (uint)Util.RandomClass.Next(); ; - aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, viewer); + aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, clientIP.Address.ToString(), viewer, channel, mac, id0); success = LaunchAgentDirectly(simConnector, destination, aCircuit, out reason); if (!success && m_GridService != null) { @@ -665,7 +668,7 @@ namespace OpenSim.Services.LLLoginService if (m_UserAgentService != null) { circuitCode = (uint)Util.RandomClass.Next(); ; - aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, viewer); + aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, clientIP.Address.ToString(), viewer, channel, mac, id0); success = LaunchAgentIndirectly(gatekeeper, destination, aCircuit, clientIP, out reason); if (!success && m_GridService != null) { @@ -694,7 +697,8 @@ namespace OpenSim.Services.LLLoginService } private AgentCircuitData MakeAgent(GridRegion region, UserAccount account, - AvatarData avatar, UUID session, UUID secureSession, uint circuit, Vector3 position, string viewer) + AvatarData avatar, UUID session, UUID secureSession, uint circuit, Vector3 position, + string ipaddress, string viewer, string channel, string mac, string id0) { AgentCircuitData aCircuit = new AgentCircuitData(); @@ -715,7 +719,11 @@ namespace OpenSim.Services.LLLoginService aCircuit.SecureSessionID = secureSession; aCircuit.SessionID = session; aCircuit.startpos = position; + aCircuit.IPAddress = ipaddress; aCircuit.Viewer = viewer; + aCircuit.Channel = channel; + aCircuit.Mac = mac; + aCircuit.Id0 = id0; SetServiceURLs(aCircuit, account); return aCircuit; -- cgit v1.1 From 934ae03d44716e7102d4548045a6aed891209603 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 3 Oct 2010 20:35:26 -0700 Subject: Made the Gatekeeper proxy-able. --- OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs | 3 ++- .../Hypergrid/GatekeeperServerConnector.cs | 6 +++++- .../Server/Handlers/Simulation/AgentHandlers.cs | 22 +++++++++++++++++++++- 3 files changed, 28 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs index c951653..31eefb1 100644 --- a/OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs @@ -54,9 +54,10 @@ namespace OpenSim.Server.Handlers.Hypergrid private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private IGatekeeperService m_GatekeeperService; - public GatekeeperAgentHandler(IGatekeeperService gatekeeper) + public GatekeeperAgentHandler(IGatekeeperService gatekeeper, bool proxy) { m_GatekeeperService = gatekeeper; + m_Proxy = proxy; } protected override bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags, out string reason) diff --git a/OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs index dcb2725..49de8b1 100644 --- a/OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs +++ b/OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs @@ -51,6 +51,8 @@ namespace OpenSim.Server.Handlers.Hypergrid get { return m_GatekeeperService; } } + bool m_Proxy = false; + public GatekeeperServiceInConnector(IConfigSource config, IHttpServer server, ISimulationService simService) : base(config, server, String.Empty) { @@ -65,11 +67,13 @@ namespace OpenSim.Server.Handlers.Hypergrid if (m_GatekeeperService == null) throw new Exception("Gatekeeper server connector cannot proceed because of missing service"); + m_Proxy = gridConfig.GetBoolean("HasProxy", false); + HypergridHandlers hghandlers = new HypergridHandlers(m_GatekeeperService); server.AddXmlRPCHandler("link_region", hghandlers.LinkRegionRequest, false); server.AddXmlRPCHandler("get_region", hghandlers.GetRegion, false); - server.AddHTTPHandler("/foreignagent/", new GatekeeperAgentHandler(m_GatekeeperService).Handler); + server.AddHTTPHandler("/foreignagent/", new GatekeeperAgentHandler(m_GatekeeperService, m_Proxy).Handler); } public GatekeeperServiceInConnector(IConfigSource config, IHttpServer server) diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index 2997430..1f7e502 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs @@ -52,6 +52,8 @@ namespace OpenSim.Server.Handlers.Simulation private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private ISimulationService m_SimulationService; + protected bool m_Proxy = false; + public AgentHandler() { } public AgentHandler(ISimulationService sim) @@ -179,13 +181,31 @@ namespace OpenSim.Server.Handlers.Simulation resp["reason"] = OSD.FromString(reason); resp["success"] = OSD.FromBoolean(result); // Let's also send out the IP address of the caller back to the caller (HG 1.5) - resp["your_ip"] = OSD.FromString(Util.GetCallerIP(request)); + resp["your_ip"] = OSD.FromString(GetCallerIP(request)); // TODO: add reason if not String.Empty? responsedata["int_response_code"] = HttpStatusCode.OK; responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp); } + private string GetCallerIP(Hashtable request) + { + if (!m_Proxy) + return Util.GetCallerIP(request); + + // We're behind a proxy + Hashtable headers = (Hashtable)request["headers"]; + if (headers.ContainsKey("X-Forwarded-For") && headers["X-Forwarded-For"] != null) + { + IPEndPoint ep = Util.GetClientIPFromXFF((string)headers["X-Forwarded-For"]); + if (ep != null) + return ep.Address.ToString(); + } + + // Oops + return Util.GetCallerIP(request); + } + // subclasses can override this protected virtual bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags, out string reason) { -- cgit v1.1 From 37231e0941cec02a8d24a1f08e946525cca33afb Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 3 Oct 2010 21:21:02 -0700 Subject: Made the home agent handler check for xff if behind a proxy. --- .../Server/Handlers/Hypergrid/HomeAgentHandlers.cs | 23 ++++++++++++++++++++-- .../Handlers/Hypergrid/UserAgentServerConnector.cs | 3 ++- 2 files changed, 23 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs index 21f4f3d..f64a079 100644 --- a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs +++ b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs @@ -55,11 +55,13 @@ namespace OpenSim.Server.Handlers.Hypergrid private IUserAgentService m_UserAgentService; private string m_LoginServerIP; + private bool m_Proxy = false; - public HomeAgentHandler(IUserAgentService userAgentService, string loginServerIP) + public HomeAgentHandler(IUserAgentService userAgentService, string loginServerIP, bool proxy) { m_UserAgentService = userAgentService; m_LoginServerIP = loginServerIP; + m_Proxy = proxy; } public Hashtable Handler(Hashtable request) @@ -153,7 +155,7 @@ namespace OpenSim.Server.Handlers.Hypergrid string ip_str = args["client_ip"].ToString(); try { - string callerIP = Util.GetCallerIP(request); + string callerIP = GetCallerIP(request); // Verify if this caller has authority to send the client IP if (callerIP == m_LoginServerIP) client_ipaddress = new IPEndPoint(IPAddress.Parse(ip_str), 0); @@ -198,6 +200,23 @@ namespace OpenSim.Server.Handlers.Hypergrid responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp); } + private string GetCallerIP(Hashtable request) + { + if (!m_Proxy) + return Util.GetCallerIP(request); + + // We're behind a proxy + Hashtable headers = (Hashtable)request["headers"]; + if (headers.ContainsKey("X-Forwarded-For") && headers["X-Forwarded-For"] != null) + { + IPEndPoint ep = Util.GetClientIPFromXFF((string)headers["X-Forwarded-For"]); + if (ep != null) + return ep.Address.ToString(); + } + + // Oops + return Util.GetCallerIP(request); + } } } diff --git a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs index 70157d5..e5f6a5d 100644 --- a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs +++ b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs @@ -67,6 +67,7 @@ namespace OpenSim.Server.Handlers.Hypergrid throw new Exception("UserAgent server connector cannot proceed because of missing service"); string loginServerIP = gridConfig.GetString("LoginServerIP", "127.0.0.1"); + bool proxy = gridConfig.GetBoolean("HasProxy", false); server.AddXmlRPCHandler("agent_is_coming_home", AgentIsComingHome, false); server.AddXmlRPCHandler("get_home_region", GetHomeRegion, false); @@ -74,7 +75,7 @@ namespace OpenSim.Server.Handlers.Hypergrid server.AddXmlRPCHandler("verify_client", VerifyClient, false); server.AddXmlRPCHandler("logout_agent", LogoutAgent, false); - server.AddHTTPHandler("/homeagent/", new HomeAgentHandler(m_HomeUsersService, loginServerIP).Handler); + server.AddHTTPHandler("/homeagent/", new HomeAgentHandler(m_HomeUsersService, loginServerIP, proxy).Handler); } public XmlRpcResponse GetHomeRegion(XmlRpcRequest request, IPEndPoint remoteClient) -- cgit v1.1 From cb6e4035c73c99808a4594f8229d6fca397c439c Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Mon, 4 Oct 2010 07:37:22 +0200 Subject: Avoid throwing errors when adding existing meshes to the render scene --- OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs index a99b20c..49b4364 100644 --- a/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs +++ b/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs @@ -352,6 +352,12 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap Face face = renderMesh.Faces[i]; string meshName = primID + "-Face-" + i.ToString(); + // Avoid adding duplicate meshes to the scene + if (renderer.Scene.objectData.ContainsKey(meshName)) + { + continue; + } + warp_Object faceObj = new warp_Object(face.Vertices.Count, face.Indices.Count / 3); for (int j = 0; j < face.Vertices.Count; j++) -- cgit v1.1 From eb17d581d3f5d8b380edfbfe993a32b6edba330d Mon Sep 17 00:00:00 2001 From: BlueWall Date: Mon, 4 Oct 2010 20:56:09 -0400 Subject: Make windlight set the default environment on start --- OpenSim/Region/CoreModules/LightShare/LightShareModule.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs b/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs index e6cab1d..412dbb6 100644 --- a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs +++ b/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs @@ -91,6 +91,7 @@ namespace OpenSim.Region.CoreModules.World.LightShare m_scene.EventManager.OnMakeRootAgent += EventManager_OnMakeRootAgent; m_scene.EventManager.OnSaveNewWindlightProfile += EventManager_OnSaveNewWindlightProfile; m_scene.EventManager.OnSendNewWindlightProfileTargeted += EventManager_OnSendNewWindlightProfileTargeted; + m_scene.LoadWindlightProfile(); } InstallCommands(); -- cgit v1.1 From bc9f793a92ab9b27a4cf3251fe586da70af03d42 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Mon, 4 Oct 2010 21:28:17 -0400 Subject: Formatting cleanup. --- OpenSim/Data/Migration.cs | 4 ++-- .../CoreModules/Avatar/Attachments/AttachmentsModule.cs | 2 +- OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | 12 ++++++------ OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 2 +- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +- .../Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs | 4 ++-- .../OptionalModules/World/MoneyModule/SampleMoneyModule.cs | 2 +- OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 8 ++++---- OpenSim/Server/Base/ServicesServerBase.cs | 2 +- 9 files changed, 19 insertions(+), 19 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Data/Migration.cs b/OpenSim/Data/Migration.cs index 2895a71..d606470 100644 --- a/OpenSim/Data/Migration.cs +++ b/OpenSim/Data/Migration.cs @@ -138,12 +138,12 @@ namespace OpenSim.Data /// /// Array of strings, one-per-batch (often just one) protected virtual void ExecuteScript(DbConnection conn, string[] script) - { + { using (DbCommand cmd = conn.CreateCommand()) { cmd.CommandTimeout = 0; foreach (string sql in script) - { + { cmd.CommandText = sql; try { diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 28c50ab..457e0bb 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -307,7 +307,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments /// /// /// - /// + /// protected UUID ShowAttachInUserInventory( SceneObjectGroup att, IClientAPI remoteClient, UUID itemID, uint AttachmentPt) { diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index 7a21d5e..b3f0a25 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs @@ -318,12 +318,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(client.Scene.RegionInfo.ScopeID, fromAgentID); - PresenceInfo presence = null; - PresenceInfo[] presences = PresenceService.GetAgents(new string[] { fid }); - if (presences != null && presences.Length > 0) - presence = presences[0]; - if (presence != null) - im.offline = 0; + PresenceInfo presence = null; + PresenceInfo[] presences = PresenceService.GetAgents(new string[] { fid }); + if (presences != null && presences.Length > 0) + presence = presences[0]; + if (presence != null) + im.offline = 0; im.fromAgentID = fromAgentID.Guid; im.fromAgentName = account.FirstName + " " + account.LastName; diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index a8e76e3..8140d42 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -2763,7 +2763,7 @@ namespace OpenSim.Region.Framework.Scenes UUID = UUID.Random(); LinkNum = linkNum; LocalId = 0; - Inventory.ResetInventoryIDs(); + Inventory.ResetInventoryIDs(); } /// diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index a4533fa..13d9964 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1523,7 +1523,7 @@ namespace OpenSim.Region.Framework.Scenes } // If the agent update does move the avatar, then calculate the force ready for the velocity update, - // which occurs later in the main scene loop + // which occurs later in the main scene loop if (update_movementflag || (update_rotation && DCFlagKeyPressed)) { // m_log.DebugFormat("{0} {1}", update_movementflag, (update_rotation && DCFlagKeyPressed)); diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs index e6ff0c0..5616a4e 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs @@ -210,7 +210,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) { Name = childPartName, UUID = childPartUuid }; - SceneObjectGroup sog = new SceneObjectGroup(rootPart); + SceneObjectGroup sog = new SceneObjectGroup(rootPart); sog.AddPart(linkPart); Assert.That(sog.UUID, Is.EqualTo(rootPartUuid)); @@ -221,7 +221,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests sog.UUID = newRootPartUuid; Assert.That(sog.UUID, Is.EqualTo(newRootPartUuid)); - Assert.That(sog.RootPart.UUID, Is.EqualTo(newRootPartUuid)); + Assert.That(sog.RootPart.UUID, Is.EqualTo(newRootPartUuid)); Assert.That(sog.Parts.Length, Is.EqualTo(2)); } } diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs index e42dbf2..7e1b5ac 100644 --- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs +++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs @@ -812,7 +812,7 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule // gets the object data. If the data sent by the client doesn't match the object, the viewer probably has an // old idea of what the object properties are. Viewer developer Hazim informed us that the base module // didn't check the client sent data against the object do any. Since the base modules are the - // 'crowning glory' examples of good practice.. + // 'crowning glory' examples of good practice.. // Validate that the object exists in the scene the user is in SceneObjectPart part = s.GetSceneObjectPart(localID); diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index c37c9bd..c91658e 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs @@ -188,7 +188,7 @@ namespace OpenSim.Region.Physics.OdePlugin public OdePrim(String primName, OdeScene parent_scene, Vector3 pos, Vector3 size, Quaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, bool pisPhysical, CollisionLocker dode) { - Name = primName; + Name = primName; m_vehicle = new ODEDynamics(); //gc = GCHandle.Alloc(prim_geom, GCHandleType.Pinned); ode = dode; @@ -620,7 +620,7 @@ namespace OpenSim.Region.Physics.OdePlugin volume *= (1.0f - hollowVolume); } } - break; + break; default: break; @@ -658,7 +658,7 @@ namespace OpenSim.Region.Physics.OdePlugin taperY = _pbs.PathTaperY * 0.01f; if (taperY < 0.0f) - taperY = -taperY; + taperY = -taperY; taperY1 = 1.0f - taperY; } @@ -1059,7 +1059,7 @@ namespace OpenSim.Region.Physics.OdePlugin } foreach (OdePrim prm in childrenPrim) - { + { prm.m_collisionCategories |= CollisionCategories.Body; prm.m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind); diff --git a/OpenSim/Server/Base/ServicesServerBase.cs b/OpenSim/Server/Base/ServicesServerBase.cs index 18f0f24..2652ff2 100644 --- a/OpenSim/Server/Base/ServicesServerBase.cs +++ b/OpenSim/Server/Base/ServicesServerBase.cs @@ -176,7 +176,7 @@ namespace OpenSim.Server.Base OpenSimAppender consoleAppender = null; FileAppender fileAppender = null; - if ( logConfig != null ) + if (logConfig != null) { FileInfo cfg = new FileInfo(logConfig); XmlConfigurator.Configure(cfg); -- cgit v1.1