aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
diff options
context:
space:
mode:
authorUbitUmarov2019-08-17 23:57:05 +0100
committerUbitUmarov2019-08-17 23:57:05 +0100
commitdb374112c6ce406fafe30a5da3a16d327dcb7a03 (patch)
tree5e9c36d09fadd75a6218d2978df99b95f6fefd36 /OpenSim/Region/ClientStack
parentEstateAccess: add some ban fields to fill one day (diff)
downloadopensim-SC-db374112c6ce406fafe30a5da3a16d327dcb7a03.zip
opensim-SC-db374112c6ce406fafe30a5da3a16d327dcb7a03.tar.gz
opensim-SC-db374112c6ce406fafe30a5da3a16d327dcb7a03.tar.bz2
opensim-SC-db374112c6ce406fafe30a5da3a16d327dcb7a03.tar.xz
EstateAccess do fill the fields(mySQL only); fix the response
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/EstateAccess.cs51
1 files changed, 33 insertions, 18 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EstateAccess.cs b/OpenSim/Region/ClientStack/Linden/Caps/EstateAccess.cs
index c3a48d9..3a4d9a5 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/EstateAccess.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/EstateAccess.cs
@@ -28,6 +28,7 @@
28using System; 28using System;
29using System.Collections; 29using System.Collections;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Globalization;
31using System.Text; 32using System.Text;
32 33
33using log4net; 34using log4net;
@@ -166,59 +167,73 @@ namespace OpenSim.Region.ClientStack.Linden
166 EstateBan[] EstateBans = regionSettings.EstateBans; 167 EstateBan[] EstateBans = regionSettings.EstateBans;
167 168
168 StringBuilder sb = LLSDxmlEncode.Start(); 169 StringBuilder sb = LLSDxmlEncode.Start();
169 LLSDxmlEncode.AddArray(sb); 170 LLSDxmlEncode.AddMap(sb);
170 171
171 if (allowed != null && allowed.Length > 0) 172 if (allowed != null && allowed.Length > 0)
172 { 173 {
173 LLSDxmlEncode.AddMap("AllowedAgents", sb); 174 LLSDxmlEncode.AddArray("AllowedAgents", sb);
174 for (int i = 0; i < allowed.Length; ++i) 175 for (int i = 0; i < allowed.Length; ++i)
175 { 176 {
176 UUID id = allowed[i]; 177 UUID id = allowed[i];
177 if (id == UUID.Zero) 178 if (id == UUID.Zero)
178 continue; 179 continue;
179 LLSDxmlEncode.AddElem("id", id, sb); 180 LLSDxmlEncode.AddMap(sb);
181 LLSDxmlEncode.AddElem("id", id, sb);
182 LLSDxmlEncode.AddEndMap(sb);
180 } 183 }
181 LLSDxmlEncode.AddEndMap(sb); 184 LLSDxmlEncode.AddEndArray(sb);
182 } 185 }
183 186
184 if (groups != null && groups.Length > 0) 187 if (groups != null && groups.Length > 0)
185 { 188 {
186 LLSDxmlEncode.AddMap("AllowedGroups", sb); 189 LLSDxmlEncode.AddArray("AllowedGroups", sb);
187 for (int i = 0; i < groups.Length; ++i) 190 for (int i = 0; i < groups.Length; ++i)
188 { 191 {
189 UUID id = groups[i]; 192 UUID id = groups[i];
190 if (id == UUID.Zero) 193 if (id == UUID.Zero)
191 continue; 194 continue;
192 LLSDxmlEncode.AddElem("id", id, sb); 195 LLSDxmlEncode.AddMap(sb);
196 LLSDxmlEncode.AddElem("id", id, sb);
197 LLSDxmlEncode.AddEndMap(sb);
193 } 198 }
194 LLSDxmlEncode.AddEndMap(sb); 199 LLSDxmlEncode.AddEndArray(sb);
195 } 200 }
196 201
197 if (EstateBans != null && EstateBans.Length > 0) 202 if (EstateBans != null && EstateBans.Length > 0)
198 { 203 {
199 LLSDxmlEncode.AddMap("BannedAgents", sb); 204 LLSDxmlEncode.AddArray("BannedAgents", sb);
200 for (int i = 0; i < EstateBans.Length; ++i) 205 for (int i = 0; i < EstateBans.Length; ++i)
201 { 206 {
202 UUID id = EstateBans[i].BannedUserID; 207 EstateBan ban = EstateBans[i];
208 UUID id = ban.BannedUserID;
203 if (id == UUID.Zero) 209 if (id == UUID.Zero)
204 continue; 210 continue;
205 LLSDxmlEncode.AddElem("id", id, sb); 211 LLSDxmlEncode.AddMap(sb);
206 LLSDxmlEncode.AddElem("last_login_date", "0000-00-00 00:00:00", sb); // We will not have this 212 LLSDxmlEncode.AddElem("id", id, sb);
207 LLSDxmlEncode.AddElem("ban_date", "0000-00-00 00:00:00", sb); // We will have this 213 LLSDxmlEncode.AddElem("banning_id", ban.BanningUserID, sb);
208 LLSDxmlEncode.AddElem("banning_id", UUID.Zero, sb); // we will have this one day 214 LLSDxmlEncode.AddElem("last_login_date", "na", sb); // We will not have this. This information is far at grid
215 if (ban.BanTime == 0)
216 LLSDxmlEncode.AddElem("ban_date", "0000-00-00 00:00", sb);
217 else
218 LLSDxmlEncode.AddElem("ban_date", (Util.ToDateTime(ban.BanTime)).ToString("yyyy-MM-dd HH:mm", CultureInfo.InvariantCulture), sb);
219 LLSDxmlEncode.AddEndMap(sb);
209 } 220 }
210 LLSDxmlEncode.AddEndMap(sb); 221 LLSDxmlEncode.AddEndArray(sb);
211 } 222 }
212 223
213 if (managers != null && managers.Length > 0) 224 if (managers != null && managers.Length > 0)
214 { 225 {
215 LLSDxmlEncode.AddMap("Managers", sb); 226 LLSDxmlEncode.AddArray("Managers", sb);
216 for (int i = 0; i < managers.Length; ++i) 227 for (int i = 0; i < managers.Length; ++i)
217 LLSDxmlEncode.AddElem("id", managers[i], sb); 228 {
218 LLSDxmlEncode.AddEndMap(sb); 229 LLSDxmlEncode.AddMap(sb);
230 LLSDxmlEncode.AddElem("id", managers[i], sb);
231 LLSDxmlEncode.AddEndMap(sb);
232 }
233 LLSDxmlEncode.AddEndArray(sb);
219 } 234 }
220 235
221 LLSDxmlEncode.AddEndArray(sb); 236 LLSDxmlEncode.AddEndMap(sb);
222 responsedata["str_response_string"] = LLSDxmlEncode.End(sb); 237 responsedata["str_response_string"] = LLSDxmlEncode.End(sb);
223 238
224 return responsedata; 239 return responsedata;