aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie2010-03-09 22:28:52 +0000
committerMelanie2010-03-09 22:28:52 +0000
commit06e351f1ef83217ac5f9ab479120cd23a68a6012 (patch)
treec36dab0b42a332a9f6c144640c7037ad5762d01b /OpenSim
parentSmall consistency change (diff)
downloadopensim-SC_OLD-06e351f1ef83217ac5f9ab479120cd23a68a6012.zip
opensim-SC_OLD-06e351f1ef83217ac5f9ab479120cd23a68a6012.tar.gz
opensim-SC_OLD-06e351f1ef83217ac5f9ab479120cd23a68a6012.tar.bz2
opensim-SC_OLD-06e351f1ef83217ac5f9ab479120cd23a68a6012.tar.xz
Revert "Adds land ejection and freezing. Adds more checks to land banning."
This reverts commit 44d523518af31075c77653eacc7489220db4abaa.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs128
1 files changed, 25 insertions, 103 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index ef3e722..33d16d5 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -161,10 +161,6 @@ namespace OpenSim.Region.CoreModules.World.Land
161 client.OnParcelInfoRequest += ClientOnParcelInfoRequest; 161 client.OnParcelInfoRequest += ClientOnParcelInfoRequest;
162 client.OnParcelDwellRequest += ClientOnParcelDwellRequest; 162 client.OnParcelDwellRequest += ClientOnParcelDwellRequest;
163 client.OnParcelDeedToGroup += ClientOnParcelDeedToGroup; 163 client.OnParcelDeedToGroup += ClientOnParcelDeedToGroup;
164 client.OnParcelGodMark += ClientOnParcelGodMark;
165 client.OnSimWideDeletes += ClientOnSimWideDeletes;
166 client.OnParcelFreezeUser += ClientOnParcelFreezeUser;
167 client.OnParcelEjectUser += ClientOnParcelEjectUser;
168 164
169 EntityBase presenceEntity; 165 EntityBase presenceEntity;
170 if (m_scene.Entities.TryGetValue(client.AgentId, out presenceEntity) && presenceEntity is ScenePresence) 166 if (m_scene.Entities.TryGetValue(client.AgentId, out presenceEntity) && presenceEntity is ScenePresence)
@@ -273,7 +269,22 @@ namespace OpenSim.Region.CoreModules.World.Land
273 return parcelsNear; 269 return parcelsNear;
274 } 270 }
275 271
276 272 public void KickUserOffOfParcel(ScenePresence avatar)
273 {
274 if (avatar.GodLevel == 0)
275 {
276 List<ILandObject> parcelsNear = ParcelsNearPoint(avatar.AbsolutePosition);
277 foreach (ILandObject check in parcelsNear)
278 {
279 if (check.IsEitherBannedOrRestricted(avatar.UUID) != true)
280 {
281 Vector3 target = check.LandData.UserLocation;
282 avatar.TeleportWithMomentum(target);
283 return;
284 }
285 }
286 }
287 }
277 public void MoveUserOutOfParcel(ScenePresence avatar) 288 public void MoveUserOutOfParcel(ScenePresence avatar)
278 { 289 {
279 if (avatar.GodLevel == 0) 290 if (avatar.GodLevel == 0)
@@ -290,6 +301,7 @@ namespace OpenSim.Region.CoreModules.World.Land
290 { 301 {
291 Vector3 target = new Vector3(avatar.AbsolutePosition.X + x, avatar.AbsolutePosition.Y, avatar.AbsolutePosition.Z); 302 Vector3 target = new Vector3(avatar.AbsolutePosition.X + x, avatar.AbsolutePosition.Y, avatar.AbsolutePosition.Z);
292 avatar.TeleportWithMomentum(target); 303 avatar.TeleportWithMomentum(target);
304 avatar.Velocity = new Vector3(-avatar.Velocity.X - 5, avatar.Velocity.Y, avatar.Velocity.Z);
293 return; 305 return;
294 } 306 }
295 } 307 }
@@ -303,73 +315,11 @@ namespace OpenSim.Region.CoreModules.World.Land
303 { 315 {
304 Vector3 target = new Vector3(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y + y, avatar.AbsolutePosition.Z); 316 Vector3 target = new Vector3(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y + y, avatar.AbsolutePosition.Z);
305 avatar.TeleportWithMomentum(target); 317 avatar.TeleportWithMomentum(target);
318 avatar.Velocity = new Vector3(avatar.Velocity.X, -avatar.Velocity.Y - 5, avatar.Velocity.Z);
306 return; 319 return;
307 } 320 }
308 } 321 }
309 } 322 }
310 List<ILandObject> allParcels = new List<ILandObject>();
311 allParcels = AllParcels();
312 if (allParcels.Count != 1)
313 {
314 foreach (ILandObject parcel in allParcels)
315 {
316 if (parcel.IsEitherBannedOrRestricted(avatar.UUID) != true)
317 {
318 Vector3 temptarget = parcel.LandData.UserLocation;
319 if (parcel.ContainsPoint((int)parcel.LandData.UserLocation.X, (int)parcel.LandData.UserLocation.Y))
320 {
321 avatar.TeleportWithMomentum(temptarget);
322 return;
323 }
324 else
325 {
326 for (int x = 0; x <= Constants.RegionSize / 3; x += 3)
327 {
328 for (int y = 0; y <= Constants.RegionSize / 3; y += 3)
329 {
330 if (parcel.ContainsPoint(x, y))
331 {
332 temptarget = new Vector3(x, y, avatar.AbsolutePosition.Z);
333 avatar.TeleportWithMomentum(temptarget);
334 return;
335 }
336 }
337 }
338 }
339 }
340 }
341 }
342 //Move to region side
343 if (avatar.AbsolutePosition.X > avatar.AbsolutePosition.Y)
344 {
345 if (avatar.AbsolutePosition.X > .5 * Constants.RegionSize)
346 {
347 Vector3 target = new Vector3(Constants.RegionSize, avatar.AbsolutePosition.Y, avatar.AbsolutePosition.Z); ;
348 avatar.TeleportWithMomentum(target);
349 return;
350 }
351 else
352 {
353 Vector3 target = new Vector3(0, avatar.AbsolutePosition.Y, avatar.AbsolutePosition.Z); ;
354 avatar.TeleportWithMomentum(target);
355 return;
356 }
357 }
358 else
359 {
360 if (avatar.AbsolutePosition.Y > .5 * Constants.RegionSize)
361 {
362 Vector3 target = new Vector3(avatar.AbsolutePosition.X, Constants.RegionSize, avatar.AbsolutePosition.Z); ;
363 avatar.TeleportWithMomentum(target);
364 return;
365 }
366 else
367 {
368 Vector3 target = new Vector3(avatar.AbsolutePosition.X, 0, avatar.AbsolutePosition.Z); ;
369 avatar.TeleportWithMomentum(target);
370 return;
371 }
372 }
373 } 323 }
374 } 324 }
375 325
@@ -412,12 +362,12 @@ namespace OpenSim.Region.CoreModules.World.Land
412 { 362 {
413 if (checkBan.IsRestrictedFromLand(avatar.ControllingClient.AgentId)) 363 if (checkBan.IsRestrictedFromLand(avatar.ControllingClient.AgentId))
414 { 364 {
415 checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionNotOnAccessList, true, (int)ParcelResult.Multiple, avatar.ControllingClient); 365 checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionNotOnAccessList, false, (int)ParcelResult.Single, avatar.ControllingClient);
416 return; 366 return;
417 } 367 }
418 if (checkBan.IsBannedFromLand(avatar.ControllingClient.AgentId)) 368 if (checkBan.IsBannedFromLand(avatar.ControllingClient.AgentId))
419 { 369 {
420 checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionBanned, true, (int)ParcelResult.Multiple, avatar.ControllingClient); 370 checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionBanned, false, (int)ParcelResult.Single, avatar.ControllingClient);
421 return; 371 return;
422 } 372 }
423 } 373 }
@@ -432,12 +382,12 @@ namespace OpenSim.Region.CoreModules.World.Land
432 { 382 {
433 if (checkBan.IsRestrictedFromLand(avatar.ControllingClient.AgentId)) 383 if (checkBan.IsRestrictedFromLand(avatar.ControllingClient.AgentId))
434 { 384 {
435 checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionNotOnAccessList, true, (int)ParcelResult.Multiple, avatar.ControllingClient); 385 checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionNotOnAccessList, false, (int)ParcelResult.Single, avatar.ControllingClient);
436 return; 386 return;
437 } 387 }
438 if (checkBan.IsBannedFromLand(avatar.ControllingClient.AgentId)) 388 if (checkBan.IsBannedFromLand(avatar.ControllingClient.AgentId))
439 { 389 {
440 checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionBanned, true, (int)ParcelResult.Multiple, avatar.ControllingClient); 390 checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionBanned, false, (int)ParcelResult.Single, avatar.ControllingClient);
441 return; 391 return;
442 } 392 }
443 } 393 }
@@ -545,18 +495,6 @@ namespace OpenSim.Region.CoreModules.World.Land
545 if (m_scene.Permissions.CanEditParcel(agentID, land)) 495 if (m_scene.Permissions.CanEditParcel(agentID, land))
546 { 496 {
547 land.UpdateAccessList(flags, entries, remote_client); 497 land.UpdateAccessList(flags, entries, remote_client);
548 List<ScenePresence> presences = ((Scene)remote_client.Scene).GetAvatars();
549 foreach (ScenePresence presence in presences)
550 {
551 land = GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y);
552 if (land != null)
553 {
554 if (land.IsEitherBannedOrRestricted(presence.UUID))
555 {
556 MoveUserOutOfParcel(presence);
557 }
558 }
559 }
560 } 498 }
561 } 499 }
562 else 500 else
@@ -1122,25 +1060,7 @@ namespace OpenSim.Region.CoreModules.World.Land
1122 m_landList.TryGetValue(localID, out land); 1060 m_landList.TryGetValue(localID, out land);
1123 } 1061 }
1124 1062
1125 if (land != null) 1063 if (land != null) land.UpdateLandProperties(args, remote_client);
1126 {
1127 land.UpdateLandProperties(args, remote_client);
1128 if ((args.ParcelFlags & (uint)(ParcelFlags.UseBanList | ParcelFlags.UseAccessList | ParcelFlags.UseAccessGroup | ParcelFlags.UsePassList)) != 0)
1129 {
1130 List<ScenePresence> presences = ((Scene)remote_client.Scene).GetAvatars();
1131 foreach (ScenePresence presence in presences)
1132 {
1133 land = GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y);
1134 if (land != null)
1135 {
1136 if (land.IsEitherBannedOrRestricted(presence.UUID))
1137 {
1138 MoveUserOutOfParcel(presence);
1139 }
1140 }
1141 }
1142 }
1143 }
1144 } 1064 }
1145 1065
1146 public void ClientOnParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client) 1066 public void ClientOnParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client)
@@ -1552,6 +1472,7 @@ namespace OpenSim.Region.CoreModules.World.Land
1552 1472
1553 UpdateLandObject(localID, land.LandData); 1473 UpdateLandObject(localID, land.LandData);
1554 } 1474 }
1475
1555 public void ClientOnParcelGodMark(IClientAPI client, UUID god, int landID) 1476 public void ClientOnParcelGodMark(IClientAPI client, UUID god, int landID)
1556 { 1477 {
1557 ILandObject land = null; 1478 ILandObject land = null;
@@ -1567,6 +1488,7 @@ namespace OpenSim.Region.CoreModules.World.Land
1567 land.LandData.Name = DefaultGodParcelName; 1488 land.LandData.Name = DefaultGodParcelName;
1568 land.SendLandUpdateToAvatarsOverMe(); 1489 land.SendLandUpdateToAvatarsOverMe();
1569 } 1490 }
1491
1570 private void ClientOnSimWideDeletes(IClientAPI client, UUID agentID, int flags, UUID targetID) 1492 private void ClientOnSimWideDeletes(IClientAPI client, UUID agentID, int flags, UUID targetID)
1571 { 1493 {
1572 ScenePresence SP; 1494 ScenePresence SP;