aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/IClientAPI.cs5
-rw-r--r--OpenSim/Region/ClientStack/ClientView.API.cs3
-rw-r--r--OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs22
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs32
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs19
-rw-r--r--OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs1
6 files changed, 64 insertions, 18 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 2c82d97..f7e3521 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -267,6 +267,8 @@ namespace OpenSim.Framework
267 267
268 public delegate void AddNewPrim(LLUUID ownerID, LLVector3 pos, LLQuaternion rot, PrimitiveBaseShape shape); 268 public delegate void AddNewPrim(LLUUID ownerID, LLVector3 pos, LLQuaternion rot, PrimitiveBaseShape shape);
269 269
270 public delegate void RequestGodlikePowers(LLUUID AgentID, LLUUID SessionID, LLUUID token, IClientAPI remote_client);
271
270 public delegate void CreateInventoryFolder( 272 public delegate void CreateInventoryFolder(
271 IClientAPI remoteClient, LLUUID folderID, ushort folderType, string folderName, LLUUID parentID); 273 IClientAPI remoteClient, LLUUID folderID, ushort folderType, string folderName, LLUUID parentID);
272 274
@@ -329,6 +331,9 @@ namespace OpenSim.Framework
329 event AvatarPickerRequest OnAvatarPickerRequest; 331 event AvatarPickerRequest OnAvatarPickerRequest;
330 event Action<IClientAPI> OnRequestAvatarsData; 332 event Action<IClientAPI> OnRequestAvatarsData;
331 event AddNewPrim OnAddPrim; 333 event AddNewPrim OnAddPrim;
334
335 event RequestGodlikePowers OnRequestGodlikePowers;
336
332 event ObjectDuplicate OnObjectDuplicate; 337 event ObjectDuplicate OnObjectDuplicate;
333 event UpdateVector OnGrabObject; 338 event UpdateVector OnGrabObject;
334 event ObjectSelect OnDeGrabObject; 339 event ObjectSelect OnDeGrabObject;
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs
index 9182b5c..b046f0a 100644
--- a/OpenSim/Region/ClientStack/ClientView.API.cs
+++ b/OpenSim/Region/ClientStack/ClientView.API.cs
@@ -65,6 +65,7 @@ namespace OpenSim.Region.ClientStack
65 public event ObjectDuplicate OnObjectDuplicate; 65 public event ObjectDuplicate OnObjectDuplicate;
66 public event MoveObject OnGrabUpdate; 66 public event MoveObject OnGrabUpdate;
67 public event AddNewPrim OnAddPrim; 67 public event AddNewPrim OnAddPrim;
68 public event RequestGodlikePowers OnRequestGodlikePowers;
68 public event ObjectExtraParams OnUpdateExtraParams; 69 public event ObjectExtraParams OnUpdateExtraParams;
69 public event UpdateShape OnUpdatePrimShape; 70 public event UpdateShape OnUpdatePrimShape;
70 public event ObjectSelect OnObjectSelect; 71 public event ObjectSelect OnObjectSelect;
@@ -246,7 +247,7 @@ namespace OpenSim.Region.ClientStack
246 247
247 OutPacket(reply, ThrottleOutPacketType.Task); 248 OutPacket(reply, ThrottleOutPacketType.Task);
248 } 249 }
249 250
250 /// <summary> 251 /// <summary>
251 /// 252 ///
252 /// </summary> 253 /// </summary>
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
index 64f5b6d..ca7ba7f 100644
--- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
+++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
@@ -1066,25 +1066,13 @@ namespace OpenSim.Region.ClientStack
1066 1066
1067 #region unimplemented handlers 1067 #region unimplemented handlers
1068 case PacketType.RequestGodlikePowers: 1068 case PacketType.RequestGodlikePowers:
1069 //RequestGodlikePowersPacket rglpPack = (RequestGodlikePowersPacket) Pack; 1069 RequestGodlikePowersPacket rglpPack = (RequestGodlikePowersPacket) Pack;
1070 //RequestGodlikePowersPacket.RequestBlockBlock rblock = rglpPack.RequestBlock; 1070 RequestGodlikePowersPacket.RequestBlockBlock rblock = rglpPack.RequestBlock;
1071 //LLUUID token = rblock.Token; 1071 LLUUID token = rblock.Token;
1072 //RequestGodlikePowersPacket.AgentDataBlock ablock = rglpPack.AgentData; 1072 RequestGodlikePowersPacket.AgentDataBlock ablock = rglpPack.AgentData;
1073 1073
1074 OnRequestGodlikePowers(ablock.AgentID, ablock.SessionID, token, this);
1074 1075
1075 //GrantGodlikePowersPacket respondPacket = new GrantGodlikePowersPacket();
1076 //GrantGodlikePowersPacket.GrantDataBlock gdb = new GrantGodlikePowersPacket.GrantDataBlock();
1077 //GrantGodlikePowersPacket.AgentDataBlock adb = new GrantGodlikePowersPacket.AgentDataBlock();
1078
1079 //adb.AgentID = ablock.AgentID;
1080 //adb.SessionID = ablock.SessionID;
1081
1082 //gdb.GodLevel = (byte)100;
1083 //gdb.Token = token;
1084 //respondPacket.AgentData = (GrantGodlikePowersPacket.AgentDataBlock)ablock;
1085 //respondPacket.GrantData = gdb;
1086 //respondPacket.AgentData = adb;
1087 //OutPacket(respondPacket, ThrottleOutPacketType.Task);
1088 break; 1076 break;
1089 case PacketType.GodKickUser: 1077 case PacketType.GodKickUser:
1090 //GodKickUserPacket gkupack = (GodKickUserPacket) Pack; 1078 //GodKickUserPacket gkupack = (GodKickUserPacket) Pack;
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>
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
index 65c8ee7..b8800a8 100644
--- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
@@ -75,6 +75,7 @@ namespace SimpleApp
75 public event AvatarPickerRequest OnAvatarPickerRequest; 75 public event AvatarPickerRequest OnAvatarPickerRequest;
76 public event Action<IClientAPI> OnRequestAvatarsData; 76 public event Action<IClientAPI> OnRequestAvatarsData;
77 public event AddNewPrim OnAddPrim; 77 public event AddNewPrim OnAddPrim;
78 public event RequestGodlikePowers OnRequestGodlikePowers;
78 public event ObjectDuplicate OnObjectDuplicate; 79 public event ObjectDuplicate OnObjectDuplicate;
79 public event UpdateVector OnGrabObject; 80 public event UpdateVector OnGrabObject;
80 public event ObjectSelect OnDeGrabObject; 81 public event ObjectSelect OnDeGrabObject;