aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.RegionServer/Grid.cs
diff options
context:
space:
mode:
authorMW2007-05-24 12:16:50 +0000
committerMW2007-05-24 12:16:50 +0000
commit3376b82501000692d6dac24b051af738cdaf2737 (patch)
tree90ed0a5d4955236f011fa63fce9d555186b0d179 /OpenSim.RegionServer/Grid.cs
parentAdded "terrain save grdmap <filename> <gradientmap>" function to console. Gra... (diff)
downloadopensim-SC_OLD-3376b82501000692d6dac24b051af738cdaf2737.zip
opensim-SC_OLD-3376b82501000692d6dac24b051af738cdaf2737.tar.gz
opensim-SC_OLD-3376b82501000692d6dac24b051af738cdaf2737.tar.bz2
opensim-SC_OLD-3376b82501000692d6dac24b051af738cdaf2737.tar.xz
Some more code refactoring, plus a restructuring of the directories so that the Grid servers can be a separate solution to the region server.
Diffstat (limited to 'OpenSim.RegionServer/Grid.cs')
-rw-r--r--OpenSim.RegionServer/Grid.cs90
1 files changed, 0 insertions, 90 deletions
diff --git a/OpenSim.RegionServer/Grid.cs b/OpenSim.RegionServer/Grid.cs
deleted file mode 100644
index db5b8fe..0000000
--- a/OpenSim.RegionServer/Grid.cs
+++ /dev/null
@@ -1,90 +0,0 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.Reflection;
5using OpenSim.Framework.Interfaces;
6using OpenSim.UserServer;
7
8namespace OpenSim
9{
10 public class Grid
11 {
12 public IAssetServer AssetServer;
13 public IGridServer GridServer;
14 public IUserServer UserServer;
15 public string AssetDll = "";
16 public string GridDll = "";
17
18 public Grid()
19 {
20 }
21
22 public virtual void Initialise()
23 {
24 //load the dlls
25 this.AssetServer = this.LoadAssetDll(this.AssetDll);
26 this.GridServer = this.LoadGridDll(this.GridDll);
27 }
28 public virtual void Close()
29 {
30 this.AssetServer.Close();
31 this.GridServer.Close();
32 }
33
34 private IAssetServer LoadAssetDll(string dllName)
35 {
36 Assembly pluginAssembly = Assembly.LoadFrom(dllName);
37 IAssetServer server = null;
38
39 foreach (Type pluginType in pluginAssembly.GetTypes())
40 {
41 if (pluginType.IsPublic)
42 {
43 if (!pluginType.IsAbstract)
44 {
45 Type typeInterface = pluginType.GetInterface("IAssetPlugin", true);
46
47 if (typeInterface != null)
48 {
49 IAssetPlugin plug = (IAssetPlugin)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
50 server = plug.GetAssetServer();
51 break;
52 }
53
54 typeInterface = null;
55 }
56 }
57 }
58 pluginAssembly = null;
59 return server;
60 }
61
62 private IGridServer LoadGridDll(string dllName)
63 {
64 Assembly pluginAssembly = Assembly.LoadFrom(dllName);
65 IGridServer server = null;
66
67 foreach (Type pluginType in pluginAssembly.GetTypes())
68 {
69 if (pluginType.IsPublic)
70 {
71 if (!pluginType.IsAbstract)
72 {
73 Type typeInterface = pluginType.GetInterface("IGridPlugin", true);
74
75 if (typeInterface != null)
76 {
77 IGridPlugin plug = (IGridPlugin)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
78 server = plug.GetGridServer();
79 break;
80 }
81
82 typeInterface = null;
83 }
84 }
85 }
86 pluginAssembly = null;
87 return server;
88 }
89 }
90}