aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDiva Canto2009-09-24 18:23:55 -0700
committerDiva Canto2009-09-24 18:23:55 -0700
commit6a5d7650d02979c74abcbbb3595729a4a6b55411 (patch)
tree85271d3382223cc9a851309dd707be127554da47
parentGridServerPostHandler finished. GridClient tests all work. More guards on get... (diff)
downloadopensim-SC_OLD-6a5d7650d02979c74abcbbb3595729a4a6b55411.zip
opensim-SC_OLD-6a5d7650d02979c74abcbbb3595729a4a6b55411.tar.gz
opensim-SC_OLD-6a5d7650d02979c74abcbbb3595729a4a6b55411.tar.bz2
opensim-SC_OLD-6a5d7650d02979c74abcbbb3595729a4a6b55411.tar.xz
All tests pass for MySQL/MySQLRegionData.
Added OpenSim.GridServer.ini.example that I have been using for testing the ROBUST grid service with the GridClient.
-rw-r--r--OpenSim/Data/MySQL/MySQLRegionData.cs15
-rw-r--r--OpenSim/Services/GridService/GridService.cs5
-rw-r--r--OpenSim/Services/Interfaces/IGridService.cs61
-rw-r--r--bin/OpenSim.GridServer.ini.example35
4 files changed, 59 insertions, 57 deletions
diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs
index ced26a4..e13e12c 100644
--- a/OpenSim/Data/MySQL/MySQLRegionData.cs
+++ b/OpenSim/Data/MySQL/MySQLRegionData.cs
@@ -77,7 +77,7 @@ namespace OpenSim.Data.MySQL
77 cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); 77 cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString());
78 78
79 List<RegionData> ret = RunCommand(cmd); 79 List<RegionData> ret = RunCommand(cmd);
80 if (ret == null) 80 if (ret.Count == 0)
81 return null; 81 return null;
82 82
83 return ret[0]; 83 return ret[0];
@@ -95,7 +95,7 @@ namespace OpenSim.Data.MySQL
95 cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); 95 cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString());
96 96
97 List<RegionData> ret = RunCommand(cmd); 97 List<RegionData> ret = RunCommand(cmd);
98 if (ret == null) 98 if (ret.Count == 0)
99 return null; 99 return null;
100 100
101 return ret[0]; 101 return ret[0];
@@ -170,10 +170,7 @@ namespace OpenSim.Data.MySQL
170 result.Close(); 170 result.Close();
171 CloseReaderCommand(cmd); 171 CloseReaderCommand(cmd);
172 172
173 if (retList.Count > 0) 173 return retList;
174 return retList;
175
176 return null;
177 } 174 }
178 175
179 public bool Store(RegionData data) 176 public bool Store(RegionData data)
@@ -182,12 +179,6 @@ namespace OpenSim.Data.MySQL
182 data.Data.Remove("uuid"); 179 data.Data.Remove("uuid");
183 if (data.Data.ContainsKey("ScopeID")) 180 if (data.Data.ContainsKey("ScopeID"))
184 data.Data.Remove("ScopeID"); 181 data.Data.Remove("ScopeID");
185 if (data.Data.ContainsKey("regionName"))
186 data.Data.Remove("regionName");
187 if (data.Data.ContainsKey("posX"))
188 data.Data.Remove("posX");
189 if (data.Data.ContainsKey("posY"))
190 data.Data.Remove("posY");
191 182
192 string[] fields = new List<string>(data.Data.Keys).ToArray(); 183 string[] fields = new List<string>(data.Data.Keys).ToArray();
193 184
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs
index 01ffa1d..41344ad 100644
--- a/OpenSim/Services/GridService/GridService.cs
+++ b/OpenSim/Services/GridService/GridService.cs
@@ -183,9 +183,9 @@ namespace OpenSim.Services.GridService
183 rdata.posX = (int)rinfo.RegionLocX; 183 rdata.posX = (int)rinfo.RegionLocX;
184 rdata.posY = (int)rinfo.RegionLocY; 184 rdata.posY = (int)rinfo.RegionLocY;
185 rdata.RegionID = rinfo.RegionID; 185 rdata.RegionID = rinfo.RegionID;
186 rdata.Data = rinfo.ToKeyValuePairs();
187 rdata.RegionName = rinfo.RegionName; 186 rdata.RegionName = rinfo.RegionName;
188 187 rdata.Data = rinfo.ToKeyValuePairs();
188 rdata.Data["regionHandle"] = Utils.UIntsToLong((uint)rdata.posX, (uint)rdata.posY);
189 return rdata; 189 return rdata;
190 } 190 }
191 191
@@ -196,6 +196,7 @@ namespace OpenSim.Services.GridService
196 rinfo.RegionLocY = rdata.posY; 196 rinfo.RegionLocY = rdata.posY;
197 rinfo.RegionID = rdata.RegionID; 197 rinfo.RegionID = rdata.RegionID;
198 rinfo.RegionName = rdata.RegionName; 198 rinfo.RegionName = rdata.RegionName;
199 rinfo.ScopeID = rdata.ScopeID;
199 200
200 return rinfo; 201 return rinfo;
201 } 202 }
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs
index 4bdcde2..513b1b0 100644
--- a/OpenSim/Services/Interfaces/IGridService.cs
+++ b/OpenSim/Services/Interfaces/IGridService.cs
@@ -263,72 +263,47 @@ namespace OpenSim.Services.Interfaces
263 kvp["uuid"] = RegionID.ToString(); 263 kvp["uuid"] = RegionID.ToString();
264 kvp["locX"] = RegionLocX.ToString(); 264 kvp["locX"] = RegionLocX.ToString();
265 kvp["locY"] = RegionLocY.ToString(); 265 kvp["locY"] = RegionLocY.ToString();
266 kvp["name"] = RegionName; 266 kvp["regionName"] = RegionName;
267 kvp["external_ip_address"] = ExternalEndPoint.Address.ToString(); 267 kvp["serverIP"] = ExternalHostName; //ExternalEndPoint.Address.ToString();
268 kvp["external_port"] = ExternalEndPoint.Port.ToString(); 268 kvp["serverHttpPort"] = HttpPort.ToString();
269 kvp["external_host_name"] = ExternalHostName; 269 kvp["serverURI"] = ServerURI;
270 kvp["http_port"] = HttpPort.ToString();
271 kvp["internal_ip_address"] = InternalEndPoint.Address.ToString();
272 kvp["internal_port"] = InternalEndPoint.Port.ToString();
273 kvp["alternate_ports"] = m_allow_alternate_ports.ToString();
274 kvp["server_uri"] = ServerURI;
275 270
276 return kvp; 271 return kvp;
277 } 272 }
278 273
279 public GridRegion(Dictionary<string, object> kvp) 274 public GridRegion(Dictionary<string, object> kvp)
280 { 275 {
281 if (kvp["uuid"] != null) 276 if (kvp.ContainsKey("uuid"))
282 RegionID = new UUID((string)kvp["uuid"]); 277 RegionID = new UUID((string)kvp["uuid"]);
283 278
284 if (kvp["locX"] != null) 279 if (kvp.ContainsKey("locX"))
285 RegionLocX = Convert.ToInt32((string)kvp["locX"]); 280 RegionLocX = Convert.ToInt32((string)kvp["locX"]);
286 281
287 if (kvp["locY"] != null) 282 if (kvp.ContainsKey("locY"))
288 RegionLocY = Convert.ToInt32((string)kvp["locY"]); 283 RegionLocY = Convert.ToInt32((string)kvp["locY"]);
289 284
290 if (kvp["name"] != null) 285 if (kvp.ContainsKey("regionName"))
291 RegionName = (string)kvp["name"]; 286 RegionName = (string)kvp["regionName"];
292 287
293 if ((kvp["external_ip_address"] != null) && (kvp["external_port"] != null)) 288 if (kvp.ContainsKey("serverIP"))
294 { 289 {
295 int port = 0; 290 int port = 0;
296 Int32.TryParse((string)kvp["external_port"], out port); 291 //Int32.TryParse((string)kvp["serverPort"], out port);
297 IPEndPoint ep = new IPEndPoint(IPAddress.Parse((string)kvp["external_ip_address"]), port); 292 //IPEndPoint ep = new IPEndPoint(IPAddress.Parse((string)kvp["serverIP"]), port);
298 ExternalEndPoint = ep; 293 ExternalHostName = (string)kvp["serverIP"];
299 } 294 }
300 else 295 else
301 ExternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0); 296 ExternalHostName = "127.0.0.1";
302 297
303 if (kvp["external_host_name"] != null) 298 if (kvp.ContainsKey("serverHttpPort"))
304 ExternalHostName = (string)kvp["external_host_name"];
305
306 if (kvp["http_port"] != null)
307 { 299 {
308 UInt32 port = 0; 300 UInt32 port = 0;
309 UInt32.TryParse((string)kvp["http_port"], out port); 301 UInt32.TryParse((string)kvp["serverHttpPort"], out port);
310 HttpPort = port; 302 HttpPort = port;
311 } 303 }
312 304
313 if ((kvp["internal_ip_address"] != null) && (kvp["internal_port"] != null)) 305 if (kvp.ContainsKey("serverURI"))
314 { 306 ServerURI = (string)kvp["serverURI"];
315 int port = 0;
316 Int32.TryParse((string)kvp["internal_port"], out port);
317 IPEndPoint ep = new IPEndPoint(IPAddress.Parse((string)kvp["internal_ip_address"]), port);
318 InternalEndPoint = ep;
319 }
320 else
321 InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0);
322
323 if (kvp["alternate_ports"] != null)
324 {
325 bool alts = false;
326 Boolean.TryParse((string)kvp["alternate_ports"], out alts);
327 m_allow_alternate_ports = alts;
328 }
329
330 if (kvp["server_uri"] != null)
331 ServerURI = (string)kvp["server_uri"];
332 } 307 }
333 } 308 }
334 309
diff --git a/bin/OpenSim.GridServer.ini.example b/bin/OpenSim.GridServer.ini.example
new file mode 100644
index 0000000..695bf9e
--- /dev/null
+++ b/bin/OpenSim.GridServer.ini.example
@@ -0,0 +1,35 @@
1; * The startup section lists all the connectors to start up in this server
2; * instance. This may be only one, or it may be the entire server suite.
3; * Multiple connectors should be seaprated by commas.
4; *
5; * These are the IN connectors the server uses, the in connectors
6; * read this config file and load the needed OUT and database connectors
7; *
8; *
9[Startup]
10 ServiceConnectors = "OpenSim.Server.Handlers.dll:GridServiceConnector"
11
12; * This is common for all services, it's the network setup for the entire
13; * server instance
14; *
15[Network]
16 port = 8002
17
18; * The following are for the remote console
19; * They have no effect for the local or basic console types
20; * Leave commented to diable logins to the console
21;ConsoleUser = Test
22;ConsolePass = secret
23
24; * As an example, the below configuration precisely mimicks the legacy
25; * asset server. It is read by the asset IN connector (defined above)
26; * and it then loads the OUT connector (a local database module). That,
27; * in turn, reads the asset loader and database connection information
28; *
29[GridService]
30 LocalServiceModule = "OpenSim.Services.GridService.dll:GridService"
31 StorageProvider = "OpenSim.Data.Null.dll:NullRegionData"
32 ;StorageProvider = "OpenSim.Data.MySQL.dll:MySqlRegionData"
33 ;ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;"
34 Realm = "regions"
35