aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenGrid.Framework.Manager/GridManagementAgent.cs
diff options
context:
space:
mode:
authorMW2007-05-24 12:16:50 +0000
committerMW2007-05-24 12:16:50 +0000
commit3376b82501000692d6dac24b051af738cdaf2737 (patch)
tree90ed0a5d4955236f011fa63fce9d555186b0d179 /OpenGrid.Framework.Manager/GridManagementAgent.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 'OpenGrid.Framework.Manager/GridManagementAgent.cs')
-rw-r--r--OpenGrid.Framework.Manager/GridManagementAgent.cs71
1 files changed, 0 insertions, 71 deletions
diff --git a/OpenGrid.Framework.Manager/GridManagementAgent.cs b/OpenGrid.Framework.Manager/GridManagementAgent.cs
deleted file mode 100644
index e43ce87..0000000
--- a/OpenGrid.Framework.Manager/GridManagementAgent.cs
+++ /dev/null
@@ -1,71 +0,0 @@
1using Nwc.XmlRpc;
2using OpenSim.Framework;
3using OpenSim.Servers;
4using System.Collections;
5using System.Collections.Generic;
6using libsecondlife;
7
8namespace OpenGrid.Framework.Manager {
9
10 public delegate void GridManagerCallback(string param);
11
12 public class GridManagementAgent {
13
14 private GridManagerCallback thecallback;
15 private string sendkey;
16 private string recvkey;
17 private string component_type;
18
19 private static ArrayList Sessions;
20
21 public GridManagementAgent(BaseHttpServer app_httpd, string component_type, string sendkey, string recvkey, GridManagerCallback thecallback)
22 {
23 this.sendkey=sendkey;
24 this.recvkey=recvkey;
25 this.component_type=component_type;
26 this.thecallback=thecallback;
27 Sessions = new ArrayList();
28
29 app_httpd.AddXmlRPCHandler("manager_login",XmlRpcLoginMethod);
30
31 switch(component_type)
32 {
33 case "gridserver":
34 GridServerManager.sendkey=this.sendkey;
35 GridServerManager.recvkey=this.recvkey;
36 GridServerManager.thecallback=thecallback;
37 app_httpd.AddXmlRPCHandler("shutdown", GridServerManager.XmlRpcShutdownMethod);
38 break;
39 }
40 }
41
42 public static bool SessionExists(LLUUID sessionID)
43 {
44 return Sessions.Contains(sessionID);
45 }
46
47 public static XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request)
48 {
49 XmlRpcResponse response = new XmlRpcResponse();
50 Hashtable requestData = (Hashtable)request.Params[0];
51 Hashtable responseData = new Hashtable();
52
53 // TODO: Switch this over to using OpenGrid.Framework.Data
54 if( requestData["username"].Equals("admin") && requestData["password"].Equals("supersecret")) {
55 response.IsFault=false;
56 LLUUID new_session=LLUUID.Random();
57 Sessions.Add(new_session);
58 responseData["session_id"]=new_session.ToString();
59 responseData["msg"]="Login OK";
60 } else {
61 response.IsFault=true;
62 responseData["error"]="Invalid username or password";
63 }
64
65 response.Value = responseData;
66 return response;
67
68 }
69
70 }
71}