diff options
author | Dan Lake | 2012-02-01 16:25:35 -0800 |
---|---|---|
committer | Dan Lake | 2012-02-01 16:25:35 -0800 |
commit | c10193c72b1f029a958f04d2f5d7ee384e693aaa (patch) | |
tree | 052ec7e973c15b158310511197affad14eb9c64f /OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |
parent | Trigger event when prims are scheduled for an update. This gives modules earl... (diff) | |
parent | Small optimization to last commit (diff) | |
download | opensim-SC-c10193c72b1f029a958f04d2f5d7ee384e693aaa.zip opensim-SC-c10193c72b1f029a958f04d2f5d7ee384e693aaa.tar.gz opensim-SC-c10193c72b1f029a958f04d2f5d7ee384e693aaa.tar.bz2 opensim-SC-c10193c72b1f029a958f04d2f5d7ee384e693aaa.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 81 |
1 files changed, 67 insertions, 14 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index fe28ba3..a7bf06d 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -219,6 +219,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
219 | public event BakeTerrain OnBakeTerrain; | 219 | public event BakeTerrain OnBakeTerrain; |
220 | public event RequestTerrain OnUploadTerrain; | 220 | public event RequestTerrain OnUploadTerrain; |
221 | public event EstateChangeInfo OnEstateChangeInfo; | 221 | public event EstateChangeInfo OnEstateChangeInfo; |
222 | public event EstateManageTelehub OnEstateManageTelehub; | ||
222 | public event EstateRestartSimRequest OnEstateRestartSimRequest; | 223 | public event EstateRestartSimRequest OnEstateRestartSimRequest; |
223 | public event EstateChangeCovenantRequest OnEstateChangeCovenantRequest; | 224 | public event EstateChangeCovenantRequest OnEstateChangeCovenantRequest; |
224 | public event UpdateEstateAccessDeltaRequest OnUpdateEstateAccessDeltaRequest; | 225 | public event UpdateEstateAccessDeltaRequest OnUpdateEstateAccessDeltaRequest; |
@@ -304,6 +305,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
304 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 305 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
305 | protected static Dictionary<PacketType, PacketMethod> PacketHandlers = new Dictionary<PacketType, PacketMethod>(); //Global/static handlers for all clients | 306 | protected static Dictionary<PacketType, PacketMethod> PacketHandlers = new Dictionary<PacketType, PacketMethod>(); //Global/static handlers for all clients |
306 | 307 | ||
308 | /// <summary> | ||
309 | /// Handles UDP texture download. | ||
310 | /// </summary> | ||
311 | public LLImageManager ImageManager { get; private set; } | ||
312 | |||
307 | private readonly LLUDPServer m_udpServer; | 313 | private readonly LLUDPServer m_udpServer; |
308 | private readonly LLUDPClient m_udpClient; | 314 | private readonly LLUDPClient m_udpClient; |
309 | private readonly UUID m_sessionId; | 315 | private readonly UUID m_sessionId; |
@@ -348,7 +354,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
348 | protected Dictionary<PacketType, PacketProcessor> m_packetHandlers = new Dictionary<PacketType, PacketProcessor>(); | 354 | protected Dictionary<PacketType, PacketProcessor> m_packetHandlers = new Dictionary<PacketType, PacketProcessor>(); |
349 | protected Dictionary<string, GenericMessage> m_genericPacketHandlers = new Dictionary<string, GenericMessage>(); //PauPaw:Local Generic Message handlers | 355 | protected Dictionary<string, GenericMessage> m_genericPacketHandlers = new Dictionary<string, GenericMessage>(); //PauPaw:Local Generic Message handlers |
350 | protected Scene m_scene; | 356 | protected Scene m_scene; |
351 | private LLImageManager m_imageManager; | ||
352 | protected string m_firstName; | 357 | protected string m_firstName; |
353 | protected string m_lastName; | 358 | protected string m_lastName; |
354 | protected Thread m_clientThread; | 359 | protected Thread m_clientThread; |
@@ -459,7 +464,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
459 | 464 | ||
460 | m_assetService = m_scene.RequestModuleInterface<IAssetService>(); | 465 | m_assetService = m_scene.RequestModuleInterface<IAssetService>(); |
461 | m_GroupsModule = scene.RequestModuleInterface<IGroupsModule>(); | 466 | m_GroupsModule = scene.RequestModuleInterface<IGroupsModule>(); |
462 | m_imageManager = new LLImageManager(this, m_assetService, Scene.RequestModuleInterface<IJ2KDecoder>()); | 467 | ImageManager = new LLImageManager(this, m_assetService, Scene.RequestModuleInterface<IJ2KDecoder>()); |
463 | m_channelVersion = Util.StringToBytes256(scene.GetSimulatorVersion()); | 468 | m_channelVersion = Util.StringToBytes256(scene.GetSimulatorVersion()); |
464 | m_agentId = agentId; | 469 | m_agentId = agentId; |
465 | m_sessionId = sessionId; | 470 | m_sessionId = sessionId; |
@@ -499,7 +504,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
499 | IsActive = false; | 504 | IsActive = false; |
500 | 505 | ||
501 | // Shutdown the image manager | 506 | // Shutdown the image manager |
502 | m_imageManager.Close(); | 507 | ImageManager.Close(); |
503 | 508 | ||
504 | // Fire the callback for this connection closing | 509 | // Fire the callback for this connection closing |
505 | if (OnConnectionClosed != null) | 510 | if (OnConnectionClosed != null) |
@@ -577,7 +582,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
577 | /// Add a handler for the given packet type. | 582 | /// Add a handler for the given packet type. |
578 | /// </summary> | 583 | /// </summary> |
579 | /// <remarks> | 584 | /// <remarks> |
580 | /// The packet is handled on its own thread. If packets must be handled in the order in which thye | 585 | /// The packet is handled on its own thread. If packets must be handled in the order in which they |
581 | /// are received then please use the synchronous version of this method. | 586 | /// are received then please use the synchronous version of this method. |
582 | /// </remarks> | 587 | /// </remarks> |
583 | /// <param name="packetType"></param> | 588 | /// <param name="packetType"></param> |
@@ -758,9 +763,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
758 | OutPacket(handshake, ThrottleOutPacketType.Task); | 763 | OutPacket(handshake, ThrottleOutPacketType.Task); |
759 | } | 764 | } |
760 | 765 | ||
761 | /// <summary> | ||
762 | /// | ||
763 | /// </summary> | ||
764 | public void MoveAgentIntoRegion(RegionInfo regInfo, Vector3 pos, Vector3 look) | 766 | public void MoveAgentIntoRegion(RegionInfo regInfo, Vector3 pos, Vector3 look) |
765 | { | 767 | { |
766 | AgentMovementCompletePacket mov = (AgentMovementCompletePacket)PacketPool.Instance.GetPacket(PacketType.AgentMovementComplete); | 768 | AgentMovementCompletePacket mov = (AgentMovementCompletePacket)PacketPool.Instance.GetPacket(PacketType.AgentMovementComplete); |
@@ -3476,6 +3478,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3476 | 3478 | ||
3477 | public void SendAppearance(UUID agentID, byte[] visualParams, byte[] textureEntry) | 3479 | public void SendAppearance(UUID agentID, byte[] visualParams, byte[] textureEntry) |
3478 | { | 3480 | { |
3481 | // m_log.DebugFormat( | ||
3482 | // "[LLCLIENTVIEW]: Sending avatar appearance for {0} with {1} bytes to {2} {3}", | ||
3483 | // agentID, textureEntry.Length, Name, AgentId); | ||
3484 | |||
3479 | AvatarAppearancePacket avp = (AvatarAppearancePacket)PacketPool.Instance.GetPacket(PacketType.AvatarAppearance); | 3485 | AvatarAppearancePacket avp = (AvatarAppearancePacket)PacketPool.Instance.GetPacket(PacketType.AvatarAppearance); |
3480 | // TODO: don't create new blocks if recycling an old packet | 3486 | // TODO: don't create new blocks if recycling an old packet |
3481 | avp.VisualParam = new AvatarAppearancePacket.VisualParamBlock[218]; | 3487 | avp.VisualParam = new AvatarAppearancePacket.VisualParamBlock[218]; |
@@ -3497,7 +3503,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3497 | 3503 | ||
3498 | public void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId, UUID[] objectIDs) | 3504 | public void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId, UUID[] objectIDs) |
3499 | { | 3505 | { |
3500 | //m_log.DebugFormat("[CLIENT]: Sending animations to {0}", Name); | 3506 | // m_log.DebugFormat("[LLCLIENTVIEW]: Sending animations for {0} to {1}", sourceAgentId, Name); |
3501 | 3507 | ||
3502 | AvatarAnimationPacket ani = (AvatarAnimationPacket)PacketPool.Instance.GetPacket(PacketType.AvatarAnimation); | 3508 | AvatarAnimationPacket ani = (AvatarAnimationPacket)PacketPool.Instance.GetPacket(PacketType.AvatarAnimation); |
3503 | // TODO: don't create new blocks if recycling an old packet | 3509 | // TODO: don't create new blocks if recycling an old packet |
@@ -3532,6 +3538,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3532 | /// </summary> | 3538 | /// </summary> |
3533 | public void SendAvatarDataImmediate(ISceneEntity avatar) | 3539 | public void SendAvatarDataImmediate(ISceneEntity avatar) |
3534 | { | 3540 | { |
3541 | // m_log.DebugFormat( | ||
3542 | // "[LLCLIENTVIEW]: Sending immediate object update for avatar {0} {1} to {2} {3}", | ||
3543 | // avatar.Name, avatar.UUID, Name, AgentId); | ||
3544 | |||
3535 | ScenePresence presence = avatar as ScenePresence; | 3545 | ScenePresence presence = avatar as ScenePresence; |
3536 | if (presence == null) | 3546 | if (presence == null) |
3537 | return; | 3547 | return; |
@@ -3541,7 +3551,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3541 | 3551 | ||
3542 | objupdate.RegionData.RegionHandle = presence.RegionHandle; | 3552 | objupdate.RegionData.RegionHandle = presence.RegionHandle; |
3543 | objupdate.RegionData.TimeDilation = ushort.MaxValue; | 3553 | objupdate.RegionData.TimeDilation = ushort.MaxValue; |
3544 | 3554 | ||
3545 | objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1]; | 3555 | objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1]; |
3546 | objupdate.ObjectData[0] = CreateAvatarUpdateBlock(presence); | 3556 | objupdate.ObjectData[0] = CreateAvatarUpdateBlock(presence); |
3547 | 3557 | ||
@@ -3939,7 +3949,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3939 | } | 3949 | } |
3940 | 3950 | ||
3941 | if ((categories & ThrottleOutPacketTypeFlags.Texture) != 0) | 3951 | if ((categories & ThrottleOutPacketTypeFlags.Texture) != 0) |
3942 | m_imageManager.ProcessImageQueue(m_udpServer.TextureSendLimit); | 3952 | ImageManager.ProcessImageQueue(m_udpServer.TextureSendLimit); |
3943 | } | 3953 | } |
3944 | 3954 | ||
3945 | public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID) | 3955 | public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID) |
@@ -4473,6 +4483,23 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4473 | OutPacket(packet, ThrottleOutPacketType.Task); | 4483 | OutPacket(packet, ThrottleOutPacketType.Task); |
4474 | } | 4484 | } |
4475 | 4485 | ||
4486 | public void SendTelehubInfo(UUID ObjectID, string ObjectName, Vector3 ObjectPos, Quaternion ObjectRot, List<Vector3> SpawnPoint) | ||
4487 | { | ||
4488 | TelehubInfoPacket packet = (TelehubInfoPacket)PacketPool.Instance.GetPacket(PacketType.TelehubInfo); | ||
4489 | packet.TelehubBlock.ObjectID = ObjectID; | ||
4490 | packet.TelehubBlock.ObjectName = Utils.StringToBytes(ObjectName); | ||
4491 | packet.TelehubBlock.TelehubPos = ObjectPos; | ||
4492 | packet.TelehubBlock.TelehubRot = ObjectRot; | ||
4493 | |||
4494 | packet.SpawnPointBlock = new TelehubInfoPacket.SpawnPointBlockBlock[SpawnPoint.Count]; | ||
4495 | for (int n = 0; n < SpawnPoint.Count; n++) | ||
4496 | { | ||
4497 | packet.SpawnPointBlock[n] = new TelehubInfoPacket.SpawnPointBlockBlock{SpawnPointPos = SpawnPoint[n]}; | ||
4498 | } | ||
4499 | |||
4500 | OutPacket(packet, ThrottleOutPacketType.Task); | ||
4501 | } | ||
4502 | |||
4476 | #endregion | 4503 | #endregion |
4477 | 4504 | ||
4478 | #region Land Data Sending Methods | 4505 | #region Land Data Sending Methods |
@@ -7470,7 +7497,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
7470 | if ((ImageType)block.Type == ImageType.Baked) | 7497 | if ((ImageType)block.Type == ImageType.Baked) |
7471 | args.Priority *= 2.0f; | 7498 | args.Priority *= 2.0f; |
7472 | 7499 | ||
7473 | m_imageManager.EnqueueReq(args); | 7500 | ImageManager.EnqueueReq(args); |
7474 | } | 7501 | } |
7475 | 7502 | ||
7476 | return true; | 7503 | return true; |
@@ -8911,7 +8938,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8911 | private bool HandleEstateOwnerMessage(IClientAPI sender, Packet Pack) | 8938 | private bool HandleEstateOwnerMessage(IClientAPI sender, Packet Pack) |
8912 | { | 8939 | { |
8913 | EstateOwnerMessagePacket messagePacket = (EstateOwnerMessagePacket)Pack; | 8940 | EstateOwnerMessagePacket messagePacket = (EstateOwnerMessagePacket)Pack; |
8914 | //m_log.Debug(messagePacket.ToString()); | 8941 | // m_log.InfoFormat("[LLCLIENTVIEW]: Packet: {0}", Utils.BytesToString(messagePacket.MethodData.Method)); |
8915 | GodLandStatRequest handlerLandStatRequest; | 8942 | GodLandStatRequest handlerLandStatRequest; |
8916 | 8943 | ||
8917 | #region Packet Session and User Check | 8944 | #region Packet Session and User Check |
@@ -9210,6 +9237,34 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9210 | } | 9237 | } |
9211 | return true; | 9238 | return true; |
9212 | 9239 | ||
9240 | case "telehub": | ||
9241 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
9242 | { | ||
9243 | UUID invoice = messagePacket.MethodData.Invoice; | ||
9244 | UUID SenderID = messagePacket.AgentData.AgentID; | ||
9245 | UInt32 param1 = 0u; | ||
9246 | |||
9247 | string command = (string)Utils.BytesToString(messagePacket.ParamList[0].Parameter); | ||
9248 | |||
9249 | if (command != "info ui") | ||
9250 | { | ||
9251 | try | ||
9252 | { | ||
9253 | param1 = Convert.ToUInt32(Utils.BytesToString(messagePacket.ParamList[1].Parameter)); | ||
9254 | } | ||
9255 | catch | ||
9256 | { | ||
9257 | } | ||
9258 | } | ||
9259 | |||
9260 | EstateManageTelehub handlerEstateManageTelehub = OnEstateManageTelehub; | ||
9261 | if (handlerEstateManageTelehub != null) | ||
9262 | { | ||
9263 | handlerEstateManageTelehub(this, invoice, SenderID, command, param1); | ||
9264 | } | ||
9265 | } | ||
9266 | return true; | ||
9267 | |||
9213 | default: | 9268 | default: |
9214 | m_log.Error("EstateOwnerMessage: Unknown method requested\n" + messagePacket); | 9269 | m_log.Error("EstateOwnerMessage: Unknown method requested\n" + messagePacket); |
9215 | return true; | 9270 | return true; |
@@ -9221,8 +9276,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9221 | //lsrp.RequestData.ReportType; // 1 = colliders, 0 = scripts | 9276 | //lsrp.RequestData.ReportType; // 1 = colliders, 0 = scripts |
9222 | //lsrp.RequestData.RequestFlags; | 9277 | //lsrp.RequestData.RequestFlags; |
9223 | //lsrp.RequestData.Filter; | 9278 | //lsrp.RequestData.Filter; |
9224 | |||
9225 | // return true; | ||
9226 | } | 9279 | } |
9227 | 9280 | ||
9228 | private bool HandleRequestRegionInfo(IClientAPI sender, Packet Pack) | 9281 | private bool HandleRequestRegionInfo(IClientAPI sender, Packet Pack) |