Selaa lähdekoodia

refactor: rename SOG/SOP.GetProperties() to SendPropertiesToClient() to reflect what it actually does

This also makes it consistent with some other methods that send data to the client.
Justin Clark-Casey (justincc) 13 vuotta sitten
vanhempi
commit
de19dc3024

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

@@ -4119,8 +4119,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
             while (updatesThisCall < m_maxUpdates)
             {
                 lock (m_entityProps.SyncRoot)
-                        if (!m_entityProps.TryDequeue(out iupdate, out timeinqueue))
-                            break;
+                    if (!m_entityProps.TryDequeue(out iupdate, out timeinqueue))
+                        break;
 
                 ObjectPropertyUpdate update = (ObjectPropertyUpdate)iupdate;
                 if (update.SendFamilyProps)

+ 2 - 2
OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs

@@ -101,7 +101,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
 
             part.ParentGroup.HasGroupChanged = true;
 
-            part.GetProperties(client);
+            part.SendPropertiesToClient(client);
         }
 
         public bool BuyObject(IClientAPI remoteClient, UUID categoryID, uint localID, byte saleType, int salePrice)
@@ -142,7 +142,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
                 part.SalePrice = 10;
 
                 group.HasGroupChanged = true;
-                part.GetProperties(remoteClient);
+                part.SendPropertiesToClient(remoteClient);
                 part.TriggerScriptChangedEvent(Changed.OWNER);
                 group.ResumeScripts();
                 part.ScheduleFullUpdate();

+ 9 - 9
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs

@@ -274,7 +274,7 @@ namespace OpenSim.Region.Framework.Scenes
             if (group.UpdateInventoryItem(item))
                 remoteClient.SendAgentAlertMessage("Script saved", false);
             
-            part.GetProperties(remoteClient);
+            part.SendPropertiesToClient(remoteClient);
 
             // Trigger rerunning of script (use TriggerRezScript event, see RezScript)
             ArrayList errors = new ArrayList();
@@ -999,7 +999,7 @@ namespace OpenSim.Region.Framework.Scenes
             }
             
             group.RemoveInventoryItem(localID, itemID);
-            part.GetProperties(remoteClient);
+            part.SendPropertiesToClient(remoteClient);
         }
 
         private InventoryItemBase CreateAgentInventoryItemFromTask(UUID destAgent, SceneObjectPart part, UUID itemId)
@@ -1272,7 +1272,7 @@ namespace OpenSim.Region.Framework.Scenes
 
             if (TryGetScenePresence(srcTaskItem.OwnerID, out avatar))
             {
-                destPart.GetProperties(avatar.ControllingClient);
+                destPart.SendPropertiesToClient(avatar.ControllingClient);
             }
         }
 
@@ -1427,7 +1427,7 @@ namespace OpenSim.Region.Framework.Scenes
                             m_log.InfoFormat(
                                 "[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}",
                                 item.Name, primLocalID, remoteClient.Name);
-                            part.GetProperties(remoteClient);
+                            part.SendPropertiesToClient(remoteClient);
                             if (!Permissions.BypassPermissions())
                             {
                                 if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
@@ -1522,7 +1522,7 @@ namespace OpenSim.Region.Framework.Scenes
 
                     if (part.Inventory.UpdateInventoryItem(itemInfo))
                     {
-                        part.GetProperties(remoteClient);
+                        part.SendPropertiesToClient(remoteClient);
                     }
                 }
             }
@@ -1574,7 +1574,7 @@ namespace OpenSim.Region.Framework.Scenes
                         //                        m_log.InfoFormat("[PRIMINVENTORY]: " +
                         //                                         "Rezzed script {0} into prim local ID {1} for user {2}",
                         //                                         item.inventoryName, localID, remoteClient.Name);
-                        part.GetProperties(remoteClient);
+                        part.SendPropertiesToClient(remoteClient);
                         part.ParentGroup.ResumeScripts();
                     }
                     else
@@ -1632,7 +1632,7 @@ namespace OpenSim.Region.Framework.Scenes
                 taskItem.AssetID = asset.FullID;
 
                 part.Inventory.AddInventoryItem(taskItem, false);
-                part.GetProperties(remoteClient);
+                part.SendPropertiesToClient(remoteClient);
 
                 part.Inventory.CreateScriptInstance(taskItem, 0, false, DefaultScriptEngine, 0);
                 part.ParentGroup.ResumeScripts();
@@ -1746,7 +1746,7 @@ namespace OpenSim.Region.Framework.Scenes
 
             if (TryGetScenePresence(srcTaskItem.OwnerID, out avatar))
             {
-                destPart.GetProperties(avatar.ControllingClient);
+                destPart.SendPropertiesToClient(avatar.ControllingClient);
             }
         }
 
@@ -2084,7 +2084,7 @@ namespace OpenSim.Region.Framework.Scenes
                 SceneObjectPart part = GetSceneObjectPart(localID);
 	            if (part == null)
 	                continue;
-                part.GetProperties(remoteClient);
+                part.SendPropertiesToClient(remoteClient);
             }
         }
 

+ 2 - 2
OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs

@@ -144,7 +144,7 @@ namespace OpenSim.Region.Framework.Scenes
                 {
                     if (((SceneObjectGroup) ent).LocalId == primLocalID)
                     {
-                        ((SceneObjectGroup) ent).GetProperties(remoteClient);
+                        ((SceneObjectGroup) ent).SendPropertiesToClient(remoteClient);
                         ((SceneObjectGroup) ent).IsSelected = true;
                         // A prim is only tainted if it's allowed to be edited by the person clicking it.
                         if (Permissions.CanEditObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId) 
@@ -167,7 +167,7 @@ namespace OpenSim.Region.Framework.Scenes
                         {
                             if (part.LocalId == primLocalID) 
                             {
-                                part.GetProperties(remoteClient);
+                                part.SendPropertiesToClient(remoteClient);
                                 foundPrim = true;
                                 break;
                             }

+ 8 - 12
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs

@@ -1728,8 +1728,6 @@ namespace OpenSim.Region.Framework.Scenes
 
         #endregion
 
-        #region Scheduling
-
         public override void Update()
         {
             // Check that the group was not deleted before the scheduled update
@@ -1880,7 +1878,14 @@ namespace OpenSim.Region.Framework.Scenes
                 parts[i].SendTerseUpdateToAllClients();
         }
 
-        #endregion
+        /// <summary>
+        /// Send metadata about the root prim (name, description, sale price, etc.) to a client.
+        /// </summary>
+        /// <param name="client"></param>
+        public void SendPropertiesToClient(IClientAPI client)
+        {
+            m_rootPart.SendPropertiesToClient(client);
+        }
 
         #region SceneGroupPart Methods
 
@@ -2369,15 +2374,6 @@ namespace OpenSim.Region.Framework.Scenes
             }
         }
 
-        /// <summary>
-        /// Return metadata about a prim (name, description, sale price, etc.)
-        /// </summary>
-        /// <param name="client"></param>
-        public void GetProperties(IClientAPI client)
-        {
-            m_rootPart.GetProperties(client);
-        }
-
         /// <summary>
         /// Set the name of a prim
         /// </summary>

+ 18 - 14
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs

@@ -1305,8 +1305,6 @@ namespace OpenSim.Region.Framework.Scenes
 
         #endregion Public Properties with only Get
 
-        #region Private Methods
-
         private uint ApplyMask(uint val, bool set, uint mask)
         {
             if (set)
@@ -1327,14 +1325,27 @@ namespace OpenSim.Region.Framework.Scenes
             m_updateFlag = 0;
         }
 
-        private void SendObjectPropertiesToClient(UUID AgentID)
+        /// <summary>
+        /// Send this part's properties (name, description, inventory serial, base mask, etc.) to a client
+        /// </summary>
+        /// <param name="client"></param>
+        public void SendPropertiesToClient(IClientAPI client)
+        {
+            client.SendObjectPropertiesReply(this);
+        }
+
+        /// <summary>
+        /// For the scene object group to which this part belongs, send that scene object's root part properties to a client.
+        /// </summary>
+        /// <param name="AgentID"></param>
+        private void SendRootPartPropertiesToClient(UUID AgentID)
         {
             m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar)
             {
                 // Ugly reference :(
                 if (avatar.UUID == AgentID)
                 {
-                    m_parentGroup.GetProperties(avatar.ControllingClient);
+                    m_parentGroup.SendPropertiesToClient(avatar.ControllingClient);
                 }
             });
         }
@@ -1363,8 +1374,6 @@ namespace OpenSim.Region.Framework.Scenes
         //     }
         // }
 
-        #endregion Private Methods
-
         #region Public Methods
 
         public void ResetExpire()
@@ -2030,11 +2039,6 @@ namespace OpenSim.Region.Framework.Scenes
                 return Vector3.Zero;
         }
 
-        public void GetProperties(IClientAPI client)
-        {
-            client.SendObjectPropertiesReply(this);
-        }
-
         /// <summary>
         /// Method for a prim to get it's world position from the group.
         /// </summary>
@@ -3453,7 +3457,7 @@ namespace OpenSim.Region.Framework.Scenes
         {
             _groupID = groupID;
             if (client != null)
-                GetProperties(client);
+                SendPropertiesToClient(client);
             m_updateFlag = 2;
         }
 
@@ -4273,10 +4277,10 @@ namespace OpenSim.Region.Framework.Scenes
 
                         break;
                 }
-                SendFullUpdateToAllClients();
 
-                SendObjectPropertiesToClient(AgentID);
+                SendFullUpdateToAllClients();
 
+                SendRootPartPropertiesToClient(AgentID);
             }
         }
 

+ 1 - 1
OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs

@@ -878,7 +878,7 @@ namespace OpenSim.Region.Framework.Scenes
                     return;
                 }
 
-                CreateInventoryFile();                
+                CreateInventoryFile();
     
                 // In principle, we should only do the rest if the inventory changed;
                 // by sending m_inventorySerial to the client, it ought to know

+ 1 - 1
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs

@@ -3591,7 +3591,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
             parentPrim.ScheduleGroupForFullUpdate();
 
             if (client != null)
-                parentPrim.GetProperties(client);
+                parentPrim.SendPropertiesToClient(client);
 
             ScriptSleep(1000);
         }