aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs71
-rw-r--r--OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs1
-rw-r--r--OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs9
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs7
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs50
-rw-r--r--OpenSim/Region/CoreModules/World/Meta7Windlight/Meta7WindlightModule.cs245
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs17
-rw-r--r--OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs32
9 files changed, 372 insertions, 62 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
index 273c128..7e1bed5 100644
--- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
@@ -98,7 +98,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
98 /// <param name="godID">The person doing the kicking</param> 98 /// <param name="godID">The person doing the kicking</param>
99 /// <param name="sessionID">The session of the person doing the kicking</param> 99 /// <param name="sessionID">The session of the person doing the kicking</param>
100 /// <param name="agentID">the person that is being kicked</param> 100 /// <param name="agentID">the person that is being kicked</param>
101 /// <param name="kickflags">This isn't used apparently</param> 101 /// <param name="kickflags">Tells what to do to the user</param>
102 /// <param name="reason">The message to send to the user after it's been turned into a field</param> 102 /// <param name="reason">The message to send to the user after it's been turned into a field</param>
103 public void KickUser(UUID godID, UUID sessionID, UUID agentID, uint kickflags, byte[] reason) 103 public void KickUser(UUID godID, UUID sessionID, UUID agentID, uint kickflags, byte[] reason)
104 { 104 {
@@ -110,39 +110,56 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
110 { 110 {
111 if (m_scene.Permissions.IsGod(godID)) 111 if (m_scene.Permissions.IsGod(godID))
112 { 112 {
113 if (agentID == kickUserID) 113 if (kickflags == 0)
114 { 114 {
115 string reasonStr = Utils.BytesToString(reason); 115 if (agentID == kickUserID)
116 {
117 string reasonStr = Utils.BytesToString(reason);
116 118
117 m_scene.ForEachClient( 119 m_scene.ForEachClient(
118 delegate(IClientAPI controller) 120 delegate(IClientAPI controller)
119 { 121 {
120 if (controller.AgentId != godID) 122 if (controller.AgentId != godID)
121 controller.Kick(reasonStr); 123 controller.Kick(reasonStr);
122 } 124 }
123 ); 125 );
124 126
125 // This is a bit crude. It seems the client will be null before it actually stops the thread 127 // This is a bit crude. It seems the client will be null before it actually stops the thread
126 // The thread will kill itself eventually :/ 128 // The thread will kill itself eventually :/
127 // Is there another way to make sure *all* clients get this 'inter region' message? 129 // Is there another way to make sure *all* clients get this 'inter region' message?
128 m_scene.ForEachScenePresence( 130 m_scene.ForEachScenePresence(
129 delegate(ScenePresence p) 131 delegate(ScenePresence p)
130 {
131 if (p.UUID != godID && !p.IsChildAgent)
132 { 132 {
133 // Possibly this should really be p.Close() though that method doesn't send a close 133 if (p.UUID != godID && !p.IsChildAgent)
134 // to the client 134 {
135 p.ControllingClient.Close(); 135 // Possibly this should really be p.Close() though that method doesn't send a close
136 // to the client
137 p.ControllingClient.Close();
138 }
136 } 139 }
137 } 140 );
138 ); 141 }
142 else
143 {
144 m_scene.SceneGraph.removeUserCount(!sp.IsChildAgent);
145
146 sp.ControllingClient.Kick(Utils.BytesToString(reason));
147 sp.ControllingClient.Close();
148 }
139 } 149 }
140 else 150
151 if (kickflags == 1)
141 { 152 {
142 m_scene.SceneGraph.removeUserCount(!sp.IsChildAgent); 153 sp.AllowMovement = false;
143 154 m_dialogModule.SendAlertToUser(agentID, Utils.BytesToString(reason));
144 sp.ControllingClient.Kick(Utils.BytesToString(reason)); 155 m_dialogModule.SendAlertToUser(godID, "User Frozen");
145 sp.ControllingClient.Close(); 156 }
157
158 if (kickflags == 2)
159 {
160 sp.AllowMovement = true;
161 m_dialogModule.SendAlertToUser(agentID, Utils.BytesToString(reason));
162 m_dialogModule.SendAlertToUser(godID, "User Unfrozen");
146 } 163 }
147 } 164 }
148 else 165 else
diff --git a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs
index 62500a2..c727cec 100644
--- a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs
+++ b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs
@@ -527,7 +527,6 @@ namespace OpenSim.Region.CoreModules.InterGrid
527 userProfile.Partner = UUID.Zero; 527 userProfile.Partner = UUID.Zero;
528 userProfile.PasswordHash = "$1$"; 528 userProfile.PasswordHash = "$1$";
529 userProfile.PasswordSalt = ""; 529 userProfile.PasswordSalt = "";
530 userProfile.RootInventoryFolderID = UUID.Zero;
531 userProfile.SurName = agentData.lastname; 530 userProfile.SurName = agentData.lastname;
532 userProfile.UserAssetURI = homeScene.CommsManager.NetworkServersInfo.AssetURL; 531 userProfile.UserAssetURI = homeScene.CommsManager.NetworkServersInfo.AssetURL;
533 userProfile.UserFlags = 0; 532 userProfile.UserFlags = 0;
diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs
index d4a28e2..60df2e7 100644
--- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs
@@ -602,9 +602,12 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
602 ListenerInfo info = 602 ListenerInfo info =
603 ListenerInfo.FromData(localID, itemID, hostID, item); 603 ListenerInfo.FromData(localID, itemID, hostID, item);
604 604
605 if (!m_listeners.ContainsKey((int)item[2])) 605 lock (m_listeners)
606 m_listeners.Add((int)item[2], new List<ListenerInfo>()); 606 {
607 m_listeners[(int)item[2]].Add(info); 607 if (!m_listeners.ContainsKey((int)item[2]))
608 m_listeners.Add((int)item[2], new List<ListenerInfo>());
609 m_listeners[(int)item[2]].Add(info);
610 }
608 611
609 idx+=6; 612 idx+=6;
610 } 613 }
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs
index fca2df2..68499f3 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs
@@ -70,7 +70,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization
70 IConfig authorizationConfig = source.Configs["AuthorizationService"]; 70 IConfig authorizationConfig = source.Configs["AuthorizationService"];
71 if (authorizationConfig == null) 71 if (authorizationConfig == null)
72 { 72 {
73 m_log.Error("[REMOTE AUTHORIZATION CONNECTOR]: AuthorizationService missing from OpenSim.ini"); 73 m_log.Info("[REMOTE AUTHORIZATION CONNECTOR]: AuthorizationService missing from OpenSim.ini");
74 return; 74 return;
75 } 75 }
76 76
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
index 114dd13..3c0997c 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
@@ -453,6 +453,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
453 /// <summary> 453 /// <summary>
454 /// Resolve path to a working FileStream 454 /// Resolve path to a working FileStream
455 /// </summary> 455 /// </summary>
456 /// <param name="path"></param>
457 /// <returns></returns>
456 private Stream GetStream(string path) 458 private Stream GetStream(string path)
457 { 459 {
458 if (File.Exists(path)) 460 if (File.Exists(path))
@@ -499,8 +501,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver
499 WebResponse response = request.GetResponse(); 501 WebResponse response = request.GetResponse();
500 Stream file = response.GetResponseStream(); 502 Stream file = response.GetResponseStream();
501 503
502 if (response.ContentType != "application/x-oar") 504 // justincc: gonna ignore the content type for now and just try anything
503 throw new Exception(String.Format("{0} does not identify an OAR file", uri.ToString())); 505 //if (response.ContentType != "application/x-oar")
506 // throw new Exception(String.Format("{0} does not identify an OAR file", uri.ToString()));
504 507
505 if (response.ContentLength == 0) 508 if (response.ContentLength == 0)
506 throw new Exception(String.Format("{0} returned an empty file", uri.ToString())); 509 throw new Exception(String.Format("{0} returned an empty file", uri.ToString()));
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
index e3a395e..b1dcb14 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
@@ -471,20 +471,45 @@ namespace OpenSim.Region.CoreModules.World.Estate
471 if (terr != null) 471 if (terr != null)
472 { 472 {
473 m_log.Warn("[CLIENT]: Got Request to Send Terrain in region " + m_scene.RegionInfo.RegionName); 473 m_log.Warn("[CLIENT]: Got Request to Send Terrain in region " + m_scene.RegionInfo.RegionName);
474 if (File.Exists(Util.dataDir() + "/terrain.raw")) 474
475 {
476 File.Delete(Util.dataDir() + "/terrain.raw");
477 }
478 try 475 try
479 { 476 {
480 FileStream input = new FileStream(Util.dataDir() + "/terrain.raw", FileMode.CreateNew); 477
478 string localfilename = "terrain.raw";
479
480 if (terrainData.Length == 851968)
481 {
482 localfilename = Path.Combine(Util.dataDir(),"terrain.raw"); // It's a .LLRAW
483 }
484
485 if (terrainData.Length == 196662) // 24-bit 256x256 Bitmap
486 localfilename = Path.Combine(Util.dataDir(), "terrain.bmp");
487
488 if (terrainData.Length == 256 * 256 * 4) // It's a .R32
489 localfilename = Path.Combine(Util.dataDir(), "terrain.r32");
490
491 if (terrainData.Length == 256 * 256 * 8) // It's a .R64
492 localfilename = Path.Combine(Util.dataDir(), "terrain.r64");
493
494 if (File.Exists(localfilename))
495 {
496 File.Delete(localfilename);
497 }
498
499 FileStream input = new FileStream(localfilename, FileMode.CreateNew);
481 input.Write(terrainData, 0, terrainData.Length); 500 input.Write(terrainData, 0, terrainData.Length);
482 input.Close(); 501 input.Close();
502
503 FileInfo x = new FileInfo(localfilename);
504
505 terr.LoadFromFile(localfilename);
506 remoteClient.SendAlertMessage("Your terrain was loaded as a ." + x.Extension + " file. It may take a few moments to appear.");
507
483 } 508 }
484 catch (IOException e) 509 catch (IOException e)
485 { 510 {
486 m_log.ErrorFormat("[TERRAIN]: Error Saving a terrain file uploaded via the estate tools. It gave us the following error: {0}", e.ToString()); 511 m_log.ErrorFormat("[TERRAIN]: Error Saving a terrain file uploaded via the estate tools. It gave us the following error: {0}", e.ToString());
487 remoteClient.SendAlertMessage("There was an IO Exception loading your terrain. Please check free space"); 512 remoteClient.SendAlertMessage("There was an IO Exception loading your terrain. Please check free space.");
488 513
489 return; 514 return;
490 } 515 }
@@ -502,29 +527,16 @@ namespace OpenSim.Region.CoreModules.World.Estate
502 527
503 return; 528 return;
504 } 529 }
505
506
507
508
509 try
510 {
511 terr.LoadFromFile(Util.dataDir() + "/terrain.raw");
512 remoteClient.SendAlertMessage("Your terrain was loaded. Give it a minute or two to apply");
513 }
514 catch (Exception e) 530 catch (Exception e)
515 { 531 {
516 m_log.ErrorFormat("[TERRAIN]: Error loading a terrain file uploaded via the estate tools. It gave us the following error: {0}", e.ToString()); 532 m_log.ErrorFormat("[TERRAIN]: Error loading a terrain file uploaded via the estate tools. It gave us the following error: {0}", e.ToString());
517 remoteClient.SendAlertMessage("There was a general error loading your terrain. Please fix the terrain file and try again"); 533 remoteClient.SendAlertMessage("There was a general error loading your terrain. Please fix the terrain file and try again");
518 } 534 }
519
520 } 535 }
521 else 536 else
522 { 537 {
523 remoteClient.SendAlertMessage("Unable to apply terrain. Cannot get an instance of the terrain module"); 538 remoteClient.SendAlertMessage("Unable to apply terrain. Cannot get an instance of the terrain module");
524 } 539 }
525
526
527
528 } 540 }
529 541
530 private void handleUploadTerrain(IClientAPI remote_client, string clientFileName) 542 private void handleUploadTerrain(IClientAPI remote_client, string clientFileName)
diff --git a/OpenSim/Region/CoreModules/World/Meta7Windlight/Meta7WindlightModule.cs b/OpenSim/Region/CoreModules/World/Meta7Windlight/Meta7WindlightModule.cs
new file mode 100644
index 0000000..f180b47
--- /dev/null
+++ b/OpenSim/Region/CoreModules/World/Meta7Windlight/Meta7WindlightModule.cs
@@ -0,0 +1,245 @@
1/*
2 * Copyright (c) Thomas Grimshaw and Magne Metaverse Research
3 *
4 * This module is not open source. All rights reserved.
5 * Unauthorised copying, distribution or public display is prohibited.
6 *
7 */
8
9using System;
10using System.Collections.Generic;
11using System.IO;
12using System.Reflection;
13using OpenMetaverse;
14using log4net;
15using Nini.Config;
16using OpenSim.Data;
17using OpenSim.Framework;
18using OpenSim.Region.CoreModules.Framework.InterfaceCommander;
19using OpenSim.Region.Framework.Interfaces;
20using OpenSim.Region.Framework.Scenes;
21
22
23namespace OpenSim.Region.CoreModules.World.Meta7Windlight
24{
25 public class Meta7WindlightModule : IRegionModule, ICommandableModule
26 {
27 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
28 private readonly Commander m_commander = new Commander("windlight");
29 private Scene m_scene;
30 private static bool m_enableWindlight;
31
32 #region ICommandableModule Members
33
34 public ICommander CommandInterface
35 {
36 get { return m_commander; }
37 }
38
39 #endregion
40
41 #region IRegionModule Members
42
43 public static bool EnableWindlight
44 {
45 get
46 {
47 return m_enableWindlight;
48 }
49 set
50 {
51 }
52 }
53
54 public void Initialise(Scene scene, IConfigSource config)
55 {
56 m_scene = scene;
57 m_scene.RegisterModuleInterface<IRegionModule>(this);
58 m_scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole;
59
60 // ini file settings
61 try
62 {
63 m_enableWindlight = config.Configs["Meta7Windlight"].GetBoolean("enable_windlight", false);
64 }
65 catch (Exception)
66 {
67 m_log.Debug("[WINDLIGHT]: ini failure for enable_windlight - using default");
68 }
69
70 if (m_enableWindlight)
71 {
72 m_scene.EventManager.OnMakeRootAgent += EventManager_OnMakeRootAgent;
73 m_scene.EventManager.OnSaveNewWindlightProfile += EventManager_OnSaveNewWindlightProfile;
74 }
75
76 InstallCommands();
77
78 m_log.Debug("[WINDLIGHT]: Initialised windlight module");
79 }
80 public void SendProfileToClient(ScenePresence presence)
81 {
82 if (m_enableWindlight)
83 {
84 if (presence.IsChildAgent == false)
85 {
86 IClientAPI client = presence.ControllingClient;
87 RegionMeta7WindlightData wl = m_scene.RegionInfo.WindlightSettings;
88 byte[] mBlock = new Byte[249];
89 int pos = 0;
90
91 wl.waterColor.ToBytes(mBlock, 0); pos += 12;
92 Utils.FloatToBytes(wl.waterFogDensityExponent).CopyTo(mBlock, pos); pos += 4;
93 Utils.FloatToBytes(wl.underwaterFogModifier).CopyTo(mBlock, pos); pos += 4;
94 wl.reflectionWaveletScale.ToBytes(mBlock, pos); pos += 12;
95 Utils.FloatToBytes(wl.fresnelScale).CopyTo(mBlock, pos); pos += 4;
96 Utils.FloatToBytes(wl.fresnelOffset).CopyTo(mBlock, pos); pos += 4;
97 Utils.FloatToBytes(wl.refractScaleAbove).CopyTo(mBlock, pos); pos += 4;
98 Utils.FloatToBytes(wl.refractScaleBelow).CopyTo(mBlock, pos); pos += 4;
99 Utils.FloatToBytes(wl.blurMultiplier).CopyTo(mBlock, pos); pos += 4;
100 wl.bigWaveDirection.ToBytes(mBlock, pos); pos += 8;
101 wl.littleWaveDirection.ToBytes(mBlock, pos); pos += 8;
102 wl.normalMapTexture.ToBytes(mBlock, pos); pos += 16;
103 wl.horizon.ToBytes(mBlock, pos); pos += 16;
104 Utils.FloatToBytes(wl.hazeHorizon).CopyTo(mBlock, pos); pos += 4;
105 wl.blueDensity.ToBytes(mBlock, pos); pos += 16;
106 Utils.FloatToBytes(wl.hazeDensity).CopyTo(mBlock, pos); pos += 4;
107 Utils.FloatToBytes(wl.densityMultiplier).CopyTo(mBlock, pos); pos += 4;
108 Utils.FloatToBytes(wl.distanceMultiplier).CopyTo(mBlock, pos); pos += 4;
109 wl.sunMoonColor.ToBytes(mBlock, pos); pos += 16;
110 Utils.FloatToBytes(wl.sunMoonPosition).CopyTo(mBlock, pos); pos += 4;
111 wl.ambient.ToBytes(mBlock, pos); pos += 16;
112 Utils.FloatToBytes(wl.eastAngle).CopyTo(mBlock, pos); pos += 4;
113 Utils.FloatToBytes(wl.sunGlowFocus).CopyTo(mBlock, pos); pos += 4;
114 Utils.FloatToBytes(wl.sunGlowSize).CopyTo(mBlock, pos); pos += 4;
115 Utils.FloatToBytes(wl.sceneGamma).CopyTo(mBlock, pos); pos += 4;
116 Utils.FloatToBytes(wl.starBrightness).CopyTo(mBlock, pos); pos += 4;
117 wl.cloudColor.ToBytes(mBlock, pos); pos += 16;
118 wl.cloudXYDensity.ToBytes(mBlock, pos); pos += 12;
119 Utils.FloatToBytes(wl.cloudCoverage).CopyTo(mBlock, pos); pos += 4;
120 Utils.FloatToBytes(wl.cloudScale).CopyTo(mBlock, pos); pos += 4;
121 wl.cloudDetailXYDensity.ToBytes(mBlock, pos); pos += 12;
122 Utils.FloatToBytes(wl.cloudScrollX).CopyTo(mBlock, pos); pos += 4;
123 Utils.FloatToBytes(wl.cloudScrollY).CopyTo(mBlock, pos); pos += 4;
124 Utils.UInt16ToBytes(wl.maxAltitude).CopyTo(mBlock, pos); pos += 2;
125 mBlock[pos] = Convert.ToByte(wl.cloudScrollXLock); pos++;
126 mBlock[pos] = Convert.ToByte(wl.cloudScrollYLock); pos++;
127 mBlock[pos] = Convert.ToByte(wl.drawClassicClouds); pos++;
128 List<byte[]> param = new List<byte[]>();
129 param.Add(mBlock);
130
131 client.SendGenericMessage("Windlight", param);
132 }
133 }
134 else
135 {
136 //We probably don't want to spam chat with this.. probably
137 //m_log.Debug("[WINDLIGHT]: Module disabled");
138 }
139 }
140 private void EventManager_OnMakeRootAgent(ScenePresence presence)
141 {
142 m_log.Debug("[WINDLIGHT]: Sending windlight scene to new client");
143 SendProfileToClient(presence);
144 }
145
146 private void EventManager_OnSaveNewWindlightProfile()
147 {
148 m_scene.ForEachScenePresence(SendProfileToClient);
149 }
150
151 public void PostInitialise()
152 {
153
154 }
155
156 public void Close()
157 {
158 }
159
160 public string Name
161 {
162 get { return "Meta7WindlightModule"; }
163 }
164
165 public bool IsSharedModule
166 {
167 get { return false; }
168 }
169
170 #endregion
171
172 #region events
173
174 #endregion
175
176 #region ICommandableModule Members
177
178 private void InstallCommands()
179 {
180 Command wlload = new Command("load", CommandIntentions.COMMAND_NON_HAZARDOUS, HandleLoad, "Load windlight profile from the database and broadcast");
181 Command wlenable = new Command("enable", CommandIntentions.COMMAND_NON_HAZARDOUS, HandleEnable, "Enable the windlight plugin");
182 Command wldisable = new Command("disable", CommandIntentions.COMMAND_NON_HAZARDOUS, HandleDisable, "Enable the windlight plugin");
183
184 m_commander.RegisterCommand("load", wlload);
185 m_commander.RegisterCommand("enable", wlenable);
186 m_commander.RegisterCommand("disable", wldisable);
187
188 m_scene.RegisterModuleCommander(m_commander);
189 }
190
191 private void HandleLoad(Object[] args)
192 {
193 if (!m_enableWindlight)
194 {
195 m_log.InfoFormat("[WINDLIGHT]: Cannot load windlight profile, module disabled. Use 'windlight enable' first.");
196 }
197 else
198 {
199 m_log.InfoFormat("[WINDLIGHT]: Loading Windlight profile from database");
200 m_scene.LoadWindlightProfile();
201 m_log.InfoFormat("[WINDLIGHT]: Load complete");
202 }
203 }
204
205 private void HandleDisable(Object[] args)
206 {
207 m_log.InfoFormat("[WINDLIGHT]: Plugin now disabled");
208 m_enableWindlight=false;
209 }
210
211 private void HandleEnable(Object[] args)
212 {
213 m_log.InfoFormat("[WINDLIGHT]: Plugin now enabled");
214 m_enableWindlight = true;
215 }
216
217 /// <summary>
218 /// Processes commandline input. Do not call directly.
219 /// </summary>
220 /// <param name="args">Commandline arguments</param>
221 private void EventManager_OnPluginConsole(string[] args)
222 {
223 if (args[0] == "windlight")
224 {
225 if (args.Length == 1)
226 {
227 m_commander.ProcessConsoleCommand("add", new string[0]);
228 return;
229 }
230
231 string[] tmpArgs = new string[args.Length - 2];
232 int i;
233 for (i = 2; i < args.Length; i++)
234 {
235 tmpArgs[i - 2] = args[i];
236 }
237
238 m_commander.ProcessConsoleCommand(args[1], tmpArgs);
239 }
240 }
241 #endregion
242
243 }
244}
245
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index 013a0ef..c9b3071 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -800,30 +800,31 @@ namespace OpenSim.Region.CoreModules.World.Permissions
800 } 800 }
801 801
802 protected bool GenericParcelOwnerPermission(UUID user, ILandObject parcel, ulong groupPowers) 802 protected bool GenericParcelOwnerPermission(UUID user, ILandObject parcel, ulong groupPowers)
803 { 803 {
804 bool permission = false;
805
806 if (parcel.LandData.OwnerID == user) 804 if (parcel.LandData.OwnerID == user)
807 { 805 {
808 permission = true; 806 // Returning immediately so that group deeded objects on group deeded land don't trigger a NRE on
807 // the subsequent redundant checks when using lParcelMediaCommandList()
808 // See http://opensimulator.org/mantis/view.php?id=3999 for more details
809 return true;
809 } 810 }
810 811
811 if (parcel.LandData.IsGroupOwned && IsGroupMember(parcel.LandData.GroupID, user, groupPowers)) 812 if (parcel.LandData.IsGroupOwned && IsGroupMember(parcel.LandData.GroupID, user, groupPowers))
812 { 813 {
813 permission = true; 814 return true;
814 } 815 }
815 816
816 if (IsEstateManager(user)) 817 if (IsEstateManager(user))
817 { 818 {
818 permission = true; 819 return true;
819 } 820 }
820 821
821 if (IsAdministrator(user)) 822 if (IsAdministrator(user))
822 { 823 {
823 permission = true; 824 return true;
824 } 825 }
825 826
826 return permission; 827 return false;
827 } 828 }
828 829
829 protected bool GenericParcelPermission(UUID user, Vector3 pos, ulong groupPowers) 830 protected bool GenericParcelPermission(UUID user, Vector3 pos, ulong groupPowers)
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
index ba271fd..a40828b 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
@@ -29,6 +29,7 @@ using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.IO; 30using System.IO;
31using System.Reflection; 31using System.Reflection;
32using System.Net;
32using log4net; 33using log4net;
33using Nini.Config; 34using Nini.Config;
34using OpenMetaverse; 35using OpenMetaverse;
@@ -259,6 +260,16 @@ namespace OpenSim.Region.CoreModules.World.Terrain
259 } 260 }
260 261
261 /// <summary> 262 /// <summary>
263 /// Loads a terrain file from the specified URI
264 /// </summary>
265 /// <param name="filename">The name of the terrain to load</param>
266 /// <param name="pathToTerrainHeightmap">The URI to the terrain height map</param>
267 public void LoadFromStream(string filename, Uri pathToTerrainHeightmap)
268 {
269 LoadFromStream(filename, URIFetch(pathToTerrainHeightmap));
270 }
271
272 /// <summary>
262 /// Loads a terrain file from a stream and installs it in the scene. 273 /// Loads a terrain file from a stream and installs it in the scene.
263 /// </summary> 274 /// </summary>
264 /// <param name="filename">Filename to terrain file. Type is determined by extension.</param> 275 /// <param name="filename">Filename to terrain file. Type is determined by extension.</param>
@@ -267,7 +278,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
267 { 278 {
268 foreach (KeyValuePair<string, ITerrainLoader> loader in m_loaders) 279 foreach (KeyValuePair<string, ITerrainLoader> loader in m_loaders)
269 { 280 {
270 if (@filename.EndsWith(loader.Key)) 281 if (filename.EndsWith(loader.Key))
271 { 282 {
272 lock (m_scene) 283 lock (m_scene)
273 { 284 {
@@ -295,6 +306,25 @@ namespace OpenSim.Region.CoreModules.World.Terrain
295 throw new TerrainException(String.Format("unable to load heightmap from file {0}: no loader available for that format", filename)); 306 throw new TerrainException(String.Format("unable to load heightmap from file {0}: no loader available for that format", filename));
296 } 307 }
297 308
309 private static Stream URIFetch(Uri uri)
310 {
311 HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
312
313 // request.Credentials = credentials;
314
315 request.ContentLength = 0;
316 request.KeepAlive = false;
317
318 WebResponse response = request.GetResponse();
319 Stream file = response.GetResponseStream();
320
321 if (response.ContentLength == 0)
322 throw new Exception(String.Format("{0} returned an empty file", uri.ToString()));
323
324 // return new BufferedStream(file, (int) response.ContentLength);
325 return new BufferedStream(file, 1000000);
326 }
327
298 /// <summary> 328 /// <summary>
299 /// Modify Land 329 /// Modify Land
300 /// </summary> 330 /// </summary>