aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/OpenSim.RegionServer/Simulator
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/OpenSim.RegionServer/Simulator')
-rw-r--r--OpenSim/OpenSim.RegionServer/Simulator/Avatar.Update.cs8
-rw-r--r--OpenSim/OpenSim.RegionServer/Simulator/Avatar.cs61
-rw-r--r--OpenSim/OpenSim.RegionServer/Simulator/ParcelManager.cs10
-rw-r--r--OpenSim/OpenSim.RegionServer/Simulator/World.cs19
4 files changed, 28 insertions, 70 deletions
diff --git a/OpenSim/OpenSim.RegionServer/Simulator/Avatar.Update.cs b/OpenSim/OpenSim.RegionServer/Simulator/Avatar.Update.cs
index 6f32c85..03da861 100644
--- a/OpenSim/OpenSim.RegionServer/Simulator/Avatar.Update.cs
+++ b/OpenSim/OpenSim.RegionServer/Simulator/Avatar.Update.cs
@@ -54,7 +54,7 @@ namespace OpenSim.RegionServer.Simulator
54 //use CreateTerseBlock() 54 //use CreateTerseBlock()
55 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock(); 55 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock();
56 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); 56 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
57 terse.RegionData.RegionHandle = m_regionHandle; // FIXME 57 terse.RegionData.RegionHandle = m_world.m_regInfo.RegionHandle;
58 terse.RegionData.TimeDilation = 64096; 58 terse.RegionData.TimeDilation = 64096;
59 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; 59 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
60 terse.ObjectData[0] = terseBlock; 60 terse.ObjectData[0] = terseBlock;
@@ -78,7 +78,7 @@ namespace OpenSim.RegionServer.Simulator
78 //It has been a while since last update was sent so lets send one. 78 //It has been a while since last update was sent so lets send one.
79 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock(); 79 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock();
80 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); 80 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
81 terse.RegionData.RegionHandle = m_regionHandle; // FIXME 81 terse.RegionData.RegionHandle = m_world.m_regInfo.RegionHandle;
82 terse.RegionData.TimeDilation = 64096; 82 terse.RegionData.TimeDilation = 64096;
83 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; 83 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
84 terse.ObjectData[0] = terseBlock; 84 terse.ObjectData[0] = terseBlock;
@@ -158,7 +158,7 @@ namespace OpenSim.RegionServer.Simulator
158 System.Text.Encoding _enc = System.Text.Encoding.ASCII; 158 System.Text.Encoding _enc = System.Text.Encoding.ASCII;
159 //send a objectupdate packet with information about the clients avatar 159 //send a objectupdate packet with information about the clients avatar
160 ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); 160 ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
161 objupdate.RegionData.RegionHandle = m_regionHandle; 161 objupdate.RegionData.RegionHandle = m_world.m_regInfo.RegionHandle;
162 objupdate.RegionData.TimeDilation = 64096; 162 objupdate.RegionData.TimeDilation = 64096;
163 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; 163 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1];
164 164
@@ -182,7 +182,7 @@ namespace OpenSim.RegionServer.Simulator
182 //send a objectupdate packet with information about the clients avatar 182 //send a objectupdate packet with information about the clients avatar
183 183
184 ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); 184 ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
185 objupdate.RegionData.RegionHandle = m_regionHandle; 185 objupdate.RegionData.RegionHandle = m_world.m_regInfo.RegionHandle;
186 objupdate.RegionData.TimeDilation = 64096; 186 objupdate.RegionData.TimeDilation = 64096;
187 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; 187 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1];
188 objupdate.ObjectData[0] = AvatarTemplate; 188 objupdate.ObjectData[0] = AvatarTemplate;
diff --git a/OpenSim/OpenSim.RegionServer/Simulator/Avatar.cs b/OpenSim/OpenSim.RegionServer/Simulator/Avatar.cs
index 65a9a63..a64ee9e 100644
--- a/OpenSim/OpenSim.RegionServer/Simulator/Avatar.cs
+++ b/OpenSim/OpenSim.RegionServer/Simulator/Avatar.cs
@@ -66,24 +66,15 @@ namespace OpenSim.RegionServer.Simulator
66 66
67 private int positionParcelHoverLocalID = -1; //Local ID of the last parcel they were over 67 private int positionParcelHoverLocalID = -1; //Local ID of the last parcel they were over
68 private int parcelUpdateSequenceIncrement = 1; 68 private int parcelUpdateSequenceIncrement = 1;
69 private ulong m_regionHandle; 69
70 //private Dictionary<uint, ClientView> m_clientThreads;
71 private string m_regionName;
72 private ushort m_regionWaterHeight;
73 private bool m_regionTerraform;
74 private bool childAvatar = false; 70 private bool childAvatar = false;
75 71
76 public Avatar(ClientView TheClient, World world, string regionName, Dictionary<uint, ClientView> clientThreads, ulong regionHandle, bool regionTerraform, ushort regionWater) 72 public Avatar(ClientView TheClient, World world)
77 { 73 {
78 m_world = world; 74 m_world = world;
79 // m_clientThreads = clientThreads; 75 ControllingClient = TheClient;
80 m_regionName = regionName;
81 m_regionHandle = regionHandle;
82 m_regionTerraform = regionTerraform;
83 m_regionWaterHeight = regionWater;
84 76
85 OpenSim.Framework.Console.MainConsole.Instance.Verbose("Avatar.cs - Loading details from grid (DUMMY)"); 77 OpenSim.Framework.Console.MainConsole.Instance.Verbose("Avatar.cs - Loading details from grid (DUMMY)");
86 ControllingClient = TheClient;
87 localid = 8880000 + (this.m_world._localNumber++); 78 localid = 8880000 + (this.m_world._localNumber++);
88 Pos = ControllingClient.startpos; 79 Pos = ControllingClient.startpos;
89 visualParams = new byte[218]; 80 visualParams = new byte[218];
@@ -133,7 +124,7 @@ namespace OpenSim.RegionServer.Simulator
133 this._physActor.Velocity = new PhysicsVector(0, 0, 0); 124 this._physActor.Velocity = new PhysicsVector(0, 0, 0);
134 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock(); 125 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock();
135 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); 126 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
136 terse.RegionData.RegionHandle = m_regionHandle; // FIXME 127 terse.RegionData.RegionHandle = m_world.m_regInfo.RegionHandle;
137 terse.RegionData.TimeDilation = 64096; 128 terse.RegionData.TimeDilation = 64096;
138 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; 129 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
139 terse.ObjectData[0] = terseBlock; 130 terse.ObjectData[0] = terseBlock;
@@ -251,7 +242,7 @@ namespace OpenSim.RegionServer.Simulator
251 AgentMovementCompletePacket mov = new AgentMovementCompletePacket(); 242 AgentMovementCompletePacket mov = new AgentMovementCompletePacket();
252 mov.AgentData.SessionID = this.ControllingClient.SessionID; 243 mov.AgentData.SessionID = this.ControllingClient.SessionID;
253 mov.AgentData.AgentID = this.ControllingClient.AgentID; 244 mov.AgentData.AgentID = this.ControllingClient.AgentID;
254 mov.Data.RegionHandle = this.m_regionHandle; 245 mov.Data.RegionHandle = this.m_world.m_regInfo.RegionHandle;
255 // TODO - dynamicalise this stuff 246 // TODO - dynamicalise this stuff
256 mov.Data.Timestamp = 1172750370; 247 mov.Data.Timestamp = 1172750370;
257 mov.Data.Position = this.ControllingClient.startpos; 248 mov.Data.Position = this.ControllingClient.startpos;
@@ -415,47 +406,7 @@ namespace OpenSim.RegionServer.Simulator
415 } 406 }
416 } 407 }
417 408
418 //really really should be moved somewhere else (RegionInfo.cs ?) 409
419 public void SendRegionHandshake(World regionInfo)
420 {
421 OpenSim.Framework.Console.MainConsole.Instance.Verbose("Avatar.cs:SendRegionHandshake() - Creating empty RegionHandshake packet");
422 System.Text.Encoding _enc = System.Text.Encoding.ASCII;
423 RegionHandshakePacket handshake = new RegionHandshakePacket();
424
425 OpenSim.Framework.Console.MainConsole.Instance.Verbose("Avatar.cs:SendRegionhandshake() - Filling in RegionHandshake details");
426 handshake.RegionInfo.BillableFactor = 0;
427 handshake.RegionInfo.IsEstateManager = false;
428 handshake.RegionInfo.TerrainHeightRange00 = regionInfo.m_regInfo.estateSettings.terrainHeightRangeNW;
429 handshake.RegionInfo.TerrainHeightRange01 = regionInfo.m_regInfo.estateSettings.terrainHeightRangeNE;
430 handshake.RegionInfo.TerrainHeightRange10 = regionInfo.m_regInfo.estateSettings.terrainHeightRangeSW;
431 handshake.RegionInfo.TerrainHeightRange11 = regionInfo.m_regInfo.estateSettings.terrainHeightRangeSE;
432 handshake.RegionInfo.TerrainStartHeight00 = regionInfo.m_regInfo.estateSettings.terrainStartHeightNW;
433 handshake.RegionInfo.TerrainStartHeight01 = regionInfo.m_regInfo.estateSettings.terrainStartHeightNE;
434 handshake.RegionInfo.TerrainStartHeight10 = regionInfo.m_regInfo.estateSettings.terrainStartHeightSW;
435 handshake.RegionInfo.TerrainStartHeight11 = regionInfo.m_regInfo.estateSettings.terrainStartHeightSE;
436 handshake.RegionInfo.SimAccess = 13;
437 handshake.RegionInfo.WaterHeight = m_regionWaterHeight;
438 uint regionFlags = 72458694;
439 if (this.m_regionTerraform)
440 {
441 regionFlags -= 64;
442 }
443 handshake.RegionInfo.RegionFlags = regionFlags;
444 handshake.RegionInfo.SimName = _enc.GetBytes(m_regionName + "\0");
445 handshake.RegionInfo.SimOwner = regionInfo.m_regInfo.MasterAvatarAssignedUUID;
446 handshake.RegionInfo.TerrainBase0 = regionInfo.m_regInfo.estateSettings.terrainBase0;
447 handshake.RegionInfo.TerrainBase1 = regionInfo.m_regInfo.estateSettings.terrainBase1;
448 handshake.RegionInfo.TerrainBase2 = regionInfo.m_regInfo.estateSettings.terrainBase2;
449 handshake.RegionInfo.TerrainBase3 = regionInfo.m_regInfo.estateSettings.terrainBase3;
450 handshake.RegionInfo.TerrainDetail0 = regionInfo.m_regInfo.estateSettings.terrainDetail0;
451 handshake.RegionInfo.TerrainDetail1 = regionInfo.m_regInfo.estateSettings.terrainDetail1;
452 handshake.RegionInfo.TerrainDetail2 = regionInfo.m_regInfo.estateSettings.terrainDetail2;
453 handshake.RegionInfo.TerrainDetail3 = regionInfo.m_regInfo.estateSettings.terrainDetail3;
454 handshake.RegionInfo.CacheID = new LLUUID("545ec0a5-5751-1026-8a0b-216e38a7ab37");
455
456 OpenSim.Framework.Console.MainConsole.Instance.Verbose("Avatar.cs:SendRegionHandshake() - Sending RegionHandshake packet");
457 this.ControllingClient.OutPacket(handshake);
458 }
459 410
460 public static void LoadAnims() 411 public static void LoadAnims()
461 { 412 {
diff --git a/OpenSim/OpenSim.RegionServer/Simulator/ParcelManager.cs b/OpenSim/OpenSim.RegionServer/Simulator/ParcelManager.cs
index 6d432f1..8620e8c 100644
--- a/OpenSim/OpenSim.RegionServer/Simulator/ParcelManager.cs
+++ b/OpenSim/OpenSim.RegionServer/Simulator/ParcelManager.cs
@@ -562,7 +562,6 @@ namespace OpenSim.RegionServer.Simulator
562 updatePacket.ParcelData.TotalPrims = 0; //unemplemented 562 updatePacket.ParcelData.TotalPrims = 0; //unemplemented
563 updatePacket.ParcelData.UserLocation = parcelData.userLocation; 563 updatePacket.ParcelData.UserLocation = parcelData.userLocation;
564 updatePacket.ParcelData.UserLookAt = parcelData.userLookAt; 564 updatePacket.ParcelData.UserLookAt = parcelData.userLookAt;
565
566 remote_client.OutPacket((Packet)updatePacket); 565 remote_client.OutPacket((Packet)updatePacket);
567 } 566 }
568 567
@@ -588,6 +587,15 @@ namespace OpenSim.RegionServer.Simulator
588 parcelData.snapshotID = packet.ParcelData.SnapshotID; 587 parcelData.snapshotID = packet.ParcelData.SnapshotID;
589 parcelData.userLocation = packet.ParcelData.UserLocation; 588 parcelData.userLocation = packet.ParcelData.UserLocation;
590 parcelData.userLookAt = packet.ParcelData.UserLookAt; 589 parcelData.userLookAt = packet.ParcelData.UserLookAt;
590
591 foreach (Avatar av in m_world.Avatars.Values)
592 {
593 Parcel over = m_world.parcelManager.getParcel((int)Math.Round(av.Pos.X), (int)Math.Round(av.Pos.Y));
594 if (over == this)
595 {
596 sendParcelProperties(0, false, 0, av.ControllingClient);
597 }
598 }
591 } 599 }
592 } 600 }
593 #endregion 601 #endregion
diff --git a/OpenSim/OpenSim.RegionServer/Simulator/World.cs b/OpenSim/OpenSim.RegionServer/Simulator/World.cs
index dda8ac4..765c74e 100644
--- a/OpenSim/OpenSim.RegionServer/Simulator/World.cs
+++ b/OpenSim/OpenSim.RegionServer/Simulator/World.cs
@@ -627,19 +627,18 @@ namespace OpenSim.RegionServer.Simulator
627 try 627 try
628 { 628 {
629 MainConsole.Instance.Notice("World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent"); 629 MainConsole.Instance.Notice("World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent");
630 newAvatar = new Avatar(agentClient, this, m_regionName, m_clientThreads, m_regionHandle, true, 20); 630 newAvatar = new Avatar(agentClient, this);
631 MainConsole.Instance.Notice("World.cs:AddViewerAgent() - Adding new avatar to world"); 631 MainConsole.Instance.Notice("World.cs:AddViewerAgent() - Adding new avatar to world");
632 MainConsole.Instance.Notice("World.cs:AddViewerAgent() - Starting RegionHandshake "); 632 MainConsole.Instance.Notice("World.cs:AddViewerAgent() - Starting RegionHandshake ");
633 newAvatar.SendRegionHandshake(this); 633 estateManager.sendRegionHandshake(newAvatar.ControllingClient);
634 //if (!agentClient.m_child)
635 //{
636 634
637 PhysicsVector pVec = new PhysicsVector(newAvatar.Pos.X, newAvatar.Pos.Y, newAvatar.Pos.Z); 635 PhysicsVector pVec = new PhysicsVector(newAvatar.Pos.X, newAvatar.Pos.Y, newAvatar.Pos.Z);
638 lock (this.LockPhysicsEngine) 636 lock (this.LockPhysicsEngine)
639 { 637 {
640 newAvatar.PhysActor = this.phyScene.AddAvatar(pVec); 638 newAvatar.PhysActor = this.phyScene.AddAvatar(pVec);
641 } 639 }
642 // } 640
641
643 lock (Entities) 642 lock (Entities)
644 { 643 {
645 if (!Entities.ContainsKey(agentClient.AgentID)) 644 if (!Entities.ContainsKey(agentClient.AgentID))