From 848623eea5b8ee09681e21231258956e0ff41599 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 2 Jul 2010 03:05:40 +0200 Subject: Fix a dumb little sign error that makes a LSL wiki example fail --- OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index 1ea52c5..941c761 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs @@ -663,13 +663,13 @@ namespace OpenSim.Region.ScriptEngine.Shared Object[] ret; if (start < 0) - start=m_data.Length-start; + start=m_data.Length+start; if (start < 0) start=0; if (end < 0) - end=m_data.Length-end; + end=m_data.Length+end; if (end < 0) end=0; -- cgit v1.1 From e328c233554913393cb08fd771b64f2dd1b3de60 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 2 Jul 2010 04:03:35 +0100 Subject: Add MapTileURL to robust to supply the url needed by snowglobe --- OpenSim/Services/LLLoginService/LLLoginResponse.cs | 19 ++++++++++++++++++- OpenSim/Services/LLLoginService/LLLoginService.cs | 4 +++- bin/Robust.ini.example | 3 +++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs index 54d53fb..866e3a3 100644 --- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs +++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs @@ -170,6 +170,9 @@ namespace OpenSim.Services.LLLoginService private string firstname; private string lastname; + // Web map + private string mapTileURL; + // Error Flags private string errorReason; private string errorMessage; @@ -218,7 +221,7 @@ namespace OpenSim.Services.LLLoginService public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo, GridRegion destination, List invSkel, FriendInfo[] friendsList, ILibraryService libService, string where, string startlocation, Vector3 position, Vector3 lookAt, List gestures, string message, - GridRegion home, IPEndPoint clientIP) + GridRegion home, IPEndPoint clientIP, string mapTileURL) : this() { FillOutInventoryData(invSkel, libService); @@ -234,6 +237,7 @@ namespace OpenSim.Services.LLLoginService Message = message; BuddList = ConvertFriendListItem(friendsList); StartLocation = where; + MapTileURL = mapTileURL; FillOutHomeData(pinfo, home); LookAt = String.Format("[r{0},r{1},r{2}]", lookAt.X, lookAt.Y, lookAt.Z); @@ -405,6 +409,7 @@ namespace OpenSim.Services.LLLoginService InitialOutfitHash["folder_name"] = "Nightclub Female"; InitialOutfitHash["gender"] = "female"; initialOutfit.Add(InitialOutfitHash); + mapTileURL = String.Empty; } @@ -468,6 +473,9 @@ namespace OpenSim.Services.LLLoginService responseData["region_x"] = (Int32)(RegionX); responseData["region_y"] = (Int32)(RegionY); + if (mapTileURL != String.Empty) + responseData["map-server-url"] = mapTileURL; + if (m_buddyList != null) { responseData["buddy-list"] = m_buddyList.ToArray(); @@ -564,6 +572,9 @@ namespace OpenSim.Services.LLLoginService map["region_x"] = OSD.FromInteger(RegionX); map["region_y"] = OSD.FromInteger(RegionY); + if (mapTileURL != String.Empty) + map["map-server-url"] = OSD.FromString(mapTileURL); + if (m_buddyList != null) { map["buddy-list"] = ArrayListToOSDArray(m_buddyList.ToArray()); @@ -915,6 +926,12 @@ namespace OpenSim.Services.LLLoginService set { home = value; } } + public string MapTileURL + { + get { return mapTileURL; } + set { mapTileURL = value; } + } + public string Message { get { return welcomeMessage; } diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 00fffff..f4e045c 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -73,6 +73,7 @@ namespace OpenSim.Services.LLLoginService protected int m_MinLoginLevel; protected string m_GatekeeperURL; protected bool m_AllowRemoteSetLoginLevel; + protected string m_MapTileURL; IConfig m_LoginServerConfig; @@ -100,6 +101,7 @@ namespace OpenSim.Services.LLLoginService m_AllowRemoteSetLoginLevel = m_LoginServerConfig.GetBoolean("AllowRemoteSetLoginLevel", false); m_MinLoginLevel = m_LoginServerConfig.GetInt("MinLoginLevel", 0); m_GatekeeperURL = m_LoginServerConfig.GetString("GatekeeperURI", string.Empty); + m_MapTileURL = m_LoginServerConfig.GetString("MapTileURL", string.Empty); // These are required; the others aren't if (accountService == string.Empty || authService == string.Empty) @@ -356,7 +358,7 @@ namespace OpenSim.Services.LLLoginService // Finally, fill out the response and return it // LLLoginResponse response = new LLLoginResponse(account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService, - where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP); + where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP, m_MapTileURL); m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to client."); return response; diff --git a/bin/Robust.ini.example b/bin/Robust.ini.example index 8331db8..96dfc01 100644 --- a/bin/Robust.ini.example +++ b/bin/Robust.ini.example @@ -134,6 +134,9 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003 WelcomeMessage = "Welcome, Avatar!" AllowRemoteSetLoginLevel = "false" + ; For snowglobe's web map + ; MapTileURL = ""; + [GridInfoService] ; These settings are used to return information on a get_grid_info call. -- cgit v1.1 From 9e0b562c6e98b3945551a113be24ebaf17bbff29 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 2 Jul 2010 04:26:55 +0200 Subject: Fox another scripting nasty. Stuff no system.string objects into lists --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 712bd7d..0a8d7cb 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4950,7 +4950,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api case ',': if (parens == 0) { - result.Add(src.Substring(start,length).Trim()); + result.Add(new LSL_String(src.Substring(start,length).Trim())); start += length+1; length = 0; } -- cgit v1.1 From d58b32735d7a72497a8ecf9c76aec9e63920ccbc Mon Sep 17 00:00:00 2001 From: dahlia Date: Thu, 1 Jul 2010 20:50:24 -0700 Subject: add Micheil Merlin to CONTRIBUTORS.txt (Mantis #4784) --- CONTRIBUTORS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 9aadd70..2443244 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -95,6 +95,7 @@ what it is today. * Mic Bowman * Michelle Argus * Michael Cortez (The Flotsam Project, http://osflotsam.org/) +* Micheil Merlin * Mike Osias (IBM) * Mike Pitman (IBM) * mikkopa/_someone - RealXtend -- cgit v1.1 From fda9d7b75e88f8308f5a05ae8f5476869e675a0b Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 2 Jul 2010 04:51:31 +0200 Subject: Remove GetEconomyData and the economy data structure (unused) --- OpenSim/Framework/IMoneyModule.cs | 21 --------------------- .../World/MoneyModule/SampleMoneyModule.cs | 21 --------------------- 2 files changed, 42 deletions(-) diff --git a/OpenSim/Framework/IMoneyModule.cs b/OpenSim/Framework/IMoneyModule.cs index 3480960..17e74a0 100644 --- a/OpenSim/Framework/IMoneyModule.cs +++ b/OpenSim/Framework/IMoneyModule.cs @@ -43,27 +43,6 @@ namespace OpenSim.Framework bool AmountCovered(IClientAPI client, int amount); void ApplyCharge(UUID agentID, int amount, string text); - EconomyData GetEconomyData(); - event ObjectPaid OnObjectPaid; } - - public struct EconomyData - { - public int ObjectCapacity; - public int ObjectCount; - public int PriceEnergyUnit; - public int PriceGroupCreate; - public int PriceObjectClaim; - public float PriceObjectRent; - public float PriceObjectScaleFactor; - public int PriceParcelClaim; - public float PriceParcelClaimFactor; - public int PriceParcelRent; - public int PricePublicObjectDecay; - public int PricePublicObjectDelete; - public int PriceRentLight; - public int PriceUpload; - public int TeleportMinPrice; - } } diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs index b9a75cc..e070077 100644 --- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs +++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs @@ -268,27 +268,6 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule } - public EconomyData GetEconomyData() - { - EconomyData edata = new EconomyData(); - edata.ObjectCapacity = ObjectCapacity; - edata.ObjectCount = ObjectCount; - edata.PriceEnergyUnit = PriceEnergyUnit; - edata.PriceGroupCreate = PriceGroupCreate; - edata.PriceObjectClaim = PriceObjectClaim; - edata.PriceObjectRent = PriceObjectRent; - edata.PriceObjectScaleFactor = PriceObjectScaleFactor; - edata.PriceParcelClaim = PriceParcelClaim; - edata.PriceParcelClaimFactor = PriceParcelClaimFactor; - edata.PriceParcelRent = PriceParcelRent; - edata.PricePublicObjectDecay = PricePublicObjectDecay; - edata.PricePublicObjectDelete = PricePublicObjectDelete; - edata.PriceRentLight = PriceRentLight; - edata.PriceUpload = PriceUpload; - edata.TeleportMinPrice = TeleportMinPrice; - return edata; - } - private void GetClientFunds(IClientAPI client) { CheckExistAndRefreshFunds(client.AgentId); -- cgit v1.1 From e15f6905a53d686e3de9c2e16e842f3b735c3685 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 2 Jul 2010 06:20:36 +0200 Subject: Clean up IMoneyModule and adjust the other modules to the changes --- OpenSim/Framework/Capabilities/Caps.cs | 2 +- OpenSim/Framework/IMoneyModule.cs | 11 ++++---- .../AssetTransaction/AssetTransactionModule.cs | 2 +- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 2 +- .../Avatar/XmlRpcGroups/GroupsModule.cs | 4 +-- .../World/MoneyModule/SampleMoneyModule.cs | 31 +++++++++++----------- 6 files changed, 26 insertions(+), 26 deletions(-) diff --git a/OpenSim/Framework/Capabilities/Caps.cs b/OpenSim/Framework/Capabilities/Caps.cs index 62a1e17..da953bb 100644 --- a/OpenSim/Framework/Capabilities/Caps.cs +++ b/OpenSim/Framework/Capabilities/Caps.cs @@ -814,7 +814,7 @@ namespace OpenSim.Framework.Capabilities if (mm != null) { - if (!mm.UploadCovered(client)) + if (!mm.UploadCovered(client, mm.UploadCharge)) { if (client != null) client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); diff --git a/OpenSim/Framework/IMoneyModule.cs b/OpenSim/Framework/IMoneyModule.cs index 17e74a0..3d4873d 100644 --- a/OpenSim/Framework/IMoneyModule.cs +++ b/OpenSim/Framework/IMoneyModule.cs @@ -35,13 +35,14 @@ namespace OpenSim.Framework bool ObjectGiveMoney(UUID objectID, UUID fromID, UUID toID, int amount); - int GetBalance(IClientAPI client); - void ApplyUploadCharge(UUID agentID); - bool UploadCovered(IClientAPI client); - void ApplyGroupCreationCharge(UUID agentID); - bool GroupCreationCovered(IClientAPI client); + int GetBalance(UUID agentID); + bool UploadCovered(IClientAPI client, int amount); bool AmountCovered(IClientAPI client, int amount); void ApplyCharge(UUID agentID, int amount, string text); + void ApplyUploadCharge(UUID agentID, int amount, string text); + + int UploadCharge { get; } + int GroupCreationCharge { get; } event ObjectPaid OnObjectPaid; } diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs index 7e08ecf..ae31050 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs @@ -243,7 +243,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction if (mm != null) { - if (!mm.UploadCovered(remoteClient)) + if (!mm.UploadCovered(remoteClient, mm.UploadCharge)) { remoteClient.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); return; diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index f9da341..33173dd 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -73,7 +73,7 @@ namespace OpenSim.Region.Framework.Scenes IMoneyModule money=RequestModuleInterface(); if (money != null) { - money.ApplyUploadCharge(agentID); + money.ApplyUploadCharge(agentID, money.UploadCharge, "Asset upload"); } AddInventoryItem(agentID, item); diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 56c0d98..3f15b69 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs @@ -722,11 +722,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups if (money != null) { // do the transaction, that is if the agent has got sufficient funds - if (!money.GroupCreationCovered(remoteClient)) { + if (!money.AmountCovered(remoteClient, money.GroupCreationCharge)) { remoteClient.SendCreateGroupReply(UUID.Zero, false, "You have got issuficient funds to create a group."); return UUID.Zero; } - money.ApplyGroupCreationCharge(GetRequestingAgentID(remoteClient)); + money.ApplyCharge(GetRequestingAgentID(remoteClient), money.GroupCreationCharge, "Group Creation"); } UUID groupID = m_groupData.CreateGroup(GetRequestingAgentID(remoteClient), name, charter, showInList, insigniaID, membershipFee, openEnrollment, allowPublish, maturePublish, GetRequestingAgentID(remoteClient)); diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs index e070077..6f5ef9e 100644 --- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs +++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs @@ -108,6 +108,16 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule public event ObjectPaid OnObjectPaid; + public int UploadCharge + { + get { return 0; } + } + + public int GroupCreationCharge + { + get { return 0; } + } + /// /// Startup /// @@ -188,15 +198,10 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule // Please do not refactor these to be just one method // Existing implementations need the distinction // - public void ApplyUploadCharge(UUID agentID) - { - } - - public void ApplyGroupCreationCharge(UUID agentID) + public void ApplyCharge(UUID agentID, int amount, string text) { } - - public void ApplyCharge(UUID agentID, int amount, string text) + public void ApplyUploadCharge(UUID agentID, int amount, string text) { } @@ -769,7 +774,7 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule //m_log.Info("[FRIEND]: " + avatar.Name + " status:" + (!avatar.IsChildAgent).ToString()); } - public int GetBalance(IClientAPI client) + public int GetBalance(UUID agentID) { return 0; } @@ -777,16 +782,10 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule // Please do not refactor these to be just one method // Existing implementations need the distinction // - public bool UploadCovered(IClientAPI client) - { - return AmountCovered(client, PriceUpload); - } - - public bool GroupCreationCovered(IClientAPI client) + public bool UploadCovered(IClientAPI client, int amount) { - return AmountCovered(client, PriceGroupCreate); + return true; } - public bool AmountCovered(IClientAPI client, int amount) { return true; -- cgit v1.1 From 490f1c144c4e0159b9fb1f130134f8abdab98d81 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 2 Jul 2010 06:35:38 -0700 Subject: Fixes mantis #4782 --- OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index 0e849e5..9d9967a 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs @@ -805,7 +805,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap imgstream = new MemoryStream(); // non-async because we know we have the asset immediately. - AssetBase mapasset = m_scene.AssetService.Get(m_scene.RegionInfo.lastMapUUID.ToString()); + AssetBase mapasset = m_scene.AssetService.Get(m_scene.RegionInfo.RegionSettings.TerrainImageID.ToString()); // Decode image to System.Drawing.Image if (OpenJPEG.DecodeToImage(mapasset.Data, out managedImage, out image)) -- cgit v1.1 From 028303c3e1d1d14b734a4727a98e390f56c42ef5 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 3 Jul 2010 02:39:49 -0700 Subject: Fixes mantis #4835 --- OpenSim/Services/LLLoginService/LLLoginResponse.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs index 866e3a3..3366922 100644 --- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs +++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs @@ -658,7 +658,7 @@ namespace OpenSim.Services.LLLoginService Hashtable TempHash; foreach (InventoryFolderBase InvFolder in folders) { - if (InvFolder.ParentID == UUID.Zero) + if (InvFolder.ParentID == UUID.Zero && InvFolder.Name == "My Inventory") { rootID = InvFolder.ID; } -- cgit v1.1 From c117f2144c94e6e04d488567d3632fdf75af4e14 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 3 Jul 2010 10:40:33 -0700 Subject: Compiled Robust.32BitLaunch.exe to .Net 3.5 --- bin/Robust.32BitLaunch.exe | Bin 5632 -> 5632 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/bin/Robust.32BitLaunch.exe b/bin/Robust.32BitLaunch.exe index 747d02f..4d2698b 100644 Binary files a/bin/Robust.32BitLaunch.exe and b/bin/Robust.32BitLaunch.exe differ -- cgit v1.1 From edcfaf60c99b7cde324621c2ffcfbb16e4eb4c5e Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 3 Jul 2010 20:27:00 +0200 Subject: Fix IMs the right way. This sets it up so that timestamps are actually in PST (to match viewer time), does correct storage and retrieval of IMs, corrects the session ID and makes sure IMs don't get marked "saved" if they're live. Removes the group IM save option, which our group IM module never had in the first place, as saving group chatter makes no sense at all. --- .../Avatar/InstantMessage/InstantMessageModule.cs | 27 +++++++-- .../Avatar/InstantMessage/OfflineMessageModule.cs | 65 +++++++++++++--------- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 7 ++- .../Shared/Api/Implementation/LSL_Api.cs | 22 +++++++- 4 files changed, 86 insertions(+), 35 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs index a7aa4ea..ffdac58 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs @@ -156,16 +156,31 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage return; } - // Force timestamp to server time to avoid "Saved on" headers - // being generated for online users - im.timestamp = (uint)Util.UnixTimeSinceEpoch(); + DateTime dt = DateTime.UtcNow; - if (dialog == (byte)InstantMessageDialog.MessageFromAgent || - dialog == (byte)InstantMessageDialog.MessageFromObject) + // Ticks from UtcNow, but make it look like local. Evil, huh? + dt = DateTime.SpecifyKind(dt, DateTimeKind.Local); + + try + { + // Convert that to the PST timezone + TimeZoneInfo timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("America/Los_Angeles"); + dt = TimeZoneInfo.ConvertTime(dt, timeZoneInfo); + } + catch { - im.offline = 1; + m_log.Info("[OFFLINE MESSAGING]: No PST timezone found on this machine. Saving with local timestamp."); } + // And make it look local again to fool the unix time util + dt = DateTime.SpecifyKind(dt, DateTimeKind.Utc); + + im.timestamp = (uint)Util.ToUnixTime(dt); + + // If client is null, this message comes from storage and IS offline + if (client != null) + im.offline = 0; + if (m_TransferModule != null) { m_TransferModule.SendInstantMessage(im, diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs index a2dc91f..feeb9e6 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs @@ -192,6 +192,17 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage // Needed for proper state management for stored group // invitations // + + im.offline = 1; + + // Reconstruct imSessionID + if (im.dialog == (byte)InstantMessageDialog.MessageFromAgent) + { + UUID fromAgentID = new UUID(im.fromAgentID); + UUID sessionID = fromAgentID ^ client.AgentId; + im.imSessionID = new Guid(sessionID.ToString()); + } + Scene s = FindScene(client.AgentId); if (s != null) s.EventManager.TriggerIncomingInstantMessage(im); @@ -201,35 +212,37 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage private void UndeliveredMessage(GridInstantMessage im) { - if (im.dialog == 19) - im.offline = 1; // We want them pushed out to the server - if ((im.offline != 0) - && (!im.fromGroup || (im.fromGroup && m_ForwardOfflineGroupMessages))) + if (im.dialog != (byte)InstantMessageDialog.MessageFromObject && + im.dialog != (byte)InstantMessageDialog.MessageFromAgent && + im.dialog != (byte)InstantMessageDialog.GroupNotice && + im.dialog != (byte)InstantMessageDialog.InventoryOffered) { - // It's not delivered. Make sure the scope id is saved - // We don't need the imSessionID here anymore, overwrite it - Scene scene = FindScene(new UUID(im.fromAgentID)); - if (scene == null) - scene = m_SceneList[0]; - im.imSessionID = new Guid(scene.RegionInfo.ScopeID.ToString()); + return; + } - bool success = SynchronousRestObjectPoster.BeginPostObject( - "POST", m_RestURL+"/SaveMessage/", im); + // It's not delivered. Make sure the scope id is saved + // We don't need the imSessionID here anymore, overwrite it + Scene scene = FindScene(new UUID(im.fromAgentID)); + if (scene == null) + scene = m_SceneList[0]; + im.imSessionID = new Guid(scene.RegionInfo.ScopeID.ToString()); - if (im.dialog == (byte)InstantMessageDialog.MessageFromAgent) - { - IClientAPI client = FindClient(new UUID(im.fromAgentID)); - if (client == null) - return; - - client.SendInstantMessage(new GridInstantMessage( - null, new UUID(im.toAgentID), - "System", new UUID(im.fromAgentID), - (byte)InstantMessageDialog.MessageFromAgent, - "User is not logged in. "+ - (success ? "Message saved." : "Message not saved"), - false, new Vector3())); - } + bool success = SynchronousRestObjectPoster.BeginPostObject( + "POST", m_RestURL+"/SaveMessage/", im); + + if (im.dialog == (byte)InstantMessageDialog.MessageFromAgent) + { + IClientAPI client = FindClient(new UUID(im.fromAgentID)); + if (client == null) + return; + + client.SendInstantMessage(new GridInstantMessage( + null, new UUID(im.toAgentID), + "System", new UUID(im.fromAgentID), + (byte)InstantMessageDialog.MessageFromAgent, + "User is not logged in. "+ + (success ? "Message saved." : "Message not saved"), + false, new Vector3())); } } } diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 4a4cac9..e51d9ee 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3730,8 +3730,11 @@ Console.WriteLine("Scripted Sit ofset {0}", m_pos); { CollidingMessage.Colliders = colliding; - foreach (SceneObjectGroup att in Attachments) - Scene.EventManager.TriggerScriptColliding(att.LocalId, CollidingMessage); + lock (m_attachments) + { + foreach (SceneObjectGroup att in m_attachments) + Scene.EventManager.TriggerScriptColliding(att.LocalId, CollidingMessage); + } } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 11d7c2b..f153504 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3252,7 +3252,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api msg.imSessionID = new Guid(friendTransactionID.ToString()); // This is the item we're mucking with here // m_log.Debug("[Scripting IM]: From:" + msg.fromAgentID.ToString() + " To: " + msg.toAgentID.ToString() + " Session:" + msg.imSessionID.ToString() + " Message:" + message); // m_log.Debug("[Scripting IM]: Filling Session: " + msg.imSessionID.ToString()); - msg.timestamp = (uint)Util.UnixTimeSinceEpoch();// timestamp; + DateTime dt = DateTime.UtcNow; + + // Ticks from UtcNow, but make it look like local. Evil, huh? + dt = DateTime.SpecifyKind(dt, DateTimeKind.Local); + + try + { + // Convert that to the PST timezone + TimeZoneInfo timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("America/Los_Angeles"); + dt = TimeZoneInfo.ConvertTime(dt, timeZoneInfo); + } + catch + { + // No logging here, as it could be VERY spammy + } + + // And make it look local again to fool the unix time util + dt = DateTime.SpecifyKind(dt, DateTimeKind.Utc); + + msg.timestamp = (uint)Util.ToUnixTime(dt); + //if (client != null) //{ msg.fromAgentName = m_host.Name;//client.FirstName + " " + client.LastName;// fromAgentName; -- cgit v1.1 From abe0a9ff495fb6ebb36fd88a1f85c1ba24a42e6c Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 4 Jul 2010 02:59:38 -0700 Subject: Fixes the obvious problem in mantis #4841. Melanie needs to look at other potential problems there, though. --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 33173dd..bcb5f7c 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -1608,7 +1608,7 @@ namespace OpenSim.Region.Framework.Scenes if (action == DeRezAction.SaveToExistingUserInventoryItem) permissionToDelete = false; - // if we want to take a copy,, we also don't want to delete + // if we want to take a copy, we also don't want to delete // Note: after this point, the permissionToTakeCopy flag // becomes irrelevant. It already includes the permissionToTake // permission and after excluding no copy items here, we can @@ -1619,6 +1619,7 @@ namespace OpenSim.Region.Framework.Scenes if (!permissionToTakeCopy) return; + permissionToTake = true; // Don't delete permissionToDelete = false; } -- cgit v1.1