aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authormingchen2008-01-07 15:23:00 +0000
committermingchen2008-01-07 15:23:00 +0000
commit1718c39e100b17d44d14e9fa138d4a24793e4b89 (patch)
tree5f21bccd813292b8f568dabbf8234147c6b45b42
parent* More message server methods (diff)
downloadopensim-SC_OLD-1718c39e100b17d44d14e9fa138d4a24793e4b89.zip
opensim-SC_OLD-1718c39e100b17d44d14e9fa138d4a24793e4b89.tar.gz
opensim-SC_OLD-1718c39e100b17d44d14e9fa138d4a24793e4b89.tar.bz2
opensim-SC_OLD-1718c39e100b17d44d14e9fa138d4a24793e4b89.tar.xz
*Added ability to update only necessary data on insertRegion for the grid server.
-rw-r--r--OpenSim/Framework/Data.MySQL/MySQLManager.cs28
-rw-r--r--OpenSim/Grid/UserServer/UserManager.cs2
2 files changed, 24 insertions, 6 deletions
diff --git a/OpenSim/Framework/Data.MySQL/MySQLManager.cs b/OpenSim/Framework/Data.MySQL/MySQLManager.cs
index 96f0c4d..9532f21 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLManager.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLManager.cs
@@ -600,8 +600,19 @@ namespace OpenSim.Framework.Data.MySQL
600 /// <returns>Success?</returns> 600 /// <returns>Success?</returns>
601 public bool insertRegion(RegionProfileData regiondata) 601 public bool insertRegion(RegionProfileData regiondata)
602 { 602 {
603 string sql = 603 bool GRID_ONLY_UPDATE_NECESSARY_DATA = false;
604 "REPLACE INTO regions (regionHandle, regionName, uuid, regionRecvKey, regionSecret, regionSendKey, regionDataURI, "; 604
605 string sql = "";
606 if (GRID_ONLY_UPDATE_NECESSARY_DATA)
607 {
608 sql += "INSERT INTO ";
609 }
610 else
611 {
612 sql += "REPLACE INTO ";
613 }
614
615 sql += "regions (regionHandle, regionName, uuid, regionRecvKey, regionSecret, regionSendKey, regionDataURI, ";
605 sql += 616 sql +=
606 "serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, "; 617 "serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, ";
607 sql += 618 sql +=
@@ -611,8 +622,16 @@ namespace OpenSim.Framework.Data.MySQL
611 sql += 622 sql +=
612 "?serverIP, ?serverPort, ?serverURI, ?locX, ?locY, ?locZ, ?eastOverrideHandle, ?westOverrideHandle, ?southOverrideHandle, ?northOverrideHandle, ?regionAssetURI, ?regionAssetRecvKey, "; 623 "?serverIP, ?serverPort, ?serverURI, ?locX, ?locY, ?locZ, ?eastOverrideHandle, ?westOverrideHandle, ?southOverrideHandle, ?northOverrideHandle, ?regionAssetURI, ?regionAssetRecvKey, ";
613 sql += 624 sql +=
614 "?regionAssetSendKey, ?regionUserURI, ?regionUserRecvKey, ?regionUserSendKey, ?regionMapTexture, ?serverHttpPort, ?serverRemotingPort);"; 625 "?regionAssetSendKey, ?regionUserURI, ?regionUserRecvKey, ?regionUserSendKey, ?regionMapTexture, ?serverHttpPort, ?serverRemotingPort)";
615 //sql += "ON DUPLICATE KEY UPDATE;"; 626
627 if (GRID_ONLY_UPDATE_NECESSARY_DATA)
628 {
629 sql += "ON DUPLICATE KEY UPDATE serverIP = ?serverIP, serverPort = ?serverPort, serverURI = ?serverURI;";
630 }
631 else
632 {
633 sql += ";";
634 }
616 635
617 Dictionary<string, string> parameters = new Dictionary<string, string>(); 636 Dictionary<string, string> parameters = new Dictionary<string, string>();
618 637
@@ -642,7 +661,6 @@ namespace OpenSim.Framework.Data.MySQL
642 parameters["?regionMapTexture"] = regiondata.regionMapTextureID.ToString(); 661 parameters["?regionMapTexture"] = regiondata.regionMapTextureID.ToString();
643 parameters["?serverHttpPort"] = regiondata.httpPort.ToString(); 662 parameters["?serverHttpPort"] = regiondata.httpPort.ToString();
644 parameters["?serverRemotingPort"] = regiondata.remotingPort.ToString(); 663 parameters["?serverRemotingPort"] = regiondata.remotingPort.ToString();
645
646 bool returnval = false; 664 bool returnval = false;
647 665
648 try 666 try
diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs
index c905ffe..03b1fbc 100644
--- a/OpenSim/Grid/UserServer/UserManager.cs
+++ b/OpenSim/Grid/UserServer/UserManager.cs
@@ -334,4 +334,4 @@ namespace OpenSim.Grid.UserServer
334 throw new Exception("The method or operation is not implemented."); 334 throw new Exception("The method or operation is not implemented.");
335 } 335 }
336 } 336 }
337} \ No newline at end of file 337}