diff options
author | UbitUmarov | 2012-03-16 15:33:49 +0000 |
---|---|---|
committer | UbitUmarov | 2012-03-16 15:33:49 +0000 |
commit | ae8e089b9c73a6a675038759e3e3f9491819eb72 (patch) | |
tree | 73845e4fc4254b1dbddd090634ab01a50c3c93f9 /OpenSim/Region/ClientStack/Linden/Caps | |
parent | Merge branch 'ubitwork' (diff) | |
download | opensim-SC_OLD-ae8e089b9c73a6a675038759e3e3f9491819eb72.zip opensim-SC_OLD-ae8e089b9c73a6a675038759e3e3f9491819eb72.tar.gz opensim-SC_OLD-ae8e089b9c73a6a675038759e3e3f9491819eb72.tar.bz2 opensim-SC_OLD-ae8e089b9c73a6a675038759e3e3f9491819eb72.tar.xz |
some more work on costs
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 56 |
1 files changed, 34 insertions, 22 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index 5542680..dfd5c98 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | |||
@@ -845,9 +845,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
845 | public string GetObjectCost(string request, string path, | 845 | public string GetObjectCost(string request, string path, |
846 | string param, IOSHttpRequest httpRequest, | 846 | string param, IOSHttpRequest httpRequest, |
847 | IOSHttpResponse httpResponse) | 847 | IOSHttpResponse httpResponse) |
848 | { | 848 | { |
849 | // see being triggered but see no efect .. have something wrong ?? | ||
850 | // | ||
851 | OSDMap req = (OSDMap)OSDParser.DeserializeLLSDXml(request); | 849 | OSDMap req = (OSDMap)OSDParser.DeserializeLLSDXml(request); |
852 | OSDMap resp = new OSDMap(); | 850 | OSDMap resp = new OSDMap(); |
853 | 851 | ||
@@ -856,19 +854,29 @@ namespace OpenSim.Region.ClientStack.Linden | |||
856 | for (int i = 0; i < object_ids.Count; i++) | 854 | for (int i = 0; i < object_ids.Count; i++) |
857 | { | 855 | { |
858 | UUID uuid = object_ids[i].AsUUID(); | 856 | UUID uuid = object_ids[i].AsUUID(); |
857 | |||
858 | SceneObjectPart part = m_Scene.GetSceneObjectPart(uuid); | ||
859 | 859 | ||
860 | // only see root parts .. so guess should go by SOG only | 860 | if (part != null) |
861 | SceneObjectPart obj = m_Scene.GetSceneObjectPart(uuid); | ||
862 | if (obj != null) | ||
863 | { | 861 | { |
864 | OSDMap object_data = new OSDMap(); | 862 | SceneObjectGroup grp = part.ParentGroup; |
863 | if (grp != null) | ||
864 | { | ||
865 | float linksetCost; | ||
866 | float linksetPhysCost; | ||
867 | float partCost; | ||
868 | float partPhysCost; | ||
865 | 869 | ||
866 | object_data["linked_set_resource_cost"] = 1.0f; | 870 | grp.GetResourcesCosts(part, out linksetCost, out linksetPhysCost, out partCost, out partPhysCost); |
867 | object_data["resource_cost"] = 1.0f; | ||
868 | object_data["physics_cost"] = 1.0f; | ||
869 | object_data["linked_set_physics_cost"] = 1.0f; | ||
870 | 871 | ||
871 | resp[uuid.ToString()] = object_data; | 872 | OSDMap object_data = new OSDMap(); |
873 | object_data["linked_set_resource_cost"] = linksetCost; | ||
874 | object_data["resource_cost"] = partCost; | ||
875 | object_data["physics_cost"] = partPhysCost; | ||
876 | object_data["linked_set_physics_cost"] = linksetPhysCost; | ||
877 | |||
878 | resp[uuid.ToString()] = object_data; | ||
879 | } | ||
872 | } | 880 | } |
873 | } | 881 | } |
874 | 882 | ||
@@ -899,13 +907,17 @@ namespace OpenSim.Region.ClientStack.Linden | |||
899 | for (int i = 0; i < object_ids.Count; i++) | 907 | for (int i = 0; i < object_ids.Count; i++) |
900 | { | 908 | { |
901 | UUID uuid = object_ids[i].AsUUID(); | 909 | UUID uuid = object_ids[i].AsUUID(); |
910 | float Physc; | ||
911 | float simulc; | ||
912 | float streamc; | ||
902 | 913 | ||
903 | SceneObjectPart obj = m_Scene.GetSceneObjectPart(uuid); | 914 | SceneObjectGroup grp = m_Scene.GetGroupByPrim(uuid); |
904 | if (obj != null) | 915 | if (grp != null) |
905 | { | 916 | { |
906 | phys += 0.1f; // just to see... | 917 | grp.GetSelectedCosts(out Physc, out streamc, out simulc); |
907 | stream += 0.2f; | 918 | phys += Physc; |
908 | simul += 0.5f; | 919 | stream += streamc; |
920 | simul += simulc; | ||
909 | } | 921 | } |
910 | } | 922 | } |
911 | } | 923 | } |
@@ -920,12 +932,12 @@ namespace OpenSim.Region.ClientStack.Linden | |||
920 | { | 932 | { |
921 | UUID uuid = object_ids[i].AsUUID(); | 933 | UUID uuid = object_ids[i].AsUUID(); |
922 | 934 | ||
923 | SceneObjectPart obj = m_Scene.GetSceneObjectPart(uuid); | 935 | SceneObjectPart part = m_Scene.GetSceneObjectPart(uuid); |
924 | if (obj != null) | 936 | if (part != null) |
925 | { | 937 | { |
926 | phys += 0.1f; | 938 | phys += part.PhysicsCost; |
927 | stream += 0.2f; | 939 | stream += part.StreamingCost; |
928 | simul += 0.5f; | 940 | simul += part.SimulationCost; |
929 | } | 941 | } |
930 | } | 942 | } |
931 | } | 943 | } |