aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs102
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs11
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs8
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs324
5 files changed, 416 insertions, 31 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
index 6dacbba..acc3a78 100644
--- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
@@ -49,7 +49,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
49 private int m_shoutdistance = 100; 49 private int m_shoutdistance = 100;
50 private int m_whisperdistance = 10; 50 private int m_whisperdistance = 10;
51 private List<Scene> m_scenes = new List<Scene>(); 51 private List<Scene> m_scenes = new List<Scene>();
52 52 private List<string> FreezeCache = new List<string>();
53 private string m_adminPrefix = "";
53 internal object m_syncy = new object(); 54 internal object m_syncy = new object();
54 55
55 internal IConfig m_config; 56 internal IConfig m_config;
@@ -76,6 +77,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
76 m_whisperdistance = config.Configs["Chat"].GetInt("whisper_distance", m_whisperdistance); 77 m_whisperdistance = config.Configs["Chat"].GetInt("whisper_distance", m_whisperdistance);
77 m_saydistance = config.Configs["Chat"].GetInt("say_distance", m_saydistance); 78 m_saydistance = config.Configs["Chat"].GetInt("say_distance", m_saydistance);
78 m_shoutdistance = config.Configs["Chat"].GetInt("shout_distance", m_shoutdistance); 79 m_shoutdistance = config.Configs["Chat"].GetInt("shout_distance", m_shoutdistance);
80 m_adminPrefix = config.Configs["Chat"].GetString("admin_prefix", "");
79 } 81 }
80 82
81 public virtual void AddRegion(Scene scene) 83 public virtual void AddRegion(Scene scene)
@@ -171,7 +173,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
171 return; 173 return;
172 } 174 }
173 175
174 DeliverChatToAvatars(ChatSourceType.Agent, c); 176 if (FreezeCache.Contains(c.Sender.AgentId.ToString()))
177 {
178 if (c.Type != ChatTypeEnum.StartTyping || c.Type != ChatTypeEnum.StopTyping)
179 c.Sender.SendAgentAlertMessage("You may not talk as you are frozen.", false);
180 }
181 else
182 {
183 DeliverChatToAvatars(ChatSourceType.Agent, c);
184 }
175 } 185 }
176 186
177 public virtual void OnChatFromWorld(Object sender, OSChatMessage c) 187 public virtual void OnChatFromWorld(Object sender, OSChatMessage c)
@@ -185,6 +195,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
185 protected virtual void DeliverChatToAvatars(ChatSourceType sourceType, OSChatMessage c) 195 protected virtual void DeliverChatToAvatars(ChatSourceType sourceType, OSChatMessage c)
186 { 196 {
187 string fromName = c.From; 197 string fromName = c.From;
198 string fromNamePrefix = "";
188 UUID fromID = UUID.Zero; 199 UUID fromID = UUID.Zero;
189 string message = c.Message; 200 string message = c.Message;
190 IScene scene = c.Scene; 201 IScene scene = c.Scene;
@@ -207,7 +218,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
207 fromPos = avatar.AbsolutePosition; 218 fromPos = avatar.AbsolutePosition;
208 fromName = avatar.Name; 219 fromName = avatar.Name;
209 fromID = c.Sender.AgentId; 220 fromID = c.Sender.AgentId;
210 221 if (avatar.GodLevel > 200)
222 {
223 fromNamePrefix = m_adminPrefix;
224 }
211 break; 225 break;
212 226
213 case ChatSourceType.Object: 227 case ChatSourceType.Object:
@@ -227,7 +241,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
227 s.ForEachScenePresence( 241 s.ForEachScenePresence(
228 delegate(ScenePresence presence) 242 delegate(ScenePresence presence)
229 { 243 {
230 TrySendChatMessage(presence, fromPos, regionPos, fromID, fromName, c.Type, message, sourceType); 244 ILandObject Presencecheck = s.LandChannel.GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y);
245 if (Presencecheck != null)
246 {
247 if (Presencecheck.IsEitherBannedOrRestricted(c.SenderUUID) != true)
248 {
249 TrySendChatMessage(presence, fromPos, regionPos, fromID, fromNamePrefix+fromName, c.Type, message, sourceType);
250 }
251 }
252
231 } 253 }
232 ); 254 );
233 } 255 }
@@ -266,25 +288,29 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
266 } 288 }
267 289
268 // m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType); 290 // m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType);
269 291 if (c.Scene != null)
270 ((Scene)c.Scene).ForEachScenePresence( 292 {
271 delegate(ScenePresence presence) 293 ((Scene)c.Scene).ForEachScenePresence
272 { 294 (
273 // ignore chat from child agents 295 delegate(ScenePresence presence)
274 if (presence.IsChildAgent) return; 296 {
275 297 // ignore chat from child agents
276 IClientAPI client = presence.ControllingClient; 298 if (presence.IsChildAgent) return;
277 299
278 // don't forward SayOwner chat from objects to 300 IClientAPI client = presence.ControllingClient;
279 // non-owner agents 301
280 if ((c.Type == ChatTypeEnum.Owner) && 302 // don't forward SayOwner chat from objects to
281 (null != c.SenderObject) && 303 // non-owner agents
282 (((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId)) 304 if ((c.Type == ChatTypeEnum.Owner) &&
283 return; 305 (null != c.SenderObject) &&
284 306 (((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId))
285 client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID, 307 return;
286 (byte)sourceType, (byte)ChatAudibleLevel.Fully); 308
287 }); 309 client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID,
310 (byte)sourceType, (byte)ChatAudibleLevel.Fully);
311 }
312 );
313 }
288 } 314 }
289 315
290 316
@@ -313,5 +339,35 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
313 presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName, 339 presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName,
314 fromAgentID,(byte)src,(byte)ChatAudibleLevel.Fully); 340 fromAgentID,(byte)src,(byte)ChatAudibleLevel.Fully);
315 } 341 }
342
343 Dictionary<UUID, System.Threading.Timer> Timers = new Dictionary<UUID, System.Threading.Timer>();
344 public void ParcelFreezeUser(IClientAPI client, UUID parcelowner, uint flags, UUID target)
345 {
346 System.Threading.Timer Timer;
347 if (flags == 0)
348 {
349 FreezeCache.Add(target.ToString());
350 System.Threading.TimerCallback timeCB = new System.Threading.TimerCallback(OnEndParcelFrozen);
351 Timer = new System.Threading.Timer(timeCB, target, 30000, 0);
352 Timers.Add(target, Timer);
353 }
354 else
355 {
356 FreezeCache.Remove(target.ToString());
357 Timers.TryGetValue(target, out Timer);
358 Timers.Remove(target);
359 Timer.Dispose();
360 }
361 }
362
363 private void OnEndParcelFrozen(object avatar)
364 {
365 UUID target = (UUID)avatar;
366 FreezeCache.Remove(target.ToString());
367 System.Threading.Timer Timer;
368 Timers.TryGetValue(target, out Timer);
369 Timers.Remove(target);
370 Timer.Dispose();
371 }
316 } 372 }
317} 373}
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs
index fdfcd10..9412735 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs
@@ -172,13 +172,16 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
172 172
173 private void RetrieveInstantMessages(IClientAPI client) 173 private void RetrieveInstantMessages(IClientAPI client)
174 { 174 {
175 if (m_RestURL != "") 175 if (m_RestURL == String.Empty)
176 { 176 return;
177 m_log.DebugFormat("[OFFLINE MESSAGING] Retrieving stored messages for {0}", client.AgentId);
178 177
179 List<GridInstantMessage> msglist = SynchronousRestObjectPoster.BeginPostObject<UUID, List<GridInstantMessage>>( 178 m_log.DebugFormat("[OFFLINE MESSAGING] Retrieving stored messages for {0}", client.AgentId);
179
180 List<GridInstantMessage> msglist = SynchronousRestObjectPoster.BeginPostObject<UUID, List<GridInstantMessage>>(
180 "POST", m_RestURL + "/RetrieveMessages/", client.AgentId); 181 "POST", m_RestURL + "/RetrieveMessages/", client.AgentId);
181 182
183 if (msglist != null)
184 {
182 foreach (GridInstantMessage im in msglist) 185 foreach (GridInstantMessage im in msglist)
183 { 186 {
184 // client.SendInstantMessage(im); 187 // client.SendInstantMessage(im);
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
index be89740..7142442 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
@@ -417,7 +417,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
417 { 417 {
418 // Check if this is ours to handle 418 // Check if this is ours to handle
419 // 419 //
420 m_log.Info("OnFridInstantMessage"); 420 //m_log.Info("OnFridInstantMessage");
421 if (msg.dialog != (byte) InstantMessageDialog.InventoryOffered) 421 if (msg.dialog != (byte) InstantMessageDialog.InventoryOffered)
422 return; 422 return;
423 423
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
index b1b2336f8..14bab6e 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
@@ -256,10 +256,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver
256 // Fix ownership/creator of inventory items 256 // Fix ownership/creator of inventory items
257 // Not doing so results in inventory items 257 // Not doing so results in inventory items
258 // being no copy/no mod for everyone 258 // being no copy/no mod for everyone
259 lock (part.TaskInventory) 259 part.TaskInventory.LockItemsForRead(true);
260 TaskInventoryDictionary inv = part.TaskInventory;
261 foreach (KeyValuePair<UUID, TaskInventoryItem> kvp in inv)
260 { 262 {
261 TaskInventoryDictionary inv = part.TaskInventory; 263 if (!ResolveUserUuid(kvp.Value.OwnerID))
262 foreach (KeyValuePair<UUID, TaskInventoryItem> kvp in inv)
263 { 264 {
264 if (!ResolveUserUuid(kvp.Value.OwnerID)) 265 if (!ResolveUserUuid(kvp.Value.OwnerID))
265 { 266 {
@@ -271,6 +272,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
271 } 272 }
272 } 273 }
273 } 274 }
275 part.TaskInventory.LockItemsForRead(false);
274 } 276 }
275 277
276 if (m_scene.AddRestoredSceneObject(sceneObject, true, false)) 278 if (m_scene.AddRestoredSceneObject(sceneObject, true, false))
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index 5750aa4..7f6a0ad 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -82,6 +82,8 @@ namespace OpenSim.Region.CoreModules.World.Land
82 private int m_lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1; 82 private int m_lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1;
83 83
84 private bool m_allowedForcefulBans = true; 84 private bool m_allowedForcefulBans = true;
85 private UUID DefaultGodParcelGroup;
86 private string DefaultGodParcelName;
85 87
86 // caches ExtendedLandData 88 // caches ExtendedLandData
87 private Cache parcelInfoCache; 89 private Cache parcelInfoCache;
@@ -96,6 +98,12 @@ namespace OpenSim.Region.CoreModules.World.Land
96 98
97 public void Initialise(IConfigSource source) 99 public void Initialise(IConfigSource source)
98 { 100 {
101 IConfig cnf = source.Configs["LandManagement"];
102 if (cnf != null)
103 {
104 DefaultGodParcelGroup = new UUID(cnf.GetString("DefaultAdministratorGroupUUID", UUID.Zero.ToString()));
105 DefaultGodParcelName = cnf.GetString("DefaultAdministratorParcelName", "Default Parcel");
106 }
99 } 107 }
100 108
101 public void AddRegion(Scene scene) 109 public void AddRegion(Scene scene)
@@ -1504,5 +1512,321 @@ namespace OpenSim.Region.CoreModules.World.Land
1504 1512
1505 UpdateLandObject(localID, land.LandData); 1513 UpdateLandObject(localID, land.LandData);
1506 } 1514 }
1515
1516 public void ClientOnParcelGodMark(IClientAPI client, UUID god, int landID)
1517 {
1518 ILandObject land = null;
1519 List<ILandObject> Land = ((Scene)client.Scene).LandChannel.AllParcels();
1520 foreach (ILandObject landObject in Land)
1521 {
1522 if (landObject.LandData.LocalID == landID)
1523 {
1524 land = landObject;
1525 }
1526 }
1527 land.DeedToGroup(DefaultGodParcelGroup);
1528 land.LandData.Name = DefaultGodParcelName;
1529 land.SendLandUpdateToAvatarsOverMe();
1530 }
1531
1532 private void ClientOnSimWideDeletes(IClientAPI client, UUID agentID, int flags, UUID targetID)
1533 {
1534 ScenePresence SP;
1535 ((Scene)client.Scene).TryGetScenePresence(client.AgentId, out SP);
1536 List<SceneObjectGroup> returns = new List<SceneObjectGroup>();
1537 if (SP.GodLevel != 0)
1538 {
1539 if (flags == 0) //All parcels, scripted or not
1540 {
1541 ((Scene)client.Scene).ForEachSOG(delegate(SceneObjectGroup e)
1542 {
1543 if (e.OwnerID == targetID)
1544 {
1545 returns.Add(e);
1546 }
1547 }
1548 );
1549 }
1550 if (flags == 4) //All parcels, scripted object
1551 {
1552 ((Scene)client.Scene).ForEachSOG(delegate(SceneObjectGroup e)
1553 {
1554 if (e.OwnerID == targetID)
1555 {
1556 if (e.scriptScore >= 0.01)
1557 {
1558 returns.Add(e);
1559 }
1560 }
1561 }
1562 );
1563 }
1564 if (flags == 4) //not target parcel, scripted object
1565 {
1566 ((Scene)client.Scene).ForEachSOG(delegate(SceneObjectGroup e)
1567 {
1568 if (e.OwnerID == targetID)
1569 {
1570 ILandObject landobject = ((Scene)client.Scene).LandChannel.GetLandObject(e.AbsolutePosition.X, e.AbsolutePosition.Y);
1571 if (landobject.LandData.OwnerID != e.OwnerID)
1572 {
1573 if (e.scriptScore >= 0.01)
1574 {
1575 returns.Add(e);
1576 }
1577 }
1578 }
1579 }
1580 );
1581 }
1582 foreach (SceneObjectGroup ol in returns)
1583 {
1584 ReturnObject(ol, client);
1585 }
1586 }
1587 }
1588 public void ReturnObject(SceneObjectGroup obj, IClientAPI client)
1589 {
1590 SceneObjectGroup[] objs = new SceneObjectGroup[1];
1591 objs[0] = obj;
1592 ((Scene)client.Scene).returnObjects(objs, client.AgentId);
1593 }
1594
1595 Dictionary<UUID, System.Threading.Timer> Timers = new Dictionary<UUID, System.Threading.Timer>();
1596
1597 public void ClientOnParcelFreezeUser(IClientAPI client, UUID parcelowner, uint flags, UUID target)
1598 {
1599 ScenePresence targetAvatar = null;
1600 ((Scene)client.Scene).TryGetScenePresence(target, out targetAvatar);
1601 ScenePresence parcelManager = null;
1602 ((Scene)client.Scene).TryGetScenePresence(client.AgentId, out parcelManager);
1603 System.Threading.Timer Timer;
1604
1605 if (targetAvatar.GodLevel == 0)
1606 {
1607 ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y);
1608 if (!((Scene)client.Scene).Permissions.CanEditParcel(client.AgentId, land))
1609 return;
1610 if (flags == 0)
1611 {
1612 targetAvatar.AllowMovement = false;
1613 targetAvatar.ControllingClient.SendAlertMessage(parcelManager.Firstname + " " + parcelManager.Lastname + " has frozen you for 30 seconds. You cannot move or interact with the world.");
1614 parcelManager.ControllingClient.SendAlertMessage("Avatar Frozen.");
1615 System.Threading.TimerCallback timeCB = new System.Threading.TimerCallback(OnEndParcelFrozen);
1616 Timer = new System.Threading.Timer(timeCB, targetAvatar, 30000, 0);
1617 Timers.Add(targetAvatar.UUID, Timer);
1618 }
1619 else
1620 {
1621 targetAvatar.AllowMovement = true;
1622 targetAvatar.ControllingClient.SendAlertMessage(parcelManager.Firstname + " " + parcelManager.Lastname + " has unfrozen you.");
1623 parcelManager.ControllingClient.SendAlertMessage("Avatar Unfrozen.");
1624 Timers.TryGetValue(targetAvatar.UUID, out Timer);
1625 Timers.Remove(targetAvatar.UUID);
1626 Timer.Dispose();
1627 }
1628 }
1629 }
1630 private void OnEndParcelFrozen(object avatar)
1631 {
1632 ScenePresence targetAvatar = (ScenePresence)avatar;
1633 targetAvatar.AllowMovement = true;
1634 System.Threading.Timer Timer;
1635 Timers.TryGetValue(targetAvatar.UUID, out Timer);
1636 Timers.Remove(targetAvatar.UUID);
1637 targetAvatar.ControllingClient.SendAgentAlertMessage("The freeze has worn off; you may go about your business.", false);
1638 }
1639
1640
1641 public void ClientOnParcelEjectUser(IClientAPI client, UUID parcelowner, uint flags, UUID target)
1642 {
1643 ScenePresence targetAvatar = null;
1644 ((Scene)client.Scene).TryGetScenePresence(target, out targetAvatar);
1645 ScenePresence parcelManager = null;
1646 ((Scene)client.Scene).TryGetScenePresence(client.AgentId, out parcelManager);
1647 //Just eject
1648 if (flags == 0)
1649 {
1650 if (targetAvatar.GodLevel == 0)
1651 {
1652 ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y);
1653 if (!((Scene)client.Scene).Permissions.CanEditParcel(client.AgentId, land))
1654 return;
1655
1656 Vector3 position = new Vector3(0, 0, 0);
1657 List<ILandObject> allParcels = new List<ILandObject>();
1658 allParcels = AllParcels();
1659 if (allParcels.Count != 1)
1660 {
1661 foreach (ILandObject parcel in allParcels)
1662 {
1663 if (parcel.LandData.GlobalID != land.LandData.GlobalID)
1664 {
1665 if (parcel.IsEitherBannedOrRestricted(targetAvatar.UUID) != true)
1666 {
1667 for (int x = 1; x <= Constants.RegionSize; x += 2)
1668 {
1669 for (int y = 1; y <= Constants.RegionSize; y += 2)
1670 {
1671 if (parcel.ContainsPoint(x, y))
1672 {
1673 position = new Vector3(x, y, targetAvatar.AbsolutePosition.Z);
1674 targetAvatar.TeleportWithMomentum(position);
1675 targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
1676 parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
1677 return;
1678 }
1679 }
1680 }
1681 }
1682 }
1683 }
1684 }
1685 Vector3 targetVector;
1686 if (targetAvatar.AbsolutePosition.X > targetAvatar.AbsolutePosition.Y)
1687 {
1688 if (targetAvatar.AbsolutePosition.X > .5 * Constants.RegionSize)
1689 {
1690 targetVector = new Vector3(Constants.RegionSize, targetAvatar.AbsolutePosition.Y, targetAvatar.AbsolutePosition.Z); ;
1691 targetAvatar.TeleportWithMomentum(targetVector);
1692 targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
1693 parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
1694 return;
1695 }
1696 else
1697 {
1698 targetVector = new Vector3(0, targetAvatar.AbsolutePosition.Y, targetAvatar.AbsolutePosition.Z); ;
1699 targetAvatar.TeleportWithMomentum(targetVector);
1700 targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
1701 parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
1702 return;
1703 }
1704 }
1705 else
1706 {
1707 if (targetAvatar.AbsolutePosition.Y > .5 * Constants.RegionSize)
1708 {
1709 targetVector = new Vector3(targetAvatar.AbsolutePosition.X, Constants.RegionSize, targetAvatar.AbsolutePosition.Z); ;
1710 targetAvatar.TeleportWithMomentum(targetVector);
1711 targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
1712 parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
1713 return;
1714 }
1715 else
1716 {
1717 targetVector = new Vector3(targetAvatar.AbsolutePosition.X, 0, targetAvatar.AbsolutePosition.Z); ;
1718 targetAvatar.TeleportWithMomentum(targetVector);
1719 targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
1720 parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
1721 return;
1722 }
1723 }
1724 }
1725 }
1726 //Eject and ban
1727 if (flags == 1)
1728 {
1729 if (targetAvatar.GodLevel == 0)
1730 {
1731 ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y);
1732 if (!((Scene)client.Scene).Permissions.CanEditParcel(client.AgentId, land))
1733 return;
1734
1735 Vector3 position = new Vector3(0, 0, 0);
1736 List<ILandObject> allParcels = new List<ILandObject>();
1737 allParcels = AllParcels();
1738 if (allParcels.Count != 1)
1739 {
1740 foreach (ILandObject parcel in allParcels)
1741 {
1742 if (parcel.LandData.GlobalID != land.LandData.GlobalID)
1743 {
1744 if (parcel.IsEitherBannedOrRestricted(targetAvatar.UUID) != true)
1745 {
1746 for (int x = 1; x <= Constants.RegionSize; x += 2)
1747 {
1748 for (int y = 1; y <= Constants.RegionSize; y += 2)
1749 {
1750 if (parcel.ContainsPoint(x, y))
1751 {
1752 position = new Vector3(x, y, targetAvatar.AbsolutePosition.Z);
1753 targetAvatar.TeleportWithMomentum(position);
1754 targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname);
1755 parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned.");
1756 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
1757 entry.AgentID = targetAvatar.UUID;
1758 entry.Flags = AccessList.Ban;
1759 entry.Time = new DateTime();
1760 land.LandData.ParcelAccessList.Add(entry);
1761 return;
1762 }
1763 }
1764 }
1765 }
1766 }
1767 }
1768 }
1769 Vector3 targetVector;
1770 if (targetAvatar.AbsolutePosition.X > targetAvatar.AbsolutePosition.Y)
1771 {
1772 if (targetAvatar.AbsolutePosition.X > .5 * Constants.RegionSize)
1773 {
1774 targetVector = new Vector3(Constants.RegionSize, targetAvatar.AbsolutePosition.Y, targetAvatar.AbsolutePosition.Z); ;
1775 targetAvatar.TeleportWithMomentum(targetVector);
1776 targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname);
1777 parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned.");
1778 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
1779 entry.AgentID = targetAvatar.UUID;
1780 entry.Flags = AccessList.Ban;
1781 entry.Time = new DateTime();
1782 land.LandData.ParcelAccessList.Add(entry);
1783 return;
1784 }
1785 else
1786 {
1787 targetVector = new Vector3(0, targetAvatar.AbsolutePosition.Y, targetAvatar.AbsolutePosition.Z); ;
1788 targetAvatar.TeleportWithMomentum(targetVector);
1789 targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname);
1790 parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned.");
1791 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
1792 entry.AgentID = targetAvatar.UUID;
1793 entry.Flags = AccessList.Ban;
1794 entry.Time = new DateTime();
1795 land.LandData.ParcelAccessList.Add(entry);
1796 return;
1797 }
1798 }
1799 else
1800 {
1801 if (targetAvatar.AbsolutePosition.Y > .5 * Constants.RegionSize)
1802 {
1803 targetVector = new Vector3(targetAvatar.AbsolutePosition.X, Constants.RegionSize, targetAvatar.AbsolutePosition.Z); ;
1804 targetAvatar.TeleportWithMomentum(targetVector);
1805 targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname);
1806 parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned.");
1807 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
1808 entry.AgentID = targetAvatar.UUID;
1809 entry.Flags = AccessList.Ban;
1810 entry.Time = new DateTime();
1811 land.LandData.ParcelAccessList.Add(entry);
1812 return;
1813 }
1814 else
1815 {
1816 targetVector = new Vector3(targetAvatar.AbsolutePosition.X, 0, targetAvatar.AbsolutePosition.Z); ;
1817 targetAvatar.TeleportWithMomentum(targetVector);
1818 targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname);
1819 parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned.");
1820 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
1821 entry.AgentID = targetAvatar.UUID;
1822 entry.Flags = AccessList.Ban;
1823 entry.Time = new DateTime();
1824 land.LandData.ParcelAccessList.Add(entry);
1825 return;
1826 }
1827 }
1828 }
1829 }
1830 }
1507 } 1831 }
1508} 1832}