aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/ApplicationPlugins
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs58
-rw-r--r--OpenSim/ApplicationPlugins/LoadRegions/Properties/AssemblyInfo.cs36
2 files changed, 94 insertions, 0 deletions
diff --git a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs
new file mode 100644
index 0000000..f0232e6
--- /dev/null
+++ b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs
@@ -0,0 +1,58 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim;
5using OpenSim.Framework.Console;
6using OpenSim.Framework;
7using OpenSim.Framework.RegionLoader.Filesystem;
8using OpenSim.Framework.RegionLoader.Web;
9using Mono.Addins;
10using Mono.Addins.Description;
11using Nini;
12using Nini.Config;
13
14[assembly:Addin]
15[assembly:AddinDependency ("OpenSim", "0.4")]
16
17namespace OpenSim.ApplicationPlugins.Example
18{
19 [Extension("/OpenSim/Startup")]
20 public class LoadRegionsPlugin : IApplicationPlugin
21 {
22 public void Initialise(OpenSimMain openSim)
23 {
24 System.Console.WriteLine("Load Regions addin being initialised");
25
26 IRegionLoader regionLoader;
27 if (openSim.ConfigSource.Configs["Startup"].GetString("region_info_source", "filesystem") == "filesystem")
28 {
29 MainLog.Instance.Notice("Loading Region Info from filesystem");
30 regionLoader = new RegionLoaderFileSystem();
31 }
32 else
33 {
34 MainLog.Instance.Notice("Loading Region Info from web");
35 regionLoader = new RegionLoaderWebServer();
36 }
37
38 regionLoader.SetIniConfigSource(openSim.ConfigSource);
39 RegionInfo[] regionsToLoad = regionLoader.LoadRegions();
40
41 openSim.ModuleLoader.LoadDefaultSharedModules();
42
43 for (int i = 0; i < regionsToLoad.Length; i++)
44 {
45 MainLog.Instance.Debug("Creating Region: " + regionsToLoad[i].RegionName);
46 openSim.CreateRegion(regionsToLoad[i]);
47 }
48
49 openSim.ModuleLoader.PostInitialise();
50 openSim.ModuleLoader.ClearCache();
51 }
52
53 public void Close()
54 {
55
56 }
57 }
58}
diff --git a/OpenSim/ApplicationPlugins/LoadRegions/Properties/AssemblyInfo.cs b/OpenSim/ApplicationPlugins/LoadRegions/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..0b5f4bd
--- /dev/null
+++ b/OpenSim/ApplicationPlugins/LoadRegions/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenSim.Addin")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("")]
12[assembly: AssemblyProduct("OpenSim.Addin")]
13[assembly: AssemblyCopyright("Copyright © 2007")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("45b979d9-d8d4-42fd-9780-fe9ac7e86cb4")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32// You can specify all the values or you can default the Build and Revision Numbers
33// by using the '*' as shown below:
34// [assembly: AssemblyVersion("1.0.*")]
35[assembly: AssemblyVersion("1.0.0.0")]
36[assembly: AssemblyFileVersion("1.0.0.0")]