aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data
diff options
context:
space:
mode:
authorUbitUmarov2019-11-14 06:34:44 +0000
committerUbitUmarov2019-11-14 06:34:44 +0000
commit31aef4e82b2e746837a6ef0fcd8d3f1b7385bc8e (patch)
tree1714d1b387d631925abc9bb417adc17565084dc9 /OpenSim/Data
parentComplete PostGres from previous commit - (Not Tested) (diff)
downloadopensim-SC-31aef4e82b2e746837a6ef0fcd8d3f1b7385bc8e.zip
opensim-SC-31aef4e82b2e746837a6ef0fcd8d3f1b7385bc8e.tar.gz
opensim-SC-31aef4e82b2e746837a6ef0fcd8d3f1b7385bc8e.tar.bz2
opensim-SC-31aef4e82b2e746837a6ef0fcd8d3f1b7385bc8e.tar.xz
work on previus 2 patchs
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/IRegionData.cs2
-rw-r--r--OpenSim/Data/MySQL/MySQLRegionData.cs24
-rw-r--r--OpenSim/Data/Null/NullRegionData.cs32
-rw-r--r--OpenSim/Data/PGSQL/PGSQLRegionData.cs1
4 files changed, 25 insertions, 34 deletions
diff --git a/OpenSim/Data/IRegionData.cs b/OpenSim/Data/IRegionData.cs
index d67b5fa..218356a 100644
--- a/OpenSim/Data/IRegionData.cs
+++ b/OpenSim/Data/IRegionData.cs
@@ -71,8 +71,6 @@ namespace OpenSim.Data
71 { 71 {
72 RegionData Get(UUID regionID, UUID ScopeID); 72 RegionData Get(UUID regionID, UUID ScopeID);
73 List<RegionData> Get(string regionName, UUID ScopeID); 73 List<RegionData> Get(string regionName, UUID ScopeID);
74
75 //BA MOD....
76 RegionData GetSpecific(string regionName, UUID ScopeID); 74 RegionData GetSpecific(string regionName, UUID ScopeID);
77 75
78 RegionData Get(int x, int y, UUID ScopeID); 76 RegionData Get(int x, int y, UUID ScopeID);
diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs
index 12064a3..9115e93 100644
--- a/OpenSim/Data/MySQL/MySQLRegionData.cs
+++ b/OpenSim/Data/MySQL/MySQLRegionData.cs
@@ -81,15 +81,12 @@ namespace OpenSim.Data.MySQL
81 } 81 }
82 } 82 }
83 83
84 //BA MOD....
85 public RegionData GetSpecific(string regionName, UUID scopeID) 84 public RegionData GetSpecific(string regionName, UUID scopeID)
86 { 85 {
87 string command = "select * from `" + m_Realm + "` where regionName = ?regionName"; 86 string command = "select * from `" + m_Realm + "` where regionName = ?regionName";
88 if (scopeID != UUID.Zero) 87 if (scopeID != UUID.Zero)
89 command += " and ScopeID = ?scopeID"; 88 command += " and ScopeID = ?scopeID";
90 89
91 //command += " order by regionName";
92
93 using (MySqlCommand cmd = new MySqlCommand(command)) 90 using (MySqlCommand cmd = new MySqlCommand(command))
94 { 91 {
95 cmd.Parameters.AddWithValue("?regionName", regionName); 92 cmd.Parameters.AddWithValue("?regionName", regionName);
@@ -104,27 +101,8 @@ namespace OpenSim.Data.MySQL
104 101
105 } 102 }
106 103
107 public RegionData Get(int posX, int posY, UUID scopeID) 104 public RegionData Get(int posX, int posY, UUID scopeID)
108 { 105 {
109/* fixed size regions
110 string command = "select * from `"+m_Realm+"` where locX = ?posX and locY = ?posY";
111 if (scopeID != UUID.Zero)
112 command += " and ScopeID = ?scopeID";
113
114 using (MySqlCommand cmd = new MySqlCommand(command))
115 {
116 cmd.Parameters.AddWithValue("?posX", posX.ToString());
117 cmd.Parameters.AddWithValue("?posY", posY.ToString());
118 cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString());
119
120 List<RegionData> ret = RunCommand(cmd);
121 if (ret.Count == 0)
122 return null;
123
124 return ret[0];
125 }
126*/
127 // extend database search for maximum region size area
128 string command = "select * from `" + m_Realm + "` where locX between ?startX and ?endX and locY between ?startY and ?endY"; 106 string command = "select * from `" + m_Realm + "` where locX between ?startX and ?endX and locY between ?startY and ?endY";
129 if (scopeID != UUID.Zero) 107 if (scopeID != UUID.Zero)
130 command += " and ScopeID = ?scopeID"; 108 command += " and ScopeID = ?scopeID";
diff --git a/OpenSim/Data/Null/NullRegionData.cs b/OpenSim/Data/Null/NullRegionData.cs
index a4385fe..fd60480 100644
--- a/OpenSim/Data/Null/NullRegionData.cs
+++ b/OpenSim/Data/Null/NullRegionData.cs
@@ -68,12 +68,34 @@ namespace OpenSim.Data.Null
68 68
69 private delegate bool Matcher(string value); 69 private delegate bool Matcher(string value);
70 70
71 public RegionData GetSpecific(string regionName, UUID scopeID)
72 {
73 if (m_useStaticInstance && Instance != this)
74 return Instance.GetSpecific(regionName, scopeID);
75
76 string cleanName = regionName.ToLower();
77 Matcher queryMatch;
78 queryMatch = delegate (string s) { return s.Equals(cleanName); };
79
80 lock (m_regionData)
81 {
82 foreach (RegionData r in m_regionData.Values)
83 {
84 // m_log.DebugFormat("[NULL REGION DATA]: comparing {0} to {1}", cleanName, r.RegionName.ToLower());
85 if (queryMatch(r.RegionName.ToLower()))
86 return(r);
87 }
88 }
89
90 return null;
91 }
92
71 public List<RegionData> Get(string regionName, UUID scopeID) 93 public List<RegionData> Get(string regionName, UUID scopeID)
72 { 94 {
73 if (m_useStaticInstance && Instance != this) 95 if (m_useStaticInstance && Instance != this)
74 return Instance.Get(regionName, scopeID); 96 return Instance.Get(regionName, scopeID);
75 97
76// m_log.DebugFormat("[NULL REGION DATA]: Getting region {0}, scope {1}", regionName, scopeID); 98 // m_log.DebugFormat("[NULL REGION DATA]: Getting region {0}, scope {1}", regionName, scopeID);
77 99
78 string cleanName = regionName.ToLower(); 100 string cleanName = regionName.ToLower();
79 101
@@ -166,13 +188,7 @@ namespace OpenSim.Data.Null
166 return null; 188 return null;
167 } 189 }
168 190
169 //BA MOD... 191 public List<RegionData> Get(int startX, int startY, int endX, int endY, UUID scopeID)
170 public RegionData GetSpecific(string regionName, UUID ScopeID)
171 {
172 return null;
173 }
174
175 public List<RegionData> Get(int startX, int startY, int endX, int endY, UUID scopeID)
176 { 192 {
177 if (m_useStaticInstance && Instance != this) 193 if (m_useStaticInstance && Instance != this)
178 return Instance.Get(startX, startY, endX, endY, scopeID); 194 return Instance.Get(startX, startY, endX, endY, scopeID);
diff --git a/OpenSim/Data/PGSQL/PGSQLRegionData.cs b/OpenSim/Data/PGSQL/PGSQLRegionData.cs
index adea2e0..a58fc8a 100644
--- a/OpenSim/Data/PGSQL/PGSQLRegionData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLRegionData.cs
@@ -114,7 +114,6 @@ namespace OpenSim.Data.PGSQL
114 } 114 }
115 } 115 }
116 116
117 //BA MOD...
118 public RegionData GetSpecific(string regionName, UUID scopeID) 117 public RegionData GetSpecific(string regionName, UUID scopeID)
119 { 118 {
120 string sql = "select * from " + m_Realm + " where lower(\"regionName\") = lower(:regionName) "; 119 string sql = "select * from " + m_Realm + " where lower(\"regionName\") = lower(:regionName) ";