* Hanling RequestGodlikePowers. On Request.. sends the sim owner's client the appropriate messages to make it think it's got god status. Will be used for finding more unimplemented packets....

afrisby
Teravus Ovares 2007-11-24 01:38:36 +00:00
parent 3ce6116e4a
commit 52714c339e
6 changed files with 64 additions and 18 deletions

View File

@ -267,6 +267,8 @@ namespace OpenSim.Framework
public delegate void AddNewPrim(LLUUID ownerID, LLVector3 pos, LLQuaternion rot, PrimitiveBaseShape shape);
public delegate void RequestGodlikePowers(LLUUID AgentID, LLUUID SessionID, LLUUID token, IClientAPI remote_client);
public delegate void CreateInventoryFolder(
IClientAPI remoteClient, LLUUID folderID, ushort folderType, string folderName, LLUUID parentID);
@ -329,6 +331,9 @@ namespace OpenSim.Framework
event AvatarPickerRequest OnAvatarPickerRequest;
event Action<IClientAPI> OnRequestAvatarsData;
event AddNewPrim OnAddPrim;
event RequestGodlikePowers OnRequestGodlikePowers;
event ObjectDuplicate OnObjectDuplicate;
event UpdateVector OnGrabObject;
event ObjectSelect OnDeGrabObject;

View File

@ -65,6 +65,7 @@ namespace OpenSim.Region.ClientStack
public event ObjectDuplicate OnObjectDuplicate;
public event MoveObject OnGrabUpdate;
public event AddNewPrim OnAddPrim;
public event RequestGodlikePowers OnRequestGodlikePowers;
public event ObjectExtraParams OnUpdateExtraParams;
public event UpdateShape OnUpdatePrimShape;
public event ObjectSelect OnObjectSelect;
@ -246,7 +247,7 @@ namespace OpenSim.Region.ClientStack
OutPacket(reply, ThrottleOutPacketType.Task);
}
/// <summary>
///
/// </summary>

View File

@ -1066,25 +1066,13 @@ namespace OpenSim.Region.ClientStack
#region unimplemented handlers
case PacketType.RequestGodlikePowers:
//RequestGodlikePowersPacket rglpPack = (RequestGodlikePowersPacket) Pack;
//RequestGodlikePowersPacket.RequestBlockBlock rblock = rglpPack.RequestBlock;
//LLUUID token = rblock.Token;
//RequestGodlikePowersPacket.AgentDataBlock ablock = rglpPack.AgentData;
RequestGodlikePowersPacket rglpPack = (RequestGodlikePowersPacket) Pack;
RequestGodlikePowersPacket.RequestBlockBlock rblock = rglpPack.RequestBlock;
LLUUID token = rblock.Token;
RequestGodlikePowersPacket.AgentDataBlock ablock = rglpPack.AgentData;
OnRequestGodlikePowers(ablock.AgentID, ablock.SessionID, token, this);
//GrantGodlikePowersPacket respondPacket = new GrantGodlikePowersPacket();
//GrantGodlikePowersPacket.GrantDataBlock gdb = new GrantGodlikePowersPacket.GrantDataBlock();
//GrantGodlikePowersPacket.AgentDataBlock adb = new GrantGodlikePowersPacket.AgentDataBlock();
//adb.AgentID = ablock.AgentID;
//adb.SessionID = ablock.SessionID;
//gdb.GodLevel = (byte)100;
//gdb.Token = token;
//respondPacket.AgentData = (GrantGodlikePowersPacket.AgentDataBlock)ablock;
//respondPacket.GrantData = gdb;
//respondPacket.AgentData = adb;
//OutPacket(respondPacket, ThrottleOutPacketType.Task);
break;
case PacketType.GodKickUser:
//GodKickUserPacket gkupack = (GodKickUserPacket) Pack;

View File

@ -830,6 +830,7 @@ namespace OpenSim.Region.Environment.Scenes
new ParcelObjectOwnerRequest(m_LandManager.handleParcelObjectOwnersRequest);
client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(m_estateManager.handleEstateOwnerMessage);
client.OnRequestGodlikePowers += handleRequestGodlikePowers;
client.OnCreateNewInventoryItem += CreateNewInventoryItem;
client.OnCreateNewInventoryFolder += CommsManager.UserProfileCache.HandleCreateInventoryFolder;
@ -1177,6 +1178,37 @@ namespace OpenSim.Region.Environment.Scenes
}
}
public void handleRequestGodlikePowers(LLUUID agentID, LLUUID sessionID, LLUUID token, IClientAPI controllingclient)
{
// First check that this is the sim owner
if (agentID == RegionInfo.MasterAvatarAssignedUUID)
{
// User needs to be logged into this sim
if (m_scenePresences.ContainsKey(agentID))
{
// Next we check for spoofing.....
LLUUID testSessionID = m_scenePresences[agentID].ControllingClient.SessionId;
if (sessionID == testSessionID)
{
if (sessionID == controllingclient.SessionId)
{
m_scenePresences[agentID].GrantGodlikePowers(agentID, testSessionID, token);
}
}
}
}
else
{
m_scenePresences[agentID].ControllingClient.SendAgentAlertMessage("Request for god powers denied", false);
}
}
public void SendAlertToUser(string firstName, string lastName, string message, bool modal)
{
foreach (ScenePresence presence in m_scenePresences.Values)

View File

@ -1232,6 +1232,25 @@ namespace OpenSim.Region.Environment.Scenes
kupack.UserInfo.Reason = Helpers.StringToField(message);
ControllingClient.OutPacket(kupack, ThrottleOutPacketType.Task);
}
public void GrantGodlikePowers(LLUUID agentID, LLUUID sessionID, LLUUID token)
{
GrantGodlikePowersPacket respondPacket = new GrantGodlikePowersPacket();
GrantGodlikePowersPacket.GrantDataBlock gdb = new GrantGodlikePowersPacket.GrantDataBlock();
GrantGodlikePowersPacket.AgentDataBlock adb = new GrantGodlikePowersPacket.AgentDataBlock();
adb.AgentID = agentID;
adb.SessionID = sessionID; // More security
gdb.GodLevel = (byte)100;
gdb.Token = token;
//respondPacket.AgentData = (GrantGodlikePowersPacket.AgentDataBlock)ablock;
respondPacket.GrantData = gdb;
respondPacket.AgentData = adb;
ControllingClient.OutPacket(respondPacket, ThrottleOutPacketType.Task);
}
/// <summary>
///

View File

@ -75,6 +75,7 @@ namespace SimpleApp
public event AvatarPickerRequest OnAvatarPickerRequest;
public event Action<IClientAPI> OnRequestAvatarsData;
public event AddNewPrim OnAddPrim;
public event RequestGodlikePowers OnRequestGodlikePowers;
public event ObjectDuplicate OnObjectDuplicate;
public event UpdateVector OnGrabObject;
public event ObjectSelect OnDeGrabObject;