diff options
Diffstat (limited to 'OpenSim/OpenSim.RegionServer/world/World.cs')
-rw-r--r-- | OpenSim/OpenSim.RegionServer/world/World.cs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/OpenSim/OpenSim.RegionServer/world/World.cs b/OpenSim/OpenSim.RegionServer/world/World.cs index 921da3c..2edb8e7 100644 --- a/OpenSim/OpenSim.RegionServer/world/World.cs +++ b/OpenSim/OpenSim.RegionServer/world/World.cs | |||
@@ -530,7 +530,7 @@ namespace OpenSim.world | |||
530 | 530 | ||
531 | #region Add/Remove Avatar Methods | 531 | #region Add/Remove Avatar Methods |
532 | 532 | ||
533 | public override void AddViewerAgent(ClientView agentClient) | 533 | public override Avatar AddViewerAgent(ClientView agentClient) |
534 | { | 534 | { |
535 | //register for events | 535 | //register for events |
536 | agentClient.OnChatFromViewer += new ChatFromViewer(this.SimChat); | 536 | agentClient.OnChatFromViewer += new ChatFromViewer(this.SimChat); |
@@ -549,22 +549,23 @@ namespace OpenSim.world | |||
549 | agentClient.OnUpdatePrimRotation += new ClientView.UpdatePrimRotation(this.UpdatePrimRotation); | 549 | agentClient.OnUpdatePrimRotation += new ClientView.UpdatePrimRotation(this.UpdatePrimRotation); |
550 | agentClient.OnUpdatePrimScale += new ClientView.UpdatePrimVector(this.UpdatePrimScale); | 550 | agentClient.OnUpdatePrimScale += new ClientView.UpdatePrimVector(this.UpdatePrimScale); |
551 | agentClient.OnDeRezObject += new ClientView.GenericCall4(this.DeRezObject); | 551 | agentClient.OnDeRezObject += new ClientView.GenericCall4(this.DeRezObject); |
552 | 552 | Avatar newAvatar = null; | |
553 | try | 553 | try |
554 | { | 554 | { |
555 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent"); | 555 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent"); |
556 | Avatar newAvatar = new Avatar(agentClient, this, m_regionName, m_clientThreads, m_regionHandle, true, 20); | 556 | newAvatar = new Avatar(agentClient, this, m_regionName, m_clientThreads, m_regionHandle, true, 20); |
557 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs:AddViewerAgent() - Adding new avatar to world"); | 557 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs:AddViewerAgent() - Adding new avatar to world"); |
558 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs:AddViewerAgent() - Starting RegionHandshake "); | 558 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs:AddViewerAgent() - Starting RegionHandshake "); |
559 | newAvatar.SendRegionHandshake(this); | 559 | newAvatar.SendRegionHandshake(this); |
560 | if (!agentClient.m_child) | 560 | //if (!agentClient.m_child) |
561 | { | 561 | //{ |
562 | |||
562 | PhysicsVector pVec = new PhysicsVector(newAvatar.Pos.X, newAvatar.Pos.Y, newAvatar.Pos.Z); | 563 | PhysicsVector pVec = new PhysicsVector(newAvatar.Pos.X, newAvatar.Pos.Y, newAvatar.Pos.Z); |
563 | lock (this.LockPhysicsEngine) | 564 | lock (this.LockPhysicsEngine) |
564 | { | 565 | { |
565 | newAvatar.PhysActor = this.phyScene.AddAvatar(pVec); | 566 | newAvatar.PhysActor = this.phyScene.AddAvatar(pVec); |
566 | } | 567 | } |
567 | } | 568 | // } |
568 | lock (Entities) | 569 | lock (Entities) |
569 | { | 570 | { |
570 | if (!Entities.ContainsKey(agentClient.AgentID)) | 571 | if (!Entities.ContainsKey(agentClient.AgentID)) |
@@ -592,6 +593,7 @@ namespace OpenSim.world | |||
592 | { | 593 | { |
593 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: AddViewerAgent() - Failed with exception " + e.ToString()); | 594 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: AddViewerAgent() - Failed with exception " + e.ToString()); |
594 | } | 595 | } |
596 | return newAvatar; | ||
595 | } | 597 | } |
596 | 598 | ||
597 | public override void RemoveViewerAgent(ClientView agentClient) | 599 | public override void RemoveViewerAgent(ClientView agentClient) |
@@ -608,7 +610,7 @@ namespace OpenSim.world | |||
608 | } | 610 | } |
609 | if (agentClient.ClientAvatar.PhysActor != null) | 611 | if (agentClient.ClientAvatar.PhysActor != null) |
610 | { | 612 | { |
611 | //this.phyScene.RemoveAvatar(agentClient.ClientAvatar.PhysActor); | 613 | this.phyScene.RemoveAvatar(agentClient.ClientAvatar.PhysActor); |
612 | } | 614 | } |
613 | } | 615 | } |
614 | catch (Exception e) | 616 | catch (Exception e) |