aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenGridServices-Source/OpenGrid.Framework.Manager/GridServerManager.cs
diff options
context:
space:
mode:
authorMW2007-05-24 12:16:50 +0000
committerMW2007-05-24 12:16:50 +0000
commit3376b82501000692d6dac24b051af738cdaf2737 (patch)
tree90ed0a5d4955236f011fa63fce9d555186b0d179 /OpenGridServices-Source/OpenGrid.Framework.Manager/GridServerManager.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 'OpenGridServices-Source/OpenGrid.Framework.Manager/GridServerManager.cs')
-rw-r--r--OpenGridServices-Source/OpenGrid.Framework.Manager/GridServerManager.cs50
1 files changed, 50 insertions, 0 deletions
diff --git a/OpenGridServices-Source/OpenGrid.Framework.Manager/GridServerManager.cs b/OpenGridServices-Source/OpenGrid.Framework.Manager/GridServerManager.cs
new file mode 100644
index 0000000..7ebf66a
--- /dev/null
+++ b/OpenGridServices-Source/OpenGrid.Framework.Manager/GridServerManager.cs
@@ -0,0 +1,50 @@
1using System;
2using System.Collections;
3using System.Collections.Generic;
4using Nwc.XmlRpc;
5using System.Threading;
6using libsecondlife;
7
8namespace OpenGrid.Framework.Manager {
9
10 public class GridServerManager
11 {
12 public static GridManagerCallback thecallback;
13
14 public static string sendkey;
15 public static string recvkey;
16
17 public static XmlRpcResponse XmlRpcShutdownMethod(XmlRpcRequest request)
18 {
19 XmlRpcResponse response = new XmlRpcResponse();
20 Hashtable requestData = (Hashtable)request.Params[0];
21 Hashtable responseData = new Hashtable();
22
23 if(requestData.ContainsKey("session_id")) {
24 if(GridManagementAgent.SessionExists(new LLUUID((string)requestData["session_id"]))) {
25 responseData["msg"]="Shutdown command accepted";
26 (new Thread(new ThreadStart(ZOMGServerIsNowTerminallyIll))).Start();
27 } else {
28 response.IsFault=true;
29 responseData["error"]="bad session ID";
30 }
31 } else {
32 response.IsFault=true;
33 responseData["error"]="no session ID";
34 }
35
36 response.Value = responseData;
37 return response;
38 }
39
40 // Brought to by late-night coding
41 public static void ZOMGServerIsNowTerminallyIll()
42 {
43 Console.WriteLine("ZOMG! THIS SERVER IS TERMINALLY ILL - WE GOT A SHUTDOWN REQUEST FROM A GRID MANAGER!!!!");
44 Console.WriteLine("We have 3 seconds to live...");
45 Thread.Sleep(3000);
46 thecallback("shutdown");
47 }
48 }
49}
50