aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorMelanie Thielker2017-01-06 00:55:14 +0000
committerMelanie Thielker2017-01-06 00:55:14 +0000
commitad8915f154d2ce6ba1b3a021b1725a0b0a671635 (patch)
tree431a20d28837bc3b002dcb65b60450729eb5ed8a /OpenSim/Framework
parentAdd GodController class (diff)
downloadopensim-SC_OLD-ad8915f154d2ce6ba1b3a021b1725a0b0a671635.zip
opensim-SC_OLD-ad8915f154d2ce6ba1b3a021b1725a0b0a671635.tar.gz
opensim-SC_OLD-ad8915f154d2ce6ba1b3a021b1725a0b0a671635.tar.bz2
opensim-SC_OLD-ad8915f154d2ce6ba1b3a021b1725a0b0a671635.tar.xz
Restructure god level and permissions
Create a class GodController which controls all aspects of god level, viewer modes and user levels at ScenePresence level.
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/ChildAgentDataUpdate.cs33
1 files changed, 25 insertions, 8 deletions
diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs
index 03ead01..b9d64b1 100644
--- a/OpenSim/Framework/ChildAgentDataUpdate.cs
+++ b/OpenSim/Framework/ChildAgentDataUpdate.cs
@@ -89,7 +89,8 @@ namespace OpenSim.Framework
89 public Vector3 AtAxis; 89 public Vector3 AtAxis;
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 bool ChangedGrid; 94 public bool ChangedGrid;
94 95
95 // This probably shouldn't be here 96 // This probably shouldn't be here
@@ -117,7 +118,13 @@ namespace OpenSim.Framework
117 118
118 args["far"] = OSD.FromReal(Far); 119 args["far"] = OSD.FromReal(Far);
119 args["changed_grid"] = OSD.FromBoolean(ChangedGrid); 120 args["changed_grid"] = OSD.FromBoolean(ChangedGrid);
120 args["god_level"] = OSD.FromString(GodLevel.ToString()); 121 //args["god_level"] = OSD.FromString(GodLevel.ToString());
122 args["god_data"] = GodData;
123 OSDMap g = (OSDMap)GodData;
124 // Set legacy value
125 // TODO: remove after 0.9 is superseded
126 if (g.ContainsKey("ViewerUiIsGod"))
127 args["god_level"] = g["ViewerUiIsGod"].AsBoolean() ? 200 : 0;;
121 128
122 if ((Throttles != null) && (Throttles.Length > 0)) 129 if ((Throttles != null) && (Throttles.Length > 0))
123 args["throttles"] = OSD.FromBinary(Throttles); 130 args["throttles"] = OSD.FromBinary(Throttles);
@@ -176,8 +183,10 @@ namespace OpenSim.Framework
176 if (args["changed_grid"] != null) 183 if (args["changed_grid"] != null)
177 ChangedGrid = args["changed_grid"].AsBoolean(); 184 ChangedGrid = args["changed_grid"].AsBoolean();
178 185
179 if (args["god_level"] != null) 186 //if (args["god_level"] != null)
180 Int32.TryParse(args["god_level"].AsString(), out GodLevel); 187 // Int32.TryParse(args["god_level"].AsString(), out GodLevel);
188 if (args["god_data"] != null)
189 GodData = args["god_data"];
181 190
182 if (args["far"] != null) 191 if (args["far"] != null)
183 Far = (float)(args["far"].AsReal()); 192 Far = (float)(args["far"].AsReal());
@@ -353,7 +362,8 @@ namespace OpenSim.Framework
353 public Quaternion BodyRotation; 362 public Quaternion BodyRotation;
354 public uint ControlFlags; 363 public uint ControlFlags;
355 public float EnergyLevel; 364 public float EnergyLevel;
356 public Byte GodLevel; 365 public OSD GodData = new OSDMap();
366 //public Byte GodLevel;
357 public bool AlwaysRun; 367 public bool AlwaysRun;
358 public UUID PreyAgent; 368 public UUID PreyAgent;
359 public Byte AgentAccess; 369 public Byte AgentAccess;
@@ -427,7 +437,11 @@ namespace OpenSim.Framework
427 args["control_flags"] = OSD.FromString(ControlFlags.ToString()); 437 args["control_flags"] = OSD.FromString(ControlFlags.ToString());
428 438
429 args["energy_level"] = OSD.FromReal(EnergyLevel); 439 args["energy_level"] = OSD.FromReal(EnergyLevel);
430 args["god_level"] = OSD.FromString(GodLevel.ToString()); 440 //args["god_level"] = OSD.FromString(GodLevel.ToString());
441 args["god_data"] = GodData;
442 OSDMap g = (OSDMap)GodData;
443 if (g.ContainsKey("ViewerUiIsGod"))
444 args["god_level"] = g["ViewerUiIsGod"].AsBoolean() ? 200 : 0;;
431 args["always_run"] = OSD.FromBoolean(AlwaysRun); 445 args["always_run"] = OSD.FromBoolean(AlwaysRun);
432 args["prey_agent"] = OSD.FromUUID(PreyAgent); 446 args["prey_agent"] = OSD.FromUUID(PreyAgent);
433 args["agent_access"] = OSD.FromString(AgentAccess.ToString()); 447 args["agent_access"] = OSD.FromString(AgentAccess.ToString());
@@ -605,8 +619,11 @@ namespace OpenSim.Framework
605 if (args["energy_level"] != null) 619 if (args["energy_level"] != null)
606 EnergyLevel = (float)(args["energy_level"].AsReal()); 620 EnergyLevel = (float)(args["energy_level"].AsReal());
607 621
608 if (args["god_level"] != null) 622 //if (args["god_level"] != null)
609 Byte.TryParse(args["god_level"].AsString(), out GodLevel); 623 // Byte.TryParse(args["god_level"].AsString(), out GodLevel);
624
625 if (args["god_data"] != null)
626 GodData = args["god_data"];
610 627
611 if (args["always_run"] != null) 628 if (args["always_run"] != null)
612 AlwaysRun = args["always_run"].AsBoolean(); 629 AlwaysRun = args["always_run"].AsBoolean();