aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs61
1 files changed, 28 insertions, 33 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 8c912d0..d5406b6 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -493,19 +493,19 @@ namespace OpenSim.Region.Environment.Scenes
493 /// <param name="remoteClient"></param 493 /// <param name="remoteClient"></param
494 /// <param name="agentID"></param> 494 /// <param name="agentID"></param>
495 /// <param name="child"></param> 495 /// <param name="child"></param>
496 public override void AddNewClient(IClientAPI remoteClient, LLUUID agentID, bool child) 496 public override void AddNewClient(IClientAPI client, bool child)
497 { 497 {
498 remoteClient.OnRegionHandShakeReply += this.SendLayerData; 498 client.OnRegionHandShakeReply += this.SendLayerData;
499 //remoteClient.OnRequestWearables += new GenericCall(this.GetInitialPrims); 499 //remoteClient.OnRequestWearables += new GenericCall(this.GetInitialPrims);
500 remoteClient.OnChatFromViewer += this.SimChat; 500 client.OnChatFromViewer += this.SimChat;
501 remoteClient.OnRequestWearables += this.InformClientOfNeighbours; 501 client.OnRequestWearables += this.InformClientOfNeighbours;
502 remoteClient.OnAddPrim += this.AddNewPrim; 502 client.OnAddPrim += this.AddNewPrim;
503 remoteClient.OnUpdatePrimPosition += this.UpdatePrimPosition; 503 client.OnUpdatePrimPosition += this.UpdatePrimPosition;
504 remoteClient.OnRequestMapBlocks += this.RequestMapBlocks; 504 client.OnRequestMapBlocks += this.RequestMapBlocks;
505 remoteClient.OnTeleportLocationRequest += this.RequestTeleportLocation; 505 client.OnTeleportLocationRequest += this.RequestTeleportLocation;
506 //remoteClient.OnObjectSelect += this.SelectPrim; 506 //remoteClient.OnObjectSelect += this.SelectPrim;
507 remoteClient.OnGrapUpdate += this.MoveObject; 507 client.OnGrapUpdate += this.MoveObject;
508 remoteClient.OnNameFromUUIDRequest += this.commsManager.HandleUUIDNameRequest; 508 client.OnNameFromUUIDRequest += this.commsManager.HandleUUIDNameRequest;
509 509
510 /* remoteClient.OnParcelPropertiesRequest += new ParcelPropertiesRequest(parcelManager.handleParcelPropertiesRequest); 510 /* remoteClient.OnParcelPropertiesRequest += new ParcelPropertiesRequest(parcelManager.handleParcelPropertiesRequest);
511 remoteClient.OnParcelDivideRequest += new ParcelDivideRequest(parcelManager.handleParcelDivideRequest); 511 remoteClient.OnParcelDivideRequest += new ParcelDivideRequest(parcelManager.handleParcelDivideRequest);
@@ -513,19 +513,21 @@ namespace OpenSim.Region.Environment.Scenes
513 remoteClient.OnParcelPropertiesUpdateRequest += new ParcelPropertiesUpdateRequest(parcelManager.handleParcelPropertiesUpdateRequest); 513 remoteClient.OnParcelPropertiesUpdateRequest += new ParcelPropertiesUpdateRequest(parcelManager.handleParcelPropertiesUpdateRequest);
514 remoteClient.OnEstateOwnerMessage += new EstateOwnerMessageRequest(estateManager.handleEstateOwnerMessage); 514 remoteClient.OnEstateOwnerMessage += new EstateOwnerMessageRequest(estateManager.handleEstateOwnerMessage);
515 */ 515 */
516 516 this.estateManager.sendRegionHandshake(client);
517
518 CreateAndAddScenePresence(client);
519 return;
520 }
521
522 protected void CreateAndAddScenePresence(IClientAPI client)
523 {
517 ScenePresence newAvatar = null; 524 ScenePresence newAvatar = null;
518 try
519 {
520 525
521 OpenSim.Framework.Console.MainLog.Instance.Verbose( "World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent"); 526 OpenSim.Framework.Console.MainLog.Instance.Verbose( "World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent");
522 newAvatar = new ScenePresence(remoteClient, this, this.m_regInfo); 527 newAvatar = new ScenePresence(client, this, this.m_regInfo);
523 OpenSim.Framework.Console.MainLog.Instance.Verbose( "World.cs:AddViewerAgent() - Adding new avatar to world"); 528 OpenSim.Framework.Console.MainLog.Instance.Verbose( "World.cs:AddViewerAgent() - Adding new avatar to world");
524 OpenSim.Framework.Console.MainLog.Instance.Verbose( "World.cs:AddViewerAgent() - Starting RegionHandshake "); 529 OpenSim.Framework.Console.MainLog.Instance.Verbose( "World.cs:AddViewerAgent() - Starting RegionHandshake ");
525 530
526 //newAvatar.SendRegionHandshake();
527 this.estateManager.sendRegionHandshake(remoteClient);
528
529 PhysicsVector pVec = new PhysicsVector(newAvatar.Pos.X, newAvatar.Pos.Y, newAvatar.Pos.Z); 531 PhysicsVector pVec = new PhysicsVector(newAvatar.Pos.X, newAvatar.Pos.Y, newAvatar.Pos.Z);
530 lock (this.m_syncRoot) 532 lock (this.m_syncRoot)
531 { 533 {
@@ -534,36 +536,29 @@ namespace OpenSim.Region.Environment.Scenes
534 536
535 lock (Entities) 537 lock (Entities)
536 { 538 {
537 if (!Entities.ContainsKey(agentID)) 539 if (!Entities.ContainsKey(client.AgentId))
538 { 540 {
539 this.Entities.Add(agentID, newAvatar); 541 this.Entities.Add(client.AgentId, newAvatar);
540 } 542 }
541 else 543 else
542 { 544 {
543 Entities[agentID] = newAvatar; 545 Entities[client.AgentId] = newAvatar;
544 } 546 }
545 } 547 }
546 lock (Avatars) 548 lock (Avatars)
547 { 549 {
548 if (Avatars.ContainsKey(agentID)) 550 if (Avatars.ContainsKey(client.AgentId))
549 { 551 {
550 Avatars[agentID] = newAvatar; 552 Avatars[client.AgentId] = newAvatar;
551 } 553 }
552 else 554 else
553 { 555 {
554 this.Avatars.Add(agentID, newAvatar); 556 this.Avatars.Add(client.AgentId, newAvatar);
555 } 557 }
556 } 558 }
557 }
558 catch (Exception e)
559 {
560 OpenSim.Framework.Console.MainLog.Instance.Warn("World.cs: AddViewerAgent() - Failed with exception " + e.ToString());
561 }
562 return;
563 } 559 }
564 560
565 561
566
567 /// <summary> 562 /// <summary>
568 /// 563 ///
569 /// </summary> 564 /// </summary>
@@ -642,8 +637,8 @@ namespace OpenSim.Region.Environment.Scenes
642 this.regionCommsHost = this.commsManager.GridServer.RegisterRegion(this.m_regInfo,gridSettings); 637 this.regionCommsHost = this.commsManager.GridServer.RegisterRegion(this.m_regInfo,gridSettings);
643 if (this.regionCommsHost != null) 638 if (this.regionCommsHost != null)
644 { 639 {
645 this.regionCommsHost.OnExpectUser += new ExpectUserDelegate(this.NewUserConnection); 640 this.regionCommsHost.OnExpectUser += this.NewUserConnection;
646 this.regionCommsHost.OnAvatarCrossingIntoRegion += new AgentCrossing(this.AgentCrossing); 641 this.regionCommsHost.OnAvatarCrossingIntoRegion += this.AgentCrossing;
647 } 642 }
648 } 643 }
649 644