diff options
author | UbitUmarov | 2019-08-17 23:57:05 +0100 |
---|---|---|
committer | UbitUmarov | 2019-08-17 23:57:05 +0100 |
commit | db374112c6ce406fafe30a5da3a16d327dcb7a03 (patch) | |
tree | 5e9c36d09fadd75a6218d2978df99b95f6fefd36 /OpenSim/Region | |
parent | EstateAccess: add some ban fields to fill one day (diff) | |
download | opensim-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 '')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/Caps/EstateAccess.cs | 51 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | 6 |
2 files changed, 37 insertions, 20 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 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Globalization; | ||
31 | using System.Text; | 32 | using System.Text; |
32 | 33 | ||
33 | using log4net; | 34 | using 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; |
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index c91933f..00c77d7 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -969,11 +969,12 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
969 | continue; | 969 | continue; |
970 | 970 | ||
971 | EstateBan bitem = new EstateBan(); | 971 | EstateBan bitem = new EstateBan(); |
972 | |||
973 | bitem.BannedUserID = user; | 972 | bitem.BannedUserID = user; |
974 | bitem.EstateID = estateSettings.EstateID; | 973 | bitem.EstateID = estateSettings.EstateID; |
975 | bitem.BannedHostAddress = "0.0.0.0"; | 974 | bitem.BannedHostAddress = "0.0.0.0"; |
976 | bitem.BannedHostIPMask = "0.0.0.0"; | 975 | bitem.BannedHostIPMask = "0.0.0.0"; |
976 | bitem.BanningUserID = remote_client.AgentId; | ||
977 | bitem.BanTime = Util.UnixTimeSinceEpoch(); | ||
977 | 978 | ||
978 | estateSettings.AddBan(bitem); | 979 | estateSettings.AddBan(bitem); |
979 | estateSettings.RemoveEstateUser(user); | 980 | estateSettings.RemoveEstateUser(user); |
@@ -982,11 +983,12 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
982 | } | 983 | } |
983 | 984 | ||
984 | EstateBan item = new EstateBan(); | 985 | EstateBan item = new EstateBan(); |
985 | |||
986 | item.BannedUserID = user; | 986 | item.BannedUserID = user; |
987 | item.EstateID = Scene.RegionInfo.EstateSettings.EstateID; | 987 | item.EstateID = Scene.RegionInfo.EstateSettings.EstateID; |
988 | item.BannedHostAddress = "0.0.0.0"; | 988 | item.BannedHostAddress = "0.0.0.0"; |
989 | item.BannedHostIPMask = "0.0.0.0"; | 989 | item.BannedHostIPMask = "0.0.0.0"; |
990 | item.BanningUserID = remote_client.AgentId; | ||
991 | item.BanTime = Util.UnixTimeSinceEpoch(); | ||
990 | 992 | ||
991 | thisSettings.AddBan(item); | 993 | thisSettings.AddBan(item); |
992 | thisSettings.RemoveEstateUser(user); | 994 | thisSettings.RemoveEstateUser(user); |