From d5406fe77309770234524f6afa38ae1502f01eab Mon Sep 17 00:00:00 2001 From: MW Date: Tue, 17 Apr 2007 12:03:52 +0000 Subject: A few fixes and stopped sim crossing being attempted in sandbox mode --- OpenSim.RegionServer/world/Avatar.cs | 6 ++-- OpenSim.RegionServer/world/AvatarUpdate.cs | 47 +++++++++++++++++------------- OpenSim.RegionServer/world/World.cs | 6 ++-- 3 files changed, 33 insertions(+), 26 deletions(-) (limited to 'OpenSim.RegionServer/world') diff --git a/OpenSim.RegionServer/world/Avatar.cs b/OpenSim.RegionServer/world/Avatar.cs index b6b8282..54043fc 100644 --- a/OpenSim.RegionServer/world/Avatar.cs +++ b/OpenSim.RegionServer/world/Avatar.cs @@ -44,7 +44,7 @@ namespace OpenSim.world OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Avatar.cs - Loading details from grid (DUMMY)"); ControllingClient = TheClient; localid = 8880000 + (this.m_world._localNumber++); - Pos = ControllingClient.startpos; + Pos = ControllingClient.startpos; visualParams = new byte[218]; for (int i = 0; i < 218; i++) { @@ -59,7 +59,7 @@ namespace OpenSim.world this.Wearables[0].ItemID = LLUUID.Random(); this.avatarAppearanceTexture = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005")); - + } public PhysicsActor PhysActor @@ -307,7 +307,7 @@ namespace OpenSim.world handshake.RegionInfo.TerrainStartHeight11 = 10; handshake.RegionInfo.SimAccess = 13; handshake.RegionInfo.WaterHeight = 20; - handshake.RegionInfo.RegionFlags = 72458694 -32; + handshake.RegionInfo.RegionFlags = 72458694 - 32; handshake.RegionInfo.SimName = _enc.GetBytes(m_regionName + "\0"); handshake.RegionInfo.SimOwner = new LLUUID("00000000-0000-0000-0000-000000000000"); handshake.RegionInfo.TerrainBase0 = new LLUUID("b8d3965a-ad78-bf43-699b-bff8eca6c975"); diff --git a/OpenSim.RegionServer/world/AvatarUpdate.cs b/OpenSim.RegionServer/world/AvatarUpdate.cs index c2f2456..6c0ace7 100644 --- a/OpenSim.RegionServer/world/AvatarUpdate.cs +++ b/OpenSim.RegionServer/world/AvatarUpdate.cs @@ -59,24 +59,31 @@ namespace OpenSim.world } } - this.positionLastFrame = pos2; - - if(this._physActor.Position.X < 0) { - ControllingClient.CrossSimBorder(new LLVector3(this._physActor.Position.X,this._physActor.Position.Y,this._physActor.Position.Z)); - } - - if(this._physActor.Position.Y < 0) { - ControllingClient.CrossSimBorder(new LLVector3(this._physActor.Position.X,this._physActor.Position.Y,this._physActor.Position.Z)); - } - - if(this._physActor.Position.X > 255) { - ControllingClient.CrossSimBorder(new LLVector3(this._physActor.Position.X,this._physActor.Position.Y,this._physActor.Position.Z)); - } - - if(this._physActor.Position.Y > 255) { - ControllingClient.CrossSimBorder(new LLVector3(this._physActor.Position.X,this._physActor.Position.Y,this._physActor.Position.Z)); - } - + this.positionLastFrame = pos2; + + if (!this.ControllingClient.m_sandboxMode) + { + if (pos2.X < 0) + { + ControllingClient.CrossSimBorder(new LLVector3(this._physActor.Position.X, this._physActor.Position.Y, this._physActor.Position.Z)); + } + + if (pos2.Y < 0) + { + ControllingClient.CrossSimBorder(new LLVector3(this._physActor.Position.X, this._physActor.Position.Y, this._physActor.Position.Z)); + } + + if (pos2.X > 255) + { + ControllingClient.CrossSimBorder(new LLVector3(this._physActor.Position.X, this._physActor.Position.Y, this._physActor.Position.Z)); + } + + if (pos2.Y > 255) + { + ControllingClient.CrossSimBorder(new LLVector3(this._physActor.Position.X, this._physActor.Position.Y, this._physActor.Position.Z)); + } + } + } public ObjectUpdatePacket CreateUpdatePacket() @@ -106,8 +113,8 @@ namespace OpenSim.world { System.Text.Encoding _enc = System.Text.Encoding.ASCII; //send a objectupdate packet with information about the clients avatar - - ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); + + ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); objupdate.RegionData.RegionHandle = m_regionHandle; objupdate.RegionData.TimeDilation = 64096; objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; diff --git a/OpenSim.RegionServer/world/World.cs b/OpenSim.RegionServer/world/World.cs index 425a135..749305f 100644 --- a/OpenSim.RegionServer/world/World.cs +++ b/OpenSim.RegionServer/world/World.cs @@ -371,13 +371,13 @@ namespace OpenSim.world OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Adding new avatar to world"); OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Starting RegionHandshake "); newAvatar.SendRegionHandshake(this); - if(!agentClient.m_child) { + if(!agentClient.m_child) { PhysicsVector pVec = new PhysicsVector(newAvatar.Pos.X, newAvatar.Pos.Y, newAvatar.Pos.Z); lock (this.LockPhysicsEngine) { newAvatar.PhysActor = this.phyScene.AddAvatar(pVec); } - } + } lock (Entities) { this.Entities.Add(agentClient.AgentID, newAvatar); @@ -385,7 +385,7 @@ namespace OpenSim.world lock (Avatars) { this.Avatars.Add(agentClient.AgentID, newAvatar); - } + } } -- cgit v1.1