aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/Manager/OpenGridServices.Manager/GridServerConnectionManager.cs
diff options
context:
space:
mode:
authorJeff Ames2008-05-14 05:33:32 +0000
committerJeff Ames2008-05-14 05:33:32 +0000
commit6a1b787436cc59043a26a296781e7a7b5ea0c67b (patch)
tree10f55a7b0abfdc47f103d40f13f3cae530c13581 /OpenSim/Grid/Manager/OpenGridServices.Manager/GridServerConnectionManager.cs
parentFormatting cleanup. (diff)
downloadopensim-SC-6a1b787436cc59043a26a296781e7a7b5ea0c67b.zip
opensim-SC-6a1b787436cc59043a26a296781e7a7b5ea0c67b.tar.gz
opensim-SC-6a1b787436cc59043a26a296781e7a7b5ea0c67b.tar.bz2
opensim-SC-6a1b787436cc59043a26a296781e7a7b5ea0c67b.tar.xz
More formatting cleanup.
Diffstat (limited to 'OpenSim/Grid/Manager/OpenGridServices.Manager/GridServerConnectionManager.cs')
-rw-r--r--OpenSim/Grid/Manager/OpenGridServices.Manager/GridServerConnectionManager.cs28
1 files changed, 20 insertions, 8 deletions
diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/GridServerConnectionManager.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/GridServerConnectionManager.cs
index a386fa8..cf44ac2 100644
--- a/OpenSim/Grid/Manager/OpenGridServices.Manager/GridServerConnectionManager.cs
+++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/GridServerConnectionManager.cs
@@ -46,7 +46,8 @@ namespace OpenGridServices.Manager
46 46
47 public bool Connect(string GridServerURL, string username, string password) 47 public bool Connect(string GridServerURL, string username, string password)
48 { 48 {
49 try { 49 try
50 {
50 this.ServerURL=GridServerURL; 51 this.ServerURL=GridServerURL;
51 Hashtable LoginParamsHT = new Hashtable(); 52 Hashtable LoginParamsHT = new Hashtable();
52 LoginParamsHT["username"]=username; 53 LoginParamsHT["username"]=username;
@@ -55,16 +56,21 @@ namespace OpenGridServices.Manager
55 LoginParams.Add(LoginParamsHT); 56 LoginParams.Add(LoginParamsHT);
56 XmlRpcRequest GridLoginReq = new XmlRpcRequest("manager_login",LoginParams); 57 XmlRpcRequest GridLoginReq = new XmlRpcRequest("manager_login",LoginParams);
57 XmlRpcResponse GridResp = GridLoginReq.Send(ServerURL,3000); 58 XmlRpcResponse GridResp = GridLoginReq.Send(ServerURL,3000);
58 if (GridResp.IsFault) { 59 if (GridResp.IsFault)
60 {
59 connected=false; 61 connected=false;
60 return false; 62 return false;
61 } else { 63 }
64 else
65 {
62 Hashtable gridrespData = (Hashtable)GridResp.Value; 66 Hashtable gridrespData = (Hashtable)GridResp.Value;
63 this.SessionID = new LLUUID((string)gridrespData["session_id"]); 67 this.SessionID = new LLUUID((string)gridrespData["session_id"]);
64 connected=true; 68 connected=true;
65 return true; 69 return true;
66 } 70 }
67 } catch(Exception e) { 71 }
72 catch(Exception e)
73 {
68 Console.WriteLine(e.ToString()); 74 Console.WriteLine(e.ToString());
69 connected=false; 75 connected=false;
70 return false; 76 return false;
@@ -107,20 +113,26 @@ namespace OpenGridServices.Manager
107 113
108 public bool ShutdownServer() 114 public bool ShutdownServer()
109 { 115 {
110 try { 116 try
117 {
111 Hashtable ShutdownParamsHT = new Hashtable(); 118 Hashtable ShutdownParamsHT = new Hashtable();
112 ArrayList ShutdownParams = new ArrayList(); 119 ArrayList ShutdownParams = new ArrayList();
113 ShutdownParamsHT["session_id"]=this.SessionID.ToString(); 120 ShutdownParamsHT["session_id"]=this.SessionID.ToString();
114 ShutdownParams.Add(ShutdownParamsHT); 121 ShutdownParams.Add(ShutdownParamsHT);
115 XmlRpcRequest GridShutdownReq = new XmlRpcRequest("shutdown",ShutdownParams); 122 XmlRpcRequest GridShutdownReq = new XmlRpcRequest("shutdown",ShutdownParams);
116 XmlRpcResponse GridResp = GridShutdownReq.Send(this.ServerURL, 3000); 123 XmlRpcResponse GridResp = GridShutdownReq.Send(this.ServerURL, 3000);
117 if (GridResp.IsFault) { 124 if (GridResp.IsFault)
125 {
118 return false; 126 return false;
119 } else { 127 }
128 else
129 {
120 connected=false; 130 connected=false;
121 return true; 131 return true;
122 } 132 }
123 } catch(Exception e) { 133 }
134 catch(Exception e)
135 {
124 Console.WriteLine(e.ToString()); 136 Console.WriteLine(e.ToString());
125 return false; 137 return false;
126 } 138 }