diff options
author | Justin Clarke Casey | 2008-02-04 18:52:24 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-02-04 18:52:24 +0000 |
commit | baefa05b575b28e1ed08670e9c937ca307f09269 (patch) | |
tree | 8f9703391fe86df4ecc1008a140e1ea760c1ae1b /OpenSim/Grid/AssetServer | |
parent | Change sim command from "stats" to "show stats" for consistency (diff) | |
download | opensim-SC_OLD-baefa05b575b28e1ed08670e9c937ca307f09269.zip opensim-SC_OLD-baefa05b575b28e1ed08670e9c937ca307f09269.tar.gz opensim-SC_OLD-baefa05b575b28e1ed08670e9c937ca307f09269.tar.bz2 opensim-SC_OLD-baefa05b575b28e1ed08670e9c937ca307f09269.tar.xz |
* Rebase all current servers on common abstract BaseOpenSimServer class
* The immediate upshot is that "show uptime" from the console will now show uptime on all server types (user, asset, grid, etc)
* DEV: This refactoring is far from complete - only just enough to makes the "show uptime" command common accross the servers. More is needed, but in this case it's somewhat like eating cabbage, which I prefer not to do all at once
Diffstat (limited to 'OpenSim/Grid/AssetServer')
-rw-r--r-- | OpenSim/Grid/AssetServer/Main.cs | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/OpenSim/Grid/AssetServer/Main.cs b/OpenSim/Grid/AssetServer/Main.cs index 23b0afa..a95ea71 100644 --- a/OpenSim/Grid/AssetServer/Main.cs +++ b/OpenSim/Grid/AssetServer/Main.cs | |||
@@ -41,13 +41,11 @@ namespace OpenSim.Grid.AssetServer | |||
41 | /// <summary> | 41 | /// <summary> |
42 | /// An asset server | 42 | /// An asset server |
43 | /// </summary> | 43 | /// </summary> |
44 | public class OpenAsset_Main : conscmd_callback | 44 | public class OpenAsset_Main : BaseOpenSimServer, conscmd_callback |
45 | { | 45 | { |
46 | public AssetConfig m_config; | 46 | public AssetConfig m_config; |
47 | 47 | ||
48 | public static OpenAsset_Main assetserver; | 48 | public static OpenAsset_Main assetserver; |
49 | |||
50 | private LogBase m_console; | ||
51 | 49 | ||
52 | // Temporarily hardcoded - should be a plugin | 50 | // Temporarily hardcoded - should be a plugin |
53 | protected IAssetLoader assetLoader = new AssetLoaderFileSystem(); | 51 | protected IAssetLoader assetLoader = new AssetLoaderFileSystem(); |
@@ -67,11 +65,11 @@ namespace OpenSim.Grid.AssetServer | |||
67 | 65 | ||
68 | private void Work() | 66 | private void Work() |
69 | { | 67 | { |
70 | m_console.Notice("Enter help for a list of commands"); | 68 | m_log.Notice("Enter help for a list of commands"); |
71 | 69 | ||
72 | while (true) | 70 | while (true) |
73 | { | 71 | { |
74 | m_console.MainLogPrompt(); | 72 | m_log.MainLogPrompt(); |
75 | } | 73 | } |
76 | } | 74 | } |
77 | 75 | ||
@@ -81,22 +79,28 @@ namespace OpenSim.Grid.AssetServer | |||
81 | { | 79 | { |
82 | Directory.CreateDirectory(Util.logDir()); | 80 | Directory.CreateDirectory(Util.logDir()); |
83 | } | 81 | } |
84 | m_console = | 82 | |
85 | new LogBase((Path.Combine(Util.logDir(), "opengrid-AssetServer-console.log")), "OpenAsset", this, true); | 83 | m_log = |
86 | MainLog.Instance = m_console; | 84 | new LogBase( |
85 | (Path.Combine(Util.logDir(), "opengrid-AssetServer-console.log")), | ||
86 | "OpenAsset", | ||
87 | this, | ||
88 | true); | ||
89 | |||
90 | MainLog.Instance = m_log; | ||
87 | } | 91 | } |
88 | 92 | ||
89 | public void Startup() | 93 | public void Startup() |
90 | { | 94 | { |
91 | m_config = new AssetConfig("ASSET SERVER", (Path.Combine(Util.configDir(), "AssetServer_Config.xml"))); | 95 | m_config = new AssetConfig("ASSET SERVER", (Path.Combine(Util.configDir(), "AssetServer_Config.xml"))); |
92 | 96 | ||
93 | m_console.Verbose("ASSET", "Setting up asset DB"); | 97 | m_log.Verbose("ASSET", "Setting up asset DB"); |
94 | setupDB(m_config); | 98 | setupDB(m_config); |
95 | 99 | ||
96 | m_console.Verbose("ASSET", "Loading default asset set.."); | 100 | m_log.Verbose("ASSET", "Loading default asset set.."); |
97 | LoadDefaultAssets(); | 101 | LoadDefaultAssets(); |
98 | 102 | ||
99 | m_console.Verbose("ASSET", "Starting HTTP process"); | 103 | m_log.Verbose("ASSET", "Starting HTTP process"); |
100 | BaseHttpServer httpServer = new BaseHttpServer(m_config.HttpPort); | 104 | BaseHttpServer httpServer = new BaseHttpServer(m_config.HttpPort); |
101 | 105 | ||
102 | StatsManager.StartCollectingAssetStats(); | 106 | StatsManager.StartCollectingAssetStats(); |
@@ -170,30 +174,28 @@ namespace OpenSim.Grid.AssetServer | |||
170 | m_assetProvider.CreateAsset(asset); | 174 | m_assetProvider.CreateAsset(asset); |
171 | } | 175 | } |
172 | 176 | ||
173 | public void RunCmd(string cmd, string[] cmdparams) | 177 | public override void RunCmd(string cmd, string[] cmdparams) |
174 | { | 178 | { |
179 | base.RunCmd(cmd, cmdparams); | ||
180 | |||
175 | switch (cmd) | 181 | switch (cmd) |
176 | { | 182 | { |
177 | case "help": | 183 | case "help": |
178 | m_console.Notice( | 184 | m_log.Notice( |
179 | @"shutdown - shutdown this asset server (USE CAUTION!) | 185 | @"shutdown - shutdown this asset server (USE CAUTION!) |
180 | stats - statistical information for this server"); | 186 | stats - statistical information for this server"); |
181 | 187 | ||
182 | break; | 188 | break; |
183 | 189 | ||
184 | case "stats": | 190 | case "stats": |
185 | m_console.Notice("STATS", Environment.NewLine + StatsManager.AssetStats.Report()); | 191 | m_log.Notice("STATS", Environment.NewLine + StatsManager.AssetStats.Report()); |
186 | break; | 192 | break; |
187 | 193 | ||
188 | case "shutdown": | 194 | case "shutdown": |
189 | m_console.Close(); | 195 | m_log.Close(); |
190 | Environment.Exit(0); | 196 | Environment.Exit(0); |
191 | break; | 197 | break; |
192 | } | 198 | } |
193 | } | 199 | } |
194 | |||
195 | public void Show(string ShowWhat) | ||
196 | { | ||
197 | } | ||
198 | } | 200 | } |
199 | } | 201 | } |