From ee352ebc7971fbb62319da53c520304bda5a15a2 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sun, 11 May 2008 04:32:43 +0000 Subject: * Added NPCModule and NPCAvatar classes for NPCs. Primitive, but we can grow them out. * Fix for Scene.Inventory.cs - It assumes every entity at startup is a SceneObjectGroup. (Actually, this shouldn't have compiled[!] without a warning.) * Fix for LandManager at startup - it assumes there's a land channel when perhaps there isnt. (Bug that needs another refactor to fix. [Mike - I've assigned a ticket to you about this]) --- OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | 7 +++++-- OpenSim/Region/Environment/Scenes/Scene.cs | 10 +++++++++- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 9 ++++++++- 3 files changed, 22 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes') diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index e78ad2b..29bcf0b 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -50,9 +50,12 @@ namespace OpenSim.Region.Environment.Scenes { m_log.Info("[PRIM INVENTORY]: Starting scripts in scene"); - foreach (SceneObjectGroup group in Entities.Values) + foreach (EntityBase group in Entities.Values) { - group.StartScripts(); + if (group is SceneObjectGroup) + { + ((SceneObjectGroup) group).StartScripts(); + } } } diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 2e1116b..e8a6c45 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -1524,7 +1524,15 @@ namespace OpenSim.Region.Environment.Scenes CreateAndAddScenePresence(client, child); - LandChannel.SendParcelOverlay(client); + try + { + LandChannel.SendParcelOverlay(client); + } //BUG: Mike - please fix this. + catch (KeyNotFoundException) + { + m_log.Warn("[LAND]: Bug #2 triggered with NPC. LandModule needs a refactor to fix this."); + } + CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); } } diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 043d337..466b20a 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -410,7 +410,14 @@ namespace OpenSim.Region.Environment.Scenes RegisterToEvents(); SetDirectionVectors(); - m_scene.LandChannel.SendLandUpdate(this, true); + try + { + m_scene.LandChannel.SendLandUpdate(this, true); + } //BUG: Mike - please fix this. + catch (KeyNotFoundException) + { + m_log.Warn("[LAND]: Bug triggered with NPC. LandModule needs a refactor to fix this."); + } } public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, byte[] visualParams, -- cgit v1.1