aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/GridServer/GridManager.cs
diff options
context:
space:
mode:
authorlbsa712008-04-11 09:56:22 +0000
committerlbsa712008-04-11 09:56:22 +0000
commitcbf9fcfac591bd8c8fcbccaa562c7a5fa05c4d9c (patch)
treef2172eccc3652e6f5bccc2be3cf71ec838801f47 /OpenSim/Grid/GridServer/GridManager.cs
parent* Added a "regionload_regionsdir" option to OpenSim.ini which determines wher... (diff)
downloadopensim-SC-cbf9fcfac591bd8c8fcbccaa562c7a5fa05c4d9c.zip
opensim-SC-cbf9fcfac591bd8c8fcbccaa562c7a5fa05c4d9c.tar.gz
opensim-SC-cbf9fcfac591bd8c8fcbccaa562c7a5fa05c4d9c.tar.bz2
opensim-SC-cbf9fcfac591bd8c8fcbccaa562c7a5fa05c4d9c.tar.xz
* Discerned between AddProfile and UpdateProfile in region registration
:: Believe it or not, but INSERT/UPDATE is actually a better pattern than REPLACE, since, with INSERT/UPDATE you can catch erroneous UPDATES to non-INSERTed items as well as catch erroneous re-INSERTS. in 95% of the cases, you SHOULD have a clear INSERT context, and a clear and separate UPDATE context. If you think your case falls within the 5%, maybe you should re-evaluate your code. ::
Diffstat (limited to '')
-rw-r--r--OpenSim/Grid/GridServer/GridManager.cs12
1 files changed, 11 insertions, 1 deletions
diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs
index 5ca8cf7..7b41f6e 100644
--- a/OpenSim/Grid/GridServer/GridManager.cs
+++ b/OpenSim/Grid/GridServer/GridManager.cs
@@ -333,7 +333,17 @@ namespace OpenSim.Grid.GridServer
333 { 333 {
334 try 334 try
335 { 335 {
336 DataResponse insertResponse = kvp.Value.AddProfile(sim); 336 DataResponse insertResponse;
337
338 if( existingSim == null )
339 {
340 insertResponse = kvp.Value.AddProfile(sim);
341 }
342 else
343 {
344 insertResponse = kvp.Value.UpdateProfile(sim);
345 }
346
337 switch (insertResponse) 347 switch (insertResponse)
338 { 348 {
339 case DataResponse.RESPONSE_OK: 349 case DataResponse.RESPONSE_OK: