From 64741b55a6d68eb2853ca2f33047e6a2f459b513 Mon Sep 17 00:00:00 2001 From: MW Date: Fri, 25 May 2007 19:09:19 +0000 Subject: First part of border crossing fix. --- OpenSim/OpenSim.RegionServer/world/Avatar.cs | 32 +++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'OpenSim/OpenSim.RegionServer/world/Avatar.cs') diff --git a/OpenSim/OpenSim.RegionServer/world/Avatar.cs b/OpenSim/OpenSim.RegionServer/world/Avatar.cs index 680d059..2c1ccdf 100644 --- a/OpenSim/OpenSim.RegionServer/world/Avatar.cs +++ b/OpenSim/OpenSim.RegionServer/world/Avatar.cs @@ -35,7 +35,7 @@ namespace OpenSim.world private string m_regionName; private ushort m_regionWaterHeight; private bool m_regionTerraform; - //private bool childShadowAvatar = false; + private bool childAvatar = false; public Avatar(ClientView TheClient, World world, string regionName, Dictionary clientThreads, ulong regionHandle, bool regionTerraform, ushort regionWater) { @@ -72,6 +72,7 @@ namespace OpenSim.world ControllingClient.OnCompleteMovementToRegion += new ClientView.GenericCall2(this.SendInitialPosition); ControllingClient.OnAgentUpdate += new ClientView.GenericCall3(this.HandleAgentUpdate); ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack); + ControllingClient.OnChildAgentStatus += new ClientView.StatusChange(this.ChildStatusChange); } @@ -87,6 +88,35 @@ namespace OpenSim.world } } + public void ChildStatusChange(bool status) + { + this.childAvatar = status; + + if (this.childAvatar == true) + { + this._physActor.Velocity = new PhysicsVector(0, 0, 0); + ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock(); + ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); + terse.RegionData.RegionHandle = m_regionHandle; // FIXME + terse.RegionData.TimeDilation = 64096; + terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; + terse.ObjectData[0] = terseBlock; + List avList = this.m_world.RequestAvatarList(); + foreach (Avatar client in avList) + { + client.SendPacketToViewer(terse); + } + } + else + { + LLVector3 startp = ControllingClient.StartPos; + lock (m_world.LockPhysicsEngine) + { + this._physActor.Position = new PhysicsVector(startp.X, startp.Y, startp.Z); + } + } + } + public override void addForces() { lock (this.forcesList) -- cgit v1.1