aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMW2007-03-15 12:44:06 +0000
committerMW2007-03-15 12:44:06 +0000
commit1260e35ca824aed8042f5b83bca487f1483815dd (patch)
tree8810014da90e24d7954816417a5bfa5a87a6fcca
parentCreated VS2005 Solution/Project files for the OGS apps (diff)
downloadopensim-SC_OLD-1260e35ca824aed8042f5b83bca487f1483815dd.zip
opensim-SC_OLD-1260e35ca824aed8042f5b83bca487f1483815dd.tar.gz
opensim-SC_OLD-1260e35ca824aed8042f5b83bca487f1483815dd.tar.bz2
opensim-SC_OLD-1260e35ca824aed8042f5b83bca487f1483815dd.tar.xz
-rw-r--r--src/CAPS/SimHttp.cs88
-rw-r--r--src/GridInterfaces/IGridServer.cs19
-rw-r--r--src/GridServers/LoginServer.cs22
-rw-r--r--src/Util.cs24
4 files changed, 89 insertions, 64 deletions
diff --git a/src/CAPS/SimHttp.cs b/src/CAPS/SimHttp.cs
index 12bc9a8..c0373de 100644
--- a/src/CAPS/SimHttp.cs
+++ b/src/CAPS/SimHttp.cs
@@ -76,27 +76,30 @@ namespace OpenSim
76 } 76 }
77 77
78 static string ParseXMLRPC(string requestBody) { 78 static string ParseXMLRPC(string requestBody) {
79 try{ 79 try
80 XmlRpcRequest request = (XmlRpcRequest)(new XmlRpcRequestDeserializer()).Deserialize(requestBody); 80 {
81 81 XmlRpcRequest request = (XmlRpcRequest)(new XmlRpcRequestDeserializer()).Deserialize(requestBody);
82 Hashtable requestData = (Hashtable)request.Params[0]; 82
83 switch(request.MethodName) { 83 Hashtable requestData = (Hashtable)request.Params[0];
84 case "expect_user": 84 switch(request.MethodName) {
85 GridServers.agentcircuitdata agent_data = new GridServers.agentcircuitdata(); 85 case "expect_user":
86 agent_data.SessionID = new LLUUID((string)requestData["session_id"]); 86 GridServers.agentcircuitdata agent_data = new GridServers.agentcircuitdata();
87 agent_data.SecureSessionID = new LLUUID((string)requestData["secure_session_id"]); 87 agent_data.SessionID = new LLUUID((string)requestData["session_id"]);
88 agent_data.firstname = (string)requestData["firstname"]; 88 agent_data.SecureSessionID = new LLUUID((string)requestData["secure_session_id"]);
89 agent_data.lastname = (string)requestData["lastname"]; 89 agent_data.firstname = (string)requestData["firstname"];
90 agent_data.AgentID = new LLUUID((string)requestData["agent_id"]); 90 agent_data.lastname = (string)requestData["lastname"];
91 agent_data.circuitcode = Convert.ToUInt32(requestData["circuit_code"]); 91 agent_data.AgentID = new LLUUID((string)requestData["agent_id"]);
92 if (OpenSim_Main.gridServers.GridServer.GetName() == "Remote") 92 agent_data.circuitcode = Convert.ToUInt32(requestData["circuit_code"]);
93 { 93 if (OpenSim_Main.gridServers.GridServer.GetName() == "Remote")
94 ((RemoteGridBase) OpenSim_Main.gridServers.GridServer).agentcircuits.Add((uint)agent_data.circuitcode,agent_data); 94 {
95 } 95 ((RemoteGridBase) OpenSim_Main.gridServers.GridServer).agentcircuits.Add((uint)agent_data.circuitcode,agent_data);
96 return "<?xml version=\"1.0\"?><methodResponse><params /></methodResponse>"; 96 }
97 break; 97 return "<?xml version=\"1.0\"?><methodResponse><params /></methodResponse>";
98 } 98 break;
99 } catch(Exception e) { 99 }
100 }
101 catch(Exception e)
102 {
100 Console.WriteLine(e.ToString()); 103 Console.WriteLine(e.ToString());
101 } 104 }
102 return ""; 105 return "";
@@ -113,49 +116,48 @@ namespace OpenSim
113 116
114 static void HandleRequest(Object stateinfo) { 117 static void HandleRequest(Object stateinfo) {
115 HttpListenerContext context=(HttpListenerContext)stateinfo; 118 HttpListenerContext context=(HttpListenerContext)stateinfo;
116 119
117 HttpListenerRequest request = context.Request; 120 HttpListenerRequest request = context.Request;
118 HttpListenerResponse response = context.Response; 121 HttpListenerResponse response = context.Response;
119 122
120 response.KeepAlive=false; 123 response.KeepAlive=false;
121 response.SendChunked=false; 124 response.SendChunked=false;
122 125
123 System.IO.Stream body = request.InputStream; 126 System.IO.Stream body = request.InputStream;
124 System.Text.Encoding encoding = System.Text.Encoding.UTF8; 127 System.Text.Encoding encoding = System.Text.Encoding.UTF8;
125 System.IO.StreamReader reader = new System.IO.StreamReader(body, encoding); 128 System.IO.StreamReader reader = new System.IO.StreamReader(body, encoding);
126 129
127 string requestBody = reader.ReadToEnd(); 130 string requestBody = reader.ReadToEnd();
128 body.Close(); 131 body.Close();
129 reader.Close(); 132 reader.Close();
130 133
131 string responseString=""; 134 string responseString="";
132 switch(request.ContentType) { 135 switch(request.ContentType) {
133 case "text/xml": 136 case "text/xml":
134 // must be XML-RPC, so pass to the XML-RPC parser 137 // must be XML-RPC, so pass to the XML-RPC parser
135 138
136 responseString=ParseXMLRPC(requestBody); 139 responseString=ParseXMLRPC(requestBody);
137 response.AddHeader("Content-type","text/xml"); 140 response.AddHeader("Content-type","text/xml");
138 break; 141 break;
139 142
140 case "application/xml": 143 case "application/xml":
141 // probably LLSD we hope, otherwise it should be ignored by the parser 144 // probably LLSD we hope, otherwise it should be ignored by the parser
142 responseString=ParseLLSDXML(requestBody); 145 responseString=ParseLLSDXML(requestBody);
143 response.AddHeader("Content-type","application/xml"); 146 response.AddHeader("Content-type","application/xml");
144 break; 147 break;
145 148
146 case null: 149 case null:
147 // must be REST or invalid crap, so pass to the REST parser 150 // must be REST or invalid crap, so pass to the REST parser
148 responseString=ParseREST(request.Url.OriginalString,requestBody); 151 responseString=ParseREST(request.Url.OriginalString,requestBody);
149 break; 152 break;
150 } 153 }
151 154
152 155 byte[] buffer = System.Text.Encoding.UTF8.GetBytes(responseString);
153 byte[] buffer = System.Text.Encoding.UTF8.GetBytes(responseString); 156 System.IO.Stream output = response.OutputStream;
154 System.IO.Stream output = response.OutputStream; 157 response.SendChunked=false;
155 response.SendChunked=false;
156 response.ContentLength64=buffer.Length; 158 response.ContentLength64=buffer.Length;
157 output.Write(buffer,0,buffer.Length); 159 output.Write(buffer,0,buffer.Length);
158 output.Close(); 160 output.Close();
159 } 161 }
160 } 162 }
161 163
diff --git a/src/GridInterfaces/IGridServer.cs b/src/GridInterfaces/IGridServer.cs
index 7a43399..c56afcd 100644
--- a/src/GridInterfaces/IGridServer.cs
+++ b/src/GridInterfaces/IGridServer.cs
@@ -120,15 +120,16 @@ namespace OpenSim.GridServers
120 IGridServer GetGridServer(); 120 IGridServer GetGridServer();
121 } 121 }
122 122
123 public class agentcircuitdata { 123 public class agentcircuitdata
124 public agentcircuitdata() { } 124 {
125 public LLUUID AgentID; 125 public agentcircuitdata() { }
126 public LLUUID SessionID; 126 public LLUUID AgentID;
127 public LLUUID SecureSessionID; 127 public LLUUID SessionID;
128 public string firstname; 128 public LLUUID SecureSessionID;
129 public string lastname; 129 public string firstname;
130 public uint circuitcode; 130 public string lastname;
131 } 131 public uint circuitcode;
132 }
132 133
133 134
134} 135}
diff --git a/src/GridServers/LoginServer.cs b/src/GridServers/LoginServer.cs
index e678dbf..f63e077 100644
--- a/src/GridServers/LoginServer.cs
+++ b/src/GridServers/LoginServer.cs
@@ -216,6 +216,21 @@ namespace OpenSim.GridServers
216 int SessionRand = this.RandomClass.Next(1,999); 216 int SessionRand = this.RandomClass.Next(1,999);
217 Session = new LLUUID("aaaabbbb-0200-"+SessionRand.ToString("0000")+"-8664-58f53e442797"); 217 Session = new LLUUID("aaaabbbb-0200-"+SessionRand.ToString("0000")+"-8664-58f53e442797");
218 218
219 //create some login info
220 Hashtable LoginFlagsHash = new Hashtable();
221 LoginFlagsHash["daylight_savings"]="N";
222 LoginFlagsHash["stipend_since_login"]="N";
223 LoginFlagsHash["gendered"]="Y";
224 LoginFlagsHash["ever_logged_in"]="Y";
225 ArrayList LoginFlags=new ArrayList();
226 LoginFlags.Add(LoginFlagsHash);
227
228 Hashtable GlobalT = new Hashtable();
229 GlobalT["sun_texture_id"] = "cce0f112-878f-4586-a2e2-a8f104bba271";
230 GlobalT["cloud_texture_id"] = "fc4b9f0b-d008-45c6-96a4-01dd947ac621";
231 GlobalT["moon_texture_id"] = "fc4b9f0b-d008-45c6-96a4-01dd947ac621";
232 ArrayList GlobalTextures = new ArrayList();
233 GlobalTextures.Add(GlobalT);
219 234
220 XmlRpcResponse response =(XmlRpcResponse)(new XmlRpcResponseDeserializer()).Deserialize(this._defaultResponse); 235 XmlRpcResponse response =(XmlRpcResponse)(new XmlRpcResponseDeserializer()).Deserialize(this._defaultResponse);
221 Hashtable responseData = (Hashtable)response.Value; 236 Hashtable responseData = (Hashtable)response.Value;
@@ -224,6 +239,11 @@ namespace OpenSim.GridServers
224 responseData["sim_ip"] = OpenSim_Main.cfg.IPListenAddr; 239 responseData["sim_ip"] = OpenSim_Main.cfg.IPListenAddr;
225 responseData["agent_id"] = Agent.ToStringHyphenated(); 240 responseData["agent_id"] = Agent.ToStringHyphenated();
226 responseData["session_id"] = Session.ToStringHyphenated(); 241 responseData["session_id"] = Session.ToStringHyphenated();
242 responseData["seconds_since_epoch"]=(Int32)(DateTime.UtcNow - new DateTime(1970,1,1)).TotalSeconds;
243 responseData["login-flags"]=LoginFlags;
244 responseData["global-textures"]=GlobalTextures;
245
246 //inventory
227 ArrayList InventoryList = (ArrayList) responseData["inventory-skeleton"]; 247 ArrayList InventoryList = (ArrayList) responseData["inventory-skeleton"];
228 Hashtable Inventory1 = (Hashtable)InventoryList[0]; 248 Hashtable Inventory1 = (Hashtable)InventoryList[0];
229 Hashtable Inventory2 = (Hashtable)InventoryList[1]; 249 Hashtable Inventory2 = (Hashtable)InventoryList[1];
@@ -249,7 +269,7 @@ namespace OpenSim.GridServers
249 _login.BaseFolder = BaseFolderID; 269 _login.BaseFolder = BaseFolderID;
250 _login.InventoryFolder = InventoryFolderID; 270 _login.InventoryFolder = InventoryFolderID;
251 271
252 //working on local computer so lets add to the gridserver's list of sessions? 272 //working on local computer if so lets add to the gridserver's list of sessions?
253 if(OpenSim_Main.gridServers.GridServer.GetName() == "Local") 273 if(OpenSim_Main.gridServers.GridServer.GetName() == "Local")
254 { 274 {
255 ((LocalGridBase)this._gridServer).AddNewSession(_login); 275 ((LocalGridBase)this._gridServer).AddNewSession(_login);
diff --git a/src/Util.cs b/src/Util.cs
index e7ca608..477390e 100644
--- a/src/Util.cs
+++ b/src/Util.cs
@@ -59,17 +59,19 @@ namespace OpenSim
59 public bool Incoming; 59 public bool Incoming;
60 } 60 }
61 61
62 public class agentcircuitdata { 62 /* this is in IGridServer.cs, so there should be no reason for it to be here as well
63 public agentcircuitdata() { } 63 public class agentcircuitdata
64 public LLUUID AgentID; 64 {
65 public LLUUID SessionID; 65 public agentcircuitdata() { }
66 public LLUUID SecureSessionID; 66 public LLUUID AgentID;
67 public string firstname; 67 public LLUUID SessionID;
68 public string lastname; 68 public LLUUID SecureSessionID;
69 public uint circuitcode; 69 public string firstname;
70 } 70 public string lastname;
71 71 public uint circuitcode;
72 72 }
73 */
74
73 public class BlockingQueue< T > { 75 public class BlockingQueue< T > {
74 private Queue< T > _queue = new Queue< T >(); 76 private Queue< T > _queue = new Queue< T >();
75 private object _queueSync = new object(); 77 private object _queueSync = new object();