diff options
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/ChildAgentDataUpdate.cs | 34 | ||||
-rw-r--r-- | OpenSim/Framework/PermissionsUtil.cs | 19 |
2 files changed, 20 insertions, 33 deletions
diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index b9d64b1..d6d8dde 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs | |||
@@ -90,7 +90,7 @@ namespace OpenSim.Framework | |||
90 | public Vector3 LeftAxis; | 90 | public Vector3 LeftAxis; |
91 | public Vector3 UpAxis; | 91 | public Vector3 UpAxis; |
92 | //public int GodLevel; | 92 | //public int GodLevel; |
93 | public OSD GodData = new OSDMap(); | 93 | public OSD GodData = null; |
94 | public bool ChangedGrid; | 94 | public bool ChangedGrid; |
95 | 95 | ||
96 | // This probably shouldn't be here | 96 | // This probably shouldn't be here |
@@ -119,12 +119,15 @@ namespace OpenSim.Framework | |||
119 | args["far"] = OSD.FromReal(Far); | 119 | args["far"] = OSD.FromReal(Far); |
120 | args["changed_grid"] = OSD.FromBoolean(ChangedGrid); | 120 | args["changed_grid"] = OSD.FromBoolean(ChangedGrid); |
121 | //args["god_level"] = OSD.FromString(GodLevel.ToString()); | 121 | //args["god_level"] = OSD.FromString(GodLevel.ToString()); |
122 | args["god_data"] = GodData; | 122 | if(GodData != null) |
123 | OSDMap g = (OSDMap)GodData; | 123 | { |
124 | // Set legacy value | 124 | args["god_data"] = GodData; |
125 | // TODO: remove after 0.9 is superseded | 125 | OSDMap g = (OSDMap)GodData; |
126 | if (g.ContainsKey("ViewerUiIsGod")) | 126 | // Set legacy value |
127 | args["god_level"] = g["ViewerUiIsGod"].AsBoolean() ? 200 : 0;; | 127 | // TODO: remove after 0.9 is superseded |
128 | if (g.ContainsKey("ViewerUiIsGod")) | ||
129 | args["god_level"] = g["ViewerUiIsGod"].AsBoolean() ? 200 : 0; | ||
130 | } | ||
128 | 131 | ||
129 | if ((Throttles != null) && (Throttles.Length > 0)) | 132 | if ((Throttles != null) && (Throttles.Length > 0)) |
130 | args["throttles"] = OSD.FromBinary(Throttles); | 133 | args["throttles"] = OSD.FromBinary(Throttles); |
@@ -185,7 +188,7 @@ namespace OpenSim.Framework | |||
185 | 188 | ||
186 | //if (args["god_level"] != null) | 189 | //if (args["god_level"] != null) |
187 | // Int32.TryParse(args["god_level"].AsString(), out GodLevel); | 190 | // Int32.TryParse(args["god_level"].AsString(), out GodLevel); |
188 | if (args["god_data"] != null) | 191 | if (args.ContainsKey("god_data") && args["god_data"] != null) |
189 | GodData = args["god_data"]; | 192 | GodData = args["god_data"]; |
190 | 193 | ||
191 | if (args["far"] != null) | 194 | if (args["far"] != null) |
@@ -362,7 +365,7 @@ namespace OpenSim.Framework | |||
362 | public Quaternion BodyRotation; | 365 | public Quaternion BodyRotation; |
363 | public uint ControlFlags; | 366 | public uint ControlFlags; |
364 | public float EnergyLevel; | 367 | public float EnergyLevel; |
365 | public OSD GodData = new OSDMap(); | 368 | public OSD GodData = null; |
366 | //public Byte GodLevel; | 369 | //public Byte GodLevel; |
367 | public bool AlwaysRun; | 370 | public bool AlwaysRun; |
368 | public UUID PreyAgent; | 371 | public UUID PreyAgent; |
@@ -438,10 +441,13 @@ namespace OpenSim.Framework | |||
438 | 441 | ||
439 | args["energy_level"] = OSD.FromReal(EnergyLevel); | 442 | args["energy_level"] = OSD.FromReal(EnergyLevel); |
440 | //args["god_level"] = OSD.FromString(GodLevel.ToString()); | 443 | //args["god_level"] = OSD.FromString(GodLevel.ToString()); |
441 | args["god_data"] = GodData; | 444 | if(GodData != null) |
442 | OSDMap g = (OSDMap)GodData; | 445 | { |
443 | if (g.ContainsKey("ViewerUiIsGod")) | 446 | args["god_data"] = GodData; |
444 | args["god_level"] = g["ViewerUiIsGod"].AsBoolean() ? 200 : 0;; | 447 | OSDMap g = (OSDMap)GodData; |
448 | if (g.ContainsKey("ViewerUiIsGod")) | ||
449 | args["god_level"] = g["ViewerUiIsGod"].AsBoolean() ? 200 : 0;; | ||
450 | } | ||
445 | args["always_run"] = OSD.FromBoolean(AlwaysRun); | 451 | args["always_run"] = OSD.FromBoolean(AlwaysRun); |
446 | args["prey_agent"] = OSD.FromUUID(PreyAgent); | 452 | args["prey_agent"] = OSD.FromUUID(PreyAgent); |
447 | args["agent_access"] = OSD.FromString(AgentAccess.ToString()); | 453 | args["agent_access"] = OSD.FromString(AgentAccess.ToString()); |
@@ -622,7 +628,7 @@ namespace OpenSim.Framework | |||
622 | //if (args["god_level"] != null) | 628 | //if (args["god_level"] != null) |
623 | // Byte.TryParse(args["god_level"].AsString(), out GodLevel); | 629 | // Byte.TryParse(args["god_level"].AsString(), out GodLevel); |
624 | 630 | ||
625 | if (args["god_data"] != null) | 631 | if (args.ContainsKey("god_data") && args["god_data"] != null) |
626 | GodData = args["god_data"]; | 632 | GodData = args["god_data"]; |
627 | 633 | ||
628 | if (args["always_run"] != null) | 634 | if (args["always_run"] != null) |
diff --git a/OpenSim/Framework/PermissionsUtil.cs b/OpenSim/Framework/PermissionsUtil.cs index 5d3186d..3dce04d 100644 --- a/OpenSim/Framework/PermissionsUtil.cs +++ b/OpenSim/Framework/PermissionsUtil.cs | |||
@@ -64,24 +64,5 @@ namespace OpenSim.Framework | |||
64 | str = "."; | 64 | str = "."; |
65 | return str; | 65 | return str; |
66 | } | 66 | } |
67 | |||
68 | /// <summary> | ||
69 | /// Applies an object's folded permissions to its regular permissions. | ||
70 | /// </summary> | ||
71 | /// <param name="foldedPerms">The folded permissions. Only the lowest 7 bits are examined.</param> | ||
72 | /// <param name="mainPerms">The permissions variable to modify.</param> | ||
73 | public static void ApplyFoldedPermissions(uint foldedPerms, ref uint mainPerms) | ||
74 | { | ||
75 | // if ((foldedPerms & 7) == 0) | ||
76 | // return; // assume that if the folded permissions are 0 then this means that they weren't actually recorded | ||
77 | |||
78 | if ((foldedPerms & ((uint)PermissionMask.Copy >> 13)) == 0) | ||
79 | mainPerms &= ~(uint)PermissionMask.Copy; | ||
80 | if ((foldedPerms & ((uint)PermissionMask.Transfer >> 13)) == 0) | ||
81 | mainPerms &= ~(uint)PermissionMask.Transfer; | ||
82 | if ((foldedPerms & ((uint)PermissionMask.Modify >> 13)) == 0) | ||
83 | mainPerms &= ~(uint)PermissionMask.Modify; | ||
84 | } | ||
85 | |||
86 | } | 67 | } |
87 | } | 68 | } |