aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.RegionServer/SimClient.cs
diff options
context:
space:
mode:
authormorphw2007-05-15 14:00:59 +0000
committermorphw2007-05-15 14:00:59 +0000
commitb5011e24ee243b30f0b649c217333669a70537d6 (patch)
tree1e76d85b2b0e56d2321be99ff43381fd83f21972 /OpenSim.RegionServer/SimClient.cs
parentAttempting to add region name to console. (diff)
downloadopensim-SC_OLD-b5011e24ee243b30f0b649c217333669a70537d6.zip
opensim-SC_OLD-b5011e24ee243b30f0b649c217333669a70537d6.tar.gz
opensim-SC_OLD-b5011e24ee243b30f0b649c217333669a70537d6.tar.bz2
opensim-SC_OLD-b5011e24ee243b30f0b649c217333669a70537d6.tar.xz
added processing for TeleportLocationRequest and TeleportLandmarkRequest. Local teleports implemented, inter-region teleports left to do.
Diffstat (limited to '')
-rw-r--r--OpenSim.RegionServer/SimClient.cs81
1 files changed, 80 insertions, 1 deletions
diff --git a/OpenSim.RegionServer/SimClient.cs b/OpenSim.RegionServer/SimClient.cs
index cb9e757..1f92a93 100644
--- a/OpenSim.RegionServer/SimClient.cs
+++ b/OpenSim.RegionServer/SimClient.cs
@@ -651,6 +651,86 @@ namespace OpenSim
651 this.RequestMapBlock( MapRequest.PositionData.MinX, MapRequest.PositionData.MinY, MapRequest.PositionData.MaxX, MapRequest.PositionData.MaxY); 651 this.RequestMapBlock( MapRequest.PositionData.MinX, MapRequest.PositionData.MinY, MapRequest.PositionData.MaxX, MapRequest.PositionData.MaxY);
652 break; 652 break;
653 653
654 case PacketType.TeleportLandmarkRequest:
655 TeleportLandmarkRequestPacket tpReq = (TeleportLandmarkRequestPacket)Pack;
656
657 TeleportStartPacket tpStart = new TeleportStartPacket();
658 tpStart.Info.TeleportFlags = 8; // tp via lm
659 this.OutPacket(tpStart);
660
661 TeleportProgressPacket tpProgress = new TeleportProgressPacket();
662 tpProgress.Info.Message = (new System.Text.ASCIIEncoding()).GetBytes("sending_landmark");
663 tpProgress.Info.TeleportFlags = 8;
664 tpProgress.AgentData.AgentID = tpReq.Info.AgentID;
665 this.OutPacket(tpProgress);
666
667 // Fetch landmark
668 LLUUID lmid = tpReq.Info.LandmarkID;
669 AssetBase lma = this.m_assetCache.GetAsset(lmid);
670 if (lma != null)
671 {
672 AssetLandmark lm = new AssetLandmark(lma);
673
674 if (lm.RegionID == m_regionData.SimUUID)
675 {
676 TeleportLocalPacket tpLocal = new TeleportLocalPacket();
677
678 tpLocal.Info.AgentID = tpReq.Info.AgentID;
679 tpLocal.Info.TeleportFlags = 8; // Teleport via landmark
680 tpLocal.Info.LocationID = 2;
681 tpLocal.Info.Position = lm.Position;
682 OutPacket(tpLocal);
683 }
684 else
685 {
686 TeleportCancelPacket tpCancel = new TeleportCancelPacket();
687 tpCancel.Info.AgentID = tpReq.Info.AgentID;
688 tpCancel.Info.SessionID = tpReq.Info.SessionID;
689 OutPacket(tpCancel);
690 }
691 }
692 else
693 {
694 Console.WriteLine("Cancelling Teleport - fetch asset not yet implemented");
695
696 TeleportCancelPacket tpCancel = new TeleportCancelPacket();
697 tpCancel.Info.AgentID = tpReq.Info.AgentID;
698 tpCancel.Info.SessionID = tpReq.Info.SessionID;
699 OutPacket(tpCancel);
700 }
701 break;
702
703 case PacketType.TeleportLocationRequest:
704 TeleportLocationRequestPacket tpLocReq = (TeleportLocationRequestPacket)Pack;
705 Console.WriteLine(tpLocReq.ToString());
706
707 tpStart = new TeleportStartPacket();
708 tpStart.Info.TeleportFlags = 16; // Teleport via location
709 Console.WriteLine(tpStart.ToString());
710 OutPacket(tpStart);
711
712 if (m_regionData.RegionHandle != tpLocReq.Info.RegionHandle)
713 {
714 /* m_gridServer.getRegion(tpLocReq.Info.RegionHandle); */
715 Console.WriteLine("Inter-sim teleport not yet implemented");
716 TeleportCancelPacket tpCancel = new TeleportCancelPacket();
717 tpCancel.Info.SessionID = tpLocReq.AgentData.SessionID;
718 tpCancel.Info.AgentID = tpLocReq.AgentData.AgentID;
719
720 OutPacket(tpCancel);
721 }
722 else {
723 Console.WriteLine("Local teleport");
724 TeleportLocalPacket tpLocal = new TeleportLocalPacket();
725 tpLocal.Info.AgentID = tpLocReq.AgentData.AgentID;
726 tpLocal.Info.TeleportFlags = tpStart.Info.TeleportFlags;
727 tpLocal.Info.LocationID = 2;
728 tpLocal.Info.LookAt = tpLocReq.Info.LookAt;
729 tpLocal.Info.Position = tpLocReq.Info.Position;
730 OutPacket(tpLocal);
731 }
732
733 break;
654 } 734 }
655 } 735 }
656 } 736 }
@@ -718,7 +798,6 @@ namespace OpenSim
718 798
719 protected virtual void ProcessOutPacket(Packet Pack) 799 protected virtual void ProcessOutPacket(Packet Pack)
720 { 800 {
721
722 // Keep track of when this packet was sent out 801 // Keep track of when this packet was sent out
723 Pack.TickCount = Environment.TickCount; 802 Pack.TickCount = Environment.TickCount;
724 803