From a45420cf34313addef328ff7987700c5bf319716 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 5 Aug 2020 17:48:45 +0100 Subject: [PATCH] cosmetics on newclient, etc --- OpenSim/Framework/AgentCircuitManager.cs | 7 ++++ OpenSim/Region/Framework/Scenes/Scene.cs | 43 +++++++++++------------- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/OpenSim/Framework/AgentCircuitManager.cs b/OpenSim/Framework/AgentCircuitManager.cs index ba4a4988c8..447a007ff3 100644 --- a/OpenSim/Framework/AgentCircuitManager.cs +++ b/OpenSim/Framework/AgentCircuitManager.cs @@ -87,6 +87,13 @@ namespace OpenSim.Framework /// /// /// + public virtual void AddNewCircuit(AgentCircuitData agentData) + { + RemoveCircuit(agentData.AgentID); // no duplications + m_agentCircuits[agentData.circuitcode] = agentData; + m_agentCircuitsByUUID[agentData.AgentID] = agentData; + } + public virtual void AddNewCircuit(uint circuitCode, AgentCircuitData agentData) { RemoveCircuit(agentData.AgentID); // no duplications diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index e7ebafe8ec..a910982614 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2295,15 +2295,12 @@ namespace OpenSim.Region.Framework.Scenes foreach (SceneObjectGroup group in PrimsFromDB) { AddRestoredSceneObject(group, true, true); - EventManager.TriggerOnSceneObjectLoaded(group); SceneObjectPart rootPart = group.GetPart(group.UUID); - rootPart.Flags &= ~PrimFlags.Scripted; + rootPart.Flags &= ~(PrimFlags.Scripted | PrimFlags.CreateSelected); rootPart.TrimPermissions(); group.InvalidateDeepEffectivePerms(); - - // Don't do this here - it will get done later on when sculpt data is loaded. - // group.CheckSculptAndLoad(); + EventManager.TriggerOnSceneObjectLoaded(group); } LoadingPrims = false; @@ -3906,9 +3903,8 @@ namespace OpenSim.Region.Framework.Scenes public bool NewUserConnection(AgentCircuitData acd, uint teleportFlags, GridRegion source, out string reason, bool requirePresenceLookup) { - bool vialogin = ((teleportFlags & (uint)TPFlags.ViaLogin) != 0 || - (teleportFlags & (uint)TPFlags.ViaHGLogin) != 0); - bool viahome = ((teleportFlags & (uint)TPFlags.ViaHome) != 0); + bool vialogin = (teleportFlags & (uint)(TPFlags.ViaLogin | TPFlags.ViaHGLogin)) != 0; + bool viahome = (teleportFlags & (uint)TPFlags.ViaHome) != 0; // bool godlike = ((teleportFlags & (uint)TPFlags.Godlike) != 0); reason = String.Empty; @@ -3984,7 +3980,7 @@ namespace OpenSim.Region.Framework.Scenes m_log.DebugFormat( "[SCENE]: Access denied for {0} {1} using {2}", acd.firstname, acd.lastname, curViewer); - reason = "Access denied, your viewer is banned by the region owner"; + reason = "Access denied, your viewer is banned"; return false; } @@ -4107,11 +4103,10 @@ namespace OpenSim.Region.Framework.Scenes { IUserAccountCacheModule cache = RequestModuleInterface(); if (cache != null) -// cache.Remove(acd.firstname + " " + acd.lastname); cache.Remove(acd.AgentID); } - m_authenticateHandler.AddNewCircuit(acd.circuitcode, acd); + m_authenticateHandler.AddNewCircuit(acd); if (sp == null) // We don't have an [child] agent here already { @@ -4196,12 +4191,12 @@ namespace OpenSim.Region.Framework.Scenes CapsModule.ActivateCaps(acd.circuitcode); } -// if (vialogin) -// { -// CleanDroppedAttachments(); -// } + //if (vialogin) + //{ + // CleanDroppedAttachments(); + //} - if(teleportFlags != (uint) TPFlags.Default) + if (teleportFlags != (uint)TPFlags.Default) { // Make sure root avatar position is in the region if (acd.startpos.X < 0) @@ -4213,28 +4208,28 @@ namespace OpenSim.Region.Framework.Scenes else if (acd.startpos.Y >= RegionInfo.RegionSizeY) acd.startpos.Y = RegionInfo.RegionSizeY - 1f; } + // only check access, actual relocations will happen later on ScenePresence MakeRoot // allow child agents creation -// if(!godlike && teleportFlags != (uint) TPFlags.Default) - if(teleportFlags != (uint) TPFlags.Default) + //if(!godlike && teleportFlags != (uint) TPFlags.Default) + if (teleportFlags != (uint)TPFlags.Default) { bool checkTeleHub; // don't check hubs if via home or via lure - if((teleportFlags & (uint) TPFlags.ViaHome) != 0 - || (teleportFlags & (uint) TPFlags.ViaLure) != 0) - checkTeleHub = false; + if ((teleportFlags & (uint)(TPFlags.ViaHome | TPFlags.ViaLure)) != 0) + checkTeleHub = false; else checkTeleHub = vialogin - || (TelehubAllowLandmarks == true ? false : ((teleportFlags & (uint)TPFlags.ViaLandmark) != 0 )) - || (teleportFlags & (uint) TPFlags.ViaLocation) != 0; + || (TelehubAllowLandmarks == true ? false : ((teleportFlags & (uint)(TPFlags.ViaLandmark | TPFlags.ViaLocation)) != 0)); - if(!CheckLandPositionAccess(acd.AgentID, true, checkTeleHub, acd.startpos, out reason)) + if (!CheckLandPositionAccess(acd.AgentID, true, checkTeleHub, acd.startpos, out reason)) { m_authenticateHandler.RemoveCircuit(acd.circuitcode); return false; } } + return true; }