aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorMelanie2011-02-16 02:41:49 +0000
committerMelanie2011-02-16 02:41:49 +0000
commitccd6e5d07146b8dd033bd1af09594834e87a883b (patch)
treee7ed9506d70d67c37ac8d40f9620cbaa24747305 /OpenSim/Region/CoreModules
parentAdd the country functions in the careminster API (diff)
parentCatch HttpServer exception: mantis #5381 (diff)
downloadopensim-SC_OLD-ccd6e5d07146b8dd033bd1af09594834e87a883b.zip
opensim-SC_OLD-ccd6e5d07146b8dd033bd1af09594834e87a883b.tar.gz
opensim-SC_OLD-ccd6e5d07146b8dd033bd1af09594834e87a883b.tar.bz2
opensim-SC_OLD-ccd6e5d07146b8dd033bd1af09594834e87a883b.tar.xz
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs74
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs40
3 files changed, 94 insertions, 22 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index ca29a7c..e8f18e7 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -244,7 +244,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
244 } 244 }
245 catch (Exception e) 245 catch (Exception e)
246 { 246 {
247 m_log.WarnFormat("[ENTITY TRANSFER MODULE]: Exception on teleport: {0}\n{1}", e.Message, e.StackTrace); 247 m_log.WarnFormat("[ENTITY TRANSFER MODULE]: Exception on teleport: {0} {1}", e.Message, e.StackTrace);
248 sp.ControllingClient.SendTeleportFailed("Internal error"); 248 sp.ControllingClient.SendTeleportFailed("Internal error");
249 } 249 }
250 } 250 }
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs
index 14f5b1e..f6d1a82 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs
@@ -30,21 +30,29 @@ using System.Collections.Generic;
30using System.IO; 30using System.IO;
31using System.Reflection; 31using System.Reflection;
32using System.Security; 32using System.Security;
33using System.Text;
33using log4net; 34using log4net;
34using Nini.Config; 35using Nini.Config;
35using OpenMetaverse; 36using OpenMetaverse;
36using OpenSim.Framework; 37using OpenSim.Framework;
38using OpenSim.Framework.Console;
39using OpenSim.Region.CoreModules.Framework.InterfaceCommander;
37using OpenSim.Region.Framework.Interfaces; 40using OpenSim.Region.Framework.Interfaces;
38using OpenSim.Region.Framework.Scenes; 41using OpenSim.Region.Framework.Scenes;
39 42
40namespace OpenSim.Region.CoreModules.World.Estate 43namespace OpenSim.Region.CoreModules.World.Estate
41{ 44{
45 /// <summary>
46 /// Estate management console commands.
47 /// </summary>
42 public class EstateManagementCommands 48 public class EstateManagementCommands
43 { 49 {
44 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 50 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
45 51
46 protected EstateManagementModule m_module; 52 protected EstateManagementModule m_module;
47 53
54 protected Commander m_commander = new Commander("estate");
55
48 public EstateManagementCommands(EstateManagementModule module) 56 public EstateManagementCommands(EstateManagementModule module)
49 { 57 {
50 m_module = module; 58 m_module = module;
@@ -52,20 +60,60 @@ namespace OpenSim.Region.CoreModules.World.Estate
52 60
53 public void Initialise() 61 public void Initialise()
54 { 62 {
55 m_module.Scene.AddCommand(this, "set terrain texture", 63 m_log.DebugFormat("[ESTATE MODULE]: Setting up estate commands for region {0}", m_module.Scene.RegionInfo.RegionName);
64
65 m_module.Scene.AddCommand(m_module, "set terrain texture",
56 "set terrain texture <number> <uuid> [<x>] [<y>]", 66 "set terrain texture <number> <uuid> [<x>] [<y>]",
57 "Sets the terrain <number> to <uuid>, if <x> or <y> are specified, it will only " + 67 "Sets the terrain <number> to <uuid>, if <x> or <y> are specified, it will only " +
58 "set it on regions with a matching coordinate. Specify -1 in <x> or <y> to wildcard" + 68 "set it on regions with a matching coordinate. Specify -1 in <x> or <y> to wildcard" +
59 " that coordinate.", 69 " that coordinate.",
60 consoleSetTerrainTexture); 70 consoleSetTerrainTexture);
61 71
62 m_module.Scene.AddCommand(this, "set terrain heights", 72 m_module.Scene.AddCommand(m_module, "set terrain heights",
63 "set terrain heights <corner> <min> <max> [<x>] [<y>]", 73 "set terrain heights <corner> <min> <max> [<x>] [<y>]",
64 "Sets the terrain texture heights on corner #<corner> to <min>/<max>, if <x> or <y> are specified, it will only " + 74 "Sets the terrain texture heights on corner #<corner> to <min>/<max>, if <x> or <y> are specified, it will only " +
65 "set it on regions with a matching coordinate. Specify -1 in <x> or <y> to wildcard" + 75 "set it on regions with a matching coordinate. Specify -1 in <x> or <y> to wildcard" +
66 " that coordinate. Corner # SW = 0, NW = 1, SE = 2, NE = 3.", 76 " that coordinate. Corner # SW = 0, NW = 1, SE = 2, NE = 3.",
67 consoleSetTerrainHeights); 77 consoleSetTerrainHeights);
68 } 78
79 Command showCommand
80 = new Command("show", CommandIntentions.COMMAND_STATISTICAL, ShowEstatesCommand, "Shows all estates on the simulator.");
81
82 m_commander.RegisterCommand("show", showCommand);
83
84 m_module.Scene.RegisterModuleCommander(m_commander);
85
86 m_module.Scene.EventManager.OnPluginConsole += EventManagerOnPluginConsole;
87 }
88
89 public void Close()
90 {
91 m_module.Scene.EventManager.OnPluginConsole -= EventManagerOnPluginConsole;
92 m_module.Scene.UnregisterModuleCommander(m_commander.Name);
93 }
94
95 /// <summary>
96 /// Processes commandline input. Do not call directly.
97 /// </summary>
98 /// <param name="args">Commandline arguments</param>
99 protected void EventManagerOnPluginConsole(string[] args)
100 {
101 if (args[0] == "estate")
102 {
103 if (args.Length == 1)
104 {
105 m_commander.ProcessConsoleCommand("help", new string[0]);
106 return;
107 }
108
109 string[] tmpArgs = new string[args.Length - 2];
110 int i;
111 for (i = 2; i < args.Length; i++)
112 tmpArgs[i - 2] = args[i];
113
114 m_commander.ProcessConsoleCommand(args[1], tmpArgs);
115 }
116 }
69 117
70 protected void consoleSetTerrainTexture(string module, string[] args) 118 protected void consoleSetTerrainTexture(string module, string[] args)
71 { 119 {
@@ -152,5 +200,25 @@ namespace OpenSim.Region.CoreModules.World.Estate
152 } 200 }
153 } 201 }
154 } 202 }
203
204 protected void ShowEstatesCommand(Object[] args)
205 {
206 StringBuilder report = new StringBuilder();
207 RegionInfo ri = m_module.Scene.RegionInfo;
208 EstateSettings es = ri.EstateSettings;
209
210 report.AppendFormat("Estate information for region {0}\n", ri.RegionName);
211 report.AppendFormat(
212 "{0,-20} {1,-7} {2,-20}\n",
213 "Estate Name",
214 "ID",
215 "Owner");
216
217 report.AppendFormat(
218 "{0,-20} {1,-7} {2,-20}\n",
219 es.EstateName, es.EstateID, m_module.UserManager.GetUserName(es.EstateOwner));
220
221 MainConsole.Instance.Output(report.ToString());
222 }
155 } 223 }
156} \ No newline at end of file 224} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
index 0652ca7..34d0cfc 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
@@ -32,6 +32,7 @@ using System.Reflection;
32using System.Security; 32using System.Security;
33using System.Timers; 33using System.Timers;
34using log4net; 34using log4net;
35using Mono.Addins;
35using Nini.Config; 36using Nini.Config;
36using OpenMetaverse; 37using OpenMetaverse;
37using OpenSim.Framework; 38using OpenSim.Framework;
@@ -40,7 +41,8 @@ using OpenSim.Region.Framework.Scenes;
40 41
41namespace OpenSim.Region.CoreModules.World.Estate 42namespace OpenSim.Region.CoreModules.World.Estate
42{ 43{
43 public class EstateManagementModule : IEstateModule 44 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "EstateManagementModule")]
45 public class EstateManagementModule : IEstateModule, INonSharedRegionModule
44 { 46 {
45 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
46 48
@@ -48,8 +50,9 @@ namespace OpenSim.Region.CoreModules.World.Estate
48 50
49 private Timer m_regionChangeTimer = new Timer(); 51 private Timer m_regionChangeTimer = new Timer();
50 public Scene Scene { get; private set; } 52 public Scene Scene { get; private set; }
53 public IUserManagement UserManager { get; private set; }
51 54
52 protected EstateManagementCommands m_commands; 55 protected EstateManagementCommands m_commands;
53 56
54 private EstateTerrainXferHandler TerrainUploader; 57 private EstateTerrainXferHandler TerrainUploader;
55 58
@@ -909,9 +912,15 @@ namespace OpenSim.Region.CoreModules.World.Estate
909 #endregion 912 #endregion
910 913
911 #region IRegionModule Members 914 #region IRegionModule Members
915
916 public string Name { get { return "EstateManagementModule"; } }
917
918 public Type ReplaceableInterface { get { return null; } }
912 919
913 public void Initialise(Scene scene, IConfigSource source) 920 public void Initialise(IConfigSource source) {}
914 { 921
922 public void AddRegion(Scene scene)
923 {
915 m_regionChangeTimer.AutoReset = false; 924 m_regionChangeTimer.AutoReset = false;
916 m_regionChangeTimer.Interval = 2000; 925 m_regionChangeTimer.Interval = 2000;
917 m_regionChangeTimer.Elapsed += RaiseRegionInfoChange; 926 m_regionChangeTimer.Elapsed += RaiseRegionInfoChange;
@@ -924,26 +933,21 @@ namespace OpenSim.Region.CoreModules.World.Estate
924 m_commands = new EstateManagementCommands(this); 933 m_commands = new EstateManagementCommands(this);
925 m_commands.Initialise(); 934 m_commands.Initialise();
926 } 935 }
927 936
928 public void PostInitialise() 937 public void RemoveRegion(Scene scene) {}
938
939 public void RegionLoaded(Scene scene)
929 { 940 {
930 // Sets up the sun module based no the saved Estate and Region Settings 941 // Sets up the sun module based no the saved Estate and Region Settings
931 // DO NOT REMOVE or the sun will stop working 942 // DO NOT REMOVE or the sun will stop working
932 Scene.TriggerEstateSunUpdate(); 943 scene.TriggerEstateSunUpdate();
933 } 944
934 945 UserManager = scene.RequestModuleInterface<IUserManagement>();
935 public void Close()
936 {
937 }
938
939 public string Name
940 {
941 get { return "EstateManagementModule"; }
942 } 946 }
943 947
944 public bool IsSharedModule 948 public void Close()
945 { 949 {
946 get { return false; } 950 m_commands.Close();
947 } 951 }
948 952
949 #endregion 953 #endregion