diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 87e8acee1d..690b04e30e 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -634,9 +634,9 @@ namespace OpenSim.Framework 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; } - [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; } [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 SendWearables(AvatarWearable[] wearables, int serial); void SendAppearance(LLUUID agentID, byte[] visualParams, byte[] textureEntry); @@ -969,6 +969,11 @@ namespace OpenSim.Framework 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); diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index e1e8854c53..b8f055e43d 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -5739,6 +5739,39 @@ namespace OpenSim.Region.ClientStack.LindenUDP offp.AgentBlock = offpb; 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() { //MainLog.Instance.Verbose("CLIENT", "GetClientInfo BGN"); diff --git a/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs index f9e81f02ad..0f7f2f258e 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs @@ -176,7 +176,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups ActiveGroupTitle = grp.ActiveGroupTitle; } - //remoteClient.SendAgentDataUpdate(AgentID, ActiveGroupID, firstname, lastname, ActiveGroupPowers, ActiveGroupName, ActiveGroupTitle); + remoteClient.SendAgentDataUpdate(AgentID, ActiveGroupID, firstname, lastname, ActiveGroupPowers, ActiveGroupName, ActiveGroupTitle); } } } diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs index e5d295bb1d..3126f1cc42 100644 --- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs @@ -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) { return LLUUID.Zero; diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 3189b10d3e..6f0fbdf1ba 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -942,10 +942,10 @@ namespace OpenSim.Region.Environment.Scenes private void SendSitResponse(IClientAPI remoteClient, LLUUID targetID, LLVector3 offset) { - AvatarSitResponsePacket avatarSitResponse = new AvatarSitResponsePacket(); - - avatarSitResponse.SitObject.ID = targetID; + + + bool autopilot = true; LLVector3 pos = new LLVector3(); LLQuaternion sitOrientation = new LLQuaternion(0, 0, 0, 1); @@ -1000,12 +1000,8 @@ namespace OpenSim.Region.Environment.Scenes } } - avatarSitResponse.SitTransform.AutoPilot = autopilot; - avatarSitResponse.SitTransform.SitPosition = offset; - avatarSitResponse.SitTransform.SitRotation = sitOrientation; - - remoteClient.OutPacket(avatarSitResponse, ThrottleOutPacketType.Task); - + ControllingClient.SendSitResponse(targetID, offset, sitOrientation, autopilot, LLVector3.Zero, LLVector3.Zero, false); + // This calls HandleAgentSit twice, once from here, and the client calls // HandleAgentSit itself after it gets to the location // It doesn't get to the location until we've moved them there though @@ -1710,29 +1706,16 @@ namespace OpenSim.Region.Environment.Scenes /// 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) { - gdb.GodLevel = (byte)250; m_godlevel = 250; } else { - gdb.GodLevel = (byte)0; m_godlevel = 0; } - - gdb.Token = token; - //respondPacket.AgentData = (GrantGodlikePowersPacket.AgentDataBlock)ablock; - respondPacket.GrantData = gdb; - respondPacket.AgentData = adb; - ControllingClient.OutPacket(respondPacket, ThrottleOutPacketType.Task); + + ControllingClient.SendAdminResponse(token, (uint)m_godlevel); } /// diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 19494c2ecb..68f3ecb0fb 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs @@ -563,7 +563,6 @@ namespace OpenSim.Region.Examples.SimpleModule { } - 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() { frame++;