From 17b4818b8e9a141b54540b342542bcb2ad21b4db Mon Sep 17 00:00:00 2001 From: MW Date: Fri, 15 Jun 2007 16:03:02 +0000 Subject: Very Preliminary border crossing added to sugilite. (Note: Sugilite doesn't have any backend ogs communication support yet so everything is Sandbox mode only ) --- .../GridServer/GridCommsManagerBase.cs | 5 ++ .../GridServer/GridCommsManagerLocal.cs | 5 ++ .../InterSimComms/InterSimsCommsBase.cs | 2 + .../InterSimComms/InterSimsCommsLocal.cs | 5 ++ .../InterSimComms/InterSimsCommsOGS.cs | 5 ++ .../LocalBackEndServices.cs | 32 +++++++++++ Common/OpenSim.Framework/IRegionCommsHost.cs | 3 +- Common/OpenSim.Framework/Interfaces/IClientAPI.cs | 3 +- Common/OpenSim.Framework/RegionCommsHostBase.cs | 12 ++++- .../BasicPhysicsPlugin/BasicPhysicsPlugin.cs | 16 +++--- OpenSim/OpenSim.Region/Scenes/Avatar.Update.cs | 62 +++++++++++++++++++++- OpenSim/OpenSim.Region/Scenes/Avatar.cs | 39 +++++++------- OpenSim/OpenSim.Region/Scenes/Entity.cs | 35 ++++++++++++ OpenSim/OpenSim.Region/Scenes/Scene.cs | 34 ++++++++++++ OpenSim/OpenSim.RegionServer/ClientView.API.cs | 34 +++++++++++- .../ClientView.ProcessPackets.cs | 1 - OpenSim/OpenSim.RegionServer/ClientView.cs | 13 +++-- 17 files changed, 266 insertions(+), 40 deletions(-) diff --git a/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerBase.cs b/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerBase.cs index 0b29f8a..357321d 100644 --- a/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerBase.cs +++ b/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerBase.cs @@ -58,6 +58,11 @@ namespace OpenGrid.Framework.Communications.GridServer { return null; } + + public virtual RegionInfo RequestNeighbourInfo(ulong regionHandle) + { + return null; + } } } diff --git a/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerLocal.cs b/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerLocal.cs index 78ae712..3c1c29b 100644 --- a/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerLocal.cs +++ b/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerLocal.cs @@ -54,5 +54,10 @@ namespace OpenGrid.Framework.Communications.GridServer { return sandBoxManager.RequestNeighbours(regionInfo); } + + public override RegionInfo RequestNeighbourInfo(ulong regionHandle) + { + return sandBoxManager.RequestNeighbourInfo(regionHandle); + } } } diff --git a/Common/OpenGrid.Framework.Communications/InterSimComms/InterSimsCommsBase.cs b/Common/OpenGrid.Framework.Communications/InterSimComms/InterSimsCommsBase.cs index 7977c53..50335c5 100644 --- a/Common/OpenGrid.Framework.Communications/InterSimComms/InterSimsCommsBase.cs +++ b/Common/OpenGrid.Framework.Communications/InterSimComms/InterSimsCommsBase.cs @@ -42,5 +42,7 @@ namespace OpenGrid.Framework.Communications /// /// public abstract bool InformNeighbourOfChildAgent(ulong regionHandle, AgentCircuitData agentData); + public abstract bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position); + } } diff --git a/Common/OpenGrid.Framework.Communications/InterSimComms/InterSimsCommsLocal.cs b/Common/OpenGrid.Framework.Communications/InterSimComms/InterSimsCommsLocal.cs index d1a0b4f..d70376c 100644 --- a/Common/OpenGrid.Framework.Communications/InterSimComms/InterSimsCommsLocal.cs +++ b/Common/OpenGrid.Framework.Communications/InterSimComms/InterSimsCommsLocal.cs @@ -52,5 +52,10 @@ namespace OpenGrid.Framework.Communications { return sandBoxManager.InformNeighbourOfChildAgent(regionHandle, agentData); } + + public override bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position) + { + return sandBoxManager.ExpectAvatarCrossing(regionHandle, agentID, position); + } } } diff --git a/Common/OpenGrid.Framework.Communications/InterSimComms/InterSimsCommsOGS.cs b/Common/OpenGrid.Framework.Communications/InterSimComms/InterSimsCommsOGS.cs index 2cdd825..e631cf4 100644 --- a/Common/OpenGrid.Framework.Communications/InterSimComms/InterSimsCommsOGS.cs +++ b/Common/OpenGrid.Framework.Communications/InterSimComms/InterSimsCommsOGS.cs @@ -39,5 +39,10 @@ namespace OpenGrid.Framework.Communications { return false; } + + public override bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position) + { + return false; + } } } diff --git a/Common/OpenGrid.Framework.Communications/LocalBackEndServices.cs b/Common/OpenGrid.Framework.Communications/LocalBackEndServices.cs index 6b923f6..928215e 100644 --- a/Common/OpenGrid.Framework.Communications/LocalBackEndServices.cs +++ b/Common/OpenGrid.Framework.Communications/LocalBackEndServices.cs @@ -96,6 +96,20 @@ namespace OpenGrid.Framework.Communications } /// + /// + /// + /// + /// + public RegionInfo RequestNeighbourInfo(ulong regionHandle) + { + if (this.regions.ContainsKey(regionHandle)) + { + return this.regions[regionHandle]; + } + return null; + } + + /// /// /// /// @@ -113,6 +127,24 @@ namespace OpenGrid.Framework.Communications } /// + /// + /// + /// + /// + /// + /// + public bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position) + { + if (this.regionHosts.ContainsKey(regionHandle)) + { + // Console.WriteLine("CommsManager- Informing a region to expect avatar crossing"); + this.regionHosts[regionHandle].ExpectAvatarCrossing(regionHandle, agentID, position); + return true; + } + return false; + } + + /// /// Is a Sandbox mode method, used by the local Login server to inform a region of a connection user/session /// /// diff --git a/Common/OpenSim.Framework/IRegionCommsHost.cs b/Common/OpenSim.Framework/IRegionCommsHost.cs index aa434c5..658afe6 100644 --- a/Common/OpenSim.Framework/IRegionCommsHost.cs +++ b/Common/OpenSim.Framework/IRegionCommsHost.cs @@ -35,12 +35,13 @@ namespace OpenSim.Framework { public delegate void ExpectUserDelegate(ulong regionHandle, AgentCircuitData agent); public delegate void UpdateNeighbours(List neighbours); + public delegate void AgentCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position); public interface IRegionCommsHost { event ExpectUserDelegate OnExpectUser; event GenericCall2 OnExpectChildAgent; - event GenericCall2 OnAvatarCrossingIntoRegion; + event AgentCrossing OnAvatarCrossingIntoRegion; event UpdateNeighbours OnNeighboursUpdate; } } diff --git a/Common/OpenSim.Framework/Interfaces/IClientAPI.cs b/Common/OpenSim.Framework/Interfaces/IClientAPI.cs index cebfd9a..45d73ef 100644 --- a/Common/OpenSim.Framework/Interfaces/IClientAPI.cs +++ b/Common/OpenSim.Framework/Interfaces/IClientAPI.cs @@ -125,9 +125,10 @@ namespace OpenSim.Framework.Interfaces void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); void SendLayerData(float[] map); - void MoveAgentIntoRegion(RegionInfo regInfo); + void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos); void InformClientOfNeighbour(ulong neighbourHandle, System.Net.IPAddress neighbourIP, ushort neighbourPort); AgentCircuitData RequestClientInfo(); + void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, System.Net.IPAddress newRegionIP, ushort newRegionPort); void SendAvatarData(RegionInfo regionInfo, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos); void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLVector3 velocity); diff --git a/Common/OpenSim.Framework/RegionCommsHostBase.cs b/Common/OpenSim.Framework/RegionCommsHostBase.cs index 6a08eb8..88751b8 100644 --- a/Common/OpenSim.Framework/RegionCommsHostBase.cs +++ b/Common/OpenSim.Framework/RegionCommsHostBase.cs @@ -37,7 +37,7 @@ namespace OpenSim.Framework { public event ExpectUserDelegate OnExpectUser; public event GenericCall2 OnExpectChildAgent; - public event GenericCall2 OnAvatarCrossingIntoRegion; + public event AgentCrossing OnAvatarCrossingIntoRegion; public event UpdateNeighbours OnNeighboursUpdate; /// @@ -55,5 +55,15 @@ namespace OpenSim.Framework return false; } + + public virtual bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position) + { + if (OnAvatarCrossingIntoRegion != null) + { + OnAvatarCrossingIntoRegion(regionHandle, agentID, position); + return true; + } + return false; + } } } diff --git a/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs b/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs index 5636b13..341ffbb 100644 --- a/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs +++ b/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs @@ -120,22 +120,22 @@ namespace OpenSim.Physics.BasicPhysicsPlugin } else { - if (actor.Position.Y < -1) + if (actor.Position.Y < 0) { - actor.Position.Y = -1; + actor.Position.Y = 0; } - else if (actor.Position.Y > 257) + else if (actor.Position.Y > 256) { - actor.Position.Y = 257; + actor.Position.Y = 256; } - if (actor.Position.X < -1) + if (actor.Position.X < 0) { - actor.Position.X = -1; + actor.Position.X = 0; } - if (actor.Position.X > 257) + if (actor.Position.X > 256) { - actor.Position.X = 257; + actor.Position.X = 256; } } //} diff --git a/OpenSim/OpenSim.Region/Scenes/Avatar.Update.cs b/OpenSim/OpenSim.Region/Scenes/Avatar.Update.cs index 3f87e10..d46bf0f 100644 --- a/OpenSim/OpenSim.Region/Scenes/Avatar.Update.cs +++ b/OpenSim/OpenSim.Region/Scenes/Avatar.Update.cs @@ -32,6 +32,7 @@ using libsecondlife; using libsecondlife.Packets; using OpenSim.Physics.Manager; using OpenSim.Framework.Interfaces; +using OpenSim.Framework.Types; namespace OpenSim.Region.Scenes { @@ -55,7 +56,24 @@ namespace OpenSim.Region.Scenes this.SendTerseUpdateToALLClients(); _updateCount = 0; } - } + } + + LLVector3 pos2 = this.Pos; + LLVector3 vel = this.Velocity; + + float timeStep = 0.3f; + pos2.X = pos2.X + (vel.X * timeStep); + pos2.Y = pos2.Y + (vel.Y * timeStep); + pos2.Z = pos2.Z + (vel.Z * timeStep); + if ((pos2.X < 0) || (pos2.X > 256)) + { + this.CrossToNewRegion(); + } + + if ((pos2.Y < 0) || (pos2.Y > 256)) + { + this.CrossToNewRegion(); + } } /// @@ -147,5 +165,47 @@ namespace OpenSim.Region.Scenes } + private void CrossToNewRegion() + { + + // Console.WriteLine("crossing to new region from region " + this.m_regionInfo.RegionLocX + " , "+ this.m_regionInfo.RegionLocY); + LLVector3 pos = this.Pos; + LLVector3 newpos = new LLVector3(pos.X, pos.Y, pos.Z); + uint neighbourx = this.m_regionInfo.RegionLocX; + uint neighboury = this.m_regionInfo.RegionLocY; + + if (pos.X < 2) + { + neighbourx -= 1; + newpos.X = 254; + } + if (pos.X > 253) + { + neighbourx += 1; + newpos.X = 1; + } + if (pos.Y < 2) + { + neighboury -= 1; + newpos.Y = 254; + } + if (pos.Y > 253) + { + neighboury += 1; + newpos.Y = 1; + } + + LLVector3 vel = this.velocity; + // Console.WriteLine("new region should be " + neighbourx + " , " + neighboury); + ulong neighbourHandle = Helpers.UIntsToLong((uint)(neighbourx * 256), (uint)(neighboury* 256)); + RegionInfo neighbourRegion = this.m_world.RequestNeighbouringRegionInfo(neighbourHandle); + if (neighbourRegion != null) + { + // Console.WriteLine("current region port is "+ this.m_regionInfo.IPListenPort + " now crossing to new region with port " + neighbourRegion.IPListenPort); + this.m_world.InformNeighbourOfCrossing(neighbourHandle, this.ControllingClient.AgentId, newpos); + this.ControllingClient.CrossRegion(neighbourHandle, newpos, vel, System.Net.IPAddress.Parse(neighbourRegion.IPListenAddr), (ushort)neighbourRegion.IPListenPort); + } + } + } } diff --git a/OpenSim/OpenSim.Region/Scenes/Avatar.cs b/OpenSim/OpenSim.Region/Scenes/Avatar.cs index 17b2437..98d7564 100644 --- a/OpenSim/OpenSim.Region/Scenes/Avatar.cs +++ b/OpenSim/OpenSim.Region/Scenes/Avatar.cs @@ -102,10 +102,10 @@ namespace OpenSim.Region.Scenes ControllingClient.OnCompleteMovementToRegion += new GenericCall2(this.CompleteMovement); ControllingClient.OnCompleteMovementToRegion += new GenericCall2(this.SendInitialPosition); ControllingClient.OnAgentUpdate += new UpdateAgent(this.HandleAgentUpdate); - /* ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack); + // ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack); ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange); - ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement); - */ + //ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement); + } /// @@ -129,7 +129,14 @@ namespace OpenSim.Region.Scenes /// public void ChildStatusChange(bool status) { + this.childAvatar = status; + if (this.childAvatar == true) + { + this.Velocity = new LLVector3(0, 0, 0); + this.Pos = new LLVector3(128, 128, 70); + + } } /// @@ -137,22 +144,17 @@ namespace OpenSim.Region.Scenes /// public override void addForces() { + newForce = false; lock (this.forcesList) - { - newForce = false; + { if (this.forcesList.Count > 0) { for (int i = 0; i < this.forcesList.Count; i++) { NewForce force = this.forcesList[i]; - PhysicsVector phyVector = new PhysicsVector(force.X, force.Y, force.Z); - lock (m_world.SyncRoot) - { - this._physActor.Velocity = phyVector; - } + this.updateflag = true; - this.velocity = new LLVector3(force.X, force.Y, force.Z); //shouldn't really be doing this - // but as we are setting the velocity (rather than using real forces) at the moment it is okay. + this.Velocity = new LLVector3(force.X, force.Y, force.Z); //shouldn't really be doing this this.newForce = true; } for (int i = 0; i < this.forcesList.Count; i++) @@ -165,7 +167,9 @@ namespace OpenSim.Region.Scenes public void SendTerseUpdateToClient(IClientAPI RemoteClient) { - RemoteClient.SendAvatarTerseUpdate(this.m_regionHandle, 64096, this.localid, new LLVector3(this.Pos.X, this.Pos.Y, this.Pos.Z), new LLVector3(this._physActor.Velocity.X, this._physActor.Velocity.Y, this._physActor.Velocity.Z)); + LLVector3 pos = this.Pos; + LLVector3 vel = this.Velocity; + RemoteClient.SendAvatarTerseUpdate(this.m_regionHandle, 64096, this.localid, new LLVector3(pos.X, pos.Y, pos.Z), new LLVector3(vel.X, vel.Y, vel.Z)); } /// @@ -185,7 +189,7 @@ namespace OpenSim.Region.Scenes /// public void CompleteMovement() { - this.ControllingClient.MoveAgentIntoRegion(m_regionInfo); + this.ControllingClient.MoveAgentIntoRegion(m_regionInfo, Pos); } /// @@ -240,10 +244,6 @@ namespace OpenSim.Region.Scenes } else { - if (movementflag == 16) - { - movementflag = 0; - } if ((movementflag) != 0) { NewForce newVelocity = new NewForce(); @@ -252,9 +252,6 @@ namespace OpenSim.Region.Scenes newVelocity.Z = 0; this.forcesList.Add(newVelocity); movementflag = 0; - - this.movementflag = 16; - } } diff --git a/OpenSim/OpenSim.Region/Scenes/Entity.cs b/OpenSim/OpenSim.Region/Scenes/Entity.cs index d4c981a..007bdaf 100644 --- a/OpenSim/OpenSim.Region/Scenes/Entity.cs +++ b/OpenSim/OpenSim.Region/Scenes/Entity.cs @@ -93,6 +93,41 @@ namespace OpenSim.Region.Scenes } } + public virtual LLVector3 Velocity + { + get + { + if (this._physActor != null) + { + velocity.X = _physActor.Velocity.X; + velocity.Y = _physActor.Velocity.Y; + velocity.Z = _physActor.Velocity.Z; + } + + return velocity; + } + set + { + if (this._physActor != null) + { + try + { + lock (this.m_world.SyncRoot) + { + + this._physActor.Velocity = new PhysicsVector(value.X, value.Y, value.Z); + } + } + catch (Exception e) + { + Console.WriteLine(e.Message); + } + } + + velocity = value; + } + } + /// /// Creates a new Entity (should not occur on it's own) /// diff --git a/OpenSim/OpenSim.Region/Scenes/Scene.cs b/OpenSim/OpenSim.Region/Scenes/Scene.cs index 98f5027..2500ee6 100644 --- a/OpenSim/OpenSim.Region/Scenes/Scene.cs +++ b/OpenSim/OpenSim.Region/Scenes/Scene.cs @@ -580,6 +580,7 @@ namespace OpenSim.Region.Scenes agent.BaseFolder = LLUUID.Zero; agent.InventoryFolder = LLUUID.Zero; agent.startpos = new LLVector3(128, 128, 70); + agent.child = true; this.commsManager.InterSims.InformNeighbourOfChildAgent(neighbours[i].RegionHandle, agent); remoteClient.InformClientOfNeighbour(neighbours[i].RegionHandle, System.Net.IPAddress.Parse(neighbours[i].IPListenAddr), (ushort)neighbours[i].IPListenPort); } @@ -589,6 +590,27 @@ namespace OpenSim.Region.Scenes /// /// /// + /// + /// + public RegionInfo RequestNeighbouringRegionInfo(ulong regionHandle) + { + return this.commsManager.GridServer.RequestNeighbourInfo(regionHandle); + } + + /// + /// + /// + /// + /// + /// + public void InformNeighbourOfCrossing(ulong regionhandle, LLUUID agentID, LLVector3 position) + { + this.commsManager.InterSims.ExpectAvatarCrossing(regionhandle, agentID, position); + } + + /// + /// + /// /// public override void RemoveAvatar(LLUUID agentID) { @@ -678,6 +700,7 @@ namespace OpenSim.Region.Scenes if (this.regionCommsHost != null) { this.regionCommsHost.OnExpectUser += new ExpectUserDelegate(this.NewUserConnection); + this.regionCommsHost.OnAvatarCrossingIntoRegion += new AgentCrossing(this.AgentCrossing); } } @@ -696,6 +719,17 @@ namespace OpenSim.Region.Scenes } } + public void AgentCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position) + { + if (regionHandle == this.m_regInfo.RegionHandle) + { + if (this.Avatars.ContainsKey(agentID)) + { + this.Avatars[agentID].Pos = position; + } + } + } + #endregion /// diff --git a/OpenSim/OpenSim.RegionServer/ClientView.API.cs b/OpenSim/OpenSim.RegionServer/ClientView.API.cs index 33727c4..b126004 100644 --- a/OpenSim/OpenSim.RegionServer/ClientView.API.cs +++ b/OpenSim/OpenSim.RegionServer/ClientView.API.cs @@ -166,7 +166,7 @@ namespace OpenSim /// /// /// - public void MoveAgentIntoRegion(RegionInfo regInfo) + public void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos) { AgentMovementCompletePacket mov = new AgentMovementCompletePacket(); mov.AgentData.SessionID = this.SessionID; @@ -174,7 +174,14 @@ namespace OpenSim mov.Data.RegionHandle = regInfo.RegionHandle; // TODO - dynamicalise this stuff mov.Data.Timestamp = 1172750370; - mov.Data.Position = this.startpos; + if (pos != null) + { + mov.Data.Position = pos; + } + else + { + mov.Data.Position = this.startpos; + } mov.Data.LookAt = new LLVector3(0.99f, 0.042f, 0); OutPacket(mov); @@ -305,6 +312,29 @@ namespace OpenSim return agentData; } + public void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, System.Net.IPAddress newRegionIP, ushort newRegionPort) + { + CrossedRegionPacket newSimPack = new CrossedRegionPacket(); + newSimPack.AgentData = new CrossedRegionPacket.AgentDataBlock(); + newSimPack.AgentData.AgentID = this.AgentID; + newSimPack.AgentData.SessionID = this.SessionID; + newSimPack.Info = new CrossedRegionPacket.InfoBlock(); + newSimPack.Info.Position = pos; + newSimPack.Info.LookAt = lookAt; // new LLVector3(0.0f, 0.0f, 0.0f); // copied from Avatar.cs - SHOULD BE DYNAMIC!!!!!!!!!! + newSimPack.RegionData = new libsecondlife.Packets.CrossedRegionPacket.RegionDataBlock(); + newSimPack.RegionData.RegionHandle = newRegionHandle; + byte[] byteIP = newRegionIP.GetAddressBytes(); + newSimPack.RegionData.SimIP = (uint)byteIP[3] << 24; + newSimPack.RegionData.SimIP += (uint)byteIP[2] << 16; + newSimPack.RegionData.SimIP += (uint)byteIP[1] << 8; + newSimPack.RegionData.SimIP += (uint)byteIP[0]; + newSimPack.RegionData.SimPort = newRegionPort; + newSimPack.RegionData.SeedCapability = new byte[0]; + + this.OutPacket(newSimPack); + this.DowngradeClient(); + } + #region Appearance/ Wearables Methods /// diff --git a/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs b/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs index f8c7cdb..4cf6ac2 100644 --- a/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs +++ b/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs @@ -163,7 +163,6 @@ namespace OpenSim { OnCompleteMovementToRegion(); } - // this.EnableNeighbours(); break; case PacketType.AgentUpdate: if (OnAgentUpdate != null) diff --git a/OpenSim/OpenSim.RegionServer/ClientView.cs b/OpenSim/OpenSim.RegionServer/ClientView.cs index 0943c0d..29c871e 100644 --- a/OpenSim/OpenSim.RegionServer/ClientView.cs +++ b/OpenSim/OpenSim.RegionServer/ClientView.cs @@ -117,17 +117,22 @@ namespace OpenSim { OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "SimClient.cs:UpgradeClient() - upgrading child to full agent"); this.m_child = false; - this.startpos = m_authenticateSessionsHandler.GetPosition(CircuitCode); + //this.startpos = m_authenticateSessionsHandler.GetPosition(CircuitCode); m_authenticateSessionsHandler.UpdateAgentChildStatus(CircuitCode, false); - OnChildAgentStatus(this.m_child); + if (OnChildAgentStatus != null) + { + OnChildAgentStatus(this.m_child); + } } public void DowngradeClient() { OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "SimClient.cs:UpgradeClient() - changing full agent to child"); this.m_child = true; - OnChildAgentStatus(this.m_child); - + if (OnChildAgentStatus != null) + { + OnChildAgentStatus(this.m_child); + } } public void KillClient() -- cgit v1.1