2 커밋 034cf66dfe ... 2736d36391

작성자 SHA1 메시지 날짜
  UbitUmarov 2736d36391 also do send terrain texture change also from viewer to viewers 2 주 전
  UbitUmarov 020ddeef65 preprocess logiin welcome msg 3 주 전

+ 2 - 2
OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs

@@ -1772,7 +1772,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
             // on to en-US to avoid number parsing issues
             Culture.SetCurrentCulture();
 
-            while (IsRunningInbound)
+            while (m_IsRunningInbound)
             {
                 Scene.ThreadAlive(1);
                 try
@@ -1818,7 +1818,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
             // Action generic every round
             Action<IClientAPI> clientPacketHandler = ClientOutgoingPacketHandler;
 
-            while (base.IsRunningOutbound)
+            while (m_IsRunningOutbound)
             {
                 Scene.ThreadAlive(2);
 

+ 22 - 19
OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs

@@ -73,13 +73,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP
         public static int m_udpBuffersPoolPtr = -1;
 
         /// <summary>Returns true if the server is currently listening for inbound packets, otherwise false</summary>
-        public bool IsRunningInbound { get; private set; }
+        internal bool m_IsRunningInbound;
+        public bool IsRunningInbound
+        {
+            get { return m_IsRunningInbound; }
+            private set { m_IsRunningInbound = value; }
+        }
+
         public CancellationTokenSource InboundCancellationSource = new();
 
 
         /// <summary>Returns true if the server is currently sending outbound packets, otherwise false</summary>
         /// <remarks>If IsRunningOut = false, then any request to send a packet is simply dropped.</remarks>
-        public bool IsRunningOutbound { get; private set; }
+        internal bool m_IsRunningOutbound;
+        public bool IsRunningOutbound
+        {
+            get { return m_IsRunningOutbound; }
+            private set { m_IsRunningOutbound = value; }
+        }
 
         /// <summary>
         /// Number of UDP receives.
@@ -179,19 +190,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
         /// the UDP socket. This value is passed up to the operating system
         /// and used in the system networking stack. Use zero to leave this
         /// value as the default</param>
-        /// <param name="asyncPacketHandling">Set this to true to start
-        /// receiving more packets while current packet handler callbacks are
-        /// still running. Setting this to false will complete each packet
-        /// callback before the next packet is processed</param>
-        /// <remarks>This method will attempt to set the SIO_UDP_CONNRESET flag
-        /// on the socket to get newer versions of Windows to behave in a sane
-        /// manner (not throwing an exception when the remote side resets the
-        /// connection). This call is ignored on Mono where the flag is not
-        /// necessary</remarks>
+
 
         public virtual void StartInbound(int recvBufferSize)
         {
-            if (!IsRunningInbound)
+            if (!m_IsRunningInbound)
             {
                 m_log.DebugFormat("[UDPBASE]: Starting inbound UDP loop");
 
@@ -242,7 +245,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
                 if (m_udpPort == 0)
                     m_udpPort = ((IPEndPoint)m_udpSocket.LocalEndPoint).Port;
 
-                IsRunningInbound = true;
+                m_IsRunningInbound = true;
 
                 // kick start the receiver tasks dance.
                 Task.Run(AsyncBeginReceive).ConfigureAwait(false);
@@ -256,16 +259,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
         {
             m_log.DebugFormat("[UDPBASE]: Starting outbound UDP loop");
 
-            IsRunningOutbound = true;
+            m_IsRunningOutbound = true;
         }
 
         public virtual void StopInbound()
         {
-            if (IsRunningInbound)
+            if (m_IsRunningInbound)
             {
                 m_log.DebugFormat("[UDPBASE]: Stopping inbound UDP loop");
 
-                IsRunningInbound = false;
+                m_IsRunningInbound = false;
                 InboundCancellationSource.Cancel();
                 m_udpSocket.Close();
                 m_udpSocket = null;
@@ -276,20 +279,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP
         {
             m_log.DebugFormat("[UDPBASE]: Stopping outbound UDP loop");
 
-            IsRunningOutbound = false;
+            m_IsRunningOutbound = false;
         }
 
         private async void AsyncBeginReceive()
         {
             SocketAddress workSktAddress = new(m_udpSocket.AddressFamily);
-            while (IsRunningInbound)
+            while (m_IsRunningInbound)
             {
                 UDPPacketBuffer buf = GetNewUDPBuffer(null); // we need a fresh one here, for now at least
                 try
                 {
                     int nbytes = 
                         await m_udpSocket.ReceiveFromAsync(buf.Data.AsMemory(), SocketFlags.None, workSktAddress, InboundCancellationSource.Token).ConfigureAwait(false);
-                    if (!IsRunningInbound)
+                    if (!m_IsRunningInbound)
                     {
                         FreeUDPBuffer(buf);
                         return;

+ 1 - 3
OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs

@@ -229,7 +229,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
         public void setEstateTerrainBaseTexture(int level, UUID texture)
         {
             SetEstateTerrainBaseTexture(null, level, texture);
-            sendRegionHandshakeToAll();
         }
 
         public void setEstateTerrainTextureHeights(int corner, float lowValue, float highValue)
@@ -560,7 +559,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
 
             Scene.RegionInfo.RegionSettings.Save();
             TriggerRegionInfoChange();
-            SendRegionInfoPacketToAll();
+            sendRegionHandshakeToAll();
         }
 
         public void SetEstateTerrainTextureHeights(IClientAPI client, int corner, float lowValue, float highValue)
@@ -588,7 +587,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
             Scene.RegionInfo.RegionSettings.Save();
             TriggerRegionInfoChange();
             sendRegionHandshakeToAll();
-//            sendRegionInfoPacketToAll();
         }
 
         private void HandleCommitEstateTerrainTextureRequest(IClientAPI remoteClient)

+ 2 - 27
OpenSim/Services/LLLoginService/LLLoginResponse.cs

@@ -270,7 +270,6 @@ namespace OpenSim.Services.LLLoginService
             m_log.DebugFormat("[LOGIN RESPONSE] LLLoginResponse create. sizeX={0}, sizeY={1}", RegionSizeX, RegionSizeY);
 
             FillOutSeedCap(aCircuit, destination, clientIP);
-
             switch (DSTZone)
             {
                 case "none":
@@ -306,7 +305,6 @@ namespace OpenSim.Services.LLLoginService
                     {
                         DST = dstTimeZone.IsDaylightSavingTime(DateTime.Now) ? "Y" : "N";
                     }
-
                     break;
             }
         }
@@ -406,30 +404,7 @@ namespace OpenSim.Services.LLLoginService
 
         private void SetDefaultValues()
         {
-            TimeZoneInfo gridTimeZone;
-
-            // Disabled for now pending making timezone a config value, which can at some point have a default of
-            // a ; separated list of possible timezones.
-            // The problem here is that US/Pacific (or even the Olsen America/Los_Angeles) is not universal across
-            // windows, mac and various distributions of linux, introducing another element of consistency.
-            // The server operator needs to be able to control this setting
-//            try
-//            {
-//                // First try to fetch DST from Pacific Standard Time, because this is
-//                // the one expected by the viewer. "US/Pacific" is the string to search
-//                // on linux and mac, and should work also on Windows (to confirm)
-//                gridTimeZone = TimeZoneInfo.FindSystemTimeZoneById("US/Pacific");
-//            }
-//            catch (Exception e)
-//            {
-//                m_log.WarnFormat(
-//                    "[TIMEZONE]: {0} Falling back to system time. System time should be set to Pacific Standard Time to provide the expected time",
-//                    e.Message);
-
-                gridTimeZone = TimeZoneInfo.Local;
-//            }
-
-            DST = gridTimeZone.IsDaylightSavingTime(DateTime.Now) ? "Y" : "N";
+            DST = "N";
 
             StipendSinceLogin = "N";
             Gendered = "Y";
@@ -494,7 +469,7 @@ namespace OpenSim.Services.LLLoginService
 
             currency = String.Empty;
             ClassifiedFee = "0";
-            MaxAgentGroups = 42;
+            MaxAgentGroups = Constants.MaxAgentGroups;
         }
 
 

+ 33 - 22
OpenSim/Services/LLLoginService/LLLoginService.cs

@@ -90,6 +90,7 @@ namespace OpenSim.Services.LLLoginService
         protected string m_DeniedID0s;
         protected string m_MessageUrl;
         protected string m_DSTZone;
+
         protected bool m_allowDuplicatePresences = false;
         protected string m_messageKey;
         protected bool m_allowLoginFallbackToAnyRegion = true;  // if login requested region if not found and there are no Default or fallback regions,
@@ -166,11 +167,32 @@ namespace OpenSim.Services.LLLoginService
             m_DeniedID0s = Util.GetConfigVarFromSections<string>(config, "DeniedID0s", accessControlConfigSections, string.Empty);
 
             m_MessageUrl = m_LoginServerConfig.GetString("MessageUrl", string.Empty);
+            m_WelcomeMessage = null;
+            if (!string.IsNullOrEmpty(m_MessageUrl))
+            {
+                try
+                { 
+                    using (WebClient client = new())
+                        m_WelcomeMessage = client.DownloadString(m_MessageUrl);
+                }
+                catch               
+                {
+                    m_WelcomeMessage = null;
+                }
+            }
+
+            if (string.IsNullOrEmpty(m_WelcomeMessage))
+                m_WelcomeMessage = m_LoginServerConfig.GetString("WelcomeMessage", "Welcome to OpenSim!");
+
+            m_WelcomeMessage = m_WelcomeMessage.Replace("\\n", "\n");
+
             m_DSTZone = m_LoginServerConfig.GetString("DSTZone", "America/Los_Angeles;Pacific Standard Time");
 
+
+            m_MaxAgentGroups = Constants.MaxAgentGroups;
             IConfig groupConfig = config.Configs["Groups"];
             if (groupConfig is not null)
-                m_MaxAgentGroups = groupConfig.GetInt("MaxAgentGroups", 42);
+                m_MaxAgentGroups = groupConfig.GetInt("MaxAgentGroups", m_MaxAgentGroups);
 
             IConfig presenceConfig = config.Configs["PresenceService"];
             if (presenceConfig is not null)
@@ -193,10 +215,7 @@ namespace OpenSim.Services.LLLoginService
             if (accountService.Length == 0 || authService.Length == 0)
                 throw new Exception("LoginService is missing service specifications");
 
-            // replace newlines in welcome message
-            m_WelcomeMessage = m_WelcomeMessage.Replace("\\n", "\n");
-
-            object[] args = new object[] { config };
+            object[] args = [config];
             m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(accountService, args);
             m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args);
             object[] authArgs = new object[] { config, m_UserAccountService };
@@ -478,7 +497,7 @@ namespace OpenSim.Services.LLLoginService
                 m_HGInventoryService?.GetRootFolder(account.PrincipalID);
 
                 List<InventoryFolderBase> inventorySkel = m_InventoryService.GetInventorySkeleton(account.PrincipalID);
-                if (m_RequireInventory && ((inventorySkel is null) || (inventorySkel is not null && inventorySkel.Count == 0)))
+                if (m_RequireInventory && inventorySkel is null || inventorySkel.Count == 0)
                 {
                     m_log.InfoFormat(
                         "[LLOGIN SERVICE]: Login failed, for {0} {1}, reason: unable to retrieve user inventory",
@@ -486,10 +505,6 @@ namespace OpenSim.Services.LLLoginService
                     return LLFailedLoginResponse.InventoryProblem;
                 }
 
-                // Get active gestures
-                List<InventoryItemBase> gestures = m_InventoryService.GetActiveGestures(account.PrincipalID);
-//                m_log.DebugFormat("[LLOGIN SERVICE]: {0} active gestures", gestures.Count);
-
                 //
                 // Login the presence
                 //
@@ -599,22 +614,17 @@ namespace OpenSim.Services.LLLoginService
                 if (m_FriendsService is not null)
                 {
                     friendsList = m_FriendsService.GetFriends(account.PrincipalID);
-//                    m_log.DebugFormat("[LLOGIN SERVICE]: Retrieved {0} friends", friendsList.Length);
+                    //m_log.DebugFormat("[LLOGIN SERVICE]: Retrieved {0} friends", friendsList.Length);
                 }
 
                 //
                 // Finally, fill out the response and return it
-                //
-                if (m_MessageUrl != string.Empty)
-                {
-                    using(WebClient client = new())
-                        processedMessage = client.DownloadString(m_MessageUrl);
-                }
-                else
-                {
-                    processedMessage = m_WelcomeMessage;
-                }
-                processedMessage = processedMessage.Replace("\\n", "\n").Replace("<USERNAME>", firstName + " " + lastName);
+    
+                processedMessage = m_WelcomeMessage.Replace("<USERNAME>", firstName + " " + lastName);
+
+                // Get active gestures
+                List<InventoryItemBase> gestures = m_InventoryService.GetActiveGestures(account.PrincipalID);
+                //m_log.DebugFormat("[LLOGIN SERVICE]: {0} active gestures", gestures.Count);
 
                 LLLoginResponse response = new(
                         account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService,
@@ -1157,6 +1167,7 @@ namespace OpenSim.Services.LLLoginService
                     {
                         m_WelcomeMessage = cmd[2];
                         MainConsole.Instance.Output("Login welcome message set to '{0}'", m_WelcomeMessage);
+                        m_WelcomeMessage = m_WelcomeMessage.Replace("\\n", "\n");
                     }
                     break;
             }