diff options
author | UbitUmarov | 2014-08-04 20:32:11 +0100 |
---|---|---|
committer | UbitUmarov | 2014-08-04 20:32:11 +0100 |
commit | 3d81f25e34cd7d536ad0e36242703ac1bc56038d (patch) | |
tree | ea317cda089e8c7e01e13077fc8038bff8ecd14d | |
parent | start sending terrain in scenePresence after well defined avatar. Minor (diff) | |
download | opensim-SC-3d81f25e34cd7d536ad0e36242703ac1bc56038d.zip opensim-SC-3d81f25e34cd7d536ad0e36242703ac1bc56038d.tar.gz opensim-SC-3d81f25e34cd7d536ad0e36242703ac1bc56038d.tar.bz2 opensim-SC-3d81f25e34cd7d536ad0e36242703ac1bc56038d.tar.xz |
Revert "start sending terrain in scenePresence after well defined avatar. Minor"
This reverts commit 05a2feba5d780c57c252891a20071800fd9f2e3e.
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 28 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 34 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneBase.cs | 1160 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 19 |
5 files changed, 616 insertions, 629 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 7d61577..34a2797 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -577,10 +577,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
577 | 577 | ||
578 | // Fire the callback for this connection closing | 578 | // Fire the callback for this connection closing |
579 | if (OnConnectionClosed != null) | 579 | if (OnConnectionClosed != null) |
580 | { | ||
581 | OnConnectionClosed(this); | 580 | OnConnectionClosed(this); |
582 | } | ||
583 | |||
584 | 581 | ||
585 | // Flush all of the packets out of the UDP server for this client | 582 | // Flush all of the packets out of the UDP server for this client |
586 | if (m_udpServer != null) | 583 | if (m_udpServer != null) |
@@ -5521,7 +5518,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5521 | AddLocalPacketHandler(PacketType.DeRezObject, HandlerDeRezObject); | 5518 | AddLocalPacketHandler(PacketType.DeRezObject, HandlerDeRezObject); |
5522 | AddLocalPacketHandler(PacketType.ModifyLand, HandlerModifyLand); | 5519 | AddLocalPacketHandler(PacketType.ModifyLand, HandlerModifyLand); |
5523 | 5520 | ||
5524 | AddLocalPacketHandler(PacketType.RegionHandshakeReply, HandlerRegionHandshakeReply, false); | 5521 | // AddLocalPacketHandler(PacketType.RegionHandshakeReply, HandlerRegionHandshakeReply, false); |
5522 | AddLocalPacketHandler(PacketType.RegionHandshakeReply, HandlerRegionHandshakeReply, true); | ||
5525 | 5523 | ||
5526 | AddLocalPacketHandler(PacketType.AgentWearablesRequest, HandlerAgentWearablesRequest); | 5524 | AddLocalPacketHandler(PacketType.AgentWearablesRequest, HandlerAgentWearablesRequest); |
5527 | AddLocalPacketHandler(PacketType.AgentSetAppearance, HandlerAgentSetAppearance); | 5525 | AddLocalPacketHandler(PacketType.AgentSetAppearance, HandlerAgentSetAppearance); |
@@ -5734,15 +5732,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5734 | #region Scene/Avatar | 5732 | #region Scene/Avatar |
5735 | 5733 | ||
5736 | // Threshold for body rotation to be a significant agent update | 5734 | // Threshold for body rotation to be a significant agent update |
5737 | // private const float QDELTA = 0.000001f; | 5735 | private const float QDELTA = 0.000001f; |
5738 | // QDELTA is now relative to abs of cos of angle between orientations | ||
5739 | |||
5740 | private const float QDELTABODY = 1 - 0.0001f; | ||
5741 | private const float QDELTAHEAD = 1 - 0.0001f; | ||
5742 | |||
5743 | // Threshold for camera rotation to be a significant agent update | 5736 | // Threshold for camera rotation to be a significant agent update |
5744 | private const float VDELTA = 0.01f; | 5737 | private const float VDELTA = 0.01f; |
5745 | 5738 | ||
5746 | /// <summary> | 5739 | /// <summary> |
5747 | /// This checks the update significance against the last update made. | 5740 | /// This checks the update significance against the last update made. |
5748 | /// </summary> | 5741 | /// </summary> |
@@ -5762,18 +5755,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5762 | /// <param name='x'></param> | 5755 | /// <param name='x'></param> |
5763 | private bool CheckAgentMovementUpdateSignificance(AgentUpdatePacket.AgentDataBlock x) | 5756 | private bool CheckAgentMovementUpdateSignificance(AgentUpdatePacket.AgentDataBlock x) |
5764 | { | 5757 | { |
5765 | // float qdelta1 = 1 - (float)Math.Pow(Quaternion.Dot(x.BodyRotation, m_thisAgentUpdateArgs.BodyRotation), 2); | 5758 | float qdelta1 = 1 - (float)Math.Pow(Quaternion.Dot(x.BodyRotation, m_thisAgentUpdateArgs.BodyRotation), 2); |
5766 | //qdelta2 = 1 - (float)Math.Pow(Quaternion.Dot(x.HeadRotation, m_thisAgentUpdateArgs.HeadRotation), 2); | 5759 | //qdelta2 = 1 - (float)Math.Pow(Quaternion.Dot(x.HeadRotation, m_thisAgentUpdateArgs.HeadRotation), 2); |
5767 | // now using abs of cos | ||
5768 | float qdelta1 = (float)Math.Abs(Quaternion.Dot(x.BodyRotation, m_thisAgentUpdateArgs.BodyRotation)); | ||
5769 | float qdelta2 = (float)Math.Abs(Quaternion.Dot(x.HeadRotation, m_thisAgentUpdateArgs.HeadRotation)); | ||
5770 | 5760 | ||
5771 | bool movementSignificant = | 5761 | bool movementSignificant = |
5772 | // (qdelta1 > QDELTA) // significant if body rotation above threshold | 5762 | (qdelta1 > QDELTA) // significant if body rotation above threshold |
5773 | (qdelta1 < QDELTABODY) // higher angle lower cos | 5763 | // Ignoring head rotation altogether, because it's not being used for anything interesting up the stack |
5774 | // Ignoring head rotation altogether, because it's not being used for anything interesting up the stack | ||
5775 | // || (qdelta2 > QDELTA * 10) // significant if head rotation above threshold | 5764 | // || (qdelta2 > QDELTA * 10) // significant if head rotation above threshold |
5776 | || (qdelta2 < QDELTAHEAD) // using cos above | ||
5777 | || (x.ControlFlags != m_thisAgentUpdateArgs.ControlFlags) // significant if control flags changed | 5765 | || (x.ControlFlags != m_thisAgentUpdateArgs.ControlFlags) // significant if control flags changed |
5778 | || (x.ControlFlags != (byte)AgentManager.ControlFlags.NONE) // significant if user supplying any movement update commands | 5766 | || (x.ControlFlags != (byte)AgentManager.ControlFlags.NONE) // significant if user supplying any movement update commands |
5779 | || (x.Far != m_thisAgentUpdateArgs.Far) // significant if far distance changed | 5767 | || (x.Far != m_thisAgentUpdateArgs.Far) // significant if far distance changed |
@@ -6488,7 +6476,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6488 | Action<IClientAPI> handlerRegionHandShakeReply = OnRegionHandShakeReply; | 6476 | Action<IClientAPI> handlerRegionHandShakeReply = OnRegionHandShakeReply; |
6489 | if (handlerRegionHandShakeReply != null) | 6477 | if (handlerRegionHandShakeReply != null) |
6490 | { | 6478 | { |
6491 | // Thread.Sleep(500); | 6479 | Thread.Sleep(500); |
6492 | handlerRegionHandShakeReply(this); | 6480 | handlerRegionHandShakeReply(this); |
6493 | } | 6481 | } |
6494 | 6482 | ||
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index a3fdae1..b7c8594 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |||
@@ -1750,10 +1750,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1750 | endPoint, | 1750 | endPoint, |
1751 | sessionInfo); | 1751 | sessionInfo); |
1752 | 1752 | ||
1753 | // Send ack straight away to let the viewer know that the connection is active. | ||
1754 | // The client will be null if it already exists (e.g. if on a region crossing the client sends a use | ||
1755 | // circuit code to the existing child agent. This is not particularly obvious. | ||
1756 | SendAckImmediate(endPoint, uccp.Header.Sequence); | ||
1757 | |||
1758 | // We only want to send initial data to new clients, not ones which are being converted from child to root. | ||
1759 | if (client != null) | ||
1760 | { | ||
1761 | AgentCircuitData aCircuit = m_scene.AuthenticateHandler.GetAgentCircuitData(uccp.CircuitCode.Code); | ||
1762 | bool tp = (aCircuit.teleportFlags > 0); | ||
1763 | // Let's delay this for TP agents, otherwise the viewer doesn't know where to get resources from | ||
1764 | if (!tp) | ||
1765 | client.SceneAgent.SendInitialDataToMe(); | ||
1766 | } | ||
1767 | |||
1753 | // Now we know we can handle more data | 1768 | // Now we know we can handle more data |
1754 | // Thread.Sleep(200); | 1769 | Thread.Sleep(200); |
1755 | 1770 | ||
1756 | // Obtain the pending queue and remove it from the cache | 1771 | // Obtain the queue and remove it from the cache |
1757 | Queue<UDPPacketBuffer> queue = null; | 1772 | Queue<UDPPacketBuffer> queue = null; |
1758 | 1773 | ||
1759 | lock (m_pendingCache) | 1774 | lock (m_pendingCache) |
@@ -1775,21 +1790,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1775 | PacketReceived(buf); | 1790 | PacketReceived(buf); |
1776 | } | 1791 | } |
1777 | queue = null; | 1792 | queue = null; |
1778 | |||
1779 | // Send ack straight away to let the viewer know that the connection is active. | ||
1780 | // The client will be null if it already exists (e.g. if on a region crossing the client sends a use | ||
1781 | // circuit code to the existing child agent. This is not particularly obvious. | ||
1782 | SendAckImmediate(endPoint, uccp.Header.Sequence); | ||
1783 | |||
1784 | // We only want to send initial data to new clients, not ones which are being converted from child to root. | ||
1785 | if (client != null) | ||
1786 | { | ||
1787 | AgentCircuitData aCircuit = m_scene.AuthenticateHandler.GetAgentCircuitData(uccp.CircuitCode.Code); | ||
1788 | bool tp = (aCircuit.teleportFlags > 0); | ||
1789 | // Let's delay this for TP agents, otherwise the viewer doesn't know where to get resources from | ||
1790 | if (!tp) | ||
1791 | client.SceneAgent.SendInitialDataToMe(); | ||
1792 | } | ||
1793 | } | 1793 | } |
1794 | else | 1794 | else |
1795 | { | 1795 | { |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index ec54e15..0266faf 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -3179,7 +3179,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3179 | 3179 | ||
3180 | public virtual void SubscribeToClientTerrainEvents(IClientAPI client) | 3180 | public virtual void SubscribeToClientTerrainEvents(IClientAPI client) |
3181 | { | 3181 | { |
3182 | // client.OnRegionHandShakeReply += SendLayerData; | 3182 | client.OnRegionHandShakeReply += SendLayerData; |
3183 | } | 3183 | } |
3184 | 3184 | ||
3185 | public virtual void SubscribeToClientPrimEvents(IClientAPI client) | 3185 | public virtual void SubscribeToClientPrimEvents(IClientAPI client) |
@@ -3307,7 +3307,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3307 | 3307 | ||
3308 | public virtual void UnSubscribeToClientTerrainEvents(IClientAPI client) | 3308 | public virtual void UnSubscribeToClientTerrainEvents(IClientAPI client) |
3309 | { | 3309 | { |
3310 | // client.OnRegionHandShakeReply -= SendLayerData; | 3310 | client.OnRegionHandShakeReply -= SendLayerData; |
3311 | } | 3311 | } |
3312 | 3312 | ||
3313 | public virtual void UnSubscribeToClientPrimEvents(IClientAPI client) | 3313 | public virtual void UnSubscribeToClientPrimEvents(IClientAPI client) |
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs index 6adccca..08e26c5 100644 --- a/OpenSim/Region/Framework/Scenes/SceneBase.cs +++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs | |||
@@ -1,581 +1,581 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSimulator Project nor the | 12 | * * Neither the name of the OpenSimulator Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using System.Threading; | 31 | using System.Threading; |
32 | using OpenMetaverse; | 32 | using OpenMetaverse; |
33 | using log4net; | 33 | using log4net; |
34 | using Nini.Config; | 34 | using Nini.Config; |
35 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
36 | using OpenSim.Framework.Console; | 36 | using OpenSim.Framework.Console; |
37 | 37 | ||
38 | using OpenSim.Region.Framework.Interfaces; | 38 | using OpenSim.Region.Framework.Interfaces; |
39 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | 39 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; |
40 | 40 | ||
41 | namespace OpenSim.Region.Framework.Scenes | 41 | namespace OpenSim.Region.Framework.Scenes |
42 | { | 42 | { |
43 | public abstract class SceneBase : IScene | 43 | public abstract class SceneBase : IScene |
44 | { | 44 | { |
45 | protected static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 45 | protected static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | protected static readonly string LogHeader = "[SCENE]"; | 46 | protected static readonly string LogHeader = "[SCENE]"; |
47 | 47 | ||
48 | #region Events | 48 | #region Events |
49 | 49 | ||
50 | public event restart OnRestart; | 50 | public event restart OnRestart; |
51 | 51 | ||
52 | #endregion | 52 | #endregion |
53 | 53 | ||
54 | #region Fields | 54 | #region Fields |
55 | 55 | ||
56 | public string Name { get { return RegionInfo.RegionName; } } | 56 | public string Name { get { return RegionInfo.RegionName; } } |
57 | 57 | ||
58 | public IConfigSource Config | 58 | public IConfigSource Config |
59 | { | 59 | { |
60 | get { return GetConfig(); } | 60 | get { return GetConfig(); } |
61 | } | 61 | } |
62 | 62 | ||
63 | protected virtual IConfigSource GetConfig() | 63 | protected virtual IConfigSource GetConfig() |
64 | { | 64 | { |
65 | return null; | 65 | return null; |
66 | } | 66 | } |
67 | 67 | ||
68 | /// <value> | 68 | /// <value> |
69 | /// All the region modules attached to this scene. | 69 | /// All the region modules attached to this scene. |
70 | /// </value> | 70 | /// </value> |
71 | public Dictionary<string, IRegionModuleBase> RegionModules | 71 | public Dictionary<string, IRegionModuleBase> RegionModules |
72 | { | 72 | { |
73 | get { return m_regionModules; } | 73 | get { return m_regionModules; } |
74 | } | 74 | } |
75 | private Dictionary<string, IRegionModuleBase> m_regionModules = new Dictionary<string, IRegionModuleBase>(); | 75 | private Dictionary<string, IRegionModuleBase> m_regionModules = new Dictionary<string, IRegionModuleBase>(); |
76 | 76 | ||
77 | /// <value> | 77 | /// <value> |
78 | /// The module interfaces available from this scene. | 78 | /// The module interfaces available from this scene. |
79 | /// </value> | 79 | /// </value> |
80 | protected Dictionary<Type, List<object>> ModuleInterfaces = new Dictionary<Type, List<object>>(); | 80 | protected Dictionary<Type, List<object>> ModuleInterfaces = new Dictionary<Type, List<object>>(); |
81 | 81 | ||
82 | protected Dictionary<string, object> ModuleAPIMethods = new Dictionary<string, object>(); | 82 | protected Dictionary<string, object> ModuleAPIMethods = new Dictionary<string, object>(); |
83 | 83 | ||
84 | /// <value> | 84 | /// <value> |
85 | /// The module commanders available from this scene | 85 | /// The module commanders available from this scene |
86 | /// </value> | 86 | /// </value> |
87 | protected Dictionary<string, ICommander> m_moduleCommanders = new Dictionary<string, ICommander>(); | 87 | protected Dictionary<string, ICommander> m_moduleCommanders = new Dictionary<string, ICommander>(); |
88 | 88 | ||
89 | /// <value> | 89 | /// <value> |
90 | /// Registered classes that are capable of creating entities. | 90 | /// Registered classes that are capable of creating entities. |
91 | /// </value> | 91 | /// </value> |
92 | protected Dictionary<PCode, IEntityCreator> m_entityCreators = new Dictionary<PCode, IEntityCreator>(); | 92 | protected Dictionary<PCode, IEntityCreator> m_entityCreators = new Dictionary<PCode, IEntityCreator>(); |
93 | 93 | ||
94 | /// <summary> | 94 | /// <summary> |
95 | /// The last allocated local prim id. When a new local id is requested, the next number in the sequence is | 95 | /// The last allocated local prim id. When a new local id is requested, the next number in the sequence is |
96 | /// dispensed. | 96 | /// dispensed. |
97 | /// </summary> | 97 | /// </summary> |
98 | protected uint m_lastAllocatedLocalId = 720000; | 98 | protected uint m_lastAllocatedLocalId = 720000; |
99 | 99 | ||
100 | private readonly Mutex _primAllocateMutex = new Mutex(false); | 100 | private readonly Mutex _primAllocateMutex = new Mutex(false); |
101 | 101 | ||
102 | protected readonly ClientManager m_clientManager = new ClientManager(); | 102 | protected readonly ClientManager m_clientManager = new ClientManager(); |
103 | 103 | ||
104 | public bool LoginsEnabled | 104 | public bool LoginsEnabled |
105 | { | 105 | { |
106 | get | 106 | get |
107 | { | 107 | { |
108 | return m_loginsEnabled; | 108 | return m_loginsEnabled; |
109 | } | 109 | } |
110 | 110 | ||
111 | set | 111 | set |
112 | { | 112 | { |
113 | if (m_loginsEnabled != value) | 113 | if (m_loginsEnabled != value) |
114 | { | 114 | { |
115 | m_loginsEnabled = value; | 115 | m_loginsEnabled = value; |
116 | EventManager.TriggerRegionLoginsStatusChange(this); | 116 | EventManager.TriggerRegionLoginsStatusChange(this); |
117 | } | 117 | } |
118 | } | 118 | } |
119 | } | 119 | } |
120 | private bool m_loginsEnabled; | 120 | private bool m_loginsEnabled; |
121 | 121 | ||
122 | public bool Ready | 122 | public bool Ready |
123 | { | 123 | { |
124 | get | 124 | get |
125 | { | 125 | { |
126 | return m_ready; | 126 | return m_ready; |
127 | } | 127 | } |
128 | 128 | ||
129 | set | 129 | set |
130 | { | 130 | { |
131 | if (m_ready != value) | 131 | if (m_ready != value) |
132 | { | 132 | { |
133 | m_ready = value; | 133 | m_ready = value; |
134 | EventManager.TriggerRegionReadyStatusChange(this); | 134 | EventManager.TriggerRegionReadyStatusChange(this); |
135 | } | 135 | } |
136 | } | 136 | } |
137 | } | 137 | } |
138 | private bool m_ready; | 138 | private bool m_ready; |
139 | 139 | ||
140 | public float TimeDilation | 140 | public float TimeDilation |
141 | { | 141 | { |
142 | get { return 1.0f; } | 142 | get { return 1.0f; } |
143 | } | 143 | } |
144 | 144 | ||
145 | protected ulong m_regionHandle; | 145 | protected ulong m_regionHandle; |
146 | protected string m_regionName; | 146 | protected string m_regionName; |
147 | 147 | ||
148 | public ITerrainChannel Heightmap; | 148 | public ITerrainChannel Heightmap; |
149 | 149 | ||
150 | /// <value> | 150 | /// <value> |
151 | /// Allows retrieval of land information for this scene. | 151 | /// Allows retrieval of land information for this scene. |
152 | /// </value> | 152 | /// </value> |
153 | public ILandChannel LandChannel; | 153 | public ILandChannel LandChannel; |
154 | 154 | ||
155 | /// <value> | 155 | /// <value> |
156 | /// Manage events that occur in this scene (avatar movement, script rez, etc.). Commonly used by region modules | 156 | /// Manage events that occur in this scene (avatar movement, script rez, etc.). Commonly used by region modules |
157 | /// to subscribe to scene events. | 157 | /// to subscribe to scene events. |
158 | /// </value> | 158 | /// </value> |
159 | public EventManager EventManager | 159 | public EventManager EventManager |
160 | { | 160 | { |
161 | get { return m_eventManager; } | 161 | get { return m_eventManager; } |
162 | } | 162 | } |
163 | protected EventManager m_eventManager; | 163 | protected EventManager m_eventManager; |
164 | 164 | ||
165 | protected ScenePermissions m_permissions; | 165 | protected ScenePermissions m_permissions; |
166 | public ScenePermissions Permissions | 166 | public ScenePermissions Permissions |
167 | { | 167 | { |
168 | get { return m_permissions; } | 168 | get { return m_permissions; } |
169 | } | 169 | } |
170 | 170 | ||
171 | protected string m_datastore; | 171 | protected string m_datastore; |
172 | 172 | ||
173 | /* Used by the loadbalancer plugin on GForge */ | 173 | /* Used by the loadbalancer plugin on GForge */ |
174 | protected RegionStatus m_regStatus; | 174 | protected RegionStatus m_regStatus; |
175 | public RegionStatus RegionStatus | 175 | public RegionStatus RegionStatus |
176 | { | 176 | { |
177 | get { return m_regStatus; } | 177 | get { return m_regStatus; } |
178 | set { m_regStatus = value; } | 178 | set { m_regStatus = value; } |
179 | } | 179 | } |
180 | 180 | ||
181 | #endregion | 181 | #endregion |
182 | 182 | ||
183 | public SceneBase(RegionInfo regInfo) | 183 | public SceneBase(RegionInfo regInfo) |
184 | { | 184 | { |
185 | RegionInfo = regInfo; | 185 | RegionInfo = regInfo; |
186 | } | 186 | } |
187 | 187 | ||
188 | #region Update Methods | 188 | #region Update Methods |
189 | 189 | ||
190 | /// <summary> | 190 | /// <summary> |
191 | /// Called to update the scene loop by a number of frames and until shutdown. | 191 | /// Called to update the scene loop by a number of frames and until shutdown. |
192 | /// </summary> | 192 | /// </summary> |
193 | /// <param name="frames"> | 193 | /// <param name="frames"> |
194 | /// Number of frames to update. Exits on shutdown even if there are frames remaining. | 194 | /// Number of frames to update. Exits on shutdown even if there are frames remaining. |
195 | /// If -1 then updates until shutdown. | 195 | /// If -1 then updates until shutdown. |
196 | /// </param> | 196 | /// </param> |
197 | public abstract void Update(int frames); | 197 | public abstract void Update(int frames); |
198 | 198 | ||
199 | #endregion | 199 | #endregion |
200 | 200 | ||
201 | #region Terrain Methods | 201 | #region Terrain Methods |
202 | 202 | ||
203 | /// <summary> | 203 | /// <summary> |
204 | /// Loads the World heightmap | 204 | /// Loads the World heightmap |
205 | /// </summary> | 205 | /// </summary> |
206 | public abstract void LoadWorldMap(); | 206 | public abstract void LoadWorldMap(); |
207 | 207 | ||
208 | /// <summary> | 208 | /// <summary> |
209 | /// Send the region heightmap to the client | 209 | /// Send the region heightmap to the client |
210 | /// </summary> | 210 | /// </summary> |
211 | /// <param name="RemoteClient">Client to send to</param> | 211 | /// <param name="RemoteClient">Client to send to</param> |
212 | public virtual void SendLayerData(IClientAPI RemoteClient) | 212 | public virtual void SendLayerData(IClientAPI RemoteClient) |
213 | { | 213 | { |
214 | RemoteClient.SendLayerData(Heightmap.GetFloatsSerialised()); | 214 | RemoteClient.SendLayerData(Heightmap.GetFloatsSerialised()); |
215 | } | 215 | } |
216 | 216 | ||
217 | #endregion | 217 | #endregion |
218 | 218 | ||
219 | #region Add/Remove Agent/Avatar | 219 | #region Add/Remove Agent/Avatar |
220 | 220 | ||
221 | public abstract ISceneAgent AddNewAgent(IClientAPI client, PresenceType type); | 221 | public abstract ISceneAgent AddNewAgent(IClientAPI client, PresenceType type); |
222 | 222 | ||
223 | public abstract bool CloseAgent(UUID agentID, bool force); | 223 | public abstract bool CloseAgent(UUID agentID, bool force); |
224 | 224 | ||
225 | public bool TryGetScenePresence(UUID agentID, out object scenePresence) | 225 | public bool TryGetScenePresence(UUID agentID, out object scenePresence) |
226 | { | 226 | { |
227 | scenePresence = null; | 227 | scenePresence = null; |
228 | ScenePresence sp = null; | 228 | ScenePresence sp = null; |
229 | if (TryGetScenePresence(agentID, out sp)) | 229 | if (TryGetScenePresence(agentID, out sp)) |
230 | { | 230 | { |
231 | scenePresence = sp; | 231 | scenePresence = sp; |
232 | return true; | 232 | return true; |
233 | } | 233 | } |
234 | 234 | ||
235 | return false; | 235 | return false; |
236 | } | 236 | } |
237 | 237 | ||
238 | /// <summary> | 238 | /// <summary> |
239 | /// Try to get a scene presence from the scene | 239 | /// Try to get a scene presence from the scene |
240 | /// </summary> | 240 | /// </summary> |
241 | /// <param name="agentID"></param> | 241 | /// <param name="agentID"></param> |
242 | /// <param name="scenePresence">null if there is no scene presence with the given agent id</param> | 242 | /// <param name="scenePresence">null if there is no scene presence with the given agent id</param> |
243 | /// <returns>true if there was a scene presence with the given id, false otherwise.</returns> | 243 | /// <returns>true if there was a scene presence with the given id, false otherwise.</returns> |
244 | public abstract bool TryGetScenePresence(UUID agentID, out ScenePresence scenePresence); | 244 | public abstract bool TryGetScenePresence(UUID agentID, out ScenePresence scenePresence); |
245 | 245 | ||
246 | #endregion | 246 | #endregion |
247 | 247 | ||
248 | /// <summary> | 248 | /// <summary> |
249 | /// | 249 | /// |
250 | /// </summary> | 250 | /// </summary> |
251 | /// <returns></returns> | 251 | /// <returns></returns> |
252 | public virtual RegionInfo RegionInfo { get; private set; } | 252 | public virtual RegionInfo RegionInfo { get; private set; } |
253 | 253 | ||
254 | #region admin stuff | 254 | #region admin stuff |
255 | 255 | ||
256 | public abstract void OtherRegionUp(GridRegion otherRegion); | 256 | public abstract void OtherRegionUp(GridRegion otherRegion); |
257 | 257 | ||
258 | public virtual string GetSimulatorVersion() | 258 | public virtual string GetSimulatorVersion() |
259 | { | 259 | { |
260 | return "OpenSimulator Server"; | 260 | return "OpenSimulator Server"; |
261 | } | 261 | } |
262 | 262 | ||
263 | #endregion | 263 | #endregion |
264 | 264 | ||
265 | #region Shutdown | 265 | #region Shutdown |
266 | 266 | ||
267 | /// <summary> | 267 | /// <summary> |
268 | /// Tidy before shutdown | 268 | /// Tidy before shutdown |
269 | /// </summary> | 269 | /// </summary> |
270 | public virtual void Close() | 270 | public virtual void Close() |
271 | { | 271 | { |
272 | try | 272 | try |
273 | { | 273 | { |
274 | EventManager.TriggerShutdown(); | 274 | EventManager.TriggerShutdown(); |
275 | } | 275 | } |
276 | catch (Exception e) | 276 | catch (Exception e) |
277 | { | 277 | { |
278 | m_log.Error(string.Format("[SCENE]: SceneBase.cs: Close() - Failed with exception ", e)); | 278 | m_log.Error(string.Format("[SCENE]: SceneBase.cs: Close() - Failed with exception ", e)); |
279 | } | 279 | } |
280 | } | 280 | } |
281 | 281 | ||
282 | #endregion | 282 | #endregion |
283 | 283 | ||
284 | /// <summary> | 284 | /// <summary> |
285 | /// Returns a new unallocated local ID | 285 | /// Returns a new unallocated local ID |
286 | /// </summary> | 286 | /// </summary> |
287 | /// <returns>A brand new local ID</returns> | 287 | /// <returns>A brand new local ID</returns> |
288 | public uint AllocateLocalId() | 288 | public uint AllocateLocalId() |
289 | { | 289 | { |
290 | uint myID; | 290 | uint myID; |
291 | 291 | ||
292 | _primAllocateMutex.WaitOne(); | 292 | _primAllocateMutex.WaitOne(); |
293 | myID = ++m_lastAllocatedLocalId; | 293 | myID = ++m_lastAllocatedLocalId; |
294 | _primAllocateMutex.ReleaseMutex(); | 294 | _primAllocateMutex.ReleaseMutex(); |
295 | 295 | ||
296 | return myID; | 296 | return myID; |
297 | } | 297 | } |
298 | 298 | ||
299 | #region Module Methods | 299 | #region Module Methods |
300 | 300 | ||
301 | /// <summary> | 301 | /// <summary> |
302 | /// Add a region-module to this scene. TODO: This will replace AddModule in the future. | 302 | /// Add a region-module to this scene. TODO: This will replace AddModule in the future. |
303 | /// </summary> | 303 | /// </summary> |
304 | /// <param name="name"></param> | 304 | /// <param name="name"></param> |
305 | /// <param name="module"></param> | 305 | /// <param name="module"></param> |
306 | public void AddRegionModule(string name, IRegionModuleBase module) | 306 | public void AddRegionModule(string name, IRegionModuleBase module) |
307 | { | 307 | { |
308 | if (!RegionModules.ContainsKey(name)) | 308 | if (!RegionModules.ContainsKey(name)) |
309 | { | 309 | { |
310 | RegionModules.Add(name, module); | 310 | RegionModules.Add(name, module); |
311 | } | 311 | } |
312 | } | 312 | } |
313 | 313 | ||
314 | public void RemoveRegionModule(string name) | 314 | public void RemoveRegionModule(string name) |
315 | { | 315 | { |
316 | RegionModules.Remove(name); | 316 | RegionModules.Remove(name); |
317 | } | 317 | } |
318 | 318 | ||
319 | /// <summary> | 319 | /// <summary> |
320 | /// Register a module commander. | 320 | /// Register a module commander. |
321 | /// </summary> | 321 | /// </summary> |
322 | /// <param name="commander"></param> | 322 | /// <param name="commander"></param> |
323 | public void RegisterModuleCommander(ICommander commander) | 323 | public void RegisterModuleCommander(ICommander commander) |
324 | { | 324 | { |
325 | lock (m_moduleCommanders) | 325 | lock (m_moduleCommanders) |
326 | { | 326 | { |
327 | m_moduleCommanders.Add(commander.Name, commander); | 327 | m_moduleCommanders.Add(commander.Name, commander); |
328 | } | 328 | } |
329 | } | 329 | } |
330 | 330 | ||
331 | /// <summary> | 331 | /// <summary> |
332 | /// Unregister a module commander and all its commands | 332 | /// Unregister a module commander and all its commands |
333 | /// </summary> | 333 | /// </summary> |
334 | /// <param name="name"></param> | 334 | /// <param name="name"></param> |
335 | public void UnregisterModuleCommander(string name) | 335 | public void UnregisterModuleCommander(string name) |
336 | { | 336 | { |
337 | lock (m_moduleCommanders) | 337 | lock (m_moduleCommanders) |
338 | { | 338 | { |
339 | ICommander commander; | 339 | ICommander commander; |
340 | if (m_moduleCommanders.TryGetValue(name, out commander)) | 340 | if (m_moduleCommanders.TryGetValue(name, out commander)) |
341 | m_moduleCommanders.Remove(name); | 341 | m_moduleCommanders.Remove(name); |
342 | } | 342 | } |
343 | } | 343 | } |
344 | 344 | ||
345 | /// <summary> | 345 | /// <summary> |
346 | /// Get a module commander | 346 | /// Get a module commander |
347 | /// </summary> | 347 | /// </summary> |
348 | /// <param name="name"></param> | 348 | /// <param name="name"></param> |
349 | /// <returns>The module commander, null if no module commander with that name was found</returns> | 349 | /// <returns>The module commander, null if no module commander with that name was found</returns> |
350 | public ICommander GetCommander(string name) | 350 | public ICommander GetCommander(string name) |
351 | { | 351 | { |
352 | lock (m_moduleCommanders) | 352 | lock (m_moduleCommanders) |
353 | { | 353 | { |
354 | if (m_moduleCommanders.ContainsKey(name)) | 354 | if (m_moduleCommanders.ContainsKey(name)) |
355 | return m_moduleCommanders[name]; | 355 | return m_moduleCommanders[name]; |
356 | } | 356 | } |
357 | 357 | ||
358 | return null; | 358 | return null; |
359 | } | 359 | } |
360 | 360 | ||
361 | public Dictionary<string, ICommander> GetCommanders() | 361 | public Dictionary<string, ICommander> GetCommanders() |
362 | { | 362 | { |
363 | return m_moduleCommanders; | 363 | return m_moduleCommanders; |
364 | } | 364 | } |
365 | 365 | ||
366 | /// <summary> | 366 | /// <summary> |
367 | /// Register an interface to a region module. This allows module methods to be called directly as | 367 | /// Register an interface to a region module. This allows module methods to be called directly as |
368 | /// well as via events. If there is already a module registered for this interface, it is not replaced | 368 | /// well as via events. If there is already a module registered for this interface, it is not replaced |
369 | /// (is this the best behaviour?) | 369 | /// (is this the best behaviour?) |
370 | /// </summary> | 370 | /// </summary> |
371 | /// <param name="mod"></param> | 371 | /// <param name="mod"></param> |
372 | public void RegisterModuleInterface<M>(M mod) | 372 | public void RegisterModuleInterface<M>(M mod) |
373 | { | 373 | { |
374 | // m_log.DebugFormat("[SCENE BASE]: Registering interface {0}", typeof(M)); | 374 | // m_log.DebugFormat("[SCENE BASE]: Registering interface {0}", typeof(M)); |
375 | 375 | ||
376 | List<Object> l = null; | 376 | List<Object> l = null; |
377 | if (!ModuleInterfaces.TryGetValue(typeof(M), out l)) | 377 | if (!ModuleInterfaces.TryGetValue(typeof(M), out l)) |
378 | { | 378 | { |
379 | l = new List<Object>(); | 379 | l = new List<Object>(); |
380 | ModuleInterfaces.Add(typeof(M), l); | 380 | ModuleInterfaces.Add(typeof(M), l); |
381 | } | 381 | } |
382 | 382 | ||
383 | if (l.Count > 0) | 383 | if (l.Count > 0) |
384 | return; | 384 | return; |
385 | 385 | ||
386 | l.Add(mod); | 386 | l.Add(mod); |
387 | 387 | ||
388 | if (mod is IEntityCreator) | 388 | if (mod is IEntityCreator) |
389 | { | 389 | { |
390 | IEntityCreator entityCreator = (IEntityCreator)mod; | 390 | IEntityCreator entityCreator = (IEntityCreator)mod; |
391 | foreach (PCode pcode in entityCreator.CreationCapabilities) | 391 | foreach (PCode pcode in entityCreator.CreationCapabilities) |
392 | { | 392 | { |
393 | m_entityCreators[pcode] = entityCreator; | 393 | m_entityCreators[pcode] = entityCreator; |
394 | } | 394 | } |
395 | } | 395 | } |
396 | } | 396 | } |
397 | 397 | ||
398 | public void UnregisterModuleInterface<M>(M mod) | 398 | public void UnregisterModuleInterface<M>(M mod) |
399 | { | 399 | { |
400 | List<Object> l; | 400 | List<Object> l; |
401 | if (ModuleInterfaces.TryGetValue(typeof(M), out l)) | 401 | if (ModuleInterfaces.TryGetValue(typeof(M), out l)) |
402 | { | 402 | { |
403 | if (l.Remove(mod)) | 403 | if (l.Remove(mod)) |
404 | { | 404 | { |
405 | if (mod is IEntityCreator) | 405 | if (mod is IEntityCreator) |
406 | { | 406 | { |
407 | IEntityCreator entityCreator = (IEntityCreator)mod; | 407 | IEntityCreator entityCreator = (IEntityCreator)mod; |
408 | foreach (PCode pcode in entityCreator.CreationCapabilities) | 408 | foreach (PCode pcode in entityCreator.CreationCapabilities) |
409 | { | 409 | { |
410 | m_entityCreators[pcode] = null; | 410 | m_entityCreators[pcode] = null; |
411 | } | 411 | } |
412 | } | 412 | } |
413 | } | 413 | } |
414 | } | 414 | } |
415 | } | 415 | } |
416 | 416 | ||
417 | public void StackModuleInterface<M>(M mod) | 417 | public void StackModuleInterface<M>(M mod) |
418 | { | 418 | { |
419 | List<Object> l; | 419 | List<Object> l; |
420 | if (ModuleInterfaces.ContainsKey(typeof(M))) | 420 | if (ModuleInterfaces.ContainsKey(typeof(M))) |
421 | l = ModuleInterfaces[typeof(M)]; | 421 | l = ModuleInterfaces[typeof(M)]; |
422 | else | 422 | else |
423 | l = new List<Object>(); | 423 | l = new List<Object>(); |
424 | 424 | ||
425 | if (l.Contains(mod)) | 425 | if (l.Contains(mod)) |
426 | return; | 426 | return; |
427 | 427 | ||
428 | l.Add(mod); | 428 | l.Add(mod); |
429 | 429 | ||
430 | if (mod is IEntityCreator) | 430 | if (mod is IEntityCreator) |
431 | { | 431 | { |
432 | IEntityCreator entityCreator = (IEntityCreator)mod; | 432 | IEntityCreator entityCreator = (IEntityCreator)mod; |
433 | foreach (PCode pcode in entityCreator.CreationCapabilities) | 433 | foreach (PCode pcode in entityCreator.CreationCapabilities) |
434 | { | 434 | { |
435 | m_entityCreators[pcode] = entityCreator; | 435 | m_entityCreators[pcode] = entityCreator; |
436 | } | 436 | } |
437 | } | 437 | } |
438 | 438 | ||
439 | ModuleInterfaces[typeof(M)] = l; | 439 | ModuleInterfaces[typeof(M)] = l; |
440 | } | 440 | } |
441 | 441 | ||
442 | /// <summary> | 442 | /// <summary> |
443 | /// For the given interface, retrieve the region module which implements it. | 443 | /// For the given interface, retrieve the region module which implements it. |
444 | /// </summary> | 444 | /// </summary> |
445 | /// <returns>null if there is no registered module implementing that interface</returns> | 445 | /// <returns>null if there is no registered module implementing that interface</returns> |
446 | public T RequestModuleInterface<T>() | 446 | public T RequestModuleInterface<T>() |
447 | { | 447 | { |
448 | if (ModuleInterfaces.ContainsKey(typeof(T)) && | 448 | if (ModuleInterfaces.ContainsKey(typeof(T)) && |
449 | (ModuleInterfaces[typeof(T)].Count > 0)) | 449 | (ModuleInterfaces[typeof(T)].Count > 0)) |
450 | return (T)ModuleInterfaces[typeof(T)][0]; | 450 | return (T)ModuleInterfaces[typeof(T)][0]; |
451 | else | 451 | else |
452 | return default(T); | 452 | return default(T); |
453 | } | 453 | } |
454 | 454 | ||
455 | /// <summary> | 455 | /// <summary> |
456 | /// For the given interface, retrieve an array of region modules that implement it. | 456 | /// For the given interface, retrieve an array of region modules that implement it. |
457 | /// </summary> | 457 | /// </summary> |
458 | /// <returns>an empty array if there are no registered modules implementing that interface</returns> | 458 | /// <returns>an empty array if there are no registered modules implementing that interface</returns> |
459 | public T[] RequestModuleInterfaces<T>() | 459 | public T[] RequestModuleInterfaces<T>() |
460 | { | 460 | { |
461 | if (ModuleInterfaces.ContainsKey(typeof(T))) | 461 | if (ModuleInterfaces.ContainsKey(typeof(T))) |
462 | { | 462 | { |
463 | List<T> ret = new List<T>(); | 463 | List<T> ret = new List<T>(); |
464 | 464 | ||
465 | foreach (Object o in ModuleInterfaces[typeof(T)]) | 465 | foreach (Object o in ModuleInterfaces[typeof(T)]) |
466 | ret.Add((T)o); | 466 | ret.Add((T)o); |
467 | return ret.ToArray(); | 467 | return ret.ToArray(); |
468 | } | 468 | } |
469 | else | 469 | else |
470 | { | 470 | { |
471 | return new T[] {}; | 471 | return new T[] {}; |
472 | } | 472 | } |
473 | } | 473 | } |
474 | 474 | ||
475 | #endregion | 475 | #endregion |
476 | 476 | ||
477 | /// <summary> | 477 | /// <summary> |
478 | /// Call this from a region module to add a command to the OpenSim console. | 478 | /// Call this from a region module to add a command to the OpenSim console. |
479 | /// </summary> | 479 | /// </summary> |
480 | /// <param name="mod"></param> | 480 | /// <param name="mod"></param> |
481 | /// <param name="command"></param> | 481 | /// <param name="command"></param> |
482 | /// <param name="shorthelp"></param> | 482 | /// <param name="shorthelp"></param> |
483 | /// <param name="longhelp"></param> | 483 | /// <param name="longhelp"></param> |
484 | /// <param name="callback"></param> | 484 | /// <param name="callback"></param> |
485 | public void AddCommand(IRegionModuleBase module, string command, string shorthelp, string longhelp, CommandDelegate callback) | 485 | public void AddCommand(IRegionModuleBase module, string command, string shorthelp, string longhelp, CommandDelegate callback) |
486 | { | 486 | { |
487 | AddCommand(module, command, shorthelp, longhelp, string.Empty, callback); | 487 | AddCommand(module, command, shorthelp, longhelp, string.Empty, callback); |
488 | } | 488 | } |
489 | 489 | ||
490 | /// <summary> | 490 | /// <summary> |
491 | /// Call this from a region module to add a command to the OpenSim console. | 491 | /// Call this from a region module to add a command to the OpenSim console. |
492 | /// </summary> | 492 | /// </summary> |
493 | /// <param name="mod"> | 493 | /// <param name="mod"> |
494 | /// The use of IRegionModuleBase is a cheap trick to get a different method signature, | 494 | /// The use of IRegionModuleBase is a cheap trick to get a different method signature, |
495 | /// though all new modules should be using interfaces descended from IRegionModuleBase anyway. | 495 | /// though all new modules should be using interfaces descended from IRegionModuleBase anyway. |
496 | /// </param> | 496 | /// </param> |
497 | /// <param name="category"> | 497 | /// <param name="category"> |
498 | /// Category of the command. This is the section under which it will appear when the user asks for help | 498 | /// Category of the command. This is the section under which it will appear when the user asks for help |
499 | /// </param> | 499 | /// </param> |
500 | /// <param name="command"></param> | 500 | /// <param name="command"></param> |
501 | /// <param name="shorthelp"></param> | 501 | /// <param name="shorthelp"></param> |
502 | /// <param name="longhelp"></param> | 502 | /// <param name="longhelp"></param> |
503 | /// <param name="callback"></param> | 503 | /// <param name="callback"></param> |
504 | public void AddCommand( | 504 | public void AddCommand( |
505 | string category, IRegionModuleBase module, string command, string shorthelp, string longhelp, CommandDelegate callback) | 505 | string category, IRegionModuleBase module, string command, string shorthelp, string longhelp, CommandDelegate callback) |
506 | { | 506 | { |
507 | AddCommand(category, module, command, shorthelp, longhelp, string.Empty, callback); | 507 | AddCommand(category, module, command, shorthelp, longhelp, string.Empty, callback); |
508 | } | 508 | } |
509 | 509 | ||
510 | /// <summary> | 510 | /// <summary> |
511 | /// Call this from a region module to add a command to the OpenSim console. | 511 | /// Call this from a region module to add a command to the OpenSim console. |
512 | /// </summary> | 512 | /// </summary> |
513 | /// <param name="mod"></param> | 513 | /// <param name="mod"></param> |
514 | /// <param name="command"></param> | 514 | /// <param name="command"></param> |
515 | /// <param name="shorthelp"></param> | 515 | /// <param name="shorthelp"></param> |
516 | /// <param name="longhelp"></param> | 516 | /// <param name="longhelp"></param> |
517 | /// <param name="descriptivehelp"></param> | 517 | /// <param name="descriptivehelp"></param> |
518 | /// <param name="callback"></param> | 518 | /// <param name="callback"></param> |
519 | public void AddCommand(IRegionModuleBase module, string command, string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback) | 519 | public void AddCommand(IRegionModuleBase module, string command, string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback) |
520 | { | 520 | { |
521 | string moduleName = ""; | 521 | string moduleName = ""; |
522 | 522 | ||
523 | if (module != null) | 523 | if (module != null) |
524 | moduleName = module.Name; | 524 | moduleName = module.Name; |
525 | 525 | ||
526 | AddCommand(moduleName, module, command, shorthelp, longhelp, descriptivehelp, callback); | 526 | AddCommand(moduleName, module, command, shorthelp, longhelp, descriptivehelp, callback); |
527 | } | 527 | } |
528 | 528 | ||
529 | /// <summary> | 529 | /// <summary> |
530 | /// Call this from a region module to add a command to the OpenSim console. | 530 | /// Call this from a region module to add a command to the OpenSim console. |
531 | /// </summary> | 531 | /// </summary> |
532 | /// <param name="category"> | 532 | /// <param name="category"> |
533 | /// Category of the command. This is the section under which it will appear when the user asks for help | 533 | /// Category of the command. This is the section under which it will appear when the user asks for help |
534 | /// </param> | 534 | /// </param> |
535 | /// <param name="mod"></param> | 535 | /// <param name="mod"></param> |
536 | /// <param name="command"></param> | 536 | /// <param name="command"></param> |
537 | /// <param name="shorthelp"></param> | 537 | /// <param name="shorthelp"></param> |
538 | /// <param name="longhelp"></param> | 538 | /// <param name="longhelp"></param> |
539 | /// <param name="descriptivehelp"></param> | 539 | /// <param name="descriptivehelp"></param> |
540 | /// <param name="callback"></param> | 540 | /// <param name="callback"></param> |
541 | public void AddCommand( | 541 | public void AddCommand( |
542 | string category, IRegionModuleBase module, string command, | 542 | string category, IRegionModuleBase module, string command, |
543 | string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback) | 543 | string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback) |
544 | { | 544 | { |
545 | if (MainConsole.Instance == null) | 545 | if (MainConsole.Instance == null) |
546 | return; | 546 | return; |
547 | 547 | ||
548 | bool shared = false; | 548 | bool shared = false; |
549 | 549 | ||
550 | if (module != null) | 550 | if (module != null) |
551 | shared = module is ISharedRegionModule; | 551 | shared = module is ISharedRegionModule; |
552 | 552 | ||
553 | MainConsole.Instance.Commands.AddCommand( | 553 | MainConsole.Instance.Commands.AddCommand( |
554 | category, shared, command, shorthelp, longhelp, descriptivehelp, callback); | 554 | category, shared, command, shorthelp, longhelp, descriptivehelp, callback); |
555 | } | 555 | } |
556 | 556 | ||
557 | public virtual ISceneObject DeserializeObject(string representation) | 557 | public virtual ISceneObject DeserializeObject(string representation) |
558 | { | 558 | { |
559 | return null; | 559 | return null; |
560 | } | 560 | } |
561 | 561 | ||
562 | public virtual bool AllowScriptCrossings | 562 | public virtual bool AllowScriptCrossings |
563 | { | 563 | { |
564 | get { return false; } | 564 | get { return false; } |
565 | } | 565 | } |
566 | 566 | ||
567 | public virtual void Start() | 567 | public virtual void Start() |
568 | { | 568 | { |
569 | } | 569 | } |
570 | 570 | ||
571 | public void Restart() | 571 | public void Restart() |
572 | { | 572 | { |
573 | // This has to be here to fire the event | 573 | // This has to be here to fire the event |
574 | restart handlerPhysicsCrash = OnRestart; | 574 | restart handlerPhysicsCrash = OnRestart; |
575 | if (handlerPhysicsCrash != null) | 575 | if (handlerPhysicsCrash != null) |
576 | handlerPhysicsCrash(RegionInfo); | 576 | handlerPhysicsCrash(RegionInfo); |
577 | } | 577 | } |
578 | 578 | ||
579 | public abstract bool CheckClient(UUID agentID, System.Net.IPEndPoint ep); | 579 | public abstract bool CheckClient(UUID agentID, System.Net.IPEndPoint ep); |
580 | } | 580 | } |
581 | } | 581 | } |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 8088dd3..24a92eb 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -3473,7 +3473,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3473 | landch.sendClientInitialLandInfo(ControllingClient); | 3473 | landch.sendClientInitialLandInfo(ControllingClient); |
3474 | } | 3474 | } |
3475 | } | 3475 | } |
3476 | m_scene.SendLayerData(ControllingClient); | ||
3477 | SendOtherAgentsAvatarDataToMe(); | 3476 | SendOtherAgentsAvatarDataToMe(); |
3478 | SendOtherAgentsAppearanceToMe(); | 3477 | SendOtherAgentsAppearanceToMe(); |
3479 | 3478 | ||
@@ -5427,7 +5426,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5427 | { | 5426 | { |
5428 | if (p.IsChildAgent) | 5427 | if (p.IsChildAgent) |
5429 | continue; | 5428 | continue; |
5430 | // m_log.Debug("[AVATAR]: viewMe: " + Lastname + " " + p.Lastname); | 5429 | m_log.Debug("[AVATAR]: viewMe: " + Lastname + " " + p.Lastname); |
5431 | ControllingClient.SendAvatarDataImmediate(p); | 5430 | ControllingClient.SendAvatarDataImmediate(p); |
5432 | p.SendAppearanceToAgent(this); | 5431 | p.SendAppearanceToAgent(this); |
5433 | p.SendAttachmentsToClient(ControllingClient); | 5432 | p.SendAttachmentsToClient(ControllingClient); |
@@ -5455,7 +5454,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5455 | { | 5454 | { |
5456 | foreach (ScenePresence p in killsToSendme) | 5455 | foreach (ScenePresence p in killsToSendme) |
5457 | { | 5456 | { |
5458 | // m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname); | 5457 | m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname); |
5459 | try { ControllingClient.SendKillObject(new List<uint> { p.LocalId }); } | 5458 | try { ControllingClient.SendKillObject(new List<uint> { p.LocalId }); } |
5460 | catch (NullReferenceException) { } | 5459 | catch (NullReferenceException) { } |
5461 | } | 5460 | } |
@@ -5500,7 +5499,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5500 | { | 5499 | { |
5501 | foreach (ScenePresence p in killsToSendto) | 5500 | foreach (ScenePresence p in killsToSendto) |
5502 | { | 5501 | { |
5503 | // m_log.Debug("[AVATAR]: killTo: " + Lastname + " " + p.Lastname); | 5502 | m_log.Debug("[AVATAR]: killTo: " + Lastname + " " + p.Lastname); |
5504 | try { p.ControllingClient.SendKillObject(new List<uint> { LocalId }); } | 5503 | try { p.ControllingClient.SendKillObject(new List<uint> { LocalId }); } |
5505 | catch (NullReferenceException) { } | 5504 | catch (NullReferenceException) { } |
5506 | } | 5505 | } |
@@ -5510,7 +5509,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5510 | { | 5509 | { |
5511 | foreach (ScenePresence p in killsToSendme) | 5510 | foreach (ScenePresence p in killsToSendme) |
5512 | { | 5511 | { |
5513 | // m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname); | 5512 | m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname); |
5514 | try { ControllingClient.SendKillObject(new List<uint> { p.LocalId }); } | 5513 | try { ControllingClient.SendKillObject(new List<uint> { p.LocalId }); } |
5515 | catch (NullReferenceException) { } | 5514 | catch (NullReferenceException) { } |
5516 | } | 5515 | } |
@@ -5520,7 +5519,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5520 | { | 5519 | { |
5521 | foreach (ScenePresence p in viewsToSendto) | 5520 | foreach (ScenePresence p in viewsToSendto) |
5522 | { | 5521 | { |
5523 | // m_log.Debug("[AVATAR]: viewTo: " + Lastname + " " + p.Lastname); | 5522 | m_log.Debug("[AVATAR]: viewTo: " + Lastname + " " + p.Lastname); |
5524 | p.ControllingClient.SendAvatarDataImmediate(this); | 5523 | p.ControllingClient.SendAvatarDataImmediate(this); |
5525 | SendAppearanceToAgent(p); | 5524 | SendAppearanceToAgent(p); |
5526 | SendAttachmentsToClient(p.ControllingClient); | 5525 | SendAttachmentsToClient(p.ControllingClient); |
@@ -5533,9 +5532,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
5533 | { | 5532 | { |
5534 | foreach (ScenePresence p in viewsToSendme) | 5533 | foreach (ScenePresence p in viewsToSendme) |
5535 | { | 5534 | { |
5535 | m_log.Debug("[AVATAR]: viewMe: " + Lastname + "<-" + p.Lastname); | ||
5536 | if (p.IsChildAgent) | 5536 | if (p.IsChildAgent) |
5537 | continue; | 5537 | continue; |
5538 | // m_log.Debug("[AVATAR]: viewMe: " + Lastname + "<-" + p.Lastname); | ||
5539 | ControllingClient.SendAvatarDataImmediate(p); | 5538 | ControllingClient.SendAvatarDataImmediate(p); |
5540 | p.SendAppearanceToAgent(this); | 5539 | p.SendAppearanceToAgent(this); |
5541 | p.SendAttachmentsToClient(ControllingClient); | 5540 | p.SendAttachmentsToClient(ControllingClient); |
@@ -5604,7 +5603,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5604 | { | 5603 | { |
5605 | foreach (ScenePresence p in killsToSendme) | 5604 | foreach (ScenePresence p in killsToSendme) |
5606 | { | 5605 | { |
5607 | // m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname); | 5606 | m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname); |
5608 | try { ControllingClient.SendKillObject(new List<uint> { p.LocalId }); } | 5607 | try { ControllingClient.SendKillObject(new List<uint> { p.LocalId }); } |
5609 | catch (NullReferenceException) { } | 5608 | catch (NullReferenceException) { } |
5610 | } | 5609 | } |
@@ -5753,7 +5752,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5753 | { | 5752 | { |
5754 | foreach (ScenePresence p in killsToSendto) | 5753 | foreach (ScenePresence p in killsToSendto) |
5755 | { | 5754 | { |
5756 | // m_log.Debug("[AVATAR]: killTo: " + Lastname + " " + p.Lastname); | 5755 | m_log.Debug("[AVATAR]: killTo: " + Lastname + " " + p.Lastname); |
5757 | try { p.ControllingClient.SendKillObject(new List<uint> { LocalId }); } | 5756 | try { p.ControllingClient.SendKillObject(new List<uint> { LocalId }); } |
5758 | catch (NullReferenceException) { } | 5757 | catch (NullReferenceException) { } |
5759 | } | 5758 | } |
@@ -5763,7 +5762,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5763 | { | 5762 | { |
5764 | foreach (ScenePresence p in killsToSendme) | 5763 | foreach (ScenePresence p in killsToSendme) |
5765 | { | 5764 | { |
5766 | // m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname); | 5765 | m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname); |
5767 | try {ControllingClient.SendKillObject(new List<uint> { p.LocalId }); } | 5766 | try {ControllingClient.SendKillObject(new List<uint> { p.LocalId }); } |
5768 | catch (NullReferenceException) { } | 5767 | catch (NullReferenceException) { } |
5769 | } | 5768 | } |