aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes
diff options
context:
space:
mode:
authorlbsa712007-07-01 13:17:27 +0000
committerlbsa712007-07-01 13:17:27 +0000
commit5e805656db1215518a344d6d5364629a4997fd47 (patch)
tree2d8b50bac8e77f983e3016e969df3535c52fb0d3 /OpenSim/Region/Environment/Scenes
parent* Project files fixed for OGS. (diff)
downloadopensim-SC_OLD-5e805656db1215518a344d6d5364629a4997fd47.zip
opensim-SC_OLD-5e805656db1215518a344d6d5364629a4997fd47.tar.gz
opensim-SC_OLD-5e805656db1215518a344d6d5364629a4997fd47.tar.bz2
opensim-SC_OLD-5e805656db1215518a344d6d5364629a4997fd47.tar.xz
Fixed SimpleApp - aka thankgoditssundaycommit
* Updated SimpleApp with various introduced dependencies * Extracted ScenePrescence creation in Scene * removed try-catchall from UserManagerBase (that actually hid a bug) * Refactored RegionInfo * handle is calculated * it will explode upon accessing x,y,ip,port,externalip if not explicitly initialized * Removed superfluous 'ref' keywords * Removed a shitload of 'catch Exception e' that causes build warnings * Lots of small refactorings, renames et c * Ignored some bins
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs61
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneBase.cs2
2 files changed, 29 insertions, 34 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
diff --git a/OpenSim/Region/Environment/Scenes/SceneBase.cs b/OpenSim/Region/Environment/Scenes/SceneBase.cs
index 50d3b82..e06acbd 100644
--- a/OpenSim/Region/Environment/Scenes/SceneBase.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneBase.cs
@@ -148,7 +148,7 @@ namespace OpenSim.Region.Environment.Scenes
148 /// <param name="remoteClient"></param> 148 /// <param name="remoteClient"></param>
149 /// <param name="agentID"></param> 149 /// <param name="agentID"></param>
150 /// <param name="child"></param> 150 /// <param name="child"></param>
151 public abstract void AddNewClient(IClientAPI remoteClient, LLUUID agentID, bool child); 151 public abstract void AddNewClient(IClientAPI client, bool child);
152 152
153 /// <summary> 153 /// <summary>
154 /// 154 ///