diff options
Diffstat (limited to '')
24 files changed, 511 insertions, 120 deletions
diff --git a/OpenSim/Framework/AssetBase.cs b/OpenSim/Framework/AssetBase.cs index d2c6c57..ff240be 100644 --- a/OpenSim/Framework/AssetBase.cs +++ b/OpenSim/Framework/AssetBase.cs | |||
@@ -60,6 +60,8 @@ namespace OpenSim.Framework | |||
60 | /// </summary> | 60 | /// </summary> |
61 | private AssetMetadata m_metadata; | 61 | private AssetMetadata m_metadata; |
62 | 62 | ||
63 | private int m_uploadAttempts; | ||
64 | |||
63 | // This is needed for .NET serialization!!! | 65 | // This is needed for .NET serialization!!! |
64 | // Do NOT "Optimize" away! | 66 | // Do NOT "Optimize" away! |
65 | public AssetBase() | 67 | public AssetBase() |
@@ -198,6 +200,12 @@ namespace OpenSim.Framework | |||
198 | set { m_metadata.Type = value; } | 200 | set { m_metadata.Type = value; } |
199 | } | 201 | } |
200 | 202 | ||
203 | public int UploadAttempts | ||
204 | { | ||
205 | get { return m_uploadAttempts; } | ||
206 | set { m_uploadAttempts = value; } | ||
207 | } | ||
208 | |||
201 | /// <summary> | 209 | /// <summary> |
202 | /// Is this a region only asset, or does this exist on the asset server also | 210 | /// Is this a region only asset, or does this exist on the asset server also |
203 | /// </summary> | 211 | /// </summary> |
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index 4f598b0..3a0b861 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs | |||
@@ -240,6 +240,21 @@ namespace OpenSim.Framework | |||
240 | // } | 240 | // } |
241 | } | 241 | } |
242 | 242 | ||
243 | /// <summary> | ||
244 | /// Invalidate all of the baked textures in the appearance, useful | ||
245 | /// if you know that none are valid | ||
246 | /// </summary> | ||
247 | public virtual void ResetBakedTextures() | ||
248 | { | ||
249 | SetDefaultTexture(); | ||
250 | |||
251 | //for (int i = 0; i < BAKE_INDICES.Length; i++) | ||
252 | // { | ||
253 | // int idx = BAKE_INDICES[i]; | ||
254 | // m_texture.FaceTextures[idx].TextureID = UUID.Zero; | ||
255 | // } | ||
256 | } | ||
257 | |||
243 | protected virtual void SetDefaultTexture() | 258 | protected virtual void SetDefaultTexture() |
244 | { | 259 | { |
245 | m_texture = new Primitive.TextureEntry(new UUID(AppearanceManager.DEFAULT_AVATAR_TEXTURE)); | 260 | m_texture = new Primitive.TextureEntry(new UUID(AppearanceManager.DEFAULT_AVATAR_TEXTURE)); |
@@ -390,19 +405,18 @@ namespace OpenSim.Framework | |||
390 | /// </remarks> | 405 | /// </remarks> |
391 | public List<AvatarAttachment> GetAttachments() | 406 | public List<AvatarAttachment> GetAttachments() |
392 | { | 407 | { |
393 | List<AvatarAttachment> alist = new List<AvatarAttachment>(); | 408 | |
394 | 409 | ||
395 | lock (m_attachments) | 410 | lock (m_attachments) |
396 | { | 411 | { |
412 | List<AvatarAttachment> alist = new List<AvatarAttachment>(); | ||
397 | foreach (KeyValuePair<int, List<AvatarAttachment>> kvp in m_attachments) | 413 | foreach (KeyValuePair<int, List<AvatarAttachment>> kvp in m_attachments) |
398 | { | 414 | { |
399 | foreach (AvatarAttachment attach in kvp.Value) | 415 | foreach (AvatarAttachment attach in kvp.Value) |
400 | alist.Add(new AvatarAttachment(attach)); | 416 | alist.Add(new AvatarAttachment(attach)); |
401 | } | 417 | } |
402 | } | 418 | return alist; |
403 | 419 | } } | |
404 | return alist; | ||
405 | } | ||
406 | 420 | ||
407 | internal void AppendAttachment(AvatarAttachment attach) | 421 | internal void AppendAttachment(AvatarAttachment attach) |
408 | { | 422 | { |
@@ -531,7 +545,6 @@ namespace OpenSim.Framework | |||
531 | return kvp.Key; | 545 | return kvp.Key; |
532 | } | 546 | } |
533 | } | 547 | } |
534 | |||
535 | return 0; | 548 | return 0; |
536 | } | 549 | } |
537 | 550 | ||
@@ -598,12 +611,14 @@ namespace OpenSim.Framework | |||
598 | OSDBinary visualparams = new OSDBinary(m_visualparams); | 611 | OSDBinary visualparams = new OSDBinary(m_visualparams); |
599 | data["visualparams"] = visualparams; | 612 | data["visualparams"] = visualparams; |
600 | 613 | ||
601 | // Attachments | 614 | lock (m_attachments) |
602 | List<AvatarAttachment> attachments = GetAttachments(); | 615 | { |
603 | OSDArray attachs = new OSDArray(attachments.Count); | 616 | // Attachments |
604 | foreach (AvatarAttachment attach in GetAttachments()) | 617 | OSDArray attachs = new OSDArray(m_attachments.Count); |
605 | attachs.Add(attach.Pack()); | 618 | foreach (AvatarAttachment attach in GetAttachments()) |
606 | data["attachments"] = attachs; | 619 | attachs.Add(attach.Pack()); |
620 | data["attachments"] = attachs; | ||
621 | } | ||
607 | 622 | ||
608 | return data; | 623 | return data; |
609 | } | 624 | } |
diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index 6d048f4..fe12874 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs | |||
@@ -308,6 +308,8 @@ namespace OpenSim.Framework | |||
308 | public Animation[] Anims; | 308 | public Animation[] Anims; |
309 | 309 | ||
310 | public UUID GranterID; | 310 | public UUID GranterID; |
311 | public UUID ParentPart; | ||
312 | public Vector3 SitOffset; | ||
311 | 313 | ||
312 | // Appearance | 314 | // Appearance |
313 | public AvatarAppearance Appearance; | 315 | public AvatarAppearance Appearance; |
@@ -468,6 +470,10 @@ namespace OpenSim.Framework | |||
468 | } | 470 | } |
469 | args["attach_objects"] = attObjs; | 471 | args["attach_objects"] = attObjs; |
470 | } | 472 | } |
473 | |||
474 | args["parent_part"] = OSD.FromUUID(ParentPart); | ||
475 | args["sit_offset"] = OSD.FromString(SitOffset.ToString()); | ||
476 | |||
471 | return args; | 477 | return args; |
472 | } | 478 | } |
473 | 479 | ||
@@ -675,6 +681,11 @@ namespace OpenSim.Framework | |||
675 | } | 681 | } |
676 | } | 682 | } |
677 | } | 683 | } |
684 | |||
685 | if (args["parent_part"] != null) | ||
686 | ParentPart = args["parent_part"].AsUUID(); | ||
687 | if (args["sit_offset"] != null) | ||
688 | Vector3.TryParse(args["sit_offset"].AsString(), out SitOffset); | ||
678 | } | 689 | } |
679 | 690 | ||
680 | public AgentData() | 691 | public AgentData() |
diff --git a/OpenSim/Framework/Communications/RestClient.cs b/OpenSim/Framework/Communications/RestClient.cs index 97b3b60..42c0b18 100644 --- a/OpenSim/Framework/Communications/RestClient.cs +++ b/OpenSim/Framework/Communications/RestClient.cs | |||
@@ -363,7 +363,7 @@ namespace OpenSim.Framework.Communications | |||
363 | _request = (HttpWebRequest) WebRequest.Create(buildUri()); | 363 | _request = (HttpWebRequest) WebRequest.Create(buildUri()); |
364 | _request.KeepAlive = false; | 364 | _request.KeepAlive = false; |
365 | _request.ContentType = "application/xml"; | 365 | _request.ContentType = "application/xml"; |
366 | _request.Timeout = 900000; | 366 | _request.Timeout = 30000; |
367 | _request.Method = RequestMethod; | 367 | _request.Method = RequestMethod; |
368 | _asyncException = null; | 368 | _asyncException = null; |
369 | _request.ContentLength = src.Length; | 369 | _request.ContentLength = src.Length; |
diff --git a/OpenSim/Framework/EstateSettings.cs b/OpenSim/Framework/EstateSettings.cs index 98604f2..142b783 100644 --- a/OpenSim/Framework/EstateSettings.cs +++ b/OpenSim/Framework/EstateSettings.cs | |||
@@ -58,6 +58,30 @@ namespace OpenSim.Framework | |||
58 | set { m_EstateName = value; } | 58 | set { m_EstateName = value; } |
59 | } | 59 | } |
60 | 60 | ||
61 | private bool m_AllowLandmark = true; | ||
62 | |||
63 | public bool AllowLandmark | ||
64 | { | ||
65 | get { return m_AllowLandmark; } | ||
66 | set { m_AllowLandmark = value; } | ||
67 | } | ||
68 | |||
69 | private bool m_AllowParcelChanges = true; | ||
70 | |||
71 | public bool AllowParcelChanges | ||
72 | { | ||
73 | get { return m_AllowParcelChanges; } | ||
74 | set { m_AllowParcelChanges = value; } | ||
75 | } | ||
76 | |||
77 | private bool m_AllowSetHome = true; | ||
78 | |||
79 | public bool AllowSetHome | ||
80 | { | ||
81 | get { return m_AllowSetHome; } | ||
82 | set { m_AllowSetHome = value; } | ||
83 | } | ||
84 | |||
61 | private uint m_ParentEstateID = 1; | 85 | private uint m_ParentEstateID = 1; |
62 | 86 | ||
63 | public uint ParentEstateID | 87 | public uint ParentEstateID |
@@ -338,11 +362,30 @@ namespace OpenSim.Framework | |||
338 | return false; | 362 | return false; |
339 | } | 363 | } |
340 | 364 | ||
341 | public bool IsBanned(UUID avatarID) | 365 | public bool IsBanned(UUID avatarID, int userFlags) |
342 | { | 366 | { |
343 | foreach (EstateBan ban in l_EstateBans) | 367 | foreach (EstateBan ban in l_EstateBans) |
344 | if (ban.BannedUserID == avatarID) | 368 | if (ban.BannedUserID == avatarID) |
345 | return true; | 369 | return true; |
370 | |||
371 | if (!IsEstateManager(avatarID) && !HasAccess(avatarID)) | ||
372 | { | ||
373 | if (DenyMinors) | ||
374 | { | ||
375 | if ((userFlags & 32) == 0) | ||
376 | { | ||
377 | return true; | ||
378 | } | ||
379 | } | ||
380 | if (DenyAnonymous) | ||
381 | { | ||
382 | if ((userFlags & 4) == 0) | ||
383 | { | ||
384 | return true; | ||
385 | } | ||
386 | } | ||
387 | } | ||
388 | |||
346 | return false; | 389 | return false; |
347 | } | 390 | } |
348 | 391 | ||
@@ -350,7 +393,7 @@ namespace OpenSim.Framework | |||
350 | { | 393 | { |
351 | if (ban == null) | 394 | if (ban == null) |
352 | return; | 395 | return; |
353 | if (!IsBanned(ban.BannedUserID)) | 396 | if (!IsBanned(ban.BannedUserID, 32)) //Ignore age-based bans |
354 | l_EstateBans.Add(ban); | 397 | l_EstateBans.Add(ban); |
355 | } | 398 | } |
356 | 399 | ||
@@ -374,6 +417,15 @@ namespace OpenSim.Framework | |||
374 | return l_EstateAccess.Contains(user); | 417 | return l_EstateAccess.Contains(user); |
375 | } | 418 | } |
376 | 419 | ||
420 | public void SetFromFlags(ulong regionFlags) | ||
421 | { | ||
422 | ResetHomeOnTeleport = ((regionFlags & (ulong)RegionFlags.ResetHomeOnTeleport) == (ulong)RegionFlags.ResetHomeOnTeleport); | ||
423 | BlockDwell = ((regionFlags & (ulong)RegionFlags.BlockDwell) == (ulong)RegionFlags.BlockDwell); | ||
424 | AllowLandmark = ((regionFlags & (ulong)RegionFlags.AllowLandmark) == (ulong)RegionFlags.AllowLandmark); | ||
425 | AllowParcelChanges = ((regionFlags & (ulong)RegionFlags.AllowParcelChanges) == (ulong)RegionFlags.AllowParcelChanges); | ||
426 | AllowSetHome = ((regionFlags & (ulong)RegionFlags.AllowSetHome) == (ulong)RegionFlags.AllowSetHome); | ||
427 | } | ||
428 | |||
377 | public bool GroupAccess(UUID groupID) | 429 | public bool GroupAccess(UUID groupID) |
378 | { | 430 | { |
379 | return l_EstateGroups.Contains(groupID); | 431 | return l_EstateGroups.Contains(groupID); |
diff --git a/OpenSim/Framework/ICallingCardModule.cs b/OpenSim/Framework/ICallingCardModule.cs new file mode 100644 index 0000000..17e6de35 --- /dev/null +++ b/OpenSim/Framework/ICallingCardModule.cs | |||
@@ -0,0 +1,13 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using OpenMetaverse; | ||
5 | using OpenSim.Framework; | ||
6 | |||
7 | namespace OpenSim.Framework | ||
8 | { | ||
9 | public interface ICallingCardModule | ||
10 | { | ||
11 | UUID CreateCallingCard(UUID userID, UUID creatorID, UUID folderID); | ||
12 | } | ||
13 | } | ||
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index c85e599..5e156f1 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -266,6 +266,9 @@ namespace OpenSim.Framework | |||
266 | public delegate void MoveInventoryItem( | 266 | public delegate void MoveInventoryItem( |
267 | IClientAPI remoteClient, List<InventoryItemBase> items); | 267 | IClientAPI remoteClient, List<InventoryItemBase> items); |
268 | 268 | ||
269 | public delegate void MoveItemsAndLeaveCopy( | ||
270 | IClientAPI remoteClient, List<InventoryItemBase> items, UUID destFolder); | ||
271 | |||
269 | public delegate void RemoveInventoryItem( | 272 | public delegate void RemoveInventoryItem( |
270 | IClientAPI remoteClient, List<UUID> itemIDs); | 273 | IClientAPI remoteClient, List<UUID> itemIDs); |
271 | 274 | ||
@@ -441,6 +444,7 @@ namespace OpenSim.Framework | |||
441 | public delegate void ClassifiedInfoRequest(UUID classifiedID, IClientAPI client); | 444 | public delegate void ClassifiedInfoRequest(UUID classifiedID, IClientAPI client); |
442 | public delegate void ClassifiedInfoUpdate(UUID classifiedID, uint category, string name, string description, UUID parcelID, uint parentEstate, UUID snapshotID, Vector3 globalPos, byte classifiedFlags, int price, IClientAPI client); | 445 | public delegate void ClassifiedInfoUpdate(UUID classifiedID, uint category, string name, string description, UUID parcelID, uint parentEstate, UUID snapshotID, Vector3 globalPos, byte classifiedFlags, int price, IClientAPI client); |
443 | public delegate void ClassifiedDelete(UUID classifiedID, IClientAPI client); | 446 | public delegate void ClassifiedDelete(UUID classifiedID, IClientAPI client); |
447 | public delegate void ClassifiedGodDelete(UUID classifiedID, UUID queryID, IClientAPI client); | ||
444 | 448 | ||
445 | public delegate void EventNotificationAddRequest(uint EventID, IClientAPI client); | 449 | public delegate void EventNotificationAddRequest(uint EventID, IClientAPI client); |
446 | public delegate void EventNotificationRemoveRequest(uint EventID, IClientAPI client); | 450 | public delegate void EventNotificationRemoveRequest(uint EventID, IClientAPI client); |
@@ -463,9 +467,9 @@ namespace OpenSim.Framework | |||
463 | 467 | ||
464 | public delegate void AgentFOV(IClientAPI client, float verticalAngle); | 468 | public delegate void AgentFOV(IClientAPI client, float verticalAngle); |
465 | 469 | ||
466 | public delegate void MuteListEntryUpdate(IClientAPI client, UUID MuteID, string Name, int Flags,UUID AgentID); | 470 | public delegate void MuteListEntryUpdate(IClientAPI client, UUID MuteID, string Name, int type, uint flags); |
467 | 471 | ||
468 | public delegate void MuteListEntryRemove(IClientAPI client, UUID MuteID, string Name, UUID AgentID); | 472 | public delegate void MuteListEntryRemove(IClientAPI client, UUID MuteID, string Name); |
469 | 473 | ||
470 | public delegate void AvatarInterestReply(IClientAPI client,UUID target, uint wantmask, string wanttext, uint skillsmask, string skillstext, string languages); | 474 | public delegate void AvatarInterestReply(IClientAPI client,UUID target, uint wantmask, string wanttext, uint skillsmask, string skillstext, string languages); |
471 | 475 | ||
@@ -503,6 +507,7 @@ namespace OpenSim.Framework | |||
503 | public delegate void SimWideDeletesDelegate(IClientAPI client,UUID agentID, int flags, UUID targetID); | 507 | public delegate void SimWideDeletesDelegate(IClientAPI client,UUID agentID, int flags, UUID targetID); |
504 | 508 | ||
505 | public delegate void SendPostcard(IClientAPI client); | 509 | public delegate void SendPostcard(IClientAPI client); |
510 | public delegate void ChangeInventoryItemFlags(IClientAPI client, UUID itemID, uint flags); | ||
506 | 511 | ||
507 | #endregion | 512 | #endregion |
508 | 513 | ||
@@ -857,6 +862,7 @@ namespace OpenSim.Framework | |||
857 | event RequestTaskInventory OnRequestTaskInventory; | 862 | event RequestTaskInventory OnRequestTaskInventory; |
858 | event UpdateInventoryItem OnUpdateInventoryItem; | 863 | event UpdateInventoryItem OnUpdateInventoryItem; |
859 | event CopyInventoryItem OnCopyInventoryItem; | 864 | event CopyInventoryItem OnCopyInventoryItem; |
865 | event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy; | ||
860 | event MoveInventoryItem OnMoveInventoryItem; | 866 | event MoveInventoryItem OnMoveInventoryItem; |
861 | event RemoveInventoryFolder OnRemoveInventoryFolder; | 867 | event RemoveInventoryFolder OnRemoveInventoryFolder; |
862 | event RemoveInventoryItem OnRemoveInventoryItem; | 868 | event RemoveInventoryItem OnRemoveInventoryItem; |
@@ -975,7 +981,7 @@ namespace OpenSim.Framework | |||
975 | event ClassifiedInfoRequest OnClassifiedInfoRequest; | 981 | event ClassifiedInfoRequest OnClassifiedInfoRequest; |
976 | event ClassifiedInfoUpdate OnClassifiedInfoUpdate; | 982 | event ClassifiedInfoUpdate OnClassifiedInfoUpdate; |
977 | event ClassifiedDelete OnClassifiedDelete; | 983 | event ClassifiedDelete OnClassifiedDelete; |
978 | event ClassifiedDelete OnClassifiedGodDelete; | 984 | event ClassifiedGodDelete OnClassifiedGodDelete; |
979 | 985 | ||
980 | event EventNotificationAddRequest OnEventNotificationAddRequest; | 986 | event EventNotificationAddRequest OnEventNotificationAddRequest; |
981 | event EventNotificationRemoveRequest OnEventNotificationRemoveRequest; | 987 | event EventNotificationRemoveRequest OnEventNotificationRemoveRequest; |
@@ -1014,6 +1020,7 @@ namespace OpenSim.Framework | |||
1014 | event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; | 1020 | event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; |
1015 | event SimWideDeletesDelegate OnSimWideDeletes; | 1021 | event SimWideDeletesDelegate OnSimWideDeletes; |
1016 | event SendPostcard OnSendPostcard; | 1022 | event SendPostcard OnSendPostcard; |
1023 | event ChangeInventoryItemFlags OnChangeInventoryItemFlags; | ||
1017 | event MuteListEntryUpdate OnUpdateMuteListEntry; | 1024 | event MuteListEntryUpdate OnUpdateMuteListEntry; |
1018 | event MuteListEntryRemove OnRemoveMuteListEntry; | 1025 | event MuteListEntryRemove OnRemoveMuteListEntry; |
1019 | event GodlikeMessage onGodlikeMessage; | 1026 | event GodlikeMessage onGodlikeMessage; |
@@ -1027,6 +1034,7 @@ namespace OpenSim.Framework | |||
1027 | void InPacket(object NewPack); | 1034 | void InPacket(object NewPack); |
1028 | void ProcessInPacket(Packet NewPack); | 1035 | void ProcessInPacket(Packet NewPack); |
1029 | void Close(); | 1036 | void Close(); |
1037 | void Close(bool sendStop); | ||
1030 | void Kick(string message); | 1038 | void Kick(string message); |
1031 | 1039 | ||
1032 | /// <summary> | 1040 | /// <summary> |
diff --git a/OpenSim/Framework/IMoneyModule.cs b/OpenSim/Framework/IMoneyModule.cs index 1e09728..71de93a 100644 --- a/OpenSim/Framework/IMoneyModule.cs +++ b/OpenSim/Framework/IMoneyModule.cs | |||
@@ -40,6 +40,7 @@ namespace OpenSim.Framework | |||
40 | bool AmountCovered(UUID agentID, int amount); | 40 | bool AmountCovered(UUID agentID, int amount); |
41 | void ApplyCharge(UUID agentID, int amount, string text); | 41 | void ApplyCharge(UUID agentID, int amount, string text); |
42 | void ApplyUploadCharge(UUID agentID, int amount, string text); | 42 | void ApplyUploadCharge(UUID agentID, int amount, string text); |
43 | void MoveMoney(UUID fromUser, UUID toUser, int amount, string text); | ||
43 | 44 | ||
44 | int UploadCharge { get; } | 45 | int UploadCharge { get; } |
45 | int GroupCreationCharge { get; } | 46 | int GroupCreationCharge { get; } |
diff --git a/OpenSim/Framework/LandData.cs b/OpenSim/Framework/LandData.cs index f6271ef..9a9a6bf 100644 --- a/OpenSim/Framework/LandData.cs +++ b/OpenSim/Framework/LandData.cs | |||
@@ -67,7 +67,7 @@ namespace OpenSim.Framework | |||
67 | 67 | ||
68 | private uint _flags = (uint) ParcelFlags.AllowFly | (uint) ParcelFlags.AllowLandmark | | 68 | private uint _flags = (uint) ParcelFlags.AllowFly | (uint) ParcelFlags.AllowLandmark | |
69 | (uint) ParcelFlags.AllowAPrimitiveEntry | | 69 | (uint) ParcelFlags.AllowAPrimitiveEntry | |
70 | (uint) ParcelFlags.AllowDeedToGroup | (uint) ParcelFlags.AllowTerraform | | 70 | (uint) ParcelFlags.AllowDeedToGroup | |
71 | (uint) ParcelFlags.CreateObjects | (uint) ParcelFlags.AllowOtherScripts | | 71 | (uint) ParcelFlags.CreateObjects | (uint) ParcelFlags.AllowOtherScripts | |
72 | (uint) ParcelFlags.SoundLocal; | 72 | (uint) ParcelFlags.SoundLocal; |
73 | 73 | ||
diff --git a/OpenSim/Framework/ParcelMediaCommandEnum.cs b/OpenSim/Framework/ParcelMediaCommandEnum.cs index 93c41ec..e714382 100644 --- a/OpenSim/Framework/ParcelMediaCommandEnum.cs +++ b/OpenSim/Framework/ParcelMediaCommandEnum.cs | |||
@@ -27,7 +27,7 @@ | |||
27 | 27 | ||
28 | namespace OpenSim.Framework | 28 | namespace OpenSim.Framework |
29 | { | 29 | { |
30 | public enum ParcelMediaCommandEnum | 30 | public enum ParcelMediaCommandEnum : int |
31 | { | 31 | { |
32 | Stop = 0, | 32 | Stop = 0, |
33 | Pause = 1, | 33 | Pause = 1, |
diff --git a/OpenSim/Framework/PluginLoader.cs b/OpenSim/Framework/PluginLoader.cs index 819cb7b..cc80943 100644 --- a/OpenSim/Framework/PluginLoader.cs +++ b/OpenSim/Framework/PluginLoader.cs | |||
@@ -244,13 +244,22 @@ namespace OpenSim.Framework | |||
244 | // The Mono addin manager (in Mono.Addins.dll version 0.2.0.0) | 244 | // The Mono addin manager (in Mono.Addins.dll version 0.2.0.0) |
245 | // occasionally seems to corrupt its addin cache | 245 | // occasionally seems to corrupt its addin cache |
246 | // Hence, as a temporary solution we'll remove it before each startup | 246 | // Hence, as a temporary solution we'll remove it before each startup |
247 | |||
248 | string customDir = Environment.GetEnvironmentVariable ("MONO_ADDINS_REGISTRY"); | ||
249 | string v0 = "addin-db-000"; | ||
250 | string v1 = "addin-db-001"; | ||
251 | if (customDir != null && customDir != String.Empty) | ||
252 | { | ||
253 | v0 = Path.Combine(customDir, v0); | ||
254 | v1 = Path.Combine(customDir, v1); | ||
255 | } | ||
247 | try | 256 | try |
248 | { | 257 | { |
249 | if (Directory.Exists("addin-db-000")) | 258 | if (Directory.Exists(v0)) |
250 | Directory.Delete("addin-db-000", true); | 259 | Directory.Delete(v0, true); |
251 | 260 | ||
252 | if (Directory.Exists("addin-db-001")) | 261 | if (Directory.Exists(v1)) |
253 | Directory.Delete("addin-db-001", true); | 262 | Directory.Delete(v1, true); |
254 | } | 263 | } |
255 | catch (IOException) | 264 | catch (IOException) |
256 | { | 265 | { |
diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs index 1b6a1d2..9cfc7ed 100644 --- a/OpenSim/Framework/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/PrimitiveBaseShape.cs | |||
@@ -720,7 +720,12 @@ namespace OpenSim.Framework | |||
720 | return _lightColorR; | 720 | return _lightColorR; |
721 | } | 721 | } |
722 | set { | 722 | set { |
723 | _lightColorR = value; | 723 | if (value < 0) |
724 | _lightColorR = 0; | ||
725 | else if (value > 1.0f) | ||
726 | _lightColorR = 1.0f; | ||
727 | else | ||
728 | _lightColorR = value; | ||
724 | } | 729 | } |
725 | } | 730 | } |
726 | 731 | ||
@@ -729,7 +734,12 @@ namespace OpenSim.Framework | |||
729 | return _lightColorG; | 734 | return _lightColorG; |
730 | } | 735 | } |
731 | set { | 736 | set { |
732 | _lightColorG = value; | 737 | if (value < 0) |
738 | _lightColorG = 0; | ||
739 | else if (value > 1.0f) | ||
740 | _lightColorG = 1.0f; | ||
741 | else | ||
742 | _lightColorG = value; | ||
733 | } | 743 | } |
734 | } | 744 | } |
735 | 745 | ||
@@ -738,7 +748,12 @@ namespace OpenSim.Framework | |||
738 | return _lightColorB; | 748 | return _lightColorB; |
739 | } | 749 | } |
740 | set { | 750 | set { |
741 | _lightColorB = value; | 751 | if (value < 0) |
752 | _lightColorB = 0; | ||
753 | else if (value > 1.0f) | ||
754 | _lightColorB = 1.0f; | ||
755 | else | ||
756 | _lightColorB = value; | ||
742 | } | 757 | } |
743 | } | 758 | } |
744 | 759 | ||
@@ -747,7 +762,12 @@ namespace OpenSim.Framework | |||
747 | return _lightColorA; | 762 | return _lightColorA; |
748 | } | 763 | } |
749 | set { | 764 | set { |
750 | _lightColorA = value; | 765 | if (value < 0) |
766 | _lightColorA = 0; | ||
767 | else if (value > 1.0f) | ||
768 | _lightColorA = 1.0f; | ||
769 | else | ||
770 | _lightColorA = value; | ||
751 | } | 771 | } |
752 | } | 772 | } |
753 | 773 | ||
@@ -1410,7 +1430,7 @@ namespace OpenSim.Framework | |||
1410 | prim.Textures = this.Textures; | 1430 | prim.Textures = this.Textures; |
1411 | 1431 | ||
1412 | prim.Properties = new Primitive.ObjectProperties(); | 1432 | prim.Properties = new Primitive.ObjectProperties(); |
1413 | prim.Properties.Name = "Primitive"; | 1433 | prim.Properties.Name = "Object"; |
1414 | prim.Properties.Description = ""; | 1434 | prim.Properties.Description = ""; |
1415 | prim.Properties.CreatorID = UUID.Zero; | 1435 | prim.Properties.CreatorID = UUID.Zero; |
1416 | prim.Properties.GroupID = UUID.Zero; | 1436 | prim.Properties.GroupID = UUID.Zero; |
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 5ba3863..7a3e67f 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs | |||
@@ -40,6 +40,7 @@ using OpenMetaverse.StructuredData; | |||
40 | 40 | ||
41 | namespace OpenSim.Framework | 41 | namespace OpenSim.Framework |
42 | { | 42 | { |
43 | [Serializable] | ||
43 | public class RegionLightShareData : ICloneable | 44 | public class RegionLightShareData : ICloneable |
44 | { | 45 | { |
45 | public bool valid = false; | 46 | public bool valid = false; |
@@ -102,6 +103,7 @@ namespace OpenSim.Framework | |||
102 | 103 | ||
103 | public bool commFailTF = false; | 104 | public bool commFailTF = false; |
104 | public ConfigurationMember configMember; | 105 | public ConfigurationMember configMember; |
106 | public string DataStore = String.Empty; | ||
105 | public string RegionFile = String.Empty; | 107 | public string RegionFile = String.Empty; |
106 | public bool isSandbox = false; | 108 | public bool isSandbox = false; |
107 | public bool Persistent = true; | 109 | public bool Persistent = true; |
@@ -643,6 +645,9 @@ namespace OpenSim.Framework | |||
643 | string location = String.Format("{0},{1}", m_regionLocX, m_regionLocY); | 645 | string location = String.Format("{0},{1}", m_regionLocX, m_regionLocY); |
644 | config.Set("Location", location); | 646 | config.Set("Location", location); |
645 | 647 | ||
648 | if (DataStore != String.Empty) | ||
649 | config.Set("Datastore", DataStore); | ||
650 | |||
646 | config.Set("InternalAddress", m_internalEndPoint.Address.ToString()); | 651 | config.Set("InternalAddress", m_internalEndPoint.Address.ToString()); |
647 | config.Set("InternalPort", m_internalEndPoint.Port); | 652 | config.Set("InternalPort", m_internalEndPoint.Port); |
648 | 653 | ||
@@ -828,6 +833,9 @@ namespace OpenSim.Framework | |||
828 | case "sim_location_y": | 833 | case "sim_location_y": |
829 | m_regionLocY = (uint) configuration_result; | 834 | m_regionLocY = (uint) configuration_result; |
830 | break; | 835 | break; |
836 | case "datastore": | ||
837 | DataStore = (string) configuration_result; | ||
838 | break; | ||
831 | case "internal_ip_address": | 839 | case "internal_ip_address": |
832 | IPAddress address = (IPAddress) configuration_result; | 840 | IPAddress address = (IPAddress) configuration_result; |
833 | m_internalEndPoint = new IPEndPoint(address, 0); | 841 | m_internalEndPoint = new IPEndPoint(address, 0); |
@@ -978,6 +986,11 @@ namespace OpenSim.Framework | |||
978 | return regionInfo; | 986 | return regionInfo; |
979 | } | 987 | } |
980 | 988 | ||
989 | public int getInternalEndPointPort() | ||
990 | { | ||
991 | return m_internalEndPoint.Port; | ||
992 | } | ||
993 | |||
981 | public Dictionary<string, object> ToKeyValuePairs() | 994 | public Dictionary<string, object> ToKeyValuePairs() |
982 | { | 995 | { |
983 | Dictionary<string, object> kvp = new Dictionary<string, object>(); | 996 | Dictionary<string, object> kvp = new Dictionary<string, object>(); |
@@ -996,4 +1009,4 @@ namespace OpenSim.Framework | |||
996 | return kvp; | 1009 | return kvp; |
997 | } | 1010 | } |
998 | } | 1011 | } |
999 | } \ No newline at end of file | 1012 | } |
diff --git a/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs b/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs index a2f5d9c..c7caf6f 100644 --- a/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs +++ b/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs | |||
@@ -48,6 +48,9 @@ namespace OpenSim.Framework.RegionLoader.Web | |||
48 | 48 | ||
49 | public RegionInfo[] LoadRegions() | 49 | public RegionInfo[] LoadRegions() |
50 | { | 50 | { |
51 | int tries = 3; | ||
52 | int wait = 2000; | ||
53 | |||
51 | if (m_configSource == null) | 54 | if (m_configSource == null) |
52 | { | 55 | { |
53 | m_log.Error("[WEBLOADER]: Unable to load configuration source!"); | 56 | m_log.Error("[WEBLOADER]: Unable to load configuration source!"); |
@@ -66,63 +69,72 @@ namespace OpenSim.Framework.RegionLoader.Web | |||
66 | } | 69 | } |
67 | else | 70 | else |
68 | { | 71 | { |
69 | RegionInfo[] regionInfos = new RegionInfo[] {}; | 72 | while(tries > 0) |
70 | int regionCount = 0; | 73 | { |
71 | HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create(url); | 74 | RegionInfo[] regionInfos = new RegionInfo[] {}; |
72 | webRequest.Timeout = 30000; //30 Second Timeout | 75 | int regionCount = 0; |
73 | m_log.DebugFormat("[WEBLOADER]: Sending download request to {0}", url); | 76 | HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create(url); |
77 | webRequest.Timeout = 30000; //30 Second Timeout | ||
78 | m_log.DebugFormat("[WEBLOADER]: Sending download request to {0}", url); | ||
74 | 79 | ||
75 | try | 80 | try |
76 | { | 81 | { |
77 | HttpWebResponse webResponse = (HttpWebResponse) webRequest.GetResponse(); | 82 | HttpWebResponse webResponse = (HttpWebResponse) webRequest.GetResponse(); |
78 | m_log.Debug("[WEBLOADER]: Downloading region information..."); | 83 | m_log.Debug("[WEBLOADER]: Downloading region information..."); |
79 | StreamReader reader = new StreamReader(webResponse.GetResponseStream()); | 84 | StreamReader reader = new StreamReader(webResponse.GetResponseStream()); |
80 | string xmlSource = String.Empty; | 85 | string xmlSource = String.Empty; |
81 | string tempStr = reader.ReadLine(); | 86 | string tempStr = reader.ReadLine(); |
82 | while (tempStr != null) | 87 | while (tempStr != null) |
83 | { | 88 | { |
84 | xmlSource = xmlSource + tempStr; | 89 | xmlSource = xmlSource + tempStr; |
85 | tempStr = reader.ReadLine(); | 90 | tempStr = reader.ReadLine(); |
86 | } | 91 | } |
87 | m_log.Debug("[WEBLOADER]: Done downloading region information from server. Total Bytes: " + | 92 | m_log.Debug("[WEBLOADER]: Done downloading region information from server. Total Bytes: " + |
88 | xmlSource.Length); | 93 | xmlSource.Length); |
89 | XmlDocument xmlDoc = new XmlDocument(); | 94 | XmlDocument xmlDoc = new XmlDocument(); |
90 | xmlDoc.LoadXml(xmlSource); | 95 | xmlDoc.LoadXml(xmlSource); |
91 | if (xmlDoc.FirstChild.Name == "Regions") | 96 | if (xmlDoc.FirstChild.Name == "Regions") |
92 | { | 97 | { |
93 | regionCount = xmlDoc.FirstChild.ChildNodes.Count; | 98 | regionCount = xmlDoc.FirstChild.ChildNodes.Count; |
94 | 99 | ||
95 | if (regionCount > 0) | 100 | if (regionCount > 0) |
96 | { | 101 | { |
97 | regionInfos = new RegionInfo[regionCount]; | 102 | regionInfos = new RegionInfo[regionCount]; |
98 | int i; | 103 | int i; |
99 | for (i = 0; i < xmlDoc.FirstChild.ChildNodes.Count; i++) | 104 | for (i = 0; i < xmlDoc.FirstChild.ChildNodes.Count; i++) |
100 | { | 105 | { |
101 | m_log.Debug(xmlDoc.FirstChild.ChildNodes[i].OuterXml); | 106 | m_log.Debug(xmlDoc.FirstChild.ChildNodes[i].OuterXml); |
102 | regionInfos[i] = | 107 | regionInfos[i] = |
103 | new RegionInfo("REGION CONFIG #" + (i + 1), xmlDoc.FirstChild.ChildNodes[i],false,m_configSource); | 108 | new RegionInfo("REGION CONFIG #" + (i + 1), xmlDoc.FirstChild.ChildNodes[i],false,m_configSource); |
104 | } | 109 | } |
105 | } | 110 | } |
106 | } | 111 | } |
107 | } | 112 | } |
108 | catch (WebException ex) | 113 | catch (WebException ex) |
109 | { | 114 | { |
110 | if (((HttpWebResponse)ex.Response).StatusCode == HttpStatusCode.NotFound) | 115 | if (((HttpWebResponse)ex.Response).StatusCode == HttpStatusCode.NotFound) |
116 | { | ||
117 | if (!allowRegionless) | ||
118 | throw ex; | ||
119 | } | ||
120 | else | ||
121 | throw ex; | ||
122 | } | ||
123 | |||
124 | if (regionCount > 0 | allowRegionless) | ||
125 | return regionInfos; | ||
126 | |||
127 | m_log.Debug("[WEBLOADER]: Request yielded no regions."); | ||
128 | tries--; | ||
129 | if (tries > 0) | ||
111 | { | 130 | { |
112 | if (!allowRegionless) | 131 | m_log.Debug("[WEBLOADER]: Retrying"); |
113 | throw ex; | 132 | System.Threading.Thread.Sleep(wait); |
114 | } | 133 | } |
115 | else | 134 | } |
116 | throw ex; | ||
117 | } | ||
118 | 135 | ||
119 | if (regionCount > 0 | allowRegionless) | 136 | m_log.Error("[WEBLOADER]: No region configs were available."); |
120 | return regionInfos; | 137 | return null; |
121 | else | ||
122 | { | ||
123 | m_log.Error("[WEBLOADER]: No region configs were available."); | ||
124 | return null; | ||
125 | } | ||
126 | } | 138 | } |
127 | } | 139 | } |
128 | } | 140 | } |
diff --git a/OpenSim/Framework/RegionSettings.cs b/OpenSim/Framework/RegionSettings.cs index 4ce3392..c142bd9 100644 --- a/OpenSim/Framework/RegionSettings.cs +++ b/OpenSim/Framework/RegionSettings.cs | |||
@@ -455,6 +455,28 @@ namespace OpenSim.Framework | |||
455 | set { m_LoadedCreationID = value; } | 455 | set { m_LoadedCreationID = value; } |
456 | } | 456 | } |
457 | 457 | ||
458 | private bool m_GodBlockSearch = false; | ||
459 | public bool GodBlockSearch | ||
460 | { | ||
461 | get { return m_GodBlockSearch; } | ||
462 | set { m_GodBlockSearch = value; } | ||
463 | } | ||
464 | |||
465 | private bool m_Casino = false; | ||
466 | public bool Casino | ||
467 | { | ||
468 | get { return m_Casino; } | ||
469 | set { m_Casino = value; } | ||
470 | } | ||
471 | |||
472 | // Telehub support | ||
473 | private bool m_TelehubEnabled = false; | ||
474 | public bool HasTelehub | ||
475 | { | ||
476 | get { return m_TelehubEnabled; } | ||
477 | set { m_TelehubEnabled = value; } | ||
478 | } | ||
479 | |||
458 | // Connected Telehub object | 480 | // Connected Telehub object |
459 | private UUID m_TelehubObject; | 481 | private UUID m_TelehubObject; |
460 | public UUID TelehubObject | 482 | public UUID TelehubObject |
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index d5c2515..f4d541e 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs | |||
@@ -304,7 +304,7 @@ namespace OpenSim.Framework.Servers | |||
304 | 304 | ||
305 | EnhanceVersionInformation(); | 305 | EnhanceVersionInformation(); |
306 | 306 | ||
307 | m_log.Info("[STARTUP]: OpenSimulator version: " + m_version + Environment.NewLine); | 307 | m_log.Info("[STARTUP]: Careminster version: " + m_version + Environment.NewLine); |
308 | // clr version potentially is more confusing than helpful, since it doesn't tell us if we're running under Mono/MS .NET and | 308 | // clr version potentially is more confusing than helpful, since it doesn't tell us if we're running under Mono/MS .NET and |
309 | // the clr version number doesn't match the project version number under Mono. | 309 | // the clr version number doesn't match the project version number under Mono. |
310 | //m_log.Info("[STARTUP]: Virtual machine runtime version: " + Environment.Version + Environment.NewLine); | 310 | //m_log.Info("[STARTUP]: Virtual machine runtime version: " + Environment.Version + Environment.NewLine); |
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index a8ece79..2c0d8f0 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | |||
@@ -1539,11 +1539,34 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1539 | 1539 | ||
1540 | internal void DoHTTPGruntWork(Hashtable responsedata, OSHttpResponse response) | 1540 | internal void DoHTTPGruntWork(Hashtable responsedata, OSHttpResponse response) |
1541 | { | 1541 | { |
1542 | //m_log.Info("[BASE HTTP SERVER]: Doing HTTP Grunt work with response"); | 1542 | int responsecode; |
1543 | int responsecode = (int)responsedata["int_response_code"]; | 1543 | string responseString; |
1544 | string responseString = (string)responsedata["str_response_string"]; | 1544 | string contentType; |
1545 | string contentType = (string)responsedata["content_type"]; | ||
1546 | 1545 | ||
1546 | if (responsedata == null) | ||
1547 | { | ||
1548 | responsecode = 500; | ||
1549 | responseString = "No response could be obtained"; | ||
1550 | contentType = "text/plain"; | ||
1551 | responsedata = new Hashtable(); | ||
1552 | } | ||
1553 | else | ||
1554 | { | ||
1555 | try | ||
1556 | { | ||
1557 | //m_log.Info("[BASE HTTP SERVER]: Doing HTTP Grunt work with response"); | ||
1558 | responsecode = (int)responsedata["int_response_code"]; | ||
1559 | responseString = (string)responsedata["str_response_string"]; | ||
1560 | contentType = (string)responsedata["content_type"]; | ||
1561 | } | ||
1562 | catch | ||
1563 | { | ||
1564 | responsecode = 500; | ||
1565 | responseString = "No response could be obtained"; | ||
1566 | contentType = "text/plain"; | ||
1567 | responsedata = new Hashtable(); | ||
1568 | } | ||
1569 | } | ||
1547 | 1570 | ||
1548 | if (responsedata.ContainsKey("error_status_text")) | 1571 | if (responsedata.ContainsKey("error_status_text")) |
1549 | { | 1572 | { |
diff --git a/OpenSim/Framework/Servers/VersionInfo.cs b/OpenSim/Framework/Servers/VersionInfo.cs index 7a5d715..63ec257 100644 --- a/OpenSim/Framework/Servers/VersionInfo.cs +++ b/OpenSim/Framework/Servers/VersionInfo.cs | |||
@@ -29,11 +29,11 @@ namespace OpenSim | |||
29 | { | 29 | { |
30 | public class VersionInfo | 30 | public class VersionInfo |
31 | { | 31 | { |
32 | private const string VERSION_NUMBER = "0.7.4"; | 32 | private const string VERSION_NUMBER = "0.7.4CM"; |
33 | private const Flavour VERSION_FLAVOUR = Flavour.Dev; | 33 | private const Flavour VERSION_FLAVOUR = Flavour.Dev; |
34 | 34 | ||
35 | public enum Flavour | 35 | public enum Flavour |
36 | { | 36 | { |
37 | Unknown, | 37 | Unknown, |
38 | Dev, | 38 | Dev, |
39 | RC1, | 39 | RC1, |
@@ -49,7 +49,7 @@ namespace OpenSim | |||
49 | 49 | ||
50 | public static string GetVersionString(string versionNumber, Flavour flavour) | 50 | public static string GetVersionString(string versionNumber, Flavour flavour) |
51 | { | 51 | { |
52 | string versionString = "OpenSim " + versionNumber + " " + flavour; | 52 | string versionString = "Careminster " + versionNumber + " " + flavour; |
53 | return versionString.PadRight(VERSIONINFO_VERSION_LENGTH); | 53 | return versionString.PadRight(VERSIONINFO_VERSION_LENGTH); |
54 | } | 54 | } |
55 | 55 | ||
diff --git a/OpenSim/Framework/TaskInventoryDictionary.cs b/OpenSim/Framework/TaskInventoryDictionary.cs index 421bd5d..814758a 100644 --- a/OpenSim/Framework/TaskInventoryDictionary.cs +++ b/OpenSim/Framework/TaskInventoryDictionary.cs | |||
@@ -27,9 +27,13 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Threading; | ||
31 | using System.Reflection; | ||
30 | using System.Xml; | 32 | using System.Xml; |
33 | using System.Diagnostics; | ||
31 | using System.Xml.Schema; | 34 | using System.Xml.Schema; |
32 | using System.Xml.Serialization; | 35 | using System.Xml.Serialization; |
36 | using log4net; | ||
33 | using OpenMetaverse; | 37 | using OpenMetaverse; |
34 | 38 | ||
35 | namespace OpenSim.Framework | 39 | namespace OpenSim.Framework |
@@ -45,6 +49,155 @@ namespace OpenSim.Framework | |||
45 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 49 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | 50 | ||
47 | private static XmlSerializer tiiSerializer = new XmlSerializer(typeof (TaskInventoryItem)); | 51 | private static XmlSerializer tiiSerializer = new XmlSerializer(typeof (TaskInventoryItem)); |
52 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
53 | |||
54 | private Thread LockedByThread; | ||
55 | private string WriterStack; | ||
56 | |||
57 | private Dictionary<Thread, string> ReadLockers = | ||
58 | new Dictionary<Thread, string>(); | ||
59 | |||
60 | /// <value> | ||
61 | /// An advanced lock for inventory data | ||
62 | /// </value> | ||
63 | private System.Threading.ReaderWriterLockSlim m_itemLock = new System.Threading.ReaderWriterLockSlim(); | ||
64 | |||
65 | /// <summary> | ||
66 | /// Are we readlocked by the calling thread? | ||
67 | /// </summary> | ||
68 | public bool IsReadLockedByMe() | ||
69 | { | ||
70 | if (m_itemLock.RecursiveReadCount > 0) | ||
71 | { | ||
72 | return true; | ||
73 | } | ||
74 | else | ||
75 | { | ||
76 | return false; | ||
77 | } | ||
78 | } | ||
79 | |||
80 | /// <summary> | ||
81 | /// Lock our inventory list for reading (many can read, one can write) | ||
82 | /// </summary> | ||
83 | public void LockItemsForRead(bool locked) | ||
84 | { | ||
85 | if (locked) | ||
86 | { | ||
87 | if (m_itemLock.IsWriteLockHeld && LockedByThread != null) | ||
88 | { | ||
89 | if (!LockedByThread.IsAlive) | ||
90 | { | ||
91 | //Locked by dead thread, reset. | ||
92 | m_itemLock = new System.Threading.ReaderWriterLockSlim(); | ||
93 | } | ||
94 | } | ||
95 | |||
96 | if (m_itemLock.RecursiveReadCount > 0) | ||
97 | { | ||
98 | m_log.Error("[TaskInventoryDictionary] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue."); | ||
99 | try | ||
100 | { | ||
101 | StackTrace stackTrace = new StackTrace(); // get call stack | ||
102 | StackFrame[] stackFrames = stackTrace.GetFrames(); // get method calls (frames) | ||
103 | |||
104 | // write call stack method names | ||
105 | foreach (StackFrame stackFrame in stackFrames) | ||
106 | { | ||
107 | m_log.Error("[SceneObjectGroup.m_parts] "+(stackFrame.GetMethod().Name)); // write method name | ||
108 | } | ||
109 | } | ||
110 | catch | ||
111 | {} | ||
112 | m_itemLock.ExitReadLock(); | ||
113 | } | ||
114 | if (m_itemLock.RecursiveWriteCount > 0) | ||
115 | { | ||
116 | m_log.Error("[TaskInventoryDictionary] Recursive write lock requested. This should not happen and means something needs to be fixed."); | ||
117 | m_itemLock.ExitWriteLock(); | ||
118 | } | ||
119 | |||
120 | while (!m_itemLock.TryEnterReadLock(60000)) | ||
121 | { | ||
122 | m_log.Error("Thread lock detected while trying to aquire READ lock in TaskInventoryDictionary. Locked by thread " + LockedByThread.Name + ". I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed."); | ||
123 | if (m_itemLock.IsWriteLockHeld) | ||
124 | { | ||
125 | m_itemLock = new System.Threading.ReaderWriterLockSlim(); | ||
126 | System.Console.WriteLine("------------------------------------------"); | ||
127 | System.Console.WriteLine("My call stack:\n" + Environment.StackTrace); | ||
128 | System.Console.WriteLine("------------------------------------------"); | ||
129 | System.Console.WriteLine("Locker's call stack:\n" + WriterStack); | ||
130 | System.Console.WriteLine("------------------------------------------"); | ||
131 | LockedByThread = null; | ||
132 | ReadLockers.Clear(); | ||
133 | } | ||
134 | } | ||
135 | } | ||
136 | else | ||
137 | { | ||
138 | if (m_itemLock.RecursiveReadCount>0) | ||
139 | { | ||
140 | m_itemLock.ExitReadLock(); | ||
141 | } | ||
142 | } | ||
143 | } | ||
144 | |||
145 | /// <summary> | ||
146 | /// Lock our inventory list for writing (many can read, one can write) | ||
147 | /// </summary> | ||
148 | public void LockItemsForWrite(bool locked) | ||
149 | { | ||
150 | if (locked) | ||
151 | { | ||
152 | //Enter a write lock, wait indefinately for one to open. | ||
153 | if (m_itemLock.RecursiveReadCount > 0) | ||
154 | { | ||
155 | m_log.Error("[TaskInventoryDictionary] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue."); | ||
156 | m_itemLock.ExitReadLock(); | ||
157 | } | ||
158 | if (m_itemLock.RecursiveWriteCount > 0) | ||
159 | { | ||
160 | m_log.Error("[TaskInventoryDictionary] Recursive write lock requested. This should not happen and means something needs to be fixed."); | ||
161 | m_itemLock.ExitWriteLock(); | ||
162 | } | ||
163 | while (!m_itemLock.TryEnterWriteLock(60000)) | ||
164 | { | ||
165 | if (m_itemLock.IsWriteLockHeld) | ||
166 | { | ||
167 | m_log.Error("Thread lock detected while trying to aquire WRITE lock in TaskInventoryDictionary. Locked by thread " + LockedByThread.Name + ". I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed."); | ||
168 | System.Console.WriteLine("------------------------------------------"); | ||
169 | System.Console.WriteLine("My call stack:\n" + Environment.StackTrace); | ||
170 | System.Console.WriteLine("------------------------------------------"); | ||
171 | System.Console.WriteLine("Locker's call stack:\n" + WriterStack); | ||
172 | System.Console.WriteLine("------------------------------------------"); | ||
173 | } | ||
174 | else | ||
175 | { | ||
176 | m_log.Error("Thread lock detected while trying to aquire WRITE lock in TaskInventoryDictionary. Locked by a reader. I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed."); | ||
177 | System.Console.WriteLine("------------------------------------------"); | ||
178 | System.Console.WriteLine("My call stack:\n" + Environment.StackTrace); | ||
179 | System.Console.WriteLine("------------------------------------------"); | ||
180 | foreach (KeyValuePair<Thread, string> kvp in ReadLockers) | ||
181 | { | ||
182 | System.Console.WriteLine("Locker name {0} call stack:\n" + kvp.Value, kvp.Key.Name); | ||
183 | System.Console.WriteLine("------------------------------------------"); | ||
184 | } | ||
185 | } | ||
186 | m_itemLock = new System.Threading.ReaderWriterLockSlim(); | ||
187 | ReadLockers.Clear(); | ||
188 | } | ||
189 | |||
190 | LockedByThread = Thread.CurrentThread; | ||
191 | WriterStack = Environment.StackTrace; | ||
192 | } | ||
193 | else | ||
194 | { | ||
195 | if (m_itemLock.RecursiveWriteCount > 0) | ||
196 | { | ||
197 | m_itemLock.ExitWriteLock(); | ||
198 | } | ||
199 | } | ||
200 | } | ||
48 | 201 | ||
49 | #region ICloneable Members | 202 | #region ICloneable Members |
50 | 203 | ||
@@ -52,14 +205,13 @@ namespace OpenSim.Framework | |||
52 | { | 205 | { |
53 | TaskInventoryDictionary clone = new TaskInventoryDictionary(); | 206 | TaskInventoryDictionary clone = new TaskInventoryDictionary(); |
54 | 207 | ||
55 | lock (this) | 208 | m_itemLock.EnterReadLock(); |
209 | foreach (UUID uuid in Keys) | ||
56 | { | 210 | { |
57 | foreach (UUID uuid in Keys) | 211 | clone.Add(uuid, (TaskInventoryItem) this[uuid].Clone()); |
58 | { | ||
59 | clone.Add(uuid, (TaskInventoryItem) this[uuid].Clone()); | ||
60 | } | ||
61 | } | 212 | } |
62 | 213 | m_itemLock.ExitReadLock(); | |
214 | |||
63 | return clone; | 215 | return clone; |
64 | } | 216 | } |
65 | 217 | ||
diff --git a/OpenSim/Framework/TaskInventoryItem.cs b/OpenSim/Framework/TaskInventoryItem.cs index d4bbbfb..7ef8bf7 100644 --- a/OpenSim/Framework/TaskInventoryItem.cs +++ b/OpenSim/Framework/TaskInventoryItem.cs | |||
@@ -68,6 +68,9 @@ namespace OpenSim.Framework | |||
68 | private UUID _loadedID = UUID.Zero; | 68 | private UUID _loadedID = UUID.Zero; |
69 | 69 | ||
70 | private bool _ownerChanged = false; | 70 | private bool _ownerChanged = false; |
71 | |||
72 | // This used ONLY during copy. It can't be relied on at other times! | ||
73 | private bool _scriptRunning = true; | ||
71 | 74 | ||
72 | public UUID AssetID { | 75 | public UUID AssetID { |
73 | get { | 76 | get { |
@@ -340,6 +343,15 @@ namespace OpenSim.Framework | |||
340 | } | 343 | } |
341 | } | 344 | } |
342 | 345 | ||
346 | public bool ScriptRunning { | ||
347 | get { | ||
348 | return _scriptRunning; | ||
349 | } | ||
350 | set { | ||
351 | _scriptRunning = value; | ||
352 | } | ||
353 | } | ||
354 | |||
343 | // See ICloneable | 355 | // See ICloneable |
344 | 356 | ||
345 | #region ICloneable Members | 357 | #region ICloneable Members |
diff --git a/OpenSim/Framework/Tests/MundaneFrameworkTests.cs b/OpenSim/Framework/Tests/MundaneFrameworkTests.cs index 76de6be..34a3f15 100644 --- a/OpenSim/Framework/Tests/MundaneFrameworkTests.cs +++ b/OpenSim/Framework/Tests/MundaneFrameworkTests.cs | |||
@@ -217,12 +217,12 @@ namespace OpenSim.Framework.Tests | |||
217 | BannedHostNameMask = string.Empty, | 217 | BannedHostNameMask = string.Empty, |
218 | BannedUserID = bannedUserId} | 218 | BannedUserID = bannedUserId} |
219 | ); | 219 | ); |
220 | Assert.IsTrue(es.IsBanned(bannedUserId), "User Should be banned but is not."); | 220 | Assert.IsTrue(es.IsBanned(bannedUserId, 32), "User Should be banned but is not."); |
221 | Assert.IsFalse(es.IsBanned(UUID.Zero), "User Should not be banned but is."); | 221 | Assert.IsFalse(es.IsBanned(UUID.Zero, 32), "User Should not be banned but is."); |
222 | 222 | ||
223 | es.RemoveBan(bannedUserId); | 223 | es.RemoveBan(bannedUserId); |
224 | 224 | ||
225 | Assert.IsFalse(es.IsBanned(bannedUserId), "User Should not be banned but is."); | 225 | Assert.IsFalse(es.IsBanned(bannedUserId, 32), "User Should not be banned but is."); |
226 | 226 | ||
227 | es.AddEstateManager(UUID.Zero); | 227 | es.AddEstateManager(UUID.Zero); |
228 | 228 | ||
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index efa4a7b..02da7f4 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -478,19 +478,25 @@ namespace OpenSim.Framework | |||
478 | /// </summary> | 478 | /// </summary> |
479 | /// <param name="data"></param> | 479 | /// <param name="data"></param> |
480 | /// <returns></returns> | 480 | /// <returns></returns> |
481 | |||
481 | public static string Md5Hash(string data) | 482 | public static string Md5Hash(string data) |
482 | { | 483 | { |
483 | byte[] dataMd5 = ComputeMD5Hash(data); | 484 | return Md5Hash(data, Encoding.Default); |
485 | } | ||
486 | |||
487 | public static string Md5Hash(string data, Encoding encoding) | ||
488 | { | ||
489 | byte[] dataMd5 = ComputeMD5Hash(data, encoding); | ||
484 | StringBuilder sb = new StringBuilder(); | 490 | StringBuilder sb = new StringBuilder(); |
485 | for (int i = 0; i < dataMd5.Length; i++) | 491 | for (int i = 0; i < dataMd5.Length; i++) |
486 | sb.AppendFormat("{0:x2}", dataMd5[i]); | 492 | sb.AppendFormat("{0:x2}", dataMd5[i]); |
487 | return sb.ToString(); | 493 | return sb.ToString(); |
488 | } | 494 | } |
489 | 495 | ||
490 | private static byte[] ComputeMD5Hash(string data) | 496 | private static byte[] ComputeMD5Hash(string data, Encoding encoding) |
491 | { | 497 | { |
492 | MD5 md5 = MD5.Create(); | 498 | MD5 md5 = MD5.Create(); |
493 | return md5.ComputeHash(Encoding.Default.GetBytes(data)); | 499 | return md5.ComputeHash(encoding.GetBytes(data)); |
494 | } | 500 | } |
495 | 501 | ||
496 | /// <summary> | 502 | /// <summary> |
@@ -498,6 +504,12 @@ namespace OpenSim.Framework | |||
498 | /// </summary> | 504 | /// </summary> |
499 | /// <param name="data"></param> | 505 | /// <param name="data"></param> |
500 | /// <returns></returns> | 506 | /// <returns></returns> |
507 | |||
508 | public static string SHA1Hash(string data, Encoding enc) | ||
509 | { | ||
510 | return SHA1Hash(enc.GetBytes(data)); | ||
511 | } | ||
512 | |||
501 | public static string SHA1Hash(string data) | 513 | public static string SHA1Hash(string data) |
502 | { | 514 | { |
503 | return SHA1Hash(Encoding.Default.GetBytes(data)); | 515 | return SHA1Hash(Encoding.Default.GetBytes(data)); |
@@ -1102,19 +1114,19 @@ namespace OpenSim.Framework | |||
1102 | { | 1114 | { |
1103 | string os = String.Empty; | 1115 | string os = String.Empty; |
1104 | 1116 | ||
1105 | if (Environment.OSVersion.Platform != PlatformID.Unix) | 1117 | // if (Environment.OSVersion.Platform != PlatformID.Unix) |
1106 | { | 1118 | // { |
1107 | os = Environment.OSVersion.ToString(); | 1119 | // os = Environment.OSVersion.ToString(); |
1108 | } | 1120 | // } |
1109 | else | 1121 | // else |
1110 | { | 1122 | // { |
1111 | os = ReadEtcIssue(); | 1123 | // os = ReadEtcIssue(); |
1112 | } | 1124 | // } |
1113 | 1125 | // | |
1114 | if (os.Length > 45) | 1126 | // if (os.Length > 45) |
1115 | { | 1127 | // { |
1116 | os = os.Substring(0, 45); | 1128 | // os = os.Substring(0, 45); |
1117 | } | 1129 | // } |
1118 | 1130 | ||
1119 | return os; | 1131 | return os; |
1120 | } | 1132 | } |
@@ -1247,7 +1259,7 @@ namespace OpenSim.Framework | |||
1247 | 1259 | ||
1248 | public static Guid GetHashGuid(string data, string salt) | 1260 | public static Guid GetHashGuid(string data, string salt) |
1249 | { | 1261 | { |
1250 | byte[] hash = ComputeMD5Hash(data + salt); | 1262 | byte[] hash = ComputeMD5Hash(data + salt, Encoding.Default); |
1251 | 1263 | ||
1252 | //string s = BitConverter.ToString(hash); | 1264 | //string s = BitConverter.ToString(hash); |
1253 | 1265 | ||
diff --git a/OpenSim/Framework/Watchdog.cs b/OpenSim/Framework/Watchdog.cs index e93e50e..881b6aa 100644 --- a/OpenSim/Framework/Watchdog.cs +++ b/OpenSim/Framework/Watchdog.cs | |||
@@ -266,7 +266,7 @@ namespace OpenSim.Framework | |||
266 | 266 | ||
267 | lock (m_threads) | 267 | lock (m_threads) |
268 | { | 268 | { |
269 | int now = Environment.TickCount & Int32.MaxValue; | 269 | int now = Environment.TickCount; |
270 | 270 | ||
271 | foreach (ThreadWatchdogInfo threadInfo in m_threads.Values) | 271 | foreach (ThreadWatchdogInfo threadInfo in m_threads.Values) |
272 | { | 272 | { |
@@ -302,4 +302,4 @@ namespace OpenSim.Framework | |||
302 | m_watchdogTimer.Start(); | 302 | m_watchdogTimer.Start(); |
303 | } | 303 | } |
304 | } | 304 | } |
305 | } \ No newline at end of file | 305 | } |
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index af25da9..f90df12 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs | |||
@@ -173,6 +173,7 @@ namespace OpenSim.Framework | |||
173 | catch (Exception ex) | 173 | catch (Exception ex) |
174 | { | 174 | { |
175 | errorMessage = ex.Message; | 175 | errorMessage = ex.Message; |
176 | m_log.Debug("[WEB UTIL]: Exception making request: " + ex.ToString()); | ||
176 | } | 177 | } |
177 | finally | 178 | finally |
178 | { | 179 | { |
@@ -243,7 +244,7 @@ namespace OpenSim.Framework | |||
243 | /// </summary> | 244 | /// </summary> |
244 | public static OSDMap PostToService(string url, NameValueCollection data) | 245 | public static OSDMap PostToService(string url, NameValueCollection data) |
245 | { | 246 | { |
246 | return ServiceFormRequest(url,data,10000); | 247 | return ServiceFormRequest(url,data, 20000); |
247 | } | 248 | } |
248 | 249 | ||
249 | public static OSDMap ServiceFormRequest(string url, NameValueCollection data, int timeout) | 250 | public static OSDMap ServiceFormRequest(string url, NameValueCollection data, int timeout) |
@@ -859,11 +860,18 @@ namespace OpenSim.Framework | |||
859 | /// the request. You'll want to make sure you deal with this as they're not uncommon</exception> | 860 | /// the request. You'll want to make sure you deal with this as they're not uncommon</exception> |
860 | public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj) | 861 | public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj) |
861 | { | 862 | { |
863 | return MakeRequest<TRequest, TResponse>(verb, requestUrl, obj, 0); | ||
864 | } | ||
865 | |||
866 | public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj, int pTimeout) | ||
867 | { | ||
862 | Type type = typeof(TRequest); | 868 | Type type = typeof(TRequest); |
863 | TResponse deserial = default(TResponse); | 869 | TResponse deserial = default(TResponse); |
864 | 870 | ||
865 | WebRequest request = WebRequest.Create(requestUrl); | 871 | WebRequest request = WebRequest.Create(requestUrl); |
866 | request.Method = verb; | 872 | request.Method = verb; |
873 | if (pTimeout != 0) | ||
874 | request.Timeout = pTimeout * 1000; | ||
867 | 875 | ||
868 | if ((verb == "POST") || (verb == "PUT")) | 876 | if ((verb == "POST") || (verb == "PUT")) |
869 | { | 877 | { |