diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/OpenSim.World/World.cs (renamed from OpenSim/OpenSim.RegionServer/world/World.cs) | 83 |
1 files changed, 2 insertions, 81 deletions
diff --git a/OpenSim/OpenSim.RegionServer/world/World.cs b/OpenSim/OpenSim.World/World.cs index ec9bbc9..d840d10 100644 --- a/OpenSim/OpenSim.RegionServer/world/World.cs +++ b/OpenSim/OpenSim.World/World.cs | |||
@@ -57,7 +57,7 @@ namespace OpenSim.world | |||
57 | /// <param name="clientThreads">Dictionary to contain client threads</param> | 57 | /// <param name="clientThreads">Dictionary to contain client threads</param> |
58 | /// <param name="regionHandle">Region Handle for this region</param> | 58 | /// <param name="regionHandle">Region Handle for this region</param> |
59 | /// <param name="regionName">Region Name for this region</param> | 59 | /// <param name="regionName">Region Name for this region</param> |
60 | public World(Dictionary<uint, ClientView> clientThreads, RegionInfo regInfo, ulong regionHandle, string regionName) | 60 | public World(Dictionary<uint, IClientAPI> clientThreads, RegionInfo regInfo, ulong regionHandle, string regionName) |
61 | { | 61 | { |
62 | try | 62 | try |
63 | { | 63 | { |
@@ -531,92 +531,13 @@ namespace OpenSim.world | |||
531 | 531 | ||
532 | public override Avatar AddViewerAgent(ClientView agentClient) | 532 | public override Avatar AddViewerAgent(ClientView agentClient) |
533 | { | 533 | { |
534 | //register for events | ||
535 | agentClient.OnChatFromViewer += new ChatFromViewer(this.SimChat); | ||
536 | agentClient.OnRezObject += new RezObject(this.RezObject); | ||
537 | agentClient.OnModifyTerrain += new ModifyTerrain(this.ModifyTerrain); | ||
538 | agentClient.OnRegionHandShakeReply += new ClientView.GenericCall(this.SendLayerData); | ||
539 | agentClient.OnRequestWearables += new ClientView.GenericCall(this.GetInitialPrims); | ||
540 | agentClient.OnRequestAvatarsData += new ClientView.GenericCall(this.SendAvatarsToClient); | ||
541 | agentClient.OnLinkObjects += new LinkObjects(this.LinkObjects); | ||
542 | agentClient.OnAddPrim += new ClientView.GenericCall4(this.AddNewPrim); | ||
543 | agentClient.OnUpdatePrimShape += new ClientView.UpdateShape(this.UpdatePrimShape); | ||
544 | agentClient.OnObjectSelect += new ClientView.ObjectSelect(this.SelectPrim); | ||
545 | agentClient.OnUpdatePrimFlags += new ClientView.UpdatePrimFlags(this.UpdatePrimFlags); | ||
546 | agentClient.OnUpdatePrimTexture += new ClientView.UpdatePrimTexture(this.UpdatePrimTexture); | ||
547 | agentClient.OnUpdatePrimPosition += new ClientView.UpdatePrimVector(this.UpdatePrimPosition); | ||
548 | agentClient.OnUpdatePrimRotation += new ClientView.UpdatePrimRotation(this.UpdatePrimRotation); | ||
549 | agentClient.OnUpdatePrimScale += new ClientView.UpdatePrimVector(this.UpdatePrimScale); | ||
550 | agentClient.OnDeRezObject += new ClientView.GenericCall4(this.DeRezObject); | ||
551 | |||
552 | Avatar newAvatar = null; | 534 | Avatar newAvatar = null; |
553 | try | ||
554 | { | ||
555 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent"); | ||
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"); | ||
558 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs:AddViewerAgent() - Starting RegionHandshake "); | ||
559 | newAvatar.SendRegionHandshake(this); | ||
560 | //if (!agentClient.m_child) | ||
561 | //{ | ||
562 | |||
563 | PhysicsVector pVec = new PhysicsVector(newAvatar.Pos.X, newAvatar.Pos.Y, newAvatar.Pos.Z); | ||
564 | lock (this.LockPhysicsEngine) | ||
565 | { | ||
566 | newAvatar.PhysActor = this.phyScene.AddAvatar(pVec); | ||
567 | } | ||
568 | // } | ||
569 | lock (Entities) | ||
570 | { | ||
571 | if (!Entities.ContainsKey(agentClient.AgentID)) | ||
572 | { | ||
573 | this.Entities.Add(agentClient.AgentID, newAvatar); | ||
574 | } | ||
575 | else | ||
576 | { | ||
577 | Entities[agentClient.AgentID] = newAvatar; | ||
578 | } | ||
579 | } | ||
580 | lock (Avatars) | ||
581 | { | ||
582 | if (Avatars.ContainsKey(agentClient.AgentID)) | ||
583 | { | ||
584 | Avatars[agentClient.AgentID] = newAvatar; | ||
585 | } | ||
586 | else | ||
587 | { | ||
588 | this.Avatars.Add(agentClient.AgentID, newAvatar); | ||
589 | } | ||
590 | } | ||
591 | } | ||
592 | catch (Exception e) | ||
593 | { | ||
594 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: AddViewerAgent() - Failed with exception " + e.ToString()); | ||
595 | } | ||
596 | return newAvatar; | 535 | return newAvatar; |
597 | } | 536 | } |
598 | 537 | ||
599 | public override void RemoveViewerAgent(ClientView agentClient) | 538 | public override void RemoveViewerAgent(ClientView agentClient) |
600 | { | 539 | { |
601 | try | 540 | |
602 | { | ||
603 | lock (Entities) | ||
604 | { | ||
605 | Entities.Remove(agentClient.AgentID); | ||
606 | } | ||
607 | lock (Avatars) | ||
608 | { | ||
609 | Avatars.Remove(agentClient.AgentID); | ||
610 | } | ||
611 | if (agentClient.ClientAvatar.PhysActor != null) | ||
612 | { | ||
613 | this.phyScene.RemoveAvatar(agentClient.ClientAvatar.PhysActor); | ||
614 | } | ||
615 | } | ||
616 | catch (Exception e) | ||
617 | { | ||
618 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: RemoveViewerAgent() - Failed with exception " + e.ToString()); | ||
619 | } | ||
620 | } | 541 | } |
621 | #endregion | 542 | #endregion |
622 | 543 | ||