From 4d0261ed2225dff3f107ec52484770a6f7435790 Mon Sep 17 00:00:00 2001
From: MW
Date: Tue, 29 May 2007 17:57:03 +0000
Subject: 

---
 Common/OpenSim.Framework/Interfaces/IClientAPI.cs |  2 ++
 OpenSim/OpenSim.RegionServer/ClientView.API.cs    | 14 ++++++++++++++
 OpenSim/OpenSim.World/Avatar.cs                   | 10 +++++-----
 OpenSim/OpenSim.World/World.cs                    |  2 +-
 4 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/Common/OpenSim.Framework/Interfaces/IClientAPI.cs b/Common/OpenSim.Framework/Interfaces/IClientAPI.cs
index e557b6e..06b3075 100644
--- a/Common/OpenSim.Framework/Interfaces/IClientAPI.cs
+++ b/Common/OpenSim.Framework/Interfaces/IClientAPI.cs
@@ -72,5 +72,7 @@ namespace OpenSim.Framework.Interfaces
         void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID);
         void SendLayerData(float[] map);
         void SendRegionHandshake(RegionInfo regionInfo);
+        void MoveAgentIntoRegion(RegionInfo regInfo);
+        void SendAvatarData(RegionInfo regionInfo, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos);
     }
 }
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.API.cs b/OpenSim/OpenSim.RegionServer/ClientView.API.cs
index 7b1e537..4177dff 100644
--- a/OpenSim/OpenSim.RegionServer/ClientView.API.cs
+++ b/OpenSim/OpenSim.RegionServer/ClientView.API.cs
@@ -57,6 +57,20 @@ namespace OpenSim
         }
 
         #region World/Avatar to Client
+
+        public void MoveAgentIntoRegion(RegionInfo regInfo)
+        {
+            AgentMovementCompletePacket mov = new AgentMovementCompletePacket();
+            mov.AgentData.SessionID = this.SessionID;
+            mov.AgentData.AgentID = this.AgentID;
+            mov.Data.RegionHandle = regInfo.RegionHandle;
+            // TODO - dynamicalise this stuff
+            mov.Data.Timestamp = 1172750370;
+            mov.Data.Position = this.startpos;
+            mov.Data.LookAt = new LLVector3(0.99f, 0.042f, 0);
+
+            OutPacket(mov);
+        }
         public void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID)
         {
             System.Text.Encoding enc = System.Text.Encoding.ASCII;
diff --git a/OpenSim/OpenSim.World/Avatar.cs b/OpenSim/OpenSim.World/Avatar.cs
index 3c22db2..ee5aa44 100644
--- a/OpenSim/OpenSim.World/Avatar.cs
+++ b/OpenSim/OpenSim.World/Avatar.cs
@@ -70,10 +70,10 @@ namespace OpenSim.world
             /*
             //register for events
             ControllingClient.OnRequestWearables += new GenericCall(this.SendOurAppearance);
-            ControllingClient.OnSetAppearance += new SetAppearance(this.SetAppearance);
+            ControllingClient.OnSetAppearance += new SetAppearance(this.SetAppearance);*/
             ControllingClient.OnCompleteMovementToRegion += new GenericCall2(this.CompleteMovement);
             ControllingClient.OnCompleteMovementToRegion += new GenericCall2(this.SendInitialPosition);
-            ControllingClient.OnAgentUpdate += new GenericCall3(this.HandleAgentUpdate);
+           /* ControllingClient.OnAgentUpdate += new GenericCall3(this.HandleAgentUpdate);
             ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack);
             ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange);
             ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement);
@@ -116,7 +116,7 @@ namespace OpenSim.world
 
         public void CompleteMovement()
         {
-
+            this.ControllingClient.MoveAgentIntoRegion(this.regionData);
         }
 
         public void HandleAgentUpdate(Packet pack)
@@ -130,9 +130,9 @@ namespace OpenSim.world
         }
 
         //really really should be moved somewhere else (RegionInfo.cs ?)
-        public void SendRegionHandshake(RegionInfo regionInfo)
+        public void SendRegionHandshake()
         {
-            this.ControllingClient.SendRegionHandshake(regionInfo);
+            this.ControllingClient.SendRegionHandshake(this.regionData);
         }
 
         public static void LoadAnims()
diff --git a/OpenSim/OpenSim.World/World.cs b/OpenSim/OpenSim.World/World.cs
index 8e8ab3e..6a50aaa 100644
--- a/OpenSim/OpenSim.World/World.cs
+++ b/OpenSim/OpenSim.World/World.cs
@@ -513,7 +513,7 @@ namespace OpenSim.world
                 newAvatar = new Avatar(remoteClient, this, m_clientThreads, this.m_regInfo);
                 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs:AddViewerAgent() - Adding new avatar to world");
                 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs:AddViewerAgent() - Starting RegionHandshake ");
-                newAvatar.SendRegionHandshake(this.m_regInfo);
+                newAvatar.SendRegionHandshake();
                
                 PhysicsVector pVec = new PhysicsVector(newAvatar.Pos.X, newAvatar.Pos.Y, newAvatar.Pos.Z);
                 lock (this.LockPhysicsEngine)
-- 
cgit v1.1