aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMW2007-11-28 12:36:09 +0000
committerMW2007-11-28 12:36:09 +0000
commitac77c50ba9efb7755bd36e832a9a93fb25946a5f (patch)
treea44c901ebd0bb80ca04beccac537d05ffb42f4b4
parent* Disambiguation in the 'sim is restarting message' that tells you 'which' si... (diff)
downloadopensim-SC-ac77c50ba9efb7755bd36e832a9a93fb25946a5f.zip
opensim-SC-ac77c50ba9efb7755bd36e832a9a93fb25946a5f.tar.gz
opensim-SC-ac77c50ba9efb7755bd36e832a9a93fb25946a5f.tar.bz2
opensim-SC-ac77c50ba9efb7755bd36e832a9a93fb25946a5f.tar.xz
Moved the m_sceneGridService.RegisterRegion(RegionInfo); call out of LoadWorldMap and into its own public method (which is called during region creation). We shouldn't have things like that in methods like LoadWorldMap as some regions might not being having a worldmap loaded via the LoadWorldMap method (like in custom applications).
Deleted the CreateTerrainTextureInitial Method which was a 99% duplicate of CreateTerrainTexture, with just a bool field setting difference. That bool is now passed to CreateTerrainTexture as a param.
-rw-r--r--OpenSim/Framework/IClientAPI.cs2
-rw-r--r--OpenSim/Region/ClientStack/ClientView.API.cs10
-rw-r--r--OpenSim/Region/ClientStack/RegionApplicationBase.cs1
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs51
-rw-r--r--OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs2
-rw-r--r--OpenSim/Region/Examples/SimpleApp/MyWorld.cs2
6 files changed, 31 insertions, 37 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 3f0c87a..e94b9aa 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -426,7 +426,7 @@ namespace OpenSim.Framework
426 void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, uint locationID, 426 void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, uint locationID,
427 uint flags, string capsURL); 427 uint flags, string capsURL);
428 428
429 void SendTeleportCancel(); 429 void SendTeleportFailed();
430 void SendTeleportLocationStart(); 430 void SendTeleportLocationStart();
431 void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance); 431 void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance);
432 432
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs
index 80111d9..25d23be 100644
--- a/OpenSim/Region/ClientStack/ClientView.API.cs
+++ b/OpenSim/Region/ClientStack/ClientView.API.cs
@@ -467,13 +467,13 @@ namespace OpenSim.Region.ClientStack
467 /// <summary> 467 /// <summary>
468 /// 468 ///
469 /// </summary> 469 /// </summary>
470 public void SendTeleportCancel() 470 public void SendTeleportFailed()
471 { 471 {
472 TeleportCancelPacket tpCancel = new TeleportCancelPacket(); 472 TeleportFailedPacket tpFailed = new TeleportFailedPacket();
473 tpCancel.Info.SessionID = m_sessionId; 473 tpFailed.Info.AgentID = this.AgentId;
474 tpCancel.Info.AgentID = AgentId; 474 tpFailed.Info.Reason = Helpers.StringToField("unknown failure of teleport");
475 475
476 OutPacket(tpCancel, ThrottleOutPacketType.Task); 476 OutPacket(tpFailed, ThrottleOutPacketType.Task);
477 } 477 }
478 478
479 /// <summary> 479 /// <summary>
diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
index bcd845f..7445c2e 100644
--- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs
+++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
@@ -113,6 +113,7 @@ namespace OpenSim.Region.ClientStack
113 udpServer.LocalScene = scene; 113 udpServer.LocalScene = scene;
114 114
115 scene.LoadWorldMap(); 115 scene.LoadWorldMap();
116 scene.RegisterRegionWithGrid();
116 117
117 scene.PhysScene = GetPhysicsScene(); 118 scene.PhysScene = GetPhysicsScene();
118 scene.PhysScene.SetTerrain(scene.Terrain.GetHeights1D()); 119 scene.PhysScene.SetTerrain(scene.Terrain.GetHeights1D());
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index ef08486..68af360 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -258,8 +258,6 @@ namespace OpenSim.Region.Environment.Scenes
258 httpListener = httpServer; 258 httpListener = httpServer;
259 m_dumpAssetsToFile = dumpAssetsToFile; 259 m_dumpAssetsToFile = dumpAssetsToFile;
260 260
261 // This function was moved to terrain for some kind of map hack by babble
262 RegisterRegionWithComms();
263 } 261 }
264 262
265 #endregion 263 #endregion
@@ -291,6 +289,7 @@ namespace OpenSim.Region.Environment.Scenes
291 } 289 }
292 return true; 290 return true;
293 } 291 }
292
294 public virtual void Restart(float seconds) 293 public virtual void Restart(float seconds)
295 { 294 {
296 if (seconds < 15) 295 if (seconds < 15)
@@ -312,6 +311,7 @@ namespace OpenSim.Region.Environment.Scenes
312 311
313 312
314 } 313 }
314
315 public void restartTimer_Elapsed(object sender, ElapsedEventArgs e) 315 public void restartTimer_Elapsed(object sender, ElapsedEventArgs e)
316 { 316 {
317 m_RestartTimerCounter++; 317 m_RestartTimerCounter++;
@@ -328,6 +328,7 @@ namespace OpenSim.Region.Environment.Scenes
328 } 328 }
329 329
330 } 330 }
331
331 public void restartNOW() 332 public void restartNOW()
332 { 333 {
333 MainLog.Instance.Error("REGION", "Closing"); 334 MainLog.Instance.Error("REGION", "Closing");
@@ -335,6 +336,7 @@ namespace OpenSim.Region.Environment.Scenes
335 MainLog.Instance.Error("REGION", "Firing Region Restart Message"); 336 MainLog.Instance.Error("REGION", "Firing Region Restart Message");
336 base.Restart(0); 337 base.Restart(0);
337 } 338 }
339
338 public void restart_Notify_Wait_Elapsed(object sender, ElapsedEventArgs e) 340 public void restart_Notify_Wait_Elapsed(object sender, ElapsedEventArgs e)
339 { 341 {
340 m_restartWaitTimer.Stop(); 342 m_restartWaitTimer.Stop();
@@ -363,6 +365,7 @@ namespace OpenSim.Region.Environment.Scenes
363 // Reset list to nothing. 365 // Reset list to nothing.
364 m_regionRestartNotifyList = new List<RegionInfo>(); 366 m_regionRestartNotifyList = new List<RegionInfo>();
365 } 367 }
368
366 public override void Close() 369 public override void Close()
367 { 370 {
368 ForEachScenePresence(delegate(ScenePresence avatar) 371 ForEachScenePresence(delegate(ScenePresence avatar)
@@ -534,7 +537,7 @@ namespace OpenSim.Region.Environment.Scenes
534 { 537 {
535 if (Terrain.Tainted() && !Terrain.StillEditing()) 538 if (Terrain.Tainted() && !Terrain.StillEditing())
536 { 539 {
537 CreateTerrainTexture(); 540 CreateTerrainTexture(true);
538 541
539 lock (Terrain.heightmap) 542 lock (Terrain.heightmap)
540 { 543 {
@@ -683,12 +686,9 @@ namespace OpenSim.Region.Environment.Scenes
683 Terrain.SetHeights2D(map); 686 Terrain.SetHeights2D(map);
684 } 687 }
685 688
686 CreateTerrainTextureInitial(); 689 CreateTerrainTexture(false);
687 //CommsManager.GridService.RegisterRegion(RegionInfo); //hack to update the terrain texture in grid mode so it shows on world map 690 //CommsManager.GridService.RegisterRegion(RegionInfo); //hack to update the terrain texture in grid mode so it shows on world map
688 691
689 // These two 'commands' *must be* next to each other or sim rebooting fails.
690 m_sceneGridService.RegisterRegion(RegionInfo);
691 m_sceneGridService.InformNeighborsThatRegionisUp(RegionInfo);
692 } 692 }
693 catch (Exception e) 693 catch (Exception e)
694 { 694 {
@@ -696,10 +696,18 @@ namespace OpenSim.Region.Environment.Scenes
696 } 696 }
697 } 697 }
698 698
699 public void RegisterRegionWithGrid()
700 {
701 RegisterCommsEvents();
702 // These two 'commands' *must be* next to each other or sim rebooting fails.
703 m_sceneGridService.RegisterRegion(RegionInfo);
704 m_sceneGridService.InformNeighborsThatRegionisUp(RegionInfo);
705 }
706
699 /// <summary> 707 /// <summary>
700 /// 708 ///
701 /// </summary> 709 /// </summary>
702 public void CreateTerrainTexture() 710 public void CreateTerrainTexture(bool temporary)
703 { 711 {
704 //create a texture asset of the terrain 712 //create a texture asset of the terrain
705 byte[] data = Terrain.ExportJpegImage("defaultstripe.png"); 713 byte[] data = Terrain.ExportJpegImage("defaultstripe.png");
@@ -710,24 +718,11 @@ namespace OpenSim.Region.Environment.Scenes
710 asset.Name = "terrainImage"; 718 asset.Name = "terrainImage";
711 asset.Description = RegionInfo.RegionName; 719 asset.Description = RegionInfo.RegionName;
712 asset.Type = 0; 720 asset.Type = 0;
713 asset.Temporary = true; 721 asset.Temporary = temporary;
714 AssetCache.AddAsset(asset); 722 AssetCache.AddAsset(asset);
715 } 723 }
716 724
717 public void CreateTerrainTextureInitial() 725
718 {
719 //create a texture asset of the terrain
720 byte[] data = Terrain.ExportJpegImage("defaultstripe.png");
721 m_regInfo.EstateSettings.terrainImageID = LLUUID.Random();
722 AssetBase asset = new AssetBase();
723 asset.FullID = m_regInfo.EstateSettings.terrainImageID;
724 asset.Data = data;
725 asset.Name = "terrainImage";
726 asset.Description = RegionInfo.RegionName;
727 asset.Type = 0;
728 asset.Temporary = false;
729 AssetCache.AddAsset(asset);
730 }
731 #endregion 726 #endregion
732 727
733 #region Primitives Methods 728 #region Primitives Methods
@@ -1117,7 +1112,7 @@ namespace OpenSim.Region.Environment.Scenes
1117 /// <summary> 1112 /// <summary>
1118 /// 1113 ///
1119 /// </summary> 1114 /// </summary>
1120 public void RegisterRegionWithComms() 1115 public void RegisterCommsEvents()
1121 { 1116 {
1122 // Don't register here. babblefro moved registration to *after *the map 1117 // Don't register here. babblefro moved registration to *after *the map
1123 // functions on line 675 so that a proper map will generate and get sent to grid services 1118 // functions on line 675 so that a proper map will generate and get sent to grid services
@@ -1129,11 +1124,9 @@ namespace OpenSim.Region.Environment.Scenes
1129 m_sceneGridService.OnCloseAgentConnection += CloseConnection; 1124 m_sceneGridService.OnCloseAgentConnection += CloseConnection;
1130 m_sceneGridService.OnRegionUp += OtherRegionUp; 1125 m_sceneGridService.OnRegionUp += OtherRegionUp;
1131 1126
1132 m_sceneGridService.KillObject = SendKillObject; 1127 m_sceneGridService.KillObject = SendKillObject;
1133
1134 // Tell Other regions that I'm here.
1135
1136 } 1128 }
1129
1137 public void UnRegisterReginWithComms() 1130 public void UnRegisterReginWithComms()
1138 { 1131 {
1139 m_sceneGridService.OnRegionUp -= OtherRegionUp; 1132 m_sceneGridService.OnRegionUp -= OtherRegionUp;
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
index 550b232..56316e6 100644
--- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
@@ -255,7 +255,7 @@ namespace SimpleApp
255 { 255 {
256 } 256 }
257 257
258 public virtual void SendTeleportCancel() 258 public virtual void SendTeleportFailed()
259 { 259 {
260 } 260 }
261 261
diff --git a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs
index 389ba47..535d519 100644
--- a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs
+++ b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs
@@ -63,7 +63,7 @@ namespace SimpleApp
63 } 63 }
64 64
65 Terrain.GetHeights1D(map); 65 Terrain.GetHeights1D(map);
66 CreateTerrainTexture(); 66 CreateTerrainTexture(true);
67 } 67 }
68 68
69 public override void AddNewClient(IClientAPI client, bool child) 69 public override void AddNewClient(IClientAPI client, bool child)