diff options
Diffstat (limited to 'OpenSim/Framework')
23 files changed, 521 insertions, 121 deletions
diff --git a/OpenSim/Framework/AssetBase.cs b/OpenSim/Framework/AssetBase.cs index e8c85c9..06e040f 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() |
@@ -197,6 +199,12 @@ namespace OpenSim.Framework | |||
197 | set { m_metadata.Type = value; } | 199 | set { m_metadata.Type = value; } |
198 | } | 200 | } |
199 | 201 | ||
202 | public int UploadAttempts | ||
203 | { | ||
204 | get { return m_uploadAttempts; } | ||
205 | set { m_uploadAttempts = value; } | ||
206 | } | ||
207 | |||
200 | /// <summary> | 208 | /// <summary> |
201 | /// Is this a region only asset, or does this exist on the asset server also | 209 | /// Is this a region only asset, or does this exist on the asset server also |
202 | /// </summary> | 210 | /// </summary> |
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index aed9087..a68de57 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs | |||
@@ -245,6 +245,21 @@ namespace OpenSim.Framework | |||
245 | // } | 245 | // } |
246 | } | 246 | } |
247 | 247 | ||
248 | /// <summary> | ||
249 | /// Invalidate all of the baked textures in the appearance, useful | ||
250 | /// if you know that none are valid | ||
251 | /// </summary> | ||
252 | public virtual void ResetBakedTextures() | ||
253 | { | ||
254 | SetDefaultTexture(); | ||
255 | |||
256 | //for (int i = 0; i < BAKE_INDICES.Length; i++) | ||
257 | // { | ||
258 | // int idx = BAKE_INDICES[i]; | ||
259 | // m_texture.FaceTextures[idx].TextureID = UUID.Zero; | ||
260 | // } | ||
261 | } | ||
262 | |||
248 | protected virtual void SetDefaultTexture() | 263 | protected virtual void SetDefaultTexture() |
249 | { | 264 | { |
250 | m_texture = new Primitive.TextureEntry(new UUID(AppearanceManager.DEFAULT_AVATAR_TEXTURE)); | 265 | m_texture = new Primitive.TextureEntry(new UUID(AppearanceManager.DEFAULT_AVATAR_TEXTURE)); |
@@ -390,27 +405,36 @@ 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 | lock (m_attachments) |
394 | foreach (KeyValuePair<int, List<AvatarAttachment>> kvp in m_attachments) | ||
395 | { | 409 | { |
396 | foreach (AvatarAttachment attach in kvp.Value) | 410 | List<AvatarAttachment> alist = new List<AvatarAttachment>(); |
397 | alist.Add(new AvatarAttachment(attach)); | 411 | foreach (KeyValuePair<int, List<AvatarAttachment>> kvp in m_attachments) |
398 | } | 412 | { |
413 | foreach (AvatarAttachment attach in kvp.Value) | ||
414 | alist.Add(new AvatarAttachment(attach)); | ||
415 | } | ||
399 | 416 | ||
400 | return alist; | 417 | return alist; |
418 | } | ||
401 | } | 419 | } |
402 | 420 | ||
403 | internal void AppendAttachment(AvatarAttachment attach) | 421 | internal void AppendAttachment(AvatarAttachment attach) |
404 | { | 422 | { |
405 | if (! m_attachments.ContainsKey(attach.AttachPoint)) | 423 | lock (m_attachments) |
406 | m_attachments[attach.AttachPoint] = new List<AvatarAttachment>(); | 424 | { |
407 | m_attachments[attach.AttachPoint].Add(attach); | 425 | if (!m_attachments.ContainsKey(attach.AttachPoint)) |
426 | m_attachments[attach.AttachPoint] = new List<AvatarAttachment>(); | ||
427 | m_attachments[attach.AttachPoint].Add(attach); | ||
428 | } | ||
408 | } | 429 | } |
409 | 430 | ||
410 | internal void ReplaceAttachment(AvatarAttachment attach) | 431 | internal void ReplaceAttachment(AvatarAttachment attach) |
411 | { | 432 | { |
412 | m_attachments[attach.AttachPoint] = new List<AvatarAttachment>(); | 433 | lock (m_attachments) |
413 | m_attachments[attach.AttachPoint].Add(attach); | 434 | { |
435 | m_attachments[attach.AttachPoint] = new List<AvatarAttachment>(); | ||
436 | m_attachments[attach.AttachPoint].Add(attach); | ||
437 | } | ||
414 | } | 438 | } |
415 | 439 | ||
416 | /// <summary> | 440 | /// <summary> |
@@ -439,12 +463,15 @@ namespace OpenSim.Framework | |||
439 | 463 | ||
440 | if (item == UUID.Zero) | 464 | if (item == UUID.Zero) |
441 | { | 465 | { |
442 | if (m_attachments.ContainsKey(attachpoint)) | 466 | lock (m_attachments) |
443 | { | 467 | { |
444 | m_attachments.Remove(attachpoint); | 468 | if (m_attachments.ContainsKey(attachpoint)) |
445 | return true; | 469 | { |
470 | m_attachments.Remove(attachpoint); | ||
471 | return true; | ||
472 | } | ||
473 | return false; | ||
446 | } | 474 | } |
447 | return false; | ||
448 | } | 475 | } |
449 | 476 | ||
450 | // check if the item is already attached at this point | 477 | // check if the item is already attached at this point |
@@ -470,31 +497,36 @@ namespace OpenSim.Framework | |||
470 | 497 | ||
471 | public int GetAttachpoint(UUID itemID) | 498 | public int GetAttachpoint(UUID itemID) |
472 | { | 499 | { |
473 | foreach (KeyValuePair<int, List<AvatarAttachment>> kvp in m_attachments) | 500 | lock (m_attachments) |
474 | { | 501 | { |
475 | int index = kvp.Value.FindIndex(delegate(AvatarAttachment a) { return a.ItemID == itemID; }); | 502 | foreach (KeyValuePair<int, List<AvatarAttachment>> kvp in m_attachments) |
476 | if (index >= 0) | 503 | { |
477 | return kvp.Key; | 504 | int index = kvp.Value.FindIndex(delegate(AvatarAttachment a) { return a.ItemID == itemID; }); |
478 | } | 505 | if (index >= 0) |
506 | return kvp.Key; | ||
507 | } | ||
479 | 508 | ||
480 | return 0; | 509 | return 0; |
510 | } | ||
481 | } | 511 | } |
482 | 512 | ||
483 | public bool DetachAttachment(UUID itemID) | 513 | public bool DetachAttachment(UUID itemID) |
484 | { | 514 | { |
485 | foreach (KeyValuePair<int, List<AvatarAttachment>> kvp in m_attachments) | 515 | lock (m_attachments) |
486 | { | 516 | { |
487 | int index = kvp.Value.FindIndex(delegate(AvatarAttachment a) { return a.ItemID == itemID; }); | 517 | foreach (KeyValuePair<int, List<AvatarAttachment>> kvp in m_attachments) |
488 | if (index >= 0) | ||
489 | { | 518 | { |
490 | // Remove it from the list of attachments at that attach point | 519 | int index = kvp.Value.FindIndex(delegate(AvatarAttachment a) { return a.ItemID == itemID; }); |
491 | m_attachments[kvp.Key].RemoveAt(index); | 520 | if (index >= 0) |
492 | 521 | { | |
493 | // And remove the list if there are no more attachments here | 522 | // Remove it from the list of attachments at that attach point |
494 | if (m_attachments[kvp.Key].Count == 0) | 523 | m_attachments[kvp.Key].RemoveAt(index); |
495 | m_attachments.Remove(kvp.Key); | ||
496 | 524 | ||
497 | return true; | 525 | // And remove the list if there are no more attachments here |
526 | if (m_attachments[kvp.Key].Count == 0) | ||
527 | m_attachments.Remove(kvp.Key); | ||
528 | return true; | ||
529 | } | ||
498 | } | 530 | } |
499 | } | 531 | } |
500 | return false; | 532 | return false; |
@@ -502,7 +534,10 @@ namespace OpenSim.Framework | |||
502 | 534 | ||
503 | public void ClearAttachments() | 535 | public void ClearAttachments() |
504 | { | 536 | { |
505 | m_attachments.Clear(); | 537 | lock (m_attachments) |
538 | { | ||
539 | m_attachments.Clear(); | ||
540 | } | ||
506 | } | 541 | } |
507 | 542 | ||
508 | #region Packing Functions | 543 | #region Packing Functions |
@@ -539,11 +574,14 @@ namespace OpenSim.Framework | |||
539 | OSDBinary visualparams = new OSDBinary(m_visualparams); | 574 | OSDBinary visualparams = new OSDBinary(m_visualparams); |
540 | data["visualparams"] = visualparams; | 575 | data["visualparams"] = visualparams; |
541 | 576 | ||
542 | // Attachments | 577 | lock (m_attachments) |
543 | OSDArray attachs = new OSDArray(m_attachments.Count); | 578 | { |
544 | foreach (AvatarAttachment attach in GetAttachments()) | 579 | // Attachments |
545 | attachs.Add(attach.Pack()); | 580 | OSDArray attachs = new OSDArray(m_attachments.Count); |
546 | data["attachments"] = attachs; | 581 | foreach (AvatarAttachment attach in GetAttachments()) |
582 | attachs.Add(attach.Pack()); | ||
583 | data["attachments"] = attachs; | ||
584 | } | ||
547 | 585 | ||
548 | return data; | 586 | return data; |
549 | } | 587 | } |
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 2a495b0..afbdd49 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 | ||
@@ -373,5 +416,14 @@ namespace OpenSim.Framework | |||
373 | 416 | ||
374 | return l_EstateAccess.Contains(user); | 417 | return l_EstateAccess.Contains(user); |
375 | } | 418 | } |
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 | } | ||
376 | } | 428 | } |
377 | } | 429 | } |
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 150ff1b..ee3d6b6 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -265,6 +265,9 @@ namespace OpenSim.Framework | |||
265 | public delegate void MoveInventoryItem( | 265 | public delegate void MoveInventoryItem( |
266 | IClientAPI remoteClient, List<InventoryItemBase> items); | 266 | IClientAPI remoteClient, List<InventoryItemBase> items); |
267 | 267 | ||
268 | public delegate void MoveItemsAndLeaveCopy( | ||
269 | IClientAPI remoteClient, List<InventoryItemBase> items, UUID destFolder); | ||
270 | |||
268 | public delegate void RemoveInventoryItem( | 271 | public delegate void RemoveInventoryItem( |
269 | IClientAPI remoteClient, List<UUID> itemIDs); | 272 | IClientAPI remoteClient, List<UUID> itemIDs); |
270 | 273 | ||
@@ -438,6 +441,7 @@ namespace OpenSim.Framework | |||
438 | public delegate void ClassifiedInfoRequest(UUID classifiedID, IClientAPI client); | 441 | public delegate void ClassifiedInfoRequest(UUID classifiedID, IClientAPI client); |
439 | 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); | 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); |
440 | public delegate void ClassifiedDelete(UUID classifiedID, IClientAPI client); | 443 | public delegate void ClassifiedDelete(UUID classifiedID, IClientAPI client); |
444 | public delegate void ClassifiedGodDelete(UUID classifiedID, UUID queryID, IClientAPI client); | ||
441 | 445 | ||
442 | public delegate void EventNotificationAddRequest(uint EventID, IClientAPI client); | 446 | public delegate void EventNotificationAddRequest(uint EventID, IClientAPI client); |
443 | public delegate void EventNotificationRemoveRequest(uint EventID, IClientAPI client); | 447 | public delegate void EventNotificationRemoveRequest(uint EventID, IClientAPI client); |
@@ -460,9 +464,9 @@ namespace OpenSim.Framework | |||
460 | 464 | ||
461 | public delegate void AgentFOV(IClientAPI client, float verticalAngle); | 465 | public delegate void AgentFOV(IClientAPI client, float verticalAngle); |
462 | 466 | ||
463 | public delegate void MuteListEntryUpdate(IClientAPI client, UUID MuteID, string Name, int Flags,UUID AgentID); | 467 | public delegate void MuteListEntryUpdate(IClientAPI client, UUID MuteID, string Name, int type, uint flags); |
464 | 468 | ||
465 | public delegate void MuteListEntryRemove(IClientAPI client, UUID MuteID, string Name, UUID AgentID); | 469 | public delegate void MuteListEntryRemove(IClientAPI client, UUID MuteID, string Name); |
466 | 470 | ||
467 | public delegate void AvatarInterestReply(IClientAPI client,UUID target, uint wantmask, string wanttext, uint skillsmask, string skillstext, string languages); | 471 | public delegate void AvatarInterestReply(IClientAPI client,UUID target, uint wantmask, string wanttext, uint skillsmask, string skillstext, string languages); |
468 | 472 | ||
@@ -846,6 +850,7 @@ namespace OpenSim.Framework | |||
846 | event RequestTaskInventory OnRequestTaskInventory; | 850 | event RequestTaskInventory OnRequestTaskInventory; |
847 | event UpdateInventoryItem OnUpdateInventoryItem; | 851 | event UpdateInventoryItem OnUpdateInventoryItem; |
848 | event CopyInventoryItem OnCopyInventoryItem; | 852 | event CopyInventoryItem OnCopyInventoryItem; |
853 | event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy; | ||
849 | event MoveInventoryItem OnMoveInventoryItem; | 854 | event MoveInventoryItem OnMoveInventoryItem; |
850 | event RemoveInventoryFolder OnRemoveInventoryFolder; | 855 | event RemoveInventoryFolder OnRemoveInventoryFolder; |
851 | event RemoveInventoryItem OnRemoveInventoryItem; | 856 | event RemoveInventoryItem OnRemoveInventoryItem; |
@@ -964,7 +969,7 @@ namespace OpenSim.Framework | |||
964 | event ClassifiedInfoRequest OnClassifiedInfoRequest; | 969 | event ClassifiedInfoRequest OnClassifiedInfoRequest; |
965 | event ClassifiedInfoUpdate OnClassifiedInfoUpdate; | 970 | event ClassifiedInfoUpdate OnClassifiedInfoUpdate; |
966 | event ClassifiedDelete OnClassifiedDelete; | 971 | event ClassifiedDelete OnClassifiedDelete; |
967 | event ClassifiedDelete OnClassifiedGodDelete; | 972 | event ClassifiedGodDelete OnClassifiedGodDelete; |
968 | 973 | ||
969 | event EventNotificationAddRequest OnEventNotificationAddRequest; | 974 | event EventNotificationAddRequest OnEventNotificationAddRequest; |
970 | event EventNotificationRemoveRequest OnEventNotificationRemoveRequest; | 975 | event EventNotificationRemoveRequest OnEventNotificationRemoveRequest; |
@@ -1016,6 +1021,7 @@ namespace OpenSim.Framework | |||
1016 | void InPacket(object NewPack); | 1021 | void InPacket(object NewPack); |
1017 | void ProcessInPacket(Packet NewPack); | 1022 | void ProcessInPacket(Packet NewPack); |
1018 | void Close(); | 1023 | void Close(); |
1024 | void Close(bool sendStop); | ||
1019 | void Kick(string message); | 1025 | void Kick(string message); |
1020 | 1026 | ||
1021 | /// <summary> | 1027 | /// <summary> |
@@ -1047,7 +1053,7 @@ namespace OpenSim.Framework | |||
1047 | /// </summary> | 1053 | /// </summary> |
1048 | /// <param name="regionHandle"></param> | 1054 | /// <param name="regionHandle"></param> |
1049 | /// <param name="localID"></param> | 1055 | /// <param name="localID"></param> |
1050 | void SendKillObject(ulong regionHandle, uint localID); | 1056 | void SendKillObject(ulong regionHandle, List<uint> localID); |
1051 | 1057 | ||
1052 | void SendAnimations(UUID[] animID, int[] seqs, UUID sourceAgentId, UUID[] objectIDs); | 1058 | void SendAnimations(UUID[] animID, int[] seqs, UUID sourceAgentId, UUID[] objectIDs); |
1053 | void SendRegionHandshake(RegionInfo regionInfo, RegionHandshakeArgs args); | 1059 | void SendRegionHandshake(RegionInfo regionInfo, RegionHandshakeArgs args); |
diff --git a/OpenSim/Framework/IMoneyModule.cs b/OpenSim/Framework/IMoneyModule.cs index 3d4873d..ea6ed4b 100644 --- a/OpenSim/Framework/IMoneyModule.cs +++ b/OpenSim/Framework/IMoneyModule.cs | |||
@@ -40,6 +40,7 @@ namespace OpenSim.Framework | |||
40 | bool AmountCovered(IClientAPI client, int amount); | 40 | bool AmountCovered(IClientAPI client, 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 c107143..282a128 100644 --- a/OpenSim/Framework/LandData.cs +++ b/OpenSim/Framework/LandData.cs | |||
@@ -60,7 +60,7 @@ namespace OpenSim.Framework | |||
60 | 60 | ||
61 | private uint _flags = (uint) ParcelFlags.AllowFly | (uint) ParcelFlags.AllowLandmark | | 61 | private uint _flags = (uint) ParcelFlags.AllowFly | (uint) ParcelFlags.AllowLandmark | |
62 | (uint) ParcelFlags.AllowAPrimitiveEntry | | 62 | (uint) ParcelFlags.AllowAPrimitiveEntry | |
63 | (uint) ParcelFlags.AllowDeedToGroup | (uint) ParcelFlags.AllowTerraform | | 63 | (uint) ParcelFlags.AllowDeedToGroup | |
64 | (uint) ParcelFlags.CreateObjects | (uint) ParcelFlags.AllowOtherScripts | | 64 | (uint) ParcelFlags.CreateObjects | (uint) ParcelFlags.AllowOtherScripts | |
65 | (uint) ParcelFlags.SoundLocal; | 65 | (uint) ParcelFlags.SoundLocal; |
66 | 66 | ||
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 0e41535..b0202fb 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs | |||
@@ -40,6 +40,7 @@ using OpenSim.Framework.Console; | |||
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; |
@@ -506,6 +508,10 @@ namespace OpenSim.Framework | |||
506 | m_regionLocX = Convert.ToUInt32(locationElements[0]); | 508 | m_regionLocX = Convert.ToUInt32(locationElements[0]); |
507 | m_regionLocY = Convert.ToUInt32(locationElements[1]); | 509 | m_regionLocY = Convert.ToUInt32(locationElements[1]); |
508 | 510 | ||
511 | |||
512 | // Datastore (is this implemented? Omitted from example!) | ||
513 | DataStore = config.GetString("Datastore", String.Empty); | ||
514 | |||
509 | // Internal IP | 515 | // Internal IP |
510 | IPAddress address; | 516 | IPAddress address; |
511 | 517 | ||
@@ -604,6 +610,9 @@ namespace OpenSim.Framework | |||
604 | string location = String.Format("{0},{1}", m_regionLocX, m_regionLocY); | 610 | string location = String.Format("{0},{1}", m_regionLocX, m_regionLocY); |
605 | config.Set("Location", location); | 611 | config.Set("Location", location); |
606 | 612 | ||
613 | if (DataStore != String.Empty) | ||
614 | config.Set("Datastore", DataStore); | ||
615 | |||
607 | config.Set("InternalAddress", m_internalEndPoint.Address.ToString()); | 616 | config.Set("InternalAddress", m_internalEndPoint.Address.ToString()); |
608 | config.Set("InternalPort", m_internalEndPoint.Port); | 617 | config.Set("InternalPort", m_internalEndPoint.Port); |
609 | 618 | ||
@@ -789,6 +798,9 @@ namespace OpenSim.Framework | |||
789 | case "sim_location_y": | 798 | case "sim_location_y": |
790 | m_regionLocY = (uint) configuration_result; | 799 | m_regionLocY = (uint) configuration_result; |
791 | break; | 800 | break; |
801 | case "datastore": | ||
802 | DataStore = (string) configuration_result; | ||
803 | break; | ||
792 | case "internal_ip_address": | 804 | case "internal_ip_address": |
793 | IPAddress address = (IPAddress) configuration_result; | 805 | IPAddress address = (IPAddress) configuration_result; |
794 | m_internalEndPoint = new IPEndPoint(address, 0); | 806 | m_internalEndPoint = new IPEndPoint(address, 0); |
@@ -939,6 +951,11 @@ namespace OpenSim.Framework | |||
939 | return regionInfo; | 951 | return regionInfo; |
940 | } | 952 | } |
941 | 953 | ||
954 | public int getInternalEndPointPort() | ||
955 | { | ||
956 | return m_internalEndPoint.Port; | ||
957 | } | ||
958 | |||
942 | public Dictionary<string, object> ToKeyValuePairs() | 959 | public Dictionary<string, object> ToKeyValuePairs() |
943 | { | 960 | { |
944 | Dictionary<string, object> kvp = new Dictionary<string, object>(); | 961 | Dictionary<string, object> kvp = new Dictionary<string, object>(); |
@@ -957,4 +974,4 @@ namespace OpenSim.Framework | |||
957 | return kvp; | 974 | return kvp; |
958 | } | 975 | } |
959 | } | 976 | } |
960 | } \ No newline at end of file | 977 | } |
diff --git a/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs b/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs index de4898a..f0ffc2c 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!"); |
@@ -64,35 +67,47 @@ namespace OpenSim.Framework.RegionLoader.Web | |||
64 | } | 67 | } |
65 | else | 68 | else |
66 | { | 69 | { |
67 | HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create(url); | 70 | while (tries > 0) |
68 | webRequest.Timeout = 30000; //30 Second Timeout | ||
69 | m_log.DebugFormat("[WEBLOADER]: Sending download request to {0}", url); | ||
70 | HttpWebResponse webResponse = (HttpWebResponse) webRequest.GetResponse(); | ||
71 | m_log.Debug("[WEBLOADER]: Downloading region information..."); | ||
72 | StreamReader reader = new StreamReader(webResponse.GetResponseStream()); | ||
73 | string xmlSource = String.Empty; | ||
74 | string tempStr = reader.ReadLine(); | ||
75 | while (tempStr != null) | ||
76 | { | ||
77 | xmlSource = xmlSource + tempStr; | ||
78 | tempStr = reader.ReadLine(); | ||
79 | } | ||
80 | m_log.Debug("[WEBLOADER]: Done downloading region information from server. Total Bytes: " + | ||
81 | xmlSource.Length); | ||
82 | XmlDocument xmlDoc = new XmlDocument(); | ||
83 | xmlDoc.LoadXml(xmlSource); | ||
84 | if (xmlDoc.FirstChild.Name == "Regions") | ||
85 | { | 71 | { |
86 | RegionInfo[] regionInfos = new RegionInfo[xmlDoc.FirstChild.ChildNodes.Count]; | 72 | HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create(url); |
87 | int i; | 73 | webRequest.Timeout = 30000; //30 Second Timeout |
88 | for (i = 0; i < xmlDoc.FirstChild.ChildNodes.Count; i++) | 74 | m_log.Debug("[WEBLOADER]: Sending Download Request..."); |
75 | HttpWebResponse webResponse = (HttpWebResponse) webRequest.GetResponse(); | ||
76 | m_log.Debug("[WEBLOADER]: Downloading Region Information From Remote Server..."); | ||
77 | StreamReader reader = new StreamReader(webResponse.GetResponseStream()); | ||
78 | string xmlSource = String.Empty; | ||
79 | string tempStr = reader.ReadLine(); | ||
80 | while (tempStr != null) | ||
81 | { | ||
82 | xmlSource = xmlSource + tempStr; | ||
83 | tempStr = reader.ReadLine(); | ||
84 | } | ||
85 | m_log.Debug("[WEBLOADER]: Done downloading region information from server. Total Bytes: " + | ||
86 | xmlSource.Length); | ||
87 | XmlDocument xmlDoc = new XmlDocument(); | ||
88 | xmlDoc.LoadXml(xmlSource); | ||
89 | if (xmlDoc.FirstChild.Name == "Regions") | ||
89 | { | 90 | { |
90 | m_log.Debug(xmlDoc.FirstChild.ChildNodes[i].OuterXml); | 91 | RegionInfo[] regionInfos = new RegionInfo[xmlDoc.FirstChild.ChildNodes.Count]; |
91 | regionInfos[i] = | 92 | int i; |
92 | new RegionInfo("REGION CONFIG #" + (i + 1), xmlDoc.FirstChild.ChildNodes[i],false,m_configSource); | 93 | for (i = 0; i < xmlDoc.FirstChild.ChildNodes.Count; i++) |
94 | { | ||
95 | m_log.Debug(xmlDoc.FirstChild.ChildNodes[i].OuterXml); | ||
96 | regionInfos[i] = | ||
97 | new RegionInfo("REGION CONFIG #" + (i + 1), xmlDoc.FirstChild.ChildNodes[i],false,m_configSource); | ||
98 | } | ||
99 | |||
100 | if (i > 0) | ||
101 | return regionInfos; | ||
93 | } | 102 | } |
94 | 103 | ||
95 | return regionInfos; | 104 | m_log.Debug("[WEBLOADER]: Request yielded no regions."); |
105 | tries--; | ||
106 | if (tries > 0) | ||
107 | { | ||
108 | m_log.Debug("[WEBLOADER]: Retrying"); | ||
109 | System.Threading.Thread.Sleep(wait); | ||
110 | } | ||
96 | } | 111 | } |
97 | return null; | 112 | return null; |
98 | } | 113 | } |
diff --git a/OpenSim/Framework/RegionSettings.cs b/OpenSim/Framework/RegionSettings.cs index 673cf20..f0786fc 100644 --- a/OpenSim/Framework/RegionSettings.cs +++ b/OpenSim/Framework/RegionSettings.cs | |||
@@ -397,5 +397,18 @@ namespace OpenSim.Framework | |||
397 | set { m_LoadedCreationID = value; } | 397 | set { m_LoadedCreationID = value; } |
398 | } | 398 | } |
399 | 399 | ||
400 | private bool m_GodBlockSearch = false; | ||
401 | public bool GodBlockSearch | ||
402 | { | ||
403 | get { return m_GodBlockSearch; } | ||
404 | set { m_GodBlockSearch = value; } | ||
405 | } | ||
406 | |||
407 | private bool m_Casino = false; | ||
408 | public bool Casino | ||
409 | { | ||
410 | get { return m_Casino; } | ||
411 | set { m_Casino = value; } | ||
412 | } | ||
400 | } | 413 | } |
401 | } | 414 | } |
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 688be3f..64b9c3e 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs | |||
@@ -280,7 +280,7 @@ namespace OpenSim.Framework.Servers | |||
280 | 280 | ||
281 | EnhanceVersionInformation(); | 281 | EnhanceVersionInformation(); |
282 | 282 | ||
283 | m_log.Info("[STARTUP]: OpenSimulator version: " + m_version + Environment.NewLine); | 283 | m_log.Info("[STARTUP]: Careminster version: " + m_version + Environment.NewLine); |
284 | // clr version potentially is more confusing than helpful, since it doesn't tell us if we're running under Mono/MS .NET and | 284 | // clr version potentially is more confusing than helpful, since it doesn't tell us if we're running under Mono/MS .NET and |
285 | // the clr version number doesn't match the project version number under Mono. | 285 | // the clr version number doesn't match the project version number under Mono. |
286 | //m_log.Info("[STARTUP]: Virtual machine runtime version: " + Environment.Version + Environment.NewLine); | 286 | //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 af9b62f..c0d65ac 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | |||
@@ -1510,11 +1510,34 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1510 | 1510 | ||
1511 | internal void DoHTTPGruntWork(Hashtable responsedata, OSHttpResponse response) | 1511 | internal void DoHTTPGruntWork(Hashtable responsedata, OSHttpResponse response) |
1512 | { | 1512 | { |
1513 | //m_log.Info("[BASE HTTP SERVER]: Doing HTTP Grunt work with response"); | 1513 | int responsecode; |
1514 | int responsecode = (int)responsedata["int_response_code"]; | 1514 | string responseString; |
1515 | string responseString = (string)responsedata["str_response_string"]; | 1515 | string contentType; |
1516 | string contentType = (string)responsedata["content_type"]; | ||
1517 | 1516 | ||
1517 | if (responsedata == null) | ||
1518 | { | ||
1519 | responsecode = 500; | ||
1520 | responseString = "No response could be obtained"; | ||
1521 | contentType = "text/plain"; | ||
1522 | responsedata = new Hashtable(); | ||
1523 | } | ||
1524 | else | ||
1525 | { | ||
1526 | try | ||
1527 | { | ||
1528 | //m_log.Info("[BASE HTTP SERVER]: Doing HTTP Grunt work with response"); | ||
1529 | responsecode = (int)responsedata["int_response_code"]; | ||
1530 | responseString = (string)responsedata["str_response_string"]; | ||
1531 | contentType = (string)responsedata["content_type"]; | ||
1532 | } | ||
1533 | catch | ||
1534 | { | ||
1535 | responsecode = 500; | ||
1536 | responseString = "No response could be obtained"; | ||
1537 | contentType = "text/plain"; | ||
1538 | responsedata = new Hashtable(); | ||
1539 | } | ||
1540 | } | ||
1518 | 1541 | ||
1519 | if (responsedata.ContainsKey("error_status_text")) | 1542 | if (responsedata.ContainsKey("error_status_text")) |
1520 | { | 1543 | { |
diff --git a/OpenSim/Framework/Servers/VersionInfo.cs b/OpenSim/Framework/Servers/VersionInfo.cs index 53a3f17..24758e8 100644 --- a/OpenSim/Framework/Servers/VersionInfo.cs +++ b/OpenSim/Framework/Servers/VersionInfo.cs | |||
@@ -33,7 +33,7 @@ namespace OpenSim | |||
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 30d775c..be2b8c8 100644 --- a/OpenSim/Framework/TaskInventoryItem.cs +++ b/OpenSim/Framework/TaskInventoryItem.cs | |||
@@ -121,9 +121,12 @@ namespace OpenSim.Framework | |||
121 | private UUID _permsGranter; | 121 | private UUID _permsGranter; |
122 | private int _permsMask; | 122 | private int _permsMask; |
123 | private int _type = 0; | 123 | private int _type = 0; |
124 | private UUID _oldID; | 124 | private UUID _oldID = UUID.Zero; |
125 | 125 | ||
126 | private bool _ownerChanged = false; | 126 | private bool _ownerChanged = false; |
127 | |||
128 | // This used ONLY during copy. It can't be relied on at other times! | ||
129 | private bool _scriptRunning = true; | ||
127 | 130 | ||
128 | public UUID AssetID { | 131 | public UUID AssetID { |
129 | get { | 132 | get { |
@@ -387,6 +390,15 @@ namespace OpenSim.Framework | |||
387 | } | 390 | } |
388 | } | 391 | } |
389 | 392 | ||
393 | public bool ScriptRunning { | ||
394 | get { | ||
395 | return _scriptRunning; | ||
396 | } | ||
397 | set { | ||
398 | _scriptRunning = value; | ||
399 | } | ||
400 | } | ||
401 | |||
390 | // See ICloneable | 402 | // See ICloneable |
391 | 403 | ||
392 | #region ICloneable Members | 404 | #region ICloneable Members |
@@ -404,7 +416,8 @@ namespace OpenSim.Framework | |||
404 | /// <param name="partID">The new part ID to which this item belongs</param> | 416 | /// <param name="partID">The new part ID to which this item belongs</param> |
405 | public void ResetIDs(UUID partID) | 417 | public void ResetIDs(UUID partID) |
406 | { | 418 | { |
407 | OldItemID = ItemID; | 419 | if (_oldID == UUID.Zero) |
420 | _oldID = ItemID; | ||
408 | ItemID = UUID.Random(); | 421 | ItemID = UUID.Random(); |
409 | ParentPartID = partID; | 422 | ParentPartID = partID; |
410 | ParentID = partID; | 423 | ParentID = partID; |
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 745da17..2d58807 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -430,19 +430,25 @@ namespace OpenSim.Framework | |||
430 | /// </summary> | 430 | /// </summary> |
431 | /// <param name="data"></param> | 431 | /// <param name="data"></param> |
432 | /// <returns></returns> | 432 | /// <returns></returns> |
433 | |||
433 | public static string Md5Hash(string data) | 434 | public static string Md5Hash(string data) |
434 | { | 435 | { |
435 | byte[] dataMd5 = ComputeMD5Hash(data); | 436 | return Md5Hash(data, Encoding.Default); |
437 | } | ||
438 | |||
439 | public static string Md5Hash(string data, Encoding encoding) | ||
440 | { | ||
441 | byte[] dataMd5 = ComputeMD5Hash(data, encoding); | ||
436 | StringBuilder sb = new StringBuilder(); | 442 | StringBuilder sb = new StringBuilder(); |
437 | for (int i = 0; i < dataMd5.Length; i++) | 443 | for (int i = 0; i < dataMd5.Length; i++) |
438 | sb.AppendFormat("{0:x2}", dataMd5[i]); | 444 | sb.AppendFormat("{0:x2}", dataMd5[i]); |
439 | return sb.ToString(); | 445 | return sb.ToString(); |
440 | } | 446 | } |
441 | 447 | ||
442 | private static byte[] ComputeMD5Hash(string data) | 448 | private static byte[] ComputeMD5Hash(string data, Encoding encoding) |
443 | { | 449 | { |
444 | MD5 md5 = MD5.Create(); | 450 | MD5 md5 = MD5.Create(); |
445 | return md5.ComputeHash(Encoding.Default.GetBytes(data)); | 451 | return md5.ComputeHash(encoding.GetBytes(data)); |
446 | } | 452 | } |
447 | 453 | ||
448 | /// <summary> | 454 | /// <summary> |
@@ -450,6 +456,12 @@ namespace OpenSim.Framework | |||
450 | /// </summary> | 456 | /// </summary> |
451 | /// <param name="data"></param> | 457 | /// <param name="data"></param> |
452 | /// <returns></returns> | 458 | /// <returns></returns> |
459 | |||
460 | public static string SHA1Hash(string data, Encoding enc) | ||
461 | { | ||
462 | return SHA1Hash(enc.GetBytes(data)); | ||
463 | } | ||
464 | |||
453 | public static string SHA1Hash(string data) | 465 | public static string SHA1Hash(string data) |
454 | { | 466 | { |
455 | return SHA1Hash(Encoding.Default.GetBytes(data)); | 467 | return SHA1Hash(Encoding.Default.GetBytes(data)); |
@@ -1054,19 +1066,19 @@ namespace OpenSim.Framework | |||
1054 | { | 1066 | { |
1055 | string os = String.Empty; | 1067 | string os = String.Empty; |
1056 | 1068 | ||
1057 | if (Environment.OSVersion.Platform != PlatformID.Unix) | 1069 | // if (Environment.OSVersion.Platform != PlatformID.Unix) |
1058 | { | 1070 | // { |
1059 | os = Environment.OSVersion.ToString(); | 1071 | // os = Environment.OSVersion.ToString(); |
1060 | } | 1072 | // } |
1061 | else | 1073 | // else |
1062 | { | 1074 | // { |
1063 | os = ReadEtcIssue(); | 1075 | // os = ReadEtcIssue(); |
1064 | } | 1076 | // } |
1065 | 1077 | // | |
1066 | if (os.Length > 45) | 1078 | // if (os.Length > 45) |
1067 | { | 1079 | // { |
1068 | os = os.Substring(0, 45); | 1080 | // os = os.Substring(0, 45); |
1069 | } | 1081 | // } |
1070 | 1082 | ||
1071 | return os; | 1083 | return os; |
1072 | } | 1084 | } |
@@ -1199,7 +1211,7 @@ namespace OpenSim.Framework | |||
1199 | 1211 | ||
1200 | public static Guid GetHashGuid(string data, string salt) | 1212 | public static Guid GetHashGuid(string data, string salt) |
1201 | { | 1213 | { |
1202 | byte[] hash = ComputeMD5Hash(data + salt); | 1214 | byte[] hash = ComputeMD5Hash(data + salt, Encoding.Default); |
1203 | 1215 | ||
1204 | //string s = BitConverter.ToString(hash); | 1216 | //string s = BitConverter.ToString(hash); |
1205 | 1217 | ||
diff --git a/OpenSim/Framework/Watchdog.cs b/OpenSim/Framework/Watchdog.cs index 0f34e83..3389ecb 100644 --- a/OpenSim/Framework/Watchdog.cs +++ b/OpenSim/Framework/Watchdog.cs | |||
@@ -52,7 +52,7 @@ namespace OpenSim.Framework | |||
52 | public ThreadWatchdogInfo(Thread thread) | 52 | public ThreadWatchdogInfo(Thread thread) |
53 | { | 53 | { |
54 | Thread = thread; | 54 | Thread = thread; |
55 | LastTick = Environment.TickCount & Int32.MaxValue; | 55 | LastTick = Environment.TickCount; |
56 | } | 56 | } |
57 | } | 57 | } |
58 | 58 | ||
@@ -127,7 +127,7 @@ namespace OpenSim.Framework | |||
127 | m_threads.Add(threadInfo.Thread.ManagedThreadId, threadInfo); | 127 | m_threads.Add(threadInfo.Thread.ManagedThreadId, threadInfo); |
128 | } | 128 | } |
129 | 129 | ||
130 | private static bool RemoveThread(int threadID) | 130 | public static bool RemoveThread(int threadID) |
131 | { | 131 | { |
132 | lock (m_threads) | 132 | lock (m_threads) |
133 | return m_threads.Remove(threadID); | 133 | return m_threads.Remove(threadID); |
@@ -144,7 +144,7 @@ namespace OpenSim.Framework | |||
144 | try | 144 | try |
145 | { | 145 | { |
146 | if (m_threads.TryGetValue(threadID, out threadInfo)) | 146 | if (m_threads.TryGetValue(threadID, out threadInfo)) |
147 | threadInfo.LastTick = Environment.TickCount & Int32.MaxValue; | 147 | threadInfo.LastTick = Environment.TickCount; |
148 | else | 148 | else |
149 | AddThread(new ThreadWatchdogInfo(Thread.CurrentThread)); | 149 | AddThread(new ThreadWatchdogInfo(Thread.CurrentThread)); |
150 | } | 150 | } |
@@ -170,7 +170,7 @@ namespace OpenSim.Framework | |||
170 | 170 | ||
171 | lock (m_threads) | 171 | lock (m_threads) |
172 | { | 172 | { |
173 | int now = Environment.TickCount & Int32.MaxValue; | 173 | int now = Environment.TickCount; |
174 | 174 | ||
175 | foreach (ThreadWatchdogInfo threadInfo in m_threads.Values) | 175 | foreach (ThreadWatchdogInfo threadInfo in m_threads.Values) |
176 | { | 176 | { |
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index be7504f..971c0b7 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs | |||
@@ -245,6 +245,7 @@ namespace OpenSim.Framework | |||
245 | catch (Exception ex) | 245 | catch (Exception ex) |
246 | { | 246 | { |
247 | errorMessage = ex.Message; | 247 | errorMessage = ex.Message; |
248 | m_log.Debug("[WEB UTIL]: Exception making request: " + ex.ToString()); | ||
248 | } | 249 | } |
249 | finally | 250 | finally |
250 | { | 251 | { |
@@ -311,7 +312,7 @@ namespace OpenSim.Framework | |||
311 | /// </summary> | 312 | /// </summary> |
312 | public static OSDMap PostToService(string url, NameValueCollection data) | 313 | public static OSDMap PostToService(string url, NameValueCollection data) |
313 | { | 314 | { |
314 | return ServiceFormRequest(url,data,10000); | 315 | return ServiceFormRequest(url,data, 20000); |
315 | } | 316 | } |
316 | 317 | ||
317 | public static OSDMap ServiceFormRequest(string url, NameValueCollection data, int timeout) | 318 | public static OSDMap ServiceFormRequest(string url, NameValueCollection data, int timeout) |
@@ -925,11 +926,18 @@ namespace OpenSim.Framework | |||
925 | /// the request. You'll want to make sure you deal with this as they're not uncommon</exception> | 926 | /// the request. You'll want to make sure you deal with this as they're not uncommon</exception> |
926 | public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj) | 927 | public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj) |
927 | { | 928 | { |
929 | return MakeRequest<TRequest, TResponse>(verb, requestUrl, obj, 0); | ||
930 | } | ||
931 | |||
932 | public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj, int pTimeout) | ||
933 | { | ||
928 | Type type = typeof(TRequest); | 934 | Type type = typeof(TRequest); |
929 | TResponse deserial = default(TResponse); | 935 | TResponse deserial = default(TResponse); |
930 | 936 | ||
931 | WebRequest request = WebRequest.Create(requestUrl); | 937 | WebRequest request = WebRequest.Create(requestUrl); |
932 | request.Method = verb; | 938 | request.Method = verb; |
939 | if (pTimeout != 0) | ||
940 | request.Timeout = pTimeout * 1000; | ||
933 | 941 | ||
934 | if ((verb == "POST") || (verb == "PUT")) | 942 | if ((verb == "POST") || (verb == "PUT")) |
935 | { | 943 | { |