aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.RegionServer/world/Avatar.cs
diff options
context:
space:
mode:
authorMW2007-04-25 18:12:06 +0000
committerMW2007-04-25 18:12:06 +0000
commit9ed0a8dbad121b64ca8baca78f28ca58602c47ca (patch)
tree5c0008e0be59cb7ccaaf8ff1b0ea2f272a0548e6 /OpenSim.RegionServer/world/Avatar.cs
parentCan now use the xml config file for setting up things like sandbox mode, logi... (diff)
downloadopensim-SC_OLD-9ed0a8dbad121b64ca8baca78f28ca58602c47ca.zip
opensim-SC_OLD-9ed0a8dbad121b64ca8baca78f28ca58602c47ca.tar.gz
opensim-SC_OLD-9ed0a8dbad121b64ca8baca78f28ca58602c47ca.tar.bz2
opensim-SC_OLD-9ed0a8dbad121b64ca8baca78f28ca58602c47ca.tar.xz
updated to use lastest version of libsl but is currently broke when using SL viewer 1.15.02, due to big changes in the message templates.
Diffstat (limited to 'OpenSim.RegionServer/world/Avatar.cs')
-rw-r--r--OpenSim.RegionServer/world/Avatar.cs27
1 files changed, 18 insertions, 9 deletions
diff --git a/OpenSim.RegionServer/world/Avatar.cs b/OpenSim.RegionServer/world/Avatar.cs
index 54043fc..df7d5ba 100644
--- a/OpenSim.RegionServer/world/Avatar.cs
+++ b/OpenSim.RegionServer/world/Avatar.cs
@@ -32,14 +32,18 @@ namespace OpenSim.world
32 private ulong m_regionHandle; 32 private ulong m_regionHandle;
33 private Dictionary<uint, SimClient> m_clientThreads; 33 private Dictionary<uint, SimClient> m_clientThreads;
34 private string m_regionName; 34 private string m_regionName;
35 private ushort m_regionWaterHeight;
36 private bool m_regionTerraform;
35 //private bool childShadowAvatar = false; 37 //private bool childShadowAvatar = false;
36 38
37 public Avatar(SimClient TheClient, World world, string regionName, Dictionary<uint, SimClient> clientThreads, ulong regionHandle) 39 public Avatar(SimClient TheClient, World world, string regionName, Dictionary<uint, SimClient> clientThreads, ulong regionHandle, bool regionTerraform, ushort regionWater)
38 { 40 {
39 m_world = world; 41 m_world = world;
40 m_clientThreads = clientThreads; 42 m_clientThreads = clientThreads;
41 m_regionName = regionName; 43 m_regionName = regionName;
42 m_regionHandle = regionHandle; 44 m_regionHandle = regionHandle;
45 m_regionTerraform = regionTerraform;
46 m_regionWaterHeight = regionWater;
43 47
44 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Avatar.cs - Loading details from grid (DUMMY)"); 48 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Avatar.cs - Loading details from grid (DUMMY)");
45 ControllingClient = TheClient; 49 ControllingClient = TheClient;
@@ -139,7 +143,7 @@ namespace OpenSim.world
139 143
140 public void HandleUpdate(AgentUpdatePacket pack) 144 public void HandleUpdate(AgentUpdatePacket pack)
141 { 145 {
142 if (((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.AgentUpdateFlags.AGENT_CONTROL_FLY) != 0) 146 if (((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY) != 0)
143 { 147 {
144 if (this._physActor.Flying == false) 148 if (this._physActor.Flying == false)
145 { 149 {
@@ -160,7 +164,7 @@ namespace OpenSim.world
160 } 164 }
161 this._physActor.Flying = false; 165 this._physActor.Flying = false;
162 } 166 }
163 if (((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.AgentUpdateFlags.AGENT_CONTROL_AT_POS) != 0) 167 if (((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_AT_POS) != 0)
164 { 168 {
165 Axiom.MathLib.Quaternion q = new Axiom.MathLib.Quaternion(pack.AgentData.BodyRotation.W, pack.AgentData.BodyRotation.X, pack.AgentData.BodyRotation.Y, pack.AgentData.BodyRotation.Z); 169 Axiom.MathLib.Quaternion q = new Axiom.MathLib.Quaternion(pack.AgentData.BodyRotation.W, pack.AgentData.BodyRotation.X, pack.AgentData.BodyRotation.Y, pack.AgentData.BodyRotation.Z);
166 if (((movementflag & 1) == 0) || (q != this.bodyRot)) 170 if (((movementflag & 1) == 0) || (q != this.bodyRot))
@@ -194,7 +198,7 @@ namespace OpenSim.world
194 this.bodyRot = q; 198 this.bodyRot = q;
195 } 199 }
196 } 200 }
197 else if ((((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.AgentUpdateFlags.AGENT_CONTROL_UP_POS) != 0) && (PhysicsEngineFlying)) 201 else if ((((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS) != 0) && (PhysicsEngineFlying))
198 { 202 {
199 if (((movementflag & 2) == 0) && this._physActor.Flying) 203 if (((movementflag & 2) == 0) && this._physActor.Flying)
200 { 204 {
@@ -214,7 +218,7 @@ namespace OpenSim.world
214 movementflag = 2; 218 movementflag = 2;
215 } 219 }
216 } 220 }
217 else if ((((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.AgentUpdateFlags.AGENT_CONTROL_UP_NEG) != 0) && (PhysicsEngineFlying)) 221 else if ((((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) && (PhysicsEngineFlying))
218 { 222 {
219 if (((movementflag & 4) == 0) && this._physActor.Flying) 223 if (((movementflag & 4) == 0) && this._physActor.Flying)
220 { 224 {
@@ -235,7 +239,7 @@ namespace OpenSim.world
235 movementflag = 4; 239 movementflag = 4;
236 } 240 }
237 } 241 }
238 else if (((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.AgentUpdateFlags.AGENT_CONTROL_AT_NEG) != 0) 242 else if (((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_AT_NEG) != 0)
239 { 243 {
240 Axiom.MathLib.Quaternion q = new Axiom.MathLib.Quaternion(pack.AgentData.BodyRotation.W, pack.AgentData.BodyRotation.X, pack.AgentData.BodyRotation.Y, pack.AgentData.BodyRotation.Z); 244 Axiom.MathLib.Quaternion q = new Axiom.MathLib.Quaternion(pack.AgentData.BodyRotation.W, pack.AgentData.BodyRotation.X, pack.AgentData.BodyRotation.Y, pack.AgentData.BodyRotation.Z);
241 if (((movementflag & 8) == 0) || (q != this.bodyRot)) 245 if (((movementflag & 8) == 0) || (q != this.bodyRot))
@@ -287,7 +291,7 @@ namespace OpenSim.world
287 } 291 }
288 } 292 }
289 293
290 //really really should be moved somewhere else 294 //really really should be moved somewhere else (RegionInfo.cs ?)
291 public void SendRegionHandshake(World RegionInfo) 295 public void SendRegionHandshake(World RegionInfo)
292 { 296 {
293 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Avatar.cs:SendRegionHandshake() - Creating empty RegionHandshake packet"); 297 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Avatar.cs:SendRegionHandshake() - Creating empty RegionHandshake packet");
@@ -306,8 +310,13 @@ namespace OpenSim.world
306 handshake.RegionInfo.TerrainStartHeight10 = 10; 310 handshake.RegionInfo.TerrainStartHeight10 = 10;
307 handshake.RegionInfo.TerrainStartHeight11 = 10; 311 handshake.RegionInfo.TerrainStartHeight11 = 10;
308 handshake.RegionInfo.SimAccess = 13; 312 handshake.RegionInfo.SimAccess = 13;
309 handshake.RegionInfo.WaterHeight = 20; 313 handshake.RegionInfo.WaterHeight = m_regionWaterHeight;
310 handshake.RegionInfo.RegionFlags = 72458694 - 32; 314 uint regionFlags = 72458694;
315 if (this.m_regionTerraform)
316 {
317 regionFlags -= 64;
318 }
319 handshake.RegionInfo.RegionFlags = regionFlags;
311 handshake.RegionInfo.SimName = _enc.GetBytes(m_regionName + "\0"); 320 handshake.RegionInfo.SimName = _enc.GetBytes(m_regionName + "\0");
312 handshake.RegionInfo.SimOwner = new LLUUID("00000000-0000-0000-0000-000000000000"); 321 handshake.RegionInfo.SimOwner = new LLUUID("00000000-0000-0000-0000-000000000000");
313 handshake.RegionInfo.TerrainBase0 = new LLUUID("b8d3965a-ad78-bf43-699b-bff8eca6c975"); 322 handshake.RegionInfo.TerrainBase0 = new LLUUID("b8d3965a-ad78-bf43-699b-bff8eca6c975");