diff options
author | Melanie | 2010-03-09 22:46:17 +0000 |
---|---|---|
committer | Melanie | 2010-03-09 22:46:17 +0000 |
commit | 40873504dcde19a3738cf4d3a4928a59b811e8f0 (patch) | |
tree | 605d2c2575e21496b05eeabd0a5755b8fa788efd /OpenSim/Region/CoreModules | |
parent | - parcel blocking, region crossing blocking, teleport blocking (diff) | |
parent | Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff) | |
download | opensim-SC_OLD-40873504dcde19a3738cf4d3a4928a59b811e8f0.zip opensim-SC_OLD-40873504dcde19a3738cf4d3a4928a59b811e8f0.tar.gz opensim-SC_OLD-40873504dcde19a3738cf4d3a4928a59b811e8f0.tar.bz2 opensim-SC_OLD-40873504dcde19a3738cf4d3a4928a59b811e8f0.tar.xz |
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/CoreModules')
9 files changed, 91 insertions, 42 deletions
diff --git a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs index 50c83b5..1386e86 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs | |||
@@ -60,6 +60,8 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender | |||
60 | 60 | ||
61 | #region IRegionModule | 61 | #region IRegionModule |
62 | 62 | ||
63 | private bool m_useCSJ2K = true; | ||
64 | |||
63 | public string Name { get { return "J2KDecoderModule"; } } | 65 | public string Name { get { return "J2KDecoderModule"; } } |
64 | public bool IsSharedModule { get { return true; } } | 66 | public bool IsSharedModule { get { return true; } } |
65 | 67 | ||
@@ -73,6 +75,12 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender | |||
73 | m_scene = scene; | 75 | m_scene = scene; |
74 | 76 | ||
75 | scene.RegisterModuleInterface<IJ2KDecoder>(this); | 77 | scene.RegisterModuleInterface<IJ2KDecoder>(this); |
78 | |||
79 | IConfig startupConfig = source.Configs["Startup"]; | ||
80 | if (startupConfig != null) | ||
81 | { | ||
82 | m_useCSJ2K = startupConfig.GetBoolean("UseCSJ2K", m_useCSJ2K); | ||
83 | } | ||
76 | } | 84 | } |
77 | 85 | ||
78 | public void PostInitialise() | 86 | public void PostInitialise() |
@@ -144,41 +152,52 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender | |||
144 | /// <param name="j2kData">JPEG2000 data</param> | 152 | /// <param name="j2kData">JPEG2000 data</param> |
145 | private void DoJ2KDecode(UUID assetID, byte[] j2kData) | 153 | private void DoJ2KDecode(UUID assetID, byte[] j2kData) |
146 | { | 154 | { |
147 | // int DecodeTime = 0; | 155 | //int DecodeTime = 0; |
148 | // DecodeTime = Environment.TickCount; | 156 | //DecodeTime = Environment.TickCount; |
149 | OpenJPEG.J2KLayerInfo[] layers; | 157 | OpenJPEG.J2KLayerInfo[] layers; |
150 | 158 | ||
151 | if (!TryLoadCacheForAsset(assetID, out layers)) | 159 | if (!TryLoadCacheForAsset(assetID, out layers)) |
152 | { | 160 | { |
153 | try | 161 | if (m_useCSJ2K) |
154 | { | 162 | { |
155 | List<int> layerStarts = CSJ2K.J2kImage.GetLayerBoundaries(new MemoryStream(j2kData)); | 163 | try |
156 | |||
157 | if (layerStarts != null && layerStarts.Count > 0) | ||
158 | { | 164 | { |
159 | layers = new OpenJPEG.J2KLayerInfo[layerStarts.Count]; | 165 | List<int> layerStarts = CSJ2K.J2kImage.GetLayerBoundaries(new MemoryStream(j2kData)); |
160 | 166 | ||
161 | for (int i = 0; i < layerStarts.Count; i++) | 167 | if (layerStarts != null && layerStarts.Count > 0) |
162 | { | 168 | { |
163 | OpenJPEG.J2KLayerInfo layer = new OpenJPEG.J2KLayerInfo(); | 169 | layers = new OpenJPEG.J2KLayerInfo[layerStarts.Count]; |
170 | |||
171 | for (int i = 0; i < layerStarts.Count; i++) | ||
172 | { | ||
173 | OpenJPEG.J2KLayerInfo layer = new OpenJPEG.J2KLayerInfo(); | ||
164 | 174 | ||
165 | if (i == 0) | 175 | if (i == 0) |
166 | layer.Start = 0; | 176 | layer.Start = 0; |
167 | else | 177 | else |
168 | layer.Start = layerStarts[i]; | 178 | layer.Start = layerStarts[i]; |
169 | 179 | ||
170 | if (i == layerStarts.Count - 1) | 180 | if (i == layerStarts.Count - 1) |
171 | layer.End = j2kData.Length; | 181 | layer.End = j2kData.Length; |
172 | else | 182 | else |
173 | layer.End = layerStarts[i + 1] - 1; | 183 | layer.End = layerStarts[i + 1] - 1; |
174 | 184 | ||
175 | layers[i] = layer; | 185 | layers[i] = layer; |
186 | } | ||
176 | } | 187 | } |
177 | } | 188 | } |
189 | catch (Exception ex) | ||
190 | { | ||
191 | m_log.Warn("[J2KDecoderModule]: CSJ2K threw an exception decoding texture " + assetID + ": " + ex.Message); | ||
192 | } | ||
178 | } | 193 | } |
179 | catch (Exception ex) | 194 | else |
180 | { | 195 | { |
181 | m_log.Warn("[J2KDecoderModule]: CSJ2K threw an exception decoding texture " + assetID + ": " + ex.Message); | 196 | int components; |
197 | if (!OpenJPEG.DecodeLayerBoundaries(j2kData, out layers, out components)) | ||
198 | { | ||
199 | m_log.Warn("[J2KDecoderModule]: OpenJPEG failed to decode texture " + assetID); | ||
200 | } | ||
182 | } | 201 | } |
183 | 202 | ||
184 | if (layers == null || layers.Length == 0) | 203 | if (layers == null || layers.Length == 0) |
diff --git a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs index fac052a..b8e013c 100644 --- a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs | |||
@@ -25,6 +25,7 @@ | |||
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.Collections.Generic; | 29 | using System.Collections.Generic; |
29 | using System.Reflection; | 30 | using System.Reflection; |
30 | using log4net; | 31 | using log4net; |
@@ -151,7 +152,30 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog | |||
151 | // region as the sending avatar. | 152 | // region as the sending avatar. |
152 | SendNotificationToUsersInRegion(fromAvatarID, fromAvatarName, message); | 153 | SendNotificationToUsersInRegion(fromAvatarID, fromAvatarName, message); |
153 | } | 154 | } |
154 | 155 | ||
156 | public void SendTextBoxToUser(UUID avatarid, string message, int chatChannel, string name, UUID objectid, UUID ownerid) | ||
157 | { | ||
158 | UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, ownerid); | ||
159 | string ownerFirstName, ownerLastName; | ||
160 | if (account != null) | ||
161 | { | ||
162 | ownerFirstName = account.FirstName; | ||
163 | ownerLastName = account.LastName; | ||
164 | } | ||
165 | else | ||
166 | { | ||
167 | ownerFirstName = "(unknown"; | ||
168 | ownerLastName = "user)"; | ||
169 | } | ||
170 | |||
171 | |||
172 | ScenePresence sp = m_scene.GetScenePresence(avatarid); | ||
173 | |||
174 | if (sp != null) { | ||
175 | sp.ControllingClient.SendTextBoxRequest(message, chatChannel, name, ownerFirstName, ownerLastName, objectid); | ||
176 | } | ||
177 | } | ||
178 | |||
155 | public void SendNotificationToUsersInRegion( | 179 | public void SendNotificationToUsersInRegion( |
156 | UUID fromAvatarID, string fromAvatarName, string message) | 180 | UUID fromAvatarID, string fromAvatarName, string message) |
157 | { | 181 | { |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/RemoteAssetServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/RemoteAssetServiceConnector.cs index 4eff60e..8a22cfc 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/RemoteAssetServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/RemoteAssetServiceConnector.cs | |||
@@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
69 | IConfig assetConfig = source.Configs["AssetService"]; | 69 | IConfig assetConfig = source.Configs["AssetService"]; |
70 | if (assetConfig == null) | 70 | if (assetConfig == null) |
71 | { | 71 | { |
72 | m_log.Error("[ASSET CONNECTOR]: AssetService missing from OpanSim.ini"); | 72 | m_log.Error("[ASSET CONNECTOR]: AssetService missing from OpenSim.ini"); |
73 | return; | 73 | return; |
74 | } | 74 | } |
75 | 75 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Avatar/RemoteAvatarServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Avatar/RemoteAvatarServiceConnector.cs index 48759b5..d665a54 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Avatar/RemoteAvatarServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Avatar/RemoteAvatarServiceConnector.cs | |||
@@ -66,7 +66,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Avatar | |||
66 | IConfig userConfig = source.Configs["AvatarService"]; | 66 | IConfig userConfig = source.Configs["AvatarService"]; |
67 | if (userConfig == null) | 67 | if (userConfig == null) |
68 | { | 68 | { |
69 | m_log.Error("[AVATAR CONNECTOR]: AvatarService missing from OpanSim.ini"); | 69 | m_log.Error("[AVATAR CONNECTOR]: AvatarService missing from OpenSim.ini"); |
70 | return; | 70 | return; |
71 | } | 71 | } |
72 | 72 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs index 891fc14..e98df28 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs | |||
@@ -77,23 +77,28 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence | |||
77 | 77 | ||
78 | public void OnNewClient(IClientAPI client) | 78 | public void OnNewClient(IClientAPI client) |
79 | { | 79 | { |
80 | client.OnLogout += OnLogout; | 80 | client.OnConnectionClosed += OnConnectionClose; |
81 | } | 81 | } |
82 | 82 | ||
83 | public void OnLogout(IClientAPI client) | 83 | public void OnConnectionClose(IClientAPI client) |
84 | { | 84 | { |
85 | client.OnLogout -= OnLogout; | 85 | if (client.IsLoggingOut) |
86 | |||
87 | ScenePresence sp = null; | ||
88 | Vector3 position = new Vector3(128, 128, 0); | ||
89 | Vector3 lookat = new Vector3(0, 1, 0); | ||
90 | |||
91 | if (m_aScene.TryGetAvatar(client.AgentId, out sp)) | ||
92 | { | 86 | { |
93 | position = sp.AbsolutePosition; | 87 | object sp = null; |
94 | lookat = sp.Lookat; | 88 | Vector3 position = new Vector3(128, 128, 0); |
89 | Vector3 lookat = new Vector3(0, 1, 0); | ||
90 | |||
91 | if (client.Scene.TryGetAvatar(client.AgentId, out sp)) | ||
92 | { | ||
93 | if (sp is ScenePresence) | ||
94 | { | ||
95 | position = ((ScenePresence)sp).AbsolutePosition; | ||
96 | lookat = ((ScenePresence)sp).Lookat; | ||
97 | } | ||
98 | } | ||
99 | |||
100 | m_PresenceService.LogoutAgent(client.SessionId, position, lookat); | ||
95 | } | 101 | } |
96 | m_PresenceService.LogoutAgent(client.SessionId, position, lookat); | ||
97 | 102 | ||
98 | } | 103 | } |
99 | } | 104 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs index e913891..783d606 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs | |||
@@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
69 | //IConfig userConfig = config.Configs["SimulationService"]; | 69 | //IConfig userConfig = config.Configs["SimulationService"]; |
70 | //if (userConfig == null) | 70 | //if (userConfig == null) |
71 | //{ | 71 | //{ |
72 | // m_log.Error("[AVATAR CONNECTOR]: SimulationService missing from OpanSim.ini"); | 72 | // m_log.Error("[AVATAR CONNECTOR]: SimulationService missing from OpenSim.ini"); |
73 | // return; | 73 | // return; |
74 | //} | 74 | //} |
75 | 75 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs index 2b1f815..4d82a05 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs | |||
@@ -74,7 +74,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
74 | //IConfig userConfig = config.Configs["SimulationService"]; | 74 | //IConfig userConfig = config.Configs["SimulationService"]; |
75 | //if (userConfig == null) | 75 | //if (userConfig == null) |
76 | //{ | 76 | //{ |
77 | // m_log.Error("[AVATAR CONNECTOR]: SimulationService missing from OpanSim.ini"); | 77 | // m_log.Error("[AVATAR CONNECTOR]: SimulationService missing from OpenSim.ini"); |
78 | // return; | 78 | // return; |
79 | //} | 79 | //} |
80 | 80 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs index 13acdf2..1140692 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs | |||
@@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
69 | IConfig userConfig = source.Configs["UserAccountService"]; | 69 | IConfig userConfig = source.Configs["UserAccountService"]; |
70 | if (userConfig == null) | 70 | if (userConfig == null) |
71 | { | 71 | { |
72 | m_log.Error("[USER CONNECTOR]: UserAccountService missing from OpanSim.ini"); | 72 | m_log.Error("[USER CONNECTOR]: UserAccountService missing from OpenSim.ini"); |
73 | return; | 73 | return; |
74 | } | 74 | } |
75 | 75 | ||
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 4652d70..2211f3e 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -609,16 +609,17 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
609 | if (IsFriendWithPerms(user, objectOwner)) | 609 | if (IsFriendWithPerms(user, objectOwner)) |
610 | return objectOwnerMask; | 610 | return objectOwnerMask; |
611 | 611 | ||
612 | // Estate users should be able to edit anything in the sim | 612 | // Estate users should be able to edit anything in the sim if RegionOwnerIsGod is set |
613 | if (IsEstateManager(user) && m_RegionOwnerIsGod && (!IsAdministrator(objectOwner)) || objectOwner == user) | 613 | if (IsEstateManager(user) && m_RegionOwnerIsGod) |
614 | return objectOwnerMask; | 614 | return objectOwnerMask; |
615 | 615 | ||
616 | // Admin should be able to edit anything in the sim (including admin objects) | 616 | // Admin should be able to edit anything in the sim (including admin objects) |
617 | if (IsAdministrator(user)) | 617 | if (IsAdministrator(user)) |
618 | return objectOwnerMask; | 618 | return objectOwnerMask; |
619 | 619 | ||
620 | // Users should be able to edit what is over their land. | 620 | // Users should be able to edit what is over their land. |
621 | ILandObject parcel = m_scene.LandChannel.GetLandObject(task.AbsolutePosition.X, task.AbsolutePosition.Y); | 621 | Vector3 taskPos = task.AbsolutePosition; |
622 | ILandObject parcel = m_scene.LandChannel.GetLandObject(taskPos.X, taskPos.Y); | ||
622 | if (parcel != null && parcel.LandData.OwnerID == user && m_ParcelOwnerIsGod) | 623 | if (parcel != null && parcel.LandData.OwnerID == user && m_ParcelOwnerIsGod) |
623 | { | 624 | { |
624 | // Admin objects should not be editable by the above | 625 | // Admin objects should not be editable by the above |