diff options
Diffstat (limited to 'OpenSim/Grid')
-rw-r--r-- | OpenSim/Grid/AssetServer/Main.cs | 44 | ||||
-rw-r--r-- | OpenSim/Grid/GridServer/Main.cs | 34 | ||||
-rw-r--r-- | OpenSim/Grid/InventoryServer/Main.cs | 23 | ||||
-rw-r--r-- | OpenSim/Grid/MessagingServer/Main.cs | 27 | ||||
-rw-r--r-- | OpenSim/Grid/ScriptServer/ScriptServerMain.cs | 14 | ||||
-rw-r--r-- | OpenSim/Grid/UserServer/Main.cs | 43 |
6 files changed, 85 insertions, 100 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 | } |
diff --git a/OpenSim/Grid/GridServer/Main.cs b/OpenSim/Grid/GridServer/Main.cs index d4947b3..8a522c2 100644 --- a/OpenSim/Grid/GridServer/Main.cs +++ b/OpenSim/Grid/GridServer/Main.cs | |||
@@ -37,7 +37,7 @@ namespace OpenSim.Grid.GridServer | |||
37 | { | 37 | { |
38 | /// <summary> | 38 | /// <summary> |
39 | /// </summary> | 39 | /// </summary> |
40 | public class OpenGrid_Main : conscmd_callback | 40 | public class OpenGrid_Main : BaseOpenSimServer, conscmd_callback |
41 | { | 41 | { |
42 | public GridConfig Cfg; | 42 | public GridConfig Cfg; |
43 | 43 | ||
@@ -51,8 +51,6 @@ namespace OpenSim.Grid.GridServer | |||
51 | 51 | ||
52 | private GridManager m_gridManager; | 52 | private GridManager m_gridManager; |
53 | 53 | ||
54 | private LogBase m_console; | ||
55 | |||
56 | [STAThread] | 54 | [STAThread] |
57 | public static void Main(string[] args) | 55 | public static void Main(string[] args) |
58 | { | 56 | { |
@@ -70,11 +68,11 @@ namespace OpenSim.Grid.GridServer | |||
70 | 68 | ||
71 | private void Work() | 69 | private void Work() |
72 | { | 70 | { |
73 | m_console.Notice("Enter help for a list of commands\n"); | 71 | m_log.Notice("Enter help for a list of commands\n"); |
74 | 72 | ||
75 | while (true) | 73 | while (true) |
76 | { | 74 | { |
77 | m_console.MainLogPrompt(); | 75 | m_log.MainLogPrompt(); |
78 | } | 76 | } |
79 | } | 77 | } |
80 | 78 | ||
@@ -84,9 +82,9 @@ namespace OpenSim.Grid.GridServer | |||
84 | { | 82 | { |
85 | Directory.CreateDirectory(Util.logDir()); | 83 | Directory.CreateDirectory(Util.logDir()); |
86 | } | 84 | } |
87 | m_console = | 85 | m_log = |
88 | new LogBase((Path.Combine(Util.logDir(), "opengrid-gridserver-console.log")), "OpenGrid", this, true); | 86 | new LogBase((Path.Combine(Util.logDir(), "opengrid-gridserver-console.log")), "OpenGrid", this, true); |
89 | MainLog.Instance = m_console; | 87 | MainLog.Instance = m_log; |
90 | } | 88 | } |
91 | 89 | ||
92 | public void managercallback(string cmd) | 90 | public void managercallback(string cmd) |
@@ -106,12 +104,12 @@ namespace OpenSim.Grid.GridServer | |||
106 | //Yeah srsly, that's it. | 104 | //Yeah srsly, that's it. |
107 | if (setuponly) Environment.Exit(0); | 105 | if (setuponly) Environment.Exit(0); |
108 | 106 | ||
109 | m_console.Verbose("GRID", "Connecting to Storage Server"); | 107 | m_log.Verbose("GRID", "Connecting to Storage Server"); |
110 | m_gridManager = new GridManager(); | 108 | m_gridManager = new GridManager(); |
111 | m_gridManager.AddPlugin(Cfg.DatabaseProvider); // Made of win | 109 | m_gridManager.AddPlugin(Cfg.DatabaseProvider); // Made of win |
112 | m_gridManager.config = Cfg; | 110 | m_gridManager.config = Cfg; |
113 | 111 | ||
114 | m_console.Verbose("GRID", "Starting HTTP process"); | 112 | m_log.Verbose("GRID", "Starting HTTP process"); |
115 | BaseHttpServer httpServer = new BaseHttpServer(Cfg.HttpPort); | 113 | BaseHttpServer httpServer = new BaseHttpServer(Cfg.HttpPort); |
116 | //GridManagementAgent GridManagerAgent = new GridManagementAgent(httpServer, "gridserver", Cfg.SimSendKey, Cfg.SimRecvKey, managercallback); | 114 | //GridManagementAgent GridManagerAgent = new GridManagementAgent(httpServer, "gridserver", Cfg.SimSendKey, Cfg.SimRecvKey, managercallback); |
117 | 115 | ||
@@ -137,7 +135,7 @@ namespace OpenSim.Grid.GridServer | |||
137 | 135 | ||
138 | httpServer.Start(); | 136 | httpServer.Start(); |
139 | 137 | ||
140 | m_console.Verbose("GRID", "Starting sim status checker"); | 138 | m_log.Verbose("GRID", "Starting sim status checker"); |
141 | 139 | ||
142 | Timer simCheckTimer = new Timer(3600000*3); // 3 Hours between updates. | 140 | Timer simCheckTimer = new Timer(3600000*3); // 3 Hours between updates. |
143 | simCheckTimer.Elapsed += new ElapsedEventHandler(CheckSims); | 141 | simCheckTimer.Elapsed += new ElapsedEventHandler(CheckSims); |
@@ -181,25 +179,23 @@ namespace OpenSim.Grid.GridServer | |||
181 | */ | 179 | */ |
182 | } | 180 | } |
183 | 181 | ||
184 | public void RunCmd(string cmd, string[] cmdparams) | 182 | public override void RunCmd(string cmd, string[] cmdparams) |
185 | { | 183 | { |
184 | base.RunCmd(cmd, cmdparams); | ||
185 | |||
186 | switch (cmd) | 186 | switch (cmd) |
187 | { | 187 | { |
188 | case "help": | 188 | case "help": |
189 | m_console.Notice("shutdown - shutdown the grid (USE CAUTION!)"); | 189 | m_log.Notice("shutdown - shutdown the grid (USE CAUTION!)"); |
190 | break; | 190 | break; |
191 | 191 | ||
192 | case "shutdown": | 192 | case "shutdown": |
193 | m_console.Close(); | 193 | m_log.Close(); |
194 | Environment.Exit(0); | 194 | Environment.Exit(0); |
195 | break; | 195 | break; |
196 | } | 196 | } |
197 | } | 197 | } |
198 | 198 | ||
199 | public void Show(string ShowWhat) | ||
200 | { | ||
201 | } | ||
202 | |||
203 | /*private void ConfigDB(IGenericConfig configData) | 199 | /*private void ConfigDB(IGenericConfig configData) |
204 | { | 200 | { |
205 | try | 201 | try |
@@ -223,4 +219,4 @@ namespace OpenSim.Grid.GridServer | |||
223 | } | 219 | } |
224 | }*/ | 220 | }*/ |
225 | } | 221 | } |
226 | } \ No newline at end of file | 222 | } |
diff --git a/OpenSim/Grid/InventoryServer/Main.cs b/OpenSim/Grid/InventoryServer/Main.cs index ce371bf..b62c696 100644 --- a/OpenSim/Grid/InventoryServer/Main.cs +++ b/OpenSim/Grid/InventoryServer/Main.cs | |||
@@ -36,9 +36,8 @@ using OpenSim.Framework.Servers; | |||
36 | 36 | ||
37 | namespace OpenSim.Grid.InventoryServer | 37 | namespace OpenSim.Grid.InventoryServer |
38 | { | 38 | { |
39 | public class OpenInventory_Main : conscmd_callback | 39 | public class OpenInventory_Main : BaseOpenSimServer, conscmd_callback |
40 | { | 40 | { |
41 | private LogBase m_console; | ||
42 | private InventoryManager m_inventoryManager; | 41 | private InventoryManager m_inventoryManager; |
43 | private InventoryConfig m_config; | 42 | private InventoryConfig m_config; |
44 | private GridInventoryService m_inventoryService; | 43 | private GridInventoryService m_inventoryService; |
@@ -56,8 +55,8 @@ namespace OpenSim.Grid.InventoryServer | |||
56 | 55 | ||
57 | public OpenInventory_Main() | 56 | public OpenInventory_Main() |
58 | { | 57 | { |
59 | m_console = new LogBase("opengrid-inventory-console.log", LogName, this, true); | 58 | m_log = new LogBase("opengrid-inventory-console.log", LogName, this, true); |
60 | MainLog.Instance = m_console; | 59 | MainLog.Instance = m_log; |
61 | } | 60 | } |
62 | 61 | ||
63 | public void Startup() | 62 | public void Startup() |
@@ -104,16 +103,18 @@ namespace OpenSim.Grid.InventoryServer | |||
104 | 103 | ||
105 | private void Work() | 104 | private void Work() |
106 | { | 105 | { |
107 | m_console.Notice("Enter help for a list of commands\n"); | 106 | m_log.Notice("Enter help for a list of commands\n"); |
108 | 107 | ||
109 | while (true) | 108 | while (true) |
110 | { | 109 | { |
111 | m_console.MainLogPrompt(); | 110 | m_log.MainLogPrompt(); |
112 | } | 111 | } |
113 | } | 112 | } |
114 | 113 | ||
115 | public void RunCmd(string cmd, string[] cmdparams) | 114 | public override void RunCmd(string cmd, string[] cmdparams) |
116 | { | 115 | { |
116 | base.RunCmd(cmd, cmdparams); | ||
117 | |||
117 | switch (cmd) | 118 | switch (cmd) |
118 | { | 119 | { |
119 | case "quit": | 120 | case "quit": |
@@ -121,14 +122,10 @@ namespace OpenSim.Grid.InventoryServer | |||
121 | m_inventoryService.CreateUsersInventory(LLUUID.Random().UUID); | 122 | m_inventoryService.CreateUsersInventory(LLUUID.Random().UUID); |
122 | break; | 123 | break; |
123 | case "shutdown": | 124 | case "shutdown": |
124 | m_console.Close(); | 125 | m_log.Close(); |
125 | Environment.Exit(0); | 126 | Environment.Exit(0); |
126 | break; | 127 | break; |
127 | } | 128 | } |
128 | } | 129 | } |
129 | |||
130 | public void Show(string ShowWhat) | ||
131 | { | ||
132 | } | ||
133 | } | 130 | } |
134 | } \ No newline at end of file | 131 | } |
diff --git a/OpenSim/Grid/MessagingServer/Main.cs b/OpenSim/Grid/MessagingServer/Main.cs index a7c3a2a..3d5ceb4 100644 --- a/OpenSim/Grid/MessagingServer/Main.cs +++ b/OpenSim/Grid/MessagingServer/Main.cs | |||
@@ -39,14 +39,13 @@ namespace OpenSim.Grid.MessagingServer | |||
39 | { | 39 | { |
40 | /// <summary> | 40 | /// <summary> |
41 | /// </summary> | 41 | /// </summary> |
42 | public class OpenMessage_Main : conscmd_callback | 42 | public class OpenMessage_Main : BaseOpenSimServer, conscmd_callback |
43 | { | 43 | { |
44 | private MessageServerConfig Cfg; | 44 | private MessageServerConfig Cfg; |
45 | 45 | ||
46 | //public UserManager m_userManager; | 46 | //public UserManager m_userManager; |
47 | //public UserLoginService m_loginService; | 47 | //public UserLoginService m_loginService; |
48 | 48 | ||
49 | private LogBase m_console; | ||
50 | private LLUUID m_lastCreatedUser = LLUUID.Random(); | 49 | private LLUUID m_lastCreatedUser = LLUUID.Random(); |
51 | 50 | ||
52 | [STAThread] | 51 | [STAThread] |
@@ -66,18 +65,18 @@ namespace OpenSim.Grid.MessagingServer | |||
66 | { | 65 | { |
67 | Directory.CreateDirectory(Util.logDir()); | 66 | Directory.CreateDirectory(Util.logDir()); |
68 | } | 67 | } |
69 | m_console = | 68 | m_log = |
70 | new LogBase((Path.Combine(Util.logDir(), "opengrid-messagingserver-console.log")), "OpenMessage", this, true); | 69 | new LogBase((Path.Combine(Util.logDir(), "opengrid-messagingserver-console.log")), "OpenMessage", this, true); |
71 | MainLog.Instance = m_console; | 70 | MainLog.Instance = m_log; |
72 | } | 71 | } |
73 | 72 | ||
74 | private void Work() | 73 | private void Work() |
75 | { | 74 | { |
76 | m_console.Notice("Enter help for a list of commands\n"); | 75 | m_log.Notice("Enter help for a list of commands\n"); |
77 | 76 | ||
78 | while (true) | 77 | while (true) |
79 | { | 78 | { |
80 | m_console.MainLogPrompt(); | 79 | m_log.MainLogPrompt(); |
81 | } | 80 | } |
82 | } | 81 | } |
83 | 82 | ||
@@ -105,7 +104,7 @@ namespace OpenSim.Grid.MessagingServer | |||
105 | //new RestStreamHandler("DELETE", "/usersessions/", m_userManager.RestDeleteUserSessionMethod)); | 104 | //new RestStreamHandler("DELETE", "/usersessions/", m_userManager.RestDeleteUserSessionMethod)); |
106 | 105 | ||
107 | httpServer.Start(); | 106 | httpServer.Start(); |
108 | m_console.Status("SERVER", "Messageserver 0.4 - Startup complete"); | 107 | m_log.Status("SERVER", "Messageserver 0.4 - Startup complete"); |
109 | } | 108 | } |
110 | 109 | ||
111 | 110 | ||
@@ -121,7 +120,7 @@ namespace OpenSim.Grid.MessagingServer | |||
121 | //m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY); | 120 | //m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY); |
122 | } catch (Exception ex) | 121 | } catch (Exception ex) |
123 | { | 122 | { |
124 | m_console.Error("SERVER", "Error creating user: {0}", ex.ToString()); | 123 | m_log.Error("SERVER", "Error creating user: {0}", ex.ToString()); |
125 | } | 124 | } |
126 | 125 | ||
127 | try | 126 | try |
@@ -131,23 +130,25 @@ namespace OpenSim.Grid.MessagingServer | |||
131 | } | 130 | } |
132 | catch (Exception ex) | 131 | catch (Exception ex) |
133 | { | 132 | { |
134 | m_console.Error("SERVER", "Error creating inventory for user: {0}", ex.ToString()); | 133 | m_log.Error("SERVER", "Error creating inventory for user: {0}", ex.ToString()); |
135 | } | 134 | } |
136 | // m_lastCreatedUser = userID; | 135 | // m_lastCreatedUser = userID; |
137 | break; | 136 | break; |
138 | } | 137 | } |
139 | } | 138 | } |
140 | 139 | ||
141 | public void RunCmd(string cmd, string[] cmdparams) | 140 | public override void RunCmd(string cmd, string[] cmdparams) |
142 | { | 141 | { |
142 | base.RunCmd(cmd, cmdparams); | ||
143 | |||
143 | switch (cmd) | 144 | switch (cmd) |
144 | { | 145 | { |
145 | case "help": | 146 | case "help": |
146 | m_console.Notice("shutdown - shutdown the message server (USE CAUTION!)"); | 147 | m_log.Notice("shutdown - shutdown the message server (USE CAUTION!)"); |
147 | break; | 148 | break; |
148 | 149 | ||
149 | case "shutdown": | 150 | case "shutdown": |
150 | m_console.Close(); | 151 | m_log.Close(); |
151 | Environment.Exit(0); | 152 | Environment.Exit(0); |
152 | break; | 153 | break; |
153 | } | 154 | } |
diff --git a/OpenSim/Grid/ScriptServer/ScriptServerMain.cs b/OpenSim/Grid/ScriptServer/ScriptServerMain.cs index 5757be4..421467d 100644 --- a/OpenSim/Grid/ScriptServer/ScriptServerMain.cs +++ b/OpenSim/Grid/ScriptServer/ScriptServerMain.cs | |||
@@ -31,20 +31,20 @@ using libsecondlife; | |||
31 | using Nini.Config; | 31 | using Nini.Config; |
32 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using OpenSim.Framework.Console; | 33 | using OpenSim.Framework.Console; |
34 | using OpenSim.Framework.Servers; | ||
34 | using OpenSim.Grid.ScriptServer.ScriptServer; | 35 | using OpenSim.Grid.ScriptServer.ScriptServer; |
35 | using OpenSim.Region.ScriptEngine.Common; | 36 | using OpenSim.Region.ScriptEngine.Common; |
36 | using OpenSim.Region.ScriptEngine.Common.TRPC; | 37 | using OpenSim.Region.ScriptEngine.Common.TRPC; |
37 | 38 | ||
38 | namespace OpenSim.Grid.ScriptServer | 39 | namespace OpenSim.Grid.ScriptServer |
39 | { | 40 | { |
40 | public class ScriptServerMain : conscmd_callback | 41 | public class ScriptServerMain : BaseOpenSimServer, conscmd_callback |
41 | { | 42 | { |
42 | // | 43 | // |
43 | // Root object. Creates objects used. | 44 | // Root object. Creates objects used. |
44 | // | 45 | // |
45 | private int listenPort = 8010; | 46 | private int listenPort = 8010; |
46 | private readonly string m_logFilename = ("scriptserver.log"); | 47 | private readonly string m_logFilename = ("scriptserver.log"); |
47 | private LogBase m_log; | ||
48 | 48 | ||
49 | // TEMP | 49 | // TEMP |
50 | public static ScriptServerInterfaces.ScriptEngine Engine; | 50 | public static ScriptServerInterfaces.ScriptEngine Engine; |
@@ -111,13 +111,5 @@ namespace OpenSim.Grid.ScriptServer | |||
111 | 111 | ||
112 | return new LogBase((Path.Combine(Util.logDir(), m_logFilename)), "ScriptServer", this, true); | 112 | return new LogBase((Path.Combine(Util.logDir(), m_logFilename)), "ScriptServer", this, true); |
113 | } | 113 | } |
114 | |||
115 | public void RunCmd(string command, string[] cmdparams) | ||
116 | { | ||
117 | } | ||
118 | |||
119 | public void Show(string ShowWhat) | ||
120 | { | ||
121 | } | ||
122 | } | 114 | } |
123 | } \ No newline at end of file | 115 | } |
diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index 20828ba..32cefc1 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs | |||
@@ -40,7 +40,7 @@ namespace OpenSim.Grid.UserServer | |||
40 | { | 40 | { |
41 | /// <summary> | 41 | /// <summary> |
42 | /// </summary> | 42 | /// </summary> |
43 | public class OpenUser_Main : conscmd_callback | 43 | public class OpenUser_Main : BaseOpenSimServer, conscmd_callback |
44 | { | 44 | { |
45 | private UserConfig Cfg; | 45 | private UserConfig Cfg; |
46 | 46 | ||
@@ -48,7 +48,6 @@ namespace OpenSim.Grid.UserServer | |||
48 | public UserLoginService m_loginService; | 48 | public UserLoginService m_loginService; |
49 | public MessageServersConnector m_messagesService; | 49 | public MessageServersConnector m_messagesService; |
50 | 50 | ||
51 | private LogBase m_console; | ||
52 | private LLUUID m_lastCreatedUser = LLUUID.Random(); | 51 | private LLUUID m_lastCreatedUser = LLUUID.Random(); |
53 | 52 | ||
54 | [STAThread] | 53 | [STAThread] |
@@ -68,18 +67,18 @@ namespace OpenSim.Grid.UserServer | |||
68 | { | 67 | { |
69 | Directory.CreateDirectory(Util.logDir()); | 68 | Directory.CreateDirectory(Util.logDir()); |
70 | } | 69 | } |
71 | m_console = | 70 | m_log = |
72 | new LogBase((Path.Combine(Util.logDir(), "opengrid-userserver-console.log")), "OpenUser", this, true); | 71 | new LogBase((Path.Combine(Util.logDir(), "opengrid-userserver-console.log")), "OpenUser", this, true); |
73 | MainLog.Instance = m_console; | 72 | MainLog.Instance = m_log; |
74 | } | 73 | } |
75 | 74 | ||
76 | private void Work() | 75 | private void Work() |
77 | { | 76 | { |
78 | m_console.Notice("Enter help for a list of commands\n"); | 77 | m_log.Notice("Enter help for a list of commands\n"); |
79 | 78 | ||
80 | while (true) | 79 | while (true) |
81 | { | 80 | { |
82 | m_console.MainLogPrompt(); | 81 | m_log.MainLogPrompt(); |
83 | } | 82 | } |
84 | } | 83 | } |
85 | 84 | ||
@@ -129,7 +128,7 @@ namespace OpenSim.Grid.UserServer | |||
129 | new RestStreamHandler("DELETE", "/usersessions/", m_userManager.RestDeleteUserSessionMethod)); | 128 | new RestStreamHandler("DELETE", "/usersessions/", m_userManager.RestDeleteUserSessionMethod)); |
130 | 129 | ||
131 | httpServer.Start(); | 130 | httpServer.Start(); |
132 | m_console.Status("SERVER", "Userserver 0.4 - Startup complete"); | 131 | m_log.Status("SERVER", "Userserver 0.4 - Startup complete"); |
133 | } | 132 | } |
134 | 133 | ||
135 | 134 | ||
@@ -144,11 +143,11 @@ namespace OpenSim.Grid.UserServer | |||
144 | uint regX = 1000; | 143 | uint regX = 1000; |
145 | uint regY = 1000; | 144 | uint regY = 1000; |
146 | 145 | ||
147 | tempfirstname = m_console.CmdPrompt("First name"); | 146 | tempfirstname = m_log.CmdPrompt("First name"); |
148 | templastname = m_console.CmdPrompt("Last name"); | 147 | templastname = m_log.CmdPrompt("Last name"); |
149 | tempMD5Passwd = m_console.PasswdPrompt("Password"); | 148 | tempMD5Passwd = m_log.PasswdPrompt("Password"); |
150 | regX = Convert.ToUInt32(m_console.CmdPrompt("Start Region X")); | 149 | regX = Convert.ToUInt32(m_log.CmdPrompt("Start Region X")); |
151 | regY = Convert.ToUInt32(m_console.CmdPrompt("Start Region Y")); | 150 | regY = Convert.ToUInt32(m_log.CmdPrompt("Start Region Y")); |
152 | 151 | ||
153 | tempMD5Passwd = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + String.Empty); | 152 | tempMD5Passwd = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + String.Empty); |
154 | 153 | ||
@@ -159,7 +158,7 @@ namespace OpenSim.Grid.UserServer | |||
159 | m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY); | 158 | m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY); |
160 | } catch (Exception ex) | 159 | } catch (Exception ex) |
161 | { | 160 | { |
162 | m_console.Error("SERVER", "Error creating user: {0}", ex.ToString()); | 161 | m_log.Error("SERVER", "Error creating user: {0}", ex.ToString()); |
163 | } | 162 | } |
164 | 163 | ||
165 | try | 164 | try |
@@ -169,21 +168,23 @@ namespace OpenSim.Grid.UserServer | |||
169 | } | 168 | } |
170 | catch (Exception ex) | 169 | catch (Exception ex) |
171 | { | 170 | { |
172 | m_console.Error("SERVER", "Error creating inventory for user: {0}", ex.ToString()); | 171 | m_log.Error("SERVER", "Error creating inventory for user: {0}", ex.ToString()); |
173 | } | 172 | } |
174 | m_lastCreatedUser = userID; | 173 | m_lastCreatedUser = userID; |
175 | break; | 174 | break; |
176 | } | 175 | } |
177 | } | 176 | } |
178 | 177 | ||
179 | public void RunCmd(string cmd, string[] cmdparams) | 178 | public override void RunCmd(string cmd, string[] cmdparams) |
180 | { | 179 | { |
180 | base.RunCmd(cmd, cmdparams); | ||
181 | |||
181 | switch (cmd) | 182 | switch (cmd) |
182 | { | 183 | { |
183 | case "help": | 184 | case "help": |
184 | m_console.Notice("create user - create a new user"); | 185 | m_log.Notice("create user - create a new user"); |
185 | m_console.Notice("stats - statistical information for this server"); | 186 | m_log.Notice("stats - statistical information for this server"); |
186 | m_console.Notice("shutdown - shutdown the grid (USE CAUTION!)"); | 187 | m_log.Notice("shutdown - shutdown the grid (USE CAUTION!)"); |
187 | break; | 188 | break; |
188 | 189 | ||
189 | case "create": | 190 | case "create": |
@@ -192,7 +193,7 @@ namespace OpenSim.Grid.UserServer | |||
192 | 193 | ||
193 | case "shutdown": | 194 | case "shutdown": |
194 | m_loginService.OnUserLoggedInAtLocation -= NotifyMessageServersUserLoggedInToLocation; | 195 | m_loginService.OnUserLoggedInAtLocation -= NotifyMessageServersUserLoggedInToLocation; |
195 | m_console.Close(); | 196 | m_log.Close(); |
196 | Environment.Exit(0); | 197 | Environment.Exit(0); |
197 | break; | 198 | break; |
198 | 199 | ||
@@ -246,9 +247,5 @@ namespace OpenSim.Grid.UserServer | |||
246 | 247 | ||
247 | } | 248 | } |
248 | }*/ | 249 | }*/ |
249 | |||
250 | public void Show(string ShowWhat) | ||
251 | { | ||
252 | } | ||
253 | } | 250 | } |
254 | } | 251 | } |