* Refactored OutPacket out of ScenePresence

* Down to 65 warnings.
0.6.0-stable
Teravus Ovares 2008-05-14 04:57:32 +00:00
parent 8fd0378ae6
commit 9e8dd941f1
6 changed files with 68 additions and 29 deletions

View File

@ -634,9 +634,9 @@ namespace OpenSim.Framework
LLUUID SecureSessionId { get; } LLUUID SecureSessionId { get; }
[Obsolete("LLClientView Specific - Use .Name instead. Do not assume an av has two names")] [Obsolete("LLClientView Specific - Use .Name instead. Do not assume an av has two names. Adam, this is impossible to completely refactor out. Nor would I suggest it. All applications that i've ever dealt with have firstname and lastname. However the firstname and lastname are not always the username.")]
string FirstName { get; } string FirstName { get; }
[Obsolete("LLClientView Specific - Use .Name instead. Do not assume an av has two names")] [Obsolete("LLClientView Specific - Use .Name instead. Do not assume an av has two names. Adam, this is impossible to completely refactor out. Nor would I suggest it. All applications that i've ever dealt with have firstname and lastname. However the firstname and lastname are not always the username.")]
string LastName { get; } string LastName { get; }
[Obsolete("LLClientView Specific - Replace with ???")] [Obsolete("LLClientView Specific - Replace with ???")]
@ -809,7 +809,7 @@ namespace OpenSim.Framework
[Obsolete("IClientAPI.OutPacket SHOULD NOT EXIST please refactor appropriately.")] [Obsolete("IClientAPI.OutPacket SHOULD NOT EXIST outside of LLClientView please refactor appropriately.")]
void OutPacket(Packet newPack, ThrottleOutPacketType packType); void OutPacket(Packet newPack, ThrottleOutPacketType packType);
void SendWearables(AvatarWearable[] wearables, int serial); void SendWearables(AvatarWearable[] wearables, int serial);
void SendAppearance(LLUUID agentID, byte[] visualParams, byte[] textureEntry); void SendAppearance(LLUUID agentID, byte[] visualParams, byte[] textureEntry);
@ -969,6 +969,11 @@ namespace OpenSim.Framework
void SendAgentOnline(LLUUID[] agentIDs); void SendAgentOnline(LLUUID[] agentIDs);
void SendSitResponse(LLUUID TargetID, LLVector3 OffsetPos, LLQuaternion SitOrientation, bool autopilot,
LLVector3 CameraAtOffset, LLVector3 CameraEyeOffset, bool ForceMouseLook);
void SendAdminResponse(LLUUID Token, uint AdminLevel);
byte[] GetThrottlesPacked(float multiplier); byte[] GetThrottlesPacked(float multiplier);

View File

@ -5739,6 +5739,39 @@ namespace OpenSim.Region.ClientStack.LindenUDP
offp.AgentBlock = offpb; offp.AgentBlock = offpb;
OutPacket(offp, ThrottleOutPacketType.Task); OutPacket(offp, ThrottleOutPacketType.Task);
} }
public void SendSitResponse(LLUUID TargetID, LLVector3 OffsetPos, LLQuaternion SitOrientation, bool autopilot,
LLVector3 CameraAtOffset, LLVector3 CameraEyeOffset, bool ForceMouseLook)
{
AvatarSitResponsePacket avatarSitResponse = new AvatarSitResponsePacket();
avatarSitResponse.SitObject.ID = TargetID;
if (CameraAtOffset != LLVector3.Zero)
{
avatarSitResponse.SitTransform.CameraAtOffset = CameraAtOffset;
avatarSitResponse.SitTransform.CameraEyeOffset = CameraEyeOffset;
}
avatarSitResponse.SitTransform.ForceMouselook = ForceMouseLook;
avatarSitResponse.SitTransform.AutoPilot = autopilot;
avatarSitResponse.SitTransform.SitPosition = OffsetPos;
avatarSitResponse.SitTransform.SitRotation = SitOrientation;
OutPacket(avatarSitResponse, ThrottleOutPacketType.Task);
}
public void SendAdminResponse(LLUUID Token, uint AdminLevel)
{
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)AdminLevel;
gdb.Token = Token;
//respondPacket.AgentData = (GrantGodlikePowersPacket.AgentDataBlock)ablock;
respondPacket.GrantData = gdb;
respondPacket.AgentData = adb;
OutPacket(respondPacket, ThrottleOutPacketType.Task);
}
public ClientInfo GetClientInfo() public ClientInfo GetClientInfo()
{ {
//MainLog.Instance.Verbose("CLIENT", "GetClientInfo BGN"); //MainLog.Instance.Verbose("CLIENT", "GetClientInfo BGN");

View File

@ -176,7 +176,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups
ActiveGroupTitle = grp.ActiveGroupTitle; ActiveGroupTitle = grp.ActiveGroupTitle;
} }
//remoteClient.SendAgentDataUpdate(AgentID, ActiveGroupID, firstname, lastname, ActiveGroupPowers, ActiveGroupName, ActiveGroupTitle); remoteClient.SendAgentDataUpdate(AgentID, ActiveGroupID, firstname, lastname, ActiveGroupPowers, ActiveGroupName, ActiveGroupTitle);
} }
} }
} }

View File

@ -92,7 +92,16 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
{ {
} }
public void SendSitResponse(LLUUID TargetID, LLVector3 OffsetPos, LLQuaternion SitOrientation, bool autopilot,
LLVector3 CameraAtOffset, LLVector3 CameraEyeOffset, bool ForceMouseLook)
{
}
public void SendAdminResponse(LLUUID Token, uint AdminLevel)
{
}
public LLUUID GetDefaultAnimation(string name) public LLUUID GetDefaultAnimation(string name)
{ {
return LLUUID.Zero; return LLUUID.Zero;

View File

@ -942,9 +942,9 @@ namespace OpenSim.Region.Environment.Scenes
private void SendSitResponse(IClientAPI remoteClient, LLUUID targetID, LLVector3 offset) private void SendSitResponse(IClientAPI remoteClient, LLUUID targetID, LLVector3 offset)
{ {
AvatarSitResponsePacket avatarSitResponse = new AvatarSitResponsePacket();
avatarSitResponse.SitObject.ID = targetID;
bool autopilot = true; bool autopilot = true;
LLVector3 pos = new LLVector3(); LLVector3 pos = new LLVector3();
@ -1000,11 +1000,7 @@ namespace OpenSim.Region.Environment.Scenes
} }
} }
avatarSitResponse.SitTransform.AutoPilot = autopilot; ControllingClient.SendSitResponse(targetID, offset, sitOrientation, autopilot, LLVector3.Zero, LLVector3.Zero, false);
avatarSitResponse.SitTransform.SitPosition = offset;
avatarSitResponse.SitTransform.SitRotation = sitOrientation;
remoteClient.OutPacket(avatarSitResponse, ThrottleOutPacketType.Task);
// This calls HandleAgentSit twice, once from here, and the client calls // This calls HandleAgentSit twice, once from here, and the client calls
// HandleAgentSit itself after it gets to the location // HandleAgentSit itself after it gets to the location
@ -1710,29 +1706,16 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary> /// </summary>
public void GrantGodlikePowers(LLUUID agentID, LLUUID sessionID, LLUUID token, bool godStatus) public void GrantGodlikePowers(LLUUID agentID, LLUUID sessionID, LLUUID token, bool godStatus)
{ {
GrantGodlikePowersPacket respondPacket = new GrantGodlikePowersPacket();
GrantGodlikePowersPacket.GrantDataBlock gdb = new GrantGodlikePowersPacket.GrantDataBlock();
GrantGodlikePowersPacket.AgentDataBlock adb = new GrantGodlikePowersPacket.AgentDataBlock();
adb.AgentID = agentID;
adb.SessionID = sessionID; // More security
if (godStatus) if (godStatus)
{ {
gdb.GodLevel = (byte)250;
m_godlevel = 250; m_godlevel = 250;
} }
else else
{ {
gdb.GodLevel = (byte)0;
m_godlevel = 0; m_godlevel = 0;
} }
gdb.Token = token; ControllingClient.SendAdminResponse(token, (uint)m_godlevel);
//respondPacket.AgentData = (GrantGodlikePowersPacket.AgentDataBlock)ablock;
respondPacket.GrantData = gdb;
respondPacket.AgentData = adb;
ControllingClient.OutPacket(respondPacket, ThrottleOutPacketType.Task);
} }
/// <summary> /// <summary>

View File

@ -563,7 +563,6 @@ namespace OpenSim.Region.Examples.SimpleModule
{ {
} }
public void SendAgentOffline(LLUUID[] agentIDs) public void SendAgentOffline(LLUUID[] agentIDs)
{ {
@ -574,6 +573,16 @@ namespace OpenSim.Region.Examples.SimpleModule
} }
public void SendSitResponse(LLUUID TargetID, LLVector3 OffsetPos, LLQuaternion SitOrientation, bool autopilot,
LLVector3 CameraAtOffset, LLVector3 CameraEyeOffset, bool ForceMouseLook)
{
}
public void SendAdminResponse(LLUUID Token, uint AdminLevel)
{
}
private void Update() private void Update()
{ {
frame++; frame++;