aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs32
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs19
2 files changed, 51 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 7bcd7bd..234b12a 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -830,6 +830,7 @@ namespace OpenSim.Region.Environment.Scenes
830 new ParcelObjectOwnerRequest(m_LandManager.handleParcelObjectOwnersRequest); 830 new ParcelObjectOwnerRequest(m_LandManager.handleParcelObjectOwnersRequest);
831 831
832 client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(m_estateManager.handleEstateOwnerMessage); 832 client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(m_estateManager.handleEstateOwnerMessage);
833 client.OnRequestGodlikePowers += handleRequestGodlikePowers;
833 834
834 client.OnCreateNewInventoryItem += CreateNewInventoryItem; 835 client.OnCreateNewInventoryItem += CreateNewInventoryItem;
835 client.OnCreateNewInventoryFolder += CommsManager.UserProfileCache.HandleCreateInventoryFolder; 836 client.OnCreateNewInventoryFolder += CommsManager.UserProfileCache.HandleCreateInventoryFolder;
@@ -1177,6 +1178,37 @@ namespace OpenSim.Region.Environment.Scenes
1177 } 1178 }
1178 } 1179 }
1179 1180
1181 public void handleRequestGodlikePowers(LLUUID agentID, LLUUID sessionID, LLUUID token, IClientAPI controllingclient)
1182 {
1183 // First check that this is the sim owner
1184
1185 if (agentID == RegionInfo.MasterAvatarAssignedUUID)
1186 {
1187
1188 // User needs to be logged into this sim
1189 if (m_scenePresences.ContainsKey(agentID))
1190 {
1191 // Next we check for spoofing.....
1192 LLUUID testSessionID = m_scenePresences[agentID].ControllingClient.SessionId;
1193 if (sessionID == testSessionID)
1194 {
1195 if (sessionID == controllingclient.SessionId)
1196 {
1197 m_scenePresences[agentID].GrantGodlikePowers(agentID, testSessionID, token);
1198
1199 }
1200
1201 }
1202
1203 }
1204 }
1205 else
1206 {
1207 m_scenePresences[agentID].ControllingClient.SendAgentAlertMessage("Request for god powers denied", false);
1208 }
1209
1210 }
1211
1180 public void SendAlertToUser(string firstName, string lastName, string message, bool modal) 1212 public void SendAlertToUser(string firstName, string lastName, string message, bool modal)
1181 { 1213 {
1182 foreach (ScenePresence presence in m_scenePresences.Values) 1214 foreach (ScenePresence presence in m_scenePresences.Values)
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 0cc3a7e..f91913d 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -1233,6 +1233,25 @@ namespace OpenSim.Region.Environment.Scenes
1233 ControllingClient.OutPacket(kupack, ThrottleOutPacketType.Task); 1233 ControllingClient.OutPacket(kupack, ThrottleOutPacketType.Task);
1234 1234
1235 } 1235 }
1236 public void GrantGodlikePowers(LLUUID agentID, LLUUID sessionID, LLUUID token)
1237 {
1238 GrantGodlikePowersPacket respondPacket = new GrantGodlikePowersPacket();
1239 GrantGodlikePowersPacket.GrantDataBlock gdb = new GrantGodlikePowersPacket.GrantDataBlock();
1240 GrantGodlikePowersPacket.AgentDataBlock adb = new GrantGodlikePowersPacket.AgentDataBlock();
1241
1242 adb.AgentID = agentID;
1243 adb.SessionID = sessionID; // More security
1244
1245 gdb.GodLevel = (byte)100;
1246 gdb.Token = token;
1247 //respondPacket.AgentData = (GrantGodlikePowersPacket.AgentDataBlock)ablock;
1248 respondPacket.GrantData = gdb;
1249 respondPacket.AgentData = adb;
1250 ControllingClient.OutPacket(respondPacket, ThrottleOutPacketType.Task);
1251
1252
1253
1254 }
1236 /// <summary> 1255 /// <summary>
1237 /// 1256 ///
1238 /// </summary> 1257 /// </summary>