diff options
Diffstat (limited to 'OpenSim/Region/CoreModules')
9 files changed, 524 insertions, 43 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index f050dcf..4fac01f 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | using System.Collections.Generic; | 28 | using System.Collections.Generic; |
29 | using System.Reflection; | 29 | using System.Reflection; |
30 | using System.Xml; | ||
30 | using log4net; | 31 | using log4net; |
31 | using Nini.Config; | 32 | using Nini.Config; |
32 | using OpenMetaverse; | 33 | using OpenMetaverse; |
@@ -35,6 +36,7 @@ using OpenSim.Framework; | |||
35 | using OpenSim.Region.Framework; | 36 | using OpenSim.Region.Framework; |
36 | using OpenSim.Region.Framework.Interfaces; | 37 | using OpenSim.Region.Framework.Interfaces; |
37 | using OpenSim.Region.Framework.Scenes; | 38 | using OpenSim.Region.Framework.Scenes; |
39 | using OpenSim.Region.Framework.Scenes.Serialization; | ||
38 | 40 | ||
39 | namespace OpenSim.Region.CoreModules.Avatar.Attachments | 41 | namespace OpenSim.Region.CoreModules.Avatar.Attachments |
40 | { | 42 | { |
@@ -190,8 +192,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
190 | 192 | ||
191 | public UUID RezSingleAttachmentFromInventory( | 193 | public UUID RezSingleAttachmentFromInventory( |
192 | IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus) | 194 | IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus) |
195 | { | ||
196 | return RezSingleAttachmentFromInventory(remoteClient, itemID, AttachmentPt, true, null); | ||
197 | } | ||
198 | |||
199 | public UUID RezSingleAttachmentFromInventory( | ||
200 | IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus, XmlDocument doc) | ||
193 | { | 201 | { |
194 | SceneObjectGroup att = RezSingleAttachmentFromInventoryInternal(remoteClient, itemID, AttachmentPt); | 202 | SceneObjectGroup att = RezSingleAttachmentFromInventoryInternal(remoteClient, itemID, AttachmentPt, doc); |
195 | 203 | ||
196 | if (updateInventoryStatus) | 204 | if (updateInventoryStatus) |
197 | { | 205 | { |
@@ -210,7 +218,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
210 | } | 218 | } |
211 | 219 | ||
212 | protected SceneObjectGroup RezSingleAttachmentFromInventoryInternal( | 220 | protected SceneObjectGroup RezSingleAttachmentFromInventoryInternal( |
213 | IClientAPI remoteClient, UUID itemID, uint AttachmentPt) | 221 | IClientAPI remoteClient, UUID itemID, uint AttachmentPt, XmlDocument doc) |
214 | { | 222 | { |
215 | IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>(); | 223 | IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>(); |
216 | if (invAccess != null) | 224 | if (invAccess != null) |
@@ -236,13 +244,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
236 | if (tainted) | 244 | if (tainted) |
237 | objatt.HasGroupChanged = true; | 245 | objatt.HasGroupChanged = true; |
238 | 246 | ||
247 | if (doc != null) | ||
248 | { | ||
249 | objatt.LoadScriptState(doc); | ||
250 | objatt.ResetOwnerChangeFlag(); | ||
251 | } | ||
252 | |||
239 | // Fire after attach, so we don't get messy perms dialogs | 253 | // Fire after attach, so we don't get messy perms dialogs |
240 | // 3 == AttachedRez | 254 | // 3 == AttachedRez |
241 | objatt.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 3); | 255 | objatt.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 3); |
242 | objatt.ResumeScripts(); | 256 | objatt.ResumeScripts(); |
243 | 257 | ||
244 | // Do this last so that event listeners have access to all the effects of the attachment | 258 | // Do this last so that event listeners have access to all the effects of the attachment |
245 | m_scene.EventManager.TriggerOnAttach(objatt.LocalId, itemID, remoteClient.AgentId); | 259 | //m_scene.EventManager.TriggerOnAttach(objatt.LocalId, itemID, remoteClient.AgentId); |
246 | } | 260 | } |
247 | else | 261 | else |
248 | { | 262 | { |
@@ -271,7 +285,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
271 | if (m_scene.TryGetScenePresence(remoteClient.AgentId, out presence)) | 285 | if (m_scene.TryGetScenePresence(remoteClient.AgentId, out presence)) |
272 | { | 286 | { |
273 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); | 287 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
274 | item = m_scene.InventoryService.GetItem(item); | 288 | if (m_scene.InventoryService != null) |
289 | item = m_scene.InventoryService.GetItem(item); | ||
275 | 290 | ||
276 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); | 291 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); |
277 | } | 292 | } |
@@ -316,6 +331,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
316 | { | 331 | { |
317 | // XXYY!! | 332 | // XXYY!! |
318 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); | 333 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
334 | if (item == null) | ||
335 | m_log.Error("[ATTACHMENT]: item == null"); | ||
336 | if (m_scene == null) | ||
337 | m_log.Error("[ATTACHMENT]: m_scene == null"); | ||
338 | if (m_scene.InventoryService == null) | ||
339 | m_log.Error("[ATTACHMENT]: m_scene.InventoryService == null"); | ||
319 | item = m_scene.InventoryService.GetItem(item); | 340 | item = m_scene.InventoryService.GetItem(item); |
320 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /* att.UUID */); | 341 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /* att.UUID */); |
321 | 342 | ||
@@ -404,6 +425,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
404 | if (group.GetFromItemID() == itemID) | 425 | if (group.GetFromItemID() == itemID) |
405 | { | 426 | { |
406 | m_scene.EventManager.TriggerOnAttach(group.LocalId, itemID, UUID.Zero); | 427 | m_scene.EventManager.TriggerOnAttach(group.LocalId, itemID, UUID.Zero); |
428 | // CM / XMREngine!!!! Needed to conclude attach event | ||
429 | SceneObjectSerializer.ToOriginalXmlFormat(group); | ||
407 | group.DetachToInventoryPrep(); | 430 | group.DetachToInventoryPrep(); |
408 | m_log.Debug("[ATTACHMENTS MODULE]: Saving attachpoint: " + ((uint)group.GetAttachmentPoint()).ToString()); | 431 | m_log.Debug("[ATTACHMENTS MODULE]: Saving attachpoint: " + ((uint)group.GetAttachmentPoint()).ToString()); |
409 | m_scene.UpdateKnownItem(remoteClient, group,group.GetFromItemID(), group.OwnerID); | 432 | m_scene.UpdateKnownItem(remoteClient, group,group.GetFromItemID(), group.OwnerID); |
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs index 02f0968..9c8cbc6 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 | } |
@@ -270,25 +292,29 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
270 | } | 292 | } |
271 | 293 | ||
272 | // m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType); | 294 | // m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType); |
273 | 295 | if (c.Scene != null) | |
274 | ((Scene)c.Scene).ForEachScenePresence( | 296 | { |
275 | delegate(ScenePresence presence) | 297 | ((Scene)c.Scene).ForEachScenePresence |
276 | { | 298 | ( |
277 | // ignore chat from child agents | 299 | delegate(ScenePresence presence) |
278 | if (presence.IsChildAgent) return; | 300 | { |
279 | 301 | // ignore chat from child agents | |
280 | IClientAPI client = presence.ControllingClient; | 302 | if (presence.IsChildAgent) return; |
281 | 303 | ||
282 | // don't forward SayOwner chat from objects to | 304 | IClientAPI client = presence.ControllingClient; |
283 | // non-owner agents | 305 | |
284 | if ((c.Type == ChatTypeEnum.Owner) && | 306 | // don't forward SayOwner chat from objects to |
285 | (null != c.SenderObject) && | 307 | // non-owner agents |
286 | (((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId)) | 308 | if ((c.Type == ChatTypeEnum.Owner) && |
287 | return; | 309 | (null != c.SenderObject) && |
288 | 310 | (((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId)) | |
289 | client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID, | 311 | return; |
290 | (byte)sourceType, (byte)ChatAudibleLevel.Fully); | 312 | |
291 | }); | 313 | client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID, |
314 | (byte)sourceType, (byte)ChatAudibleLevel.Fully); | ||
315 | } | ||
316 | ); | ||
317 | } | ||
292 | } | 318 | } |
293 | 319 | ||
294 | 320 | ||
@@ -317,5 +343,35 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
317 | presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName, | 343 | presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName, |
318 | fromAgentID,(byte)src,(byte)ChatAudibleLevel.Fully); | 344 | fromAgentID,(byte)src,(byte)ChatAudibleLevel.Fully); |
319 | } | 345 | } |
346 | |||
347 | Dictionary<UUID, System.Threading.Timer> Timers = new Dictionary<UUID, System.Threading.Timer>(); | ||
348 | public void ParcelFreezeUser(IClientAPI client, UUID parcelowner, uint flags, UUID target) | ||
349 | { | ||
350 | System.Threading.Timer Timer; | ||
351 | if (flags == 0) | ||
352 | { | ||
353 | FreezeCache.Add(target.ToString()); | ||
354 | System.Threading.TimerCallback timeCB = new System.Threading.TimerCallback(OnEndParcelFrozen); | ||
355 | Timer = new System.Threading.Timer(timeCB, target, 30000, 0); | ||
356 | Timers.Add(target, Timer); | ||
357 | } | ||
358 | else | ||
359 | { | ||
360 | FreezeCache.Remove(target.ToString()); | ||
361 | Timers.TryGetValue(target, out Timer); | ||
362 | Timers.Remove(target); | ||
363 | Timer.Dispose(); | ||
364 | } | ||
365 | } | ||
366 | |||
367 | private void OnEndParcelFrozen(object avatar) | ||
368 | { | ||
369 | UUID target = (UUID)avatar; | ||
370 | FreezeCache.Remove(target.ToString()); | ||
371 | System.Threading.Timer Timer; | ||
372 | Timers.TryGetValue(target, out Timer); | ||
373 | Timers.Remove(target); | ||
374 | Timer.Dispose(); | ||
375 | } | ||
320 | } | 376 | } |
321 | } | 377 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index 0c81f44..30eb9b8 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | |||
@@ -67,7 +67,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
67 | return false; | 67 | return false; |
68 | } | 68 | } |
69 | } | 69 | } |
70 | 70 | ||
71 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 71 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
72 | 72 | ||
73 | protected List<Scene> m_Scenes = new List<Scene>(); | 73 | protected List<Scene> m_Scenes = new List<Scene>(); |
@@ -201,9 +201,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
201 | 201 | ||
202 | UserFriendData data = m_Friends[principalID]; | 202 | UserFriendData data = m_Friends[principalID]; |
203 | 203 | ||
204 | string searchFor = friendID.ToString(); | ||
204 | foreach (FriendInfo fi in data.Friends) | 205 | foreach (FriendInfo fi in data.Friends) |
205 | { | 206 | { |
206 | if (fi.Friend == friendID.ToString()) | 207 | if (fi.Friend == searchFor) |
207 | return (uint)fi.TheirFlags; | 208 | return (uint)fi.TheirFlags; |
208 | } | 209 | } |
209 | return 0; | 210 | return 0; |
@@ -234,7 +235,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
234 | newFriends.RegionID = UUID.Zero; | 235 | newFriends.RegionID = UUID.Zero; |
235 | 236 | ||
236 | m_Friends.Add(client.AgentId, newFriends); | 237 | m_Friends.Add(client.AgentId, newFriends); |
237 | 238 | ||
238 | //StatusChange(client.AgentId, true); | 239 | //StatusChange(client.AgentId, true); |
239 | } | 240 | } |
240 | 241 | ||
@@ -289,7 +290,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
289 | 290 | ||
290 | // Inform the friends that this user is online | 291 | // Inform the friends that this user is online |
291 | StatusChange(agentID, true); | 292 | StatusChange(agentID, true); |
292 | 293 | ||
293 | // Register that we need to send the list of online friends to this user | 294 | // Register that we need to send the list of online friends to this user |
294 | lock (m_NeedsListOfFriends) | 295 | lock (m_NeedsListOfFriends) |
295 | if (!m_NeedsListOfFriends.Contains(agentID)) | 296 | if (!m_NeedsListOfFriends.Contains(agentID)) |
@@ -439,11 +440,47 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
439 | if (((fi.MyFlags & 1) != 0) && (fi.TheirFlags != -1)) | 440 | if (((fi.MyFlags & 1) != 0) && (fi.TheirFlags != -1)) |
440 | friendList.Add(fi); | 441 | friendList.Add(fi); |
441 | } | 442 | } |
443 | /* | ||
442 | foreach (FriendInfo fi in friendList) | 444 | foreach (FriendInfo fi in friendList) |
443 | { | 445 | { |
444 | // Notify about this user status | 446 | // Notify about this user status |
445 | StatusNotify(fi, agentID, online); | 447 | StatusNotify(fi, agentID, online); |
446 | } | 448 | } |
449 | */ | ||
450 | |||
451 | StatusNotifyMass(friendList, agentID, online); | ||
452 | } | ||
453 | } | ||
454 | |||
455 | private void StatusNotifyMass(List<FriendInfo> friendList, UUID userID, bool online) | ||
456 | { | ||
457 | int fct = friendList.Count; | ||
458 | string[] friendIDs = new string[fct]; | ||
459 | int notlocal = 0; | ||
460 | for (int x = 0 ; x < fct ; x++) | ||
461 | { | ||
462 | UUID friendID = UUID.Zero; | ||
463 | if (UUID.TryParse(friendList[x].Friend, out friendID)) | ||
464 | { | ||
465 | if (!LocalStatusNotification(userID, friendID, online)) | ||
466 | { | ||
467 | friendIDs[notlocal++] = friendID.ToString(); | ||
468 | } | ||
469 | } | ||
470 | } | ||
471 | |||
472 | PresenceInfo[] friendSessions = PresenceService.GetAgents(friendIDs); | ||
473 | |||
474 | for (int x = 0; x < friendSessions.GetLength(0); x++) | ||
475 | { | ||
476 | if (friendIDs.Length <= x) | ||
477 | continue; | ||
478 | PresenceInfo friendSession = friendSessions[x]; | ||
479 | if (friendSession != null) | ||
480 | { | ||
481 | GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); | ||
482 | m_FriendsSimConnector.StatusNotify(region, userID, new UUID(friendIDs[x]), online); | ||
483 | } | ||
447 | } | 484 | } |
448 | } | 485 | } |
449 | 486 | ||
@@ -456,7 +493,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
456 | // Try local | 493 | // Try local |
457 | if (LocalStatusNotification(userID, friendID, online)) | 494 | if (LocalStatusNotification(userID, friendID, online)) |
458 | return; | 495 | return; |
459 | 496 | ||
460 | // The friend is not here [as root]. Let's forward. | 497 | // The friend is not here [as root]. Let's forward. |
461 | PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() }); | 498 | PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() }); |
462 | if (friendSessions != null && friendSessions.Length > 0) | 499 | if (friendSessions != null && friendSessions.Length > 0) |
@@ -476,7 +513,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
476 | private void OnInstantMessage(IClientAPI client, GridInstantMessage im) | 513 | private void OnInstantMessage(IClientAPI client, GridInstantMessage im) |
477 | { | 514 | { |
478 | if (im.dialog == (byte)OpenMetaverse.InstantMessageDialog.FriendshipOffered) | 515 | if (im.dialog == (byte)OpenMetaverse.InstantMessageDialog.FriendshipOffered) |
479 | { | 516 | { |
480 | // we got a friendship offer | 517 | // we got a friendship offer |
481 | UUID principalID = new UUID(im.fromAgentID); | 518 | UUID principalID = new UUID(im.fromAgentID); |
482 | UUID friendID = new UUID(im.toAgentID); | 519 | UUID friendID = new UUID(im.toAgentID); |
@@ -701,7 +738,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
701 | // we're done | 738 | // we're done |
702 | return true; | 739 | return true; |
703 | } | 740 | } |
704 | 741 | ||
705 | return false; | 742 | return false; |
706 | } | 743 | } |
707 | 744 | ||
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/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs index e32dbb3..329a259 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs | |||
@@ -290,6 +290,23 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
290 | return false; | 290 | return false; |
291 | } | 291 | } |
292 | 292 | ||
293 | public bool CloseChildAgent(GridRegion destination, UUID id) | ||
294 | { | ||
295 | if (destination == null) | ||
296 | return false; | ||
297 | |||
298 | foreach (Scene s in m_sceneList) | ||
299 | { | ||
300 | if (s.RegionInfo.RegionID == destination.RegionID) | ||
301 | { | ||
302 | //m_log.Debug("[LOCAL COMMS]: Found region to SendCloseAgent"); | ||
303 | return s.IncomingCloseChildAgent(id); | ||
304 | } | ||
305 | } | ||
306 | //m_log.Debug("[LOCAL COMMS]: region not found in SendCloseAgent"); | ||
307 | return false; | ||
308 | } | ||
309 | |||
293 | /** | 310 | /** |
294 | * Object-related communications | 311 | * Object-related communications |
295 | */ | 312 | */ |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs index 9e8454f..377c868 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs | |||
@@ -253,6 +253,21 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
253 | return false; | 253 | return false; |
254 | } | 254 | } |
255 | 255 | ||
256 | public bool CloseChildAgent(GridRegion destination, UUID id) | ||
257 | { | ||
258 | if (destination == null) | ||
259 | return false; | ||
260 | |||
261 | // Try local first | ||
262 | if (m_localBackend.CloseChildAgent(destination, id)) | ||
263 | return true; | ||
264 | |||
265 | // else do the remote thing | ||
266 | if (!m_localBackend.IsLocalRegion(destination.RegionHandle)) | ||
267 | return m_remoteConnector.CloseChildAgent(destination, id); | ||
268 | |||
269 | return false; | ||
270 | } | ||
256 | 271 | ||
257 | public bool CloseAgent(GridRegion destination, UUID id) | 272 | public bool CloseAgent(GridRegion destination, UUID id) |
258 | { | 273 | { |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index bc653ce..57b7672 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -261,10 +261,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
261 | // Fix ownership/creator of inventory items | 261 | // Fix ownership/creator of inventory items |
262 | // Not doing so results in inventory items | 262 | // Not doing so results in inventory items |
263 | // being no copy/no mod for everyone | 263 | // being no copy/no mod for everyone |
264 | lock (part.TaskInventory) | 264 | part.TaskInventory.LockItemsForRead(true); |
265 | TaskInventoryDictionary inv = part.TaskInventory; | ||
266 | foreach (KeyValuePair<UUID, TaskInventoryItem> kvp in inv) | ||
265 | { | 267 | { |
266 | TaskInventoryDictionary inv = part.TaskInventory; | 268 | if (!ResolveUserUuid(kvp.Value.OwnerID)) |
267 | foreach (KeyValuePair<UUID, TaskInventoryItem> kvp in inv) | ||
268 | { | 269 | { |
269 | if (!ResolveUserUuid(kvp.Value.OwnerID)) | 270 | if (!ResolveUserUuid(kvp.Value.OwnerID)) |
270 | { | 271 | { |
@@ -276,6 +277,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
276 | } | 277 | } |
277 | } | 278 | } |
278 | } | 279 | } |
280 | part.TaskInventory.LockItemsForRead(false); | ||
279 | } | 281 | } |
280 | 282 | ||
281 | if (m_scene.AddRestoredSceneObject(sceneObject, true, false)) | 283 | 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 4ccd0f0..9d6c9a9 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) |
@@ -351,7 +359,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
351 | { | 359 | { |
352 | if (avatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT) | 360 | if (avatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT) |
353 | { | 361 | { |
354 | if (parcelAvatarIsEntering.IsBannedFromLand(avatar.UUID)) | 362 | if (parcelAvatarIsEntering.IsEitherBannedOrRestricted(avatar.UUID)) |
355 | { | 363 | { |
356 | SendYouAreBannedNotice(avatar); | 364 | SendYouAreBannedNotice(avatar); |
357 | ForceAvatarToPosition(avatar, m_scene.GetNearestAllowedPosition(avatar)); | 365 | ForceAvatarToPosition(avatar, m_scene.GetNearestAllowedPosition(avatar)); |
@@ -991,6 +999,10 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
991 | //Owner Flag | 999 | //Owner Flag |
992 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_REQUESTER); | 1000 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_REQUESTER); |
993 | } | 1001 | } |
1002 | else if (currentParcelBlock.LandData.IsGroupOwned && remote_client.IsGroupMember(currentParcelBlock.LandData.GroupID)) | ||
1003 | { | ||
1004 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_GROUP); | ||
1005 | } | ||
994 | else if (currentParcelBlock.LandData.SalePrice > 0 && | 1006 | else if (currentParcelBlock.LandData.SalePrice > 0 && |
995 | (currentParcelBlock.LandData.AuthBuyerID == UUID.Zero || | 1007 | (currentParcelBlock.LandData.AuthBuyerID == UUID.Zero || |
996 | currentParcelBlock.LandData.AuthBuyerID == remote_client.AgentId)) | 1008 | currentParcelBlock.LandData.AuthBuyerID == remote_client.AgentId)) |
@@ -1520,5 +1532,321 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1520 | 1532 | ||
1521 | UpdateLandObject(localID, land.LandData); | 1533 | UpdateLandObject(localID, land.LandData); |
1522 | } | 1534 | } |
1535 | |||
1536 | public void ClientOnParcelGodMark(IClientAPI client, UUID god, int landID) | ||
1537 | { | ||
1538 | ILandObject land = null; | ||
1539 | List<ILandObject> Land = ((Scene)client.Scene).LandChannel.AllParcels(); | ||
1540 | foreach (ILandObject landObject in Land) | ||
1541 | { | ||
1542 | if (landObject.LandData.LocalID == landID) | ||
1543 | { | ||
1544 | land = landObject; | ||
1545 | } | ||
1546 | } | ||
1547 | land.DeedToGroup(DefaultGodParcelGroup); | ||
1548 | land.LandData.Name = DefaultGodParcelName; | ||
1549 | land.SendLandUpdateToAvatarsOverMe(); | ||
1550 | } | ||
1551 | |||
1552 | private void ClientOnSimWideDeletes(IClientAPI client, UUID agentID, int flags, UUID targetID) | ||
1553 | { | ||
1554 | ScenePresence SP; | ||
1555 | ((Scene)client.Scene).TryGetScenePresence(client.AgentId, out SP); | ||
1556 | List<SceneObjectGroup> returns = new List<SceneObjectGroup>(); | ||
1557 | if (SP.GodLevel != 0) | ||
1558 | { | ||
1559 | if (flags == 0) //All parcels, scripted or not | ||
1560 | { | ||
1561 | ((Scene)client.Scene).ForEachSOG(delegate(SceneObjectGroup e) | ||
1562 | { | ||
1563 | if (e.OwnerID == targetID) | ||
1564 | { | ||
1565 | returns.Add(e); | ||
1566 | } | ||
1567 | } | ||
1568 | ); | ||
1569 | } | ||
1570 | if (flags == 4) //All parcels, scripted object | ||
1571 | { | ||
1572 | ((Scene)client.Scene).ForEachSOG(delegate(SceneObjectGroup e) | ||
1573 | { | ||
1574 | if (e.OwnerID == targetID) | ||
1575 | { | ||
1576 | if (e.scriptScore >= 0.01) | ||
1577 | { | ||
1578 | returns.Add(e); | ||
1579 | } | ||
1580 | } | ||
1581 | } | ||
1582 | ); | ||
1583 | } | ||
1584 | if (flags == 4) //not target parcel, scripted object | ||
1585 | { | ||
1586 | ((Scene)client.Scene).ForEachSOG(delegate(SceneObjectGroup e) | ||
1587 | { | ||
1588 | if (e.OwnerID == targetID) | ||
1589 | { | ||
1590 | ILandObject landobject = ((Scene)client.Scene).LandChannel.GetLandObject(e.AbsolutePosition.X, e.AbsolutePosition.Y); | ||
1591 | if (landobject.LandData.OwnerID != e.OwnerID) | ||
1592 | { | ||
1593 | if (e.scriptScore >= 0.01) | ||
1594 | { | ||
1595 | returns.Add(e); | ||
1596 | } | ||
1597 | } | ||
1598 | } | ||
1599 | } | ||
1600 | ); | ||
1601 | } | ||
1602 | foreach (SceneObjectGroup ol in returns) | ||
1603 | { | ||
1604 | ReturnObject(ol, client); | ||
1605 | } | ||
1606 | } | ||
1607 | } | ||
1608 | public void ReturnObject(SceneObjectGroup obj, IClientAPI client) | ||
1609 | { | ||
1610 | SceneObjectGroup[] objs = new SceneObjectGroup[1]; | ||
1611 | objs[0] = obj; | ||
1612 | ((Scene)client.Scene).returnObjects(objs, client.AgentId); | ||
1613 | } | ||
1614 | |||
1615 | Dictionary<UUID, System.Threading.Timer> Timers = new Dictionary<UUID, System.Threading.Timer>(); | ||
1616 | |||
1617 | public void ClientOnParcelFreezeUser(IClientAPI client, UUID parcelowner, uint flags, UUID target) | ||
1618 | { | ||
1619 | ScenePresence targetAvatar = null; | ||
1620 | ((Scene)client.Scene).TryGetScenePresence(target, out targetAvatar); | ||
1621 | ScenePresence parcelManager = null; | ||
1622 | ((Scene)client.Scene).TryGetScenePresence(client.AgentId, out parcelManager); | ||
1623 | System.Threading.Timer Timer; | ||
1624 | |||
1625 | if (targetAvatar.GodLevel == 0) | ||
1626 | { | ||
1627 | ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y); | ||
1628 | if (!((Scene)client.Scene).Permissions.CanEditParcel(client.AgentId, land)) | ||
1629 | return; | ||
1630 | if (flags == 0) | ||
1631 | { | ||
1632 | targetAvatar.AllowMovement = false; | ||
1633 | targetAvatar.ControllingClient.SendAlertMessage(parcelManager.Firstname + " " + parcelManager.Lastname + " has frozen you for 30 seconds. You cannot move or interact with the world."); | ||
1634 | parcelManager.ControllingClient.SendAlertMessage("Avatar Frozen."); | ||
1635 | System.Threading.TimerCallback timeCB = new System.Threading.TimerCallback(OnEndParcelFrozen); | ||
1636 | Timer = new System.Threading.Timer(timeCB, targetAvatar, 30000, 0); | ||
1637 | Timers.Add(targetAvatar.UUID, Timer); | ||
1638 | } | ||
1639 | else | ||
1640 | { | ||
1641 | targetAvatar.AllowMovement = true; | ||
1642 | targetAvatar.ControllingClient.SendAlertMessage(parcelManager.Firstname + " " + parcelManager.Lastname + " has unfrozen you."); | ||
1643 | parcelManager.ControllingClient.SendAlertMessage("Avatar Unfrozen."); | ||
1644 | Timers.TryGetValue(targetAvatar.UUID, out Timer); | ||
1645 | Timers.Remove(targetAvatar.UUID); | ||
1646 | Timer.Dispose(); | ||
1647 | } | ||
1648 | } | ||
1649 | } | ||
1650 | private void OnEndParcelFrozen(object avatar) | ||
1651 | { | ||
1652 | ScenePresence targetAvatar = (ScenePresence)avatar; | ||
1653 | targetAvatar.AllowMovement = true; | ||
1654 | System.Threading.Timer Timer; | ||
1655 | Timers.TryGetValue(targetAvatar.UUID, out Timer); | ||
1656 | Timers.Remove(targetAvatar.UUID); | ||
1657 | targetAvatar.ControllingClient.SendAgentAlertMessage("The freeze has worn off; you may go about your business.", false); | ||
1658 | } | ||
1659 | |||
1660 | |||
1661 | public void ClientOnParcelEjectUser(IClientAPI client, UUID parcelowner, uint flags, UUID target) | ||
1662 | { | ||
1663 | ScenePresence targetAvatar = null; | ||
1664 | ((Scene)client.Scene).TryGetScenePresence(target, out targetAvatar); | ||
1665 | ScenePresence parcelManager = null; | ||
1666 | ((Scene)client.Scene).TryGetScenePresence(client.AgentId, out parcelManager); | ||
1667 | //Just eject | ||
1668 | if (flags == 0) | ||
1669 | { | ||
1670 | if (targetAvatar.GodLevel == 0) | ||
1671 | { | ||
1672 | ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y); | ||
1673 | if (!((Scene)client.Scene).Permissions.CanEditParcel(client.AgentId, land)) | ||
1674 | return; | ||
1675 | |||
1676 | Vector3 position = new Vector3(0, 0, 0); | ||
1677 | List<ILandObject> allParcels = new List<ILandObject>(); | ||
1678 | allParcels = AllParcels(); | ||
1679 | if (allParcels.Count != 1) | ||
1680 | { | ||
1681 | foreach (ILandObject parcel in allParcels) | ||
1682 | { | ||
1683 | if (parcel.LandData.GlobalID != land.LandData.GlobalID) | ||
1684 | { | ||
1685 | if (parcel.IsEitherBannedOrRestricted(targetAvatar.UUID) != true) | ||
1686 | { | ||
1687 | for (int x = 1; x <= Constants.RegionSize; x += 2) | ||
1688 | { | ||
1689 | for (int y = 1; y <= Constants.RegionSize; y += 2) | ||
1690 | { | ||
1691 | if (parcel.ContainsPoint(x, y)) | ||
1692 | { | ||
1693 | position = new Vector3(x, y, targetAvatar.AbsolutePosition.Z); | ||
1694 | targetAvatar.TeleportWithMomentum(position); | ||
1695 | targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname); | ||
1696 | parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected."); | ||
1697 | return; | ||
1698 | } | ||
1699 | } | ||
1700 | } | ||
1701 | } | ||
1702 | } | ||
1703 | } | ||
1704 | } | ||
1705 | Vector3 targetVector; | ||
1706 | if (targetAvatar.AbsolutePosition.X > targetAvatar.AbsolutePosition.Y) | ||
1707 | { | ||
1708 | if (targetAvatar.AbsolutePosition.X > .5 * Constants.RegionSize) | ||
1709 | { | ||
1710 | targetVector = new Vector3(Constants.RegionSize, targetAvatar.AbsolutePosition.Y, targetAvatar.AbsolutePosition.Z); ; | ||
1711 | targetAvatar.TeleportWithMomentum(targetVector); | ||
1712 | targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname); | ||
1713 | parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected."); | ||
1714 | return; | ||
1715 | } | ||
1716 | else | ||
1717 | { | ||
1718 | targetVector = new Vector3(0, targetAvatar.AbsolutePosition.Y, targetAvatar.AbsolutePosition.Z); ; | ||
1719 | targetAvatar.TeleportWithMomentum(targetVector); | ||
1720 | targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname); | ||
1721 | parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected."); | ||
1722 | return; | ||
1723 | } | ||
1724 | } | ||
1725 | else | ||
1726 | { | ||
1727 | if (targetAvatar.AbsolutePosition.Y > .5 * Constants.RegionSize) | ||
1728 | { | ||
1729 | targetVector = new Vector3(targetAvatar.AbsolutePosition.X, Constants.RegionSize, targetAvatar.AbsolutePosition.Z); ; | ||
1730 | targetAvatar.TeleportWithMomentum(targetVector); | ||
1731 | targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname); | ||
1732 | parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected."); | ||
1733 | return; | ||
1734 | } | ||
1735 | else | ||
1736 | { | ||
1737 | targetVector = new Vector3(targetAvatar.AbsolutePosition.X, 0, targetAvatar.AbsolutePosition.Z); ; | ||
1738 | targetAvatar.TeleportWithMomentum(targetVector); | ||
1739 | targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname); | ||
1740 | parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected."); | ||
1741 | return; | ||
1742 | } | ||
1743 | } | ||
1744 | } | ||
1745 | } | ||
1746 | //Eject and ban | ||
1747 | if (flags == 1) | ||
1748 | { | ||
1749 | if (targetAvatar.GodLevel == 0) | ||
1750 | { | ||
1751 | ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y); | ||
1752 | if (!((Scene)client.Scene).Permissions.CanEditParcel(client.AgentId, land)) | ||
1753 | return; | ||
1754 | |||
1755 | Vector3 position = new Vector3(0, 0, 0); | ||
1756 | List<ILandObject> allParcels = new List<ILandObject>(); | ||
1757 | allParcels = AllParcels(); | ||
1758 | if (allParcels.Count != 1) | ||
1759 | { | ||
1760 | foreach (ILandObject parcel in allParcels) | ||
1761 | { | ||
1762 | if (parcel.LandData.GlobalID != land.LandData.GlobalID) | ||
1763 | { | ||
1764 | if (parcel.IsEitherBannedOrRestricted(targetAvatar.UUID) != true) | ||
1765 | { | ||
1766 | for (int x = 1; x <= Constants.RegionSize; x += 2) | ||
1767 | { | ||
1768 | for (int y = 1; y <= Constants.RegionSize; y += 2) | ||
1769 | { | ||
1770 | if (parcel.ContainsPoint(x, y)) | ||
1771 | { | ||
1772 | position = new Vector3(x, y, targetAvatar.AbsolutePosition.Z); | ||
1773 | targetAvatar.TeleportWithMomentum(position); | ||
1774 | targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname); | ||
1775 | parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned."); | ||
1776 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); | ||
1777 | entry.AgentID = targetAvatar.UUID; | ||
1778 | entry.Flags = AccessList.Ban; | ||
1779 | entry.Time = new DateTime(); | ||
1780 | land.LandData.ParcelAccessList.Add(entry); | ||
1781 | return; | ||
1782 | } | ||
1783 | } | ||
1784 | } | ||
1785 | } | ||
1786 | } | ||
1787 | } | ||
1788 | } | ||
1789 | Vector3 targetVector; | ||
1790 | if (targetAvatar.AbsolutePosition.X > targetAvatar.AbsolutePosition.Y) | ||
1791 | { | ||
1792 | if (targetAvatar.AbsolutePosition.X > .5 * Constants.RegionSize) | ||
1793 | { | ||
1794 | targetVector = new Vector3(Constants.RegionSize, targetAvatar.AbsolutePosition.Y, targetAvatar.AbsolutePosition.Z); ; | ||
1795 | targetAvatar.TeleportWithMomentum(targetVector); | ||
1796 | targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname); | ||
1797 | parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned."); | ||
1798 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); | ||
1799 | entry.AgentID = targetAvatar.UUID; | ||
1800 | entry.Flags = AccessList.Ban; | ||
1801 | entry.Time = new DateTime(); | ||
1802 | land.LandData.ParcelAccessList.Add(entry); | ||
1803 | return; | ||
1804 | } | ||
1805 | else | ||
1806 | { | ||
1807 | targetVector = new Vector3(0, targetAvatar.AbsolutePosition.Y, targetAvatar.AbsolutePosition.Z); ; | ||
1808 | targetAvatar.TeleportWithMomentum(targetVector); | ||
1809 | targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname); | ||
1810 | parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned."); | ||
1811 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); | ||
1812 | entry.AgentID = targetAvatar.UUID; | ||
1813 | entry.Flags = AccessList.Ban; | ||
1814 | entry.Time = new DateTime(); | ||
1815 | land.LandData.ParcelAccessList.Add(entry); | ||
1816 | return; | ||
1817 | } | ||
1818 | } | ||
1819 | else | ||
1820 | { | ||
1821 | if (targetAvatar.AbsolutePosition.Y > .5 * Constants.RegionSize) | ||
1822 | { | ||
1823 | targetVector = new Vector3(targetAvatar.AbsolutePosition.X, Constants.RegionSize, targetAvatar.AbsolutePosition.Z); ; | ||
1824 | targetAvatar.TeleportWithMomentum(targetVector); | ||
1825 | targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname); | ||
1826 | parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned."); | ||
1827 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); | ||
1828 | entry.AgentID = targetAvatar.UUID; | ||
1829 | entry.Flags = AccessList.Ban; | ||
1830 | entry.Time = new DateTime(); | ||
1831 | land.LandData.ParcelAccessList.Add(entry); | ||
1832 | return; | ||
1833 | } | ||
1834 | else | ||
1835 | { | ||
1836 | targetVector = new Vector3(targetAvatar.AbsolutePosition.X, 0, targetAvatar.AbsolutePosition.Z); ; | ||
1837 | targetAvatar.TeleportWithMomentum(targetVector); | ||
1838 | targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname); | ||
1839 | parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned."); | ||
1840 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); | ||
1841 | entry.AgentID = targetAvatar.UUID; | ||
1842 | entry.Flags = AccessList.Ban; | ||
1843 | entry.Time = new DateTime(); | ||
1844 | land.LandData.ParcelAccessList.Add(entry); | ||
1845 | return; | ||
1846 | } | ||
1847 | } | ||
1848 | } | ||
1849 | } | ||
1850 | } | ||
1523 | } | 1851 | } |
1524 | } | 1852 | } |