aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/General
diff options
context:
space:
mode:
authorTleiades Hax2007-10-13 07:26:21 +0000
committerTleiades Hax2007-10-13 07:26:21 +0000
commit1232eb1c587ffdc06c26a1c5b1b4fa5f22848754 (patch)
tree468fb8483a2cd03e472a6988ef60f1c8ff01c07e /OpenSim/Framework/General
parentChange 3 UserServer login messages from writeline to MainLog to help diagnose... (diff)
downloadopensim-SC_OLD-1232eb1c587ffdc06c26a1c5b1b4fa5f22848754.zip
opensim-SC_OLD-1232eb1c587ffdc06c26a1c5b1b4fa5f22848754.tar.gz
opensim-SC_OLD-1232eb1c587ffdc06c26a1c5b1b4fa5f22848754.tar.bz2
opensim-SC_OLD-1232eb1c587ffdc06c26a1c5b1b4fa5f22848754.tar.xz
Asset server implementation. Again one of these "plumbing" releases, where no real functionality has been introduced, but ground work has been made, enabling the asset server, and preparing the sim server to query the asset server.
Introduced an "IPlugin" interface, which plugins can inherit from.
Diffstat (limited to 'OpenSim/Framework/General')
-rw-r--r--OpenSim/Framework/General/Configuration/AssetConfig.cs54
-rw-r--r--OpenSim/Framework/General/Interfaces/IAssetProvider.cs3
-rw-r--r--OpenSim/Framework/General/Interfaces/IPlugin.cs29
3 files changed, 84 insertions, 2 deletions
diff --git a/OpenSim/Framework/General/Configuration/AssetConfig.cs b/OpenSim/Framework/General/Configuration/AssetConfig.cs
new file mode 100644
index 0000000..e5f1c88
--- /dev/null
+++ b/OpenSim/Framework/General/Configuration/AssetConfig.cs
@@ -0,0 +1,54 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Framework.Configuration
6{
7 /// <summary>
8 /// UserConfig -- For User Server Configuration
9 /// </summary>
10 public class AssetConfig
11 {
12 public string DefaultStartupMsg = "";
13
14 public string DatabaseProvider = "";
15
16 public uint HttpPort = 8003;
17
18 private ConfigurationMember configMember;
19
20 public AssetConfig(string description, string filename)
21 {
22 configMember = new ConfigurationMember(filename, description, this.loadConfigurationOptions, this.handleIncomingConfiguration);
23 configMember.performConfigurationRetrieve();
24 }
25
26 public void loadConfigurationOptions()
27 {
28 configMember.addConfigurationOption("default_startup_message", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default Startup Message", "Welcome to OGS", false);
29
30 configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "DLL for database provider", "OpenSim.Framework.Data.MySQL.dll", false);
31
32 configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Http Listener port", "8003", false);
33
34 }
35
36 public bool handleIncomingConfiguration(string configuration_key, object configuration_result)
37 {
38 switch (configuration_key)
39 {
40 case "default_startup_message":
41 this.DefaultStartupMsg = (string)configuration_result;
42 break;
43 case "database_provider":
44 this.DatabaseProvider = (string)configuration_result;
45 break;
46 case "http_port":
47 HttpPort = (uint)configuration_result;
48 break;
49 }
50
51 return true;
52 }
53 }
54}
diff --git a/OpenSim/Framework/General/Interfaces/IAssetProvider.cs b/OpenSim/Framework/General/Interfaces/IAssetProvider.cs
index daf9d6d..0b39d1f 100644
--- a/OpenSim/Framework/General/Interfaces/IAssetProvider.cs
+++ b/OpenSim/Framework/General/Interfaces/IAssetProvider.cs
@@ -6,9 +6,8 @@ using libsecondlife;
6 6
7namespace OpenSim.Framework.Interfaces 7namespace OpenSim.Framework.Interfaces
8{ 8{
9 public interface IAssetProvider 9 public interface IAssetProvider : IPlugin
10 { 10 {
11 void Initialise(string dbfile, string dbname);
12 AssetBase FetchAsset(LLUUID uuid); 11 AssetBase FetchAsset(LLUUID uuid);
13 void CreateAsset(AssetBase asset); 12 void CreateAsset(AssetBase asset);
14 void UpdateAsset(AssetBase asset); 13 void UpdateAsset(AssetBase asset);
diff --git a/OpenSim/Framework/General/Interfaces/IPlugin.cs b/OpenSim/Framework/General/Interfaces/IPlugin.cs
new file mode 100644
index 0000000..ceb8b63
--- /dev/null
+++ b/OpenSim/Framework/General/Interfaces/IPlugin.cs
@@ -0,0 +1,29 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Framework.Interfaces
6{
7 /// <summary>
8 /// This interface, describes a generic plugin
9 /// </summary>
10 public interface IPlugin
11 {
12 /// <summary>
13 /// Returns the plugin version
14 /// </summary>
15 /// <returns>Plugin version in MAJOR.MINOR.REVISION.BUILD format</returns>
16 string Version { get; }
17
18 /// <summary>
19 /// Returns the plugin name
20 /// </summary>
21 /// <returns>Plugin name, eg MySQL User Provider</returns>
22 string Name { get; }
23
24 /// <summary>
25 /// Initialises the plugin (artificial constructor)
26 /// </summary>
27 void Initialise();
28 }
29}