aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.RegionServer/world/Avatar.cs
diff options
context:
space:
mode:
authorlbsa712007-04-03 19:12:07 +0000
committerlbsa712007-04-03 19:12:07 +0000
commit7169acc47e8bb56581bd28c3bd921ca9236ba3c3 (patch)
tree4565785736fb759f0c665aac28cd88937042bdd3 /OpenSim.RegionServer/world/Avatar.cs
parentAnother temporary bug fix attempt, this time for the packet overflow problem,... (diff)
downloadopensim-SC_OLD-7169acc47e8bb56581bd28c3bd921ca9236ba3c3.zip
opensim-SC_OLD-7169acc47e8bb56581bd28c3bd921ca9236ba3c3.tar.gz
opensim-SC_OLD-7169acc47e8bb56581bd28c3bd921ca9236ba3c3.tar.bz2
opensim-SC_OLD-7169acc47e8bb56581bd28c3bd921ca9236ba3c3.tar.xz
* Extended Script API with GetRandomAvatar
* The script will now get a IScriptEntity to it's host object with get/sets * The script gets a IScriptReadnlyEntity interface to entities other than the host object. * the test script now follows a random avatar.
Diffstat (limited to '')
-rw-r--r--OpenSim.RegionServer/world/Avatar.cs25
1 files changed, 3 insertions, 22 deletions
diff --git a/OpenSim.RegionServer/world/Avatar.cs b/OpenSim.RegionServer/world/Avatar.cs
index e1e314a..be47eda 100644
--- a/OpenSim.RegionServer/world/Avatar.cs
+++ b/OpenSim.RegionServer/world/Avatar.cs
@@ -19,7 +19,6 @@ namespace OpenSim.world
19 public SimClient ControllingClient; 19 public SimClient ControllingClient;
20 public LLUUID current_anim; 20 public LLUUID current_anim;
21 public int anim_seq; 21 public int anim_seq;
22 private PhysicsActor _physActor;
23 private static libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock AvatarTemplate; 22 private static libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock AvatarTemplate;
24 private bool updateflag = false; 23 private bool updateflag = false;
25 private byte movementflag = 0; 24 private byte movementflag = 0;
@@ -30,7 +29,6 @@ namespace OpenSim.world
30 private byte[] visualParams; 29 private byte[] visualParams;
31 private AvatarWearable[] Wearables; 30 private AvatarWearable[] Wearables;
32 private LLVector3 positionLastFrame = new LLVector3(0, 0, 0); 31 private LLVector3 positionLastFrame = new LLVector3(0, 0, 0);
33 private World m_world;
34 private ulong m_regionHandle; 32 private ulong m_regionHandle;
35 private Dictionary<uint, SimClient> m_clientThreads; 33 private Dictionary<uint, SimClient> m_clientThreads;
36 private string m_regionName; 34 private string m_regionName;
@@ -45,8 +43,7 @@ namespace OpenSim.world
45 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Avatar.cs - Loading details from grid (DUMMY)"); 43 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Avatar.cs - Loading details from grid (DUMMY)");
46 ControllingClient = TheClient; 44 ControllingClient = TheClient;
47 localid = 8880000 + (this.m_world._localNumber++); 45 localid = 8880000 + (this.m_world._localNumber++);
48 position = new LLVector3(100.0f, 100.0f, 30.0f); 46 Pos = new LLVector3(100.0f, 100.0f, m_world.LandMap[(int)Pos.Y * 256 + (int)Pos.X] + 1);
49 position.Z = m_world.LandMap[(int)position.Y * 256 + (int)position.X] + 1;
50 visualParams = new byte[218]; 47 visualParams = new byte[218];
51 for (int i = 0; i < 218; i++) 48 for (int i = 0; i < 218; i++)
52 { 49 {
@@ -209,7 +206,7 @@ namespace OpenSim.world
209 this.uuid = objupdate.ObjectData[0].FullID = ControllingClient.AgentID; 206 this.uuid = objupdate.ObjectData[0].FullID = ControllingClient.AgentID;
210 objupdate.ObjectData[0].NameValue = _enc.GetBytes("FirstName STRING RW SV " + firstname + "\nLastName STRING RW SV " + lastname + " \0"); 207 objupdate.ObjectData[0].NameValue = _enc.GetBytes("FirstName STRING RW SV " + firstname + "\nLastName STRING RW SV " + lastname + " \0");
211 208
212 libsecondlife.LLVector3 pos2 = new LLVector3((float)this.position.X, (float)this.position.Y, (float)this.position.Z); 209 libsecondlife.LLVector3 pos2 = new LLVector3((float)this.Pos.X, (float)this.Pos.Y, (float)this.Pos.Z);
213 210
214 byte[] pb = pos2.GetBytes(); 211 byte[] pb = pos2.GetBytes();
215 212
@@ -614,23 +611,7 @@ namespace OpenSim.world
614 611
615 public override void LandRenegerated() 612 public override void LandRenegerated()
616 { 613 {
617 position = new LLVector3(100.0f, 100.0f, 30.0f); 614 Pos = new LLVector3(100.0f, 100.0f, this.m_world.LandMap[(int)Pos.Y * 256 + (int)Pos.X] + 50);
618 position.Z = this.m_world.LandMap[(int)position.Y * 256 + (int)position.X] + 50;
619 if (this._physActor != null)
620 {
621 try
622 {
623 lock (this.m_world.LockPhysicsEngine)
624 {
625
626 this._physActor.Position = new PhysicsVector(position.X, position.Y, position.Z);
627 }
628 }
629 catch (Exception e)
630 {
631 Console.WriteLine(e.Message);
632 }
633 }
634 } 615 }
635 } 616 }
636 617