From 3a91085ac2364c80b53275886c8130a4b1f0e62f Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 10 Dec 2011 15:17:34 +0000 Subject: [PATCH] Implement handler for TeleportCancel inbound packet --- OpenSim/Framework/IClientAPI.cs | 3 +++ .../Region/ClientStack/Linden/UDP/LLClientView.cs | 12 ++++++++++++ .../InternetRelayClientView/Server/IRCClientView.cs | 1 + .../Region/OptionalModules/World/NPC/NPCAvatar.cs | 1 + OpenSim/Tests/Common/Mock/TestClient.cs | 1 + 5 files changed, 18 insertions(+) diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index a070aa676b..258b3ebb59 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -84,6 +84,8 @@ namespace OpenSim.Framework public delegate void TeleportLandmarkRequest( IClientAPI remoteClient, AssetLandmark lm); + public delegate void TeleportCancel(IClientAPI remoteClient); + public delegate void DisconnectUser(); public delegate void RequestAvatarProperties(IClientAPI remoteClient, UUID avatarID); @@ -788,6 +790,7 @@ namespace OpenSim.Framework event RequestAvatarProperties OnRequestAvatarProperties; event SetAlwaysRun OnSetAlwaysRun; event TeleportLandmarkRequest OnTeleportLandmarkRequest; + event TeleportCancel OnTeleportCancel; event DeRezObject OnDeRezObject; event Action OnRegionHandShakeReply; event GenericCall1 OnRequestWearables; diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 1d4be8a444..72234384bb 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -140,6 +140,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public event RequestMapName OnMapNameRequest; public event TeleportLocationRequest OnTeleportLocationRequest; public event TeleportLandmarkRequest OnTeleportLandmarkRequest; + public event TeleportCancel OnTeleportCancel; public event DisconnectUser OnDisconnectUser; public event RequestAvatarProperties OnRequestAvatarProperties; public event SetAlwaysRun OnSetAlwaysRun; @@ -5173,6 +5174,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP AddLocalPacketHandler(PacketType.MapBlockRequest, HandleMapBlockRequest, false); AddLocalPacketHandler(PacketType.MapNameRequest, HandleMapNameRequest, false); AddLocalPacketHandler(PacketType.TeleportLandmarkRequest, HandleTeleportLandmarkRequest); + AddLocalPacketHandler(PacketType.TeleportCancel, HandleTeleportCancel); AddLocalPacketHandler(PacketType.TeleportLocationRequest, HandleTeleportLocationRequest); AddLocalPacketHandler(PacketType.UUIDNameRequest, HandleUUIDNameRequest, false); AddLocalPacketHandler(PacketType.RegionHandleRequest, HandleRegionHandleRequest); @@ -8409,6 +8411,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP return true; } + private bool HandleTeleportCancel(IClientAPI sender, Packet Pack) + { + TeleportCancel handlerTeleportCancel = OnTeleportCancel; + if (handlerTeleportCancel != null) + { + handlerTeleportCancel(this); + } + return true; + } + private AssetBase FindAssetInUserAssetServer(string id) { AgentCircuitData aCircuit = ((Scene)Scene).AuthenticateHandler.GetAgentCircuitData(CircuitCode); diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 70326b787b..32de85f6ab 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs @@ -677,6 +677,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server public event RequestAvatarProperties OnRequestAvatarProperties; public event SetAlwaysRun OnSetAlwaysRun; public event TeleportLandmarkRequest OnTeleportLandmarkRequest; + public event TeleportCancel OnTeleportCancel; public event DeRezObject OnDeRezObject; public event Action OnRegionHandShakeReply; public event GenericCall1 OnRequestWearables; diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index ed60976f85..84055cceba 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs @@ -184,6 +184,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC public event RequestMapName OnMapNameRequest; public event TeleportLocationRequest OnTeleportLocationRequest; public event TeleportLandmarkRequest OnTeleportLandmarkRequest; + public event TeleportCancel OnTeleportCancel; public event DisconnectUser OnDisconnectUser; public event RequestAvatarProperties OnRequestAvatarProperties; public event SetAlwaysRun OnSetAlwaysRun; diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 4e17b044d6..37b90e17b3 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -93,6 +93,7 @@ namespace OpenSim.Tests.Common.Mock public event RequestMapName OnMapNameRequest; public event TeleportLocationRequest OnTeleportLocationRequest; public event TeleportLandmarkRequest OnTeleportLandmarkRequest; + public event TeleportCancel OnTeleportCancel; public event DisconnectUser OnDisconnectUser; public event RequestAvatarProperties OnRequestAvatarProperties; public event SetAlwaysRun OnSetAlwaysRun;