diff options
author | Mike Rieker | 2010-07-06 02:23:10 +0000 |
---|---|---|
committer | Mike Rieker | 2010-07-06 02:23:10 +0000 |
commit | 6e7f1a3ac11b889175c87f59a3c5361c704363a6 (patch) | |
tree | 2ed5bebf54db3adc420e1510045b84b880ecb157 /OpenSim/Region/ScriptEngine/Shared | |
parent | rewrote hanging llParseStringKeepNulls() (diff) | |
parent | Undo fix is now complete. This commit repairs the special case of the root pr... (diff) | |
download | opensim-SC-6e7f1a3ac11b889175c87f59a3c5361c704363a6.zip opensim-SC-6e7f1a3ac11b889175c87f59a3c5361c704363a6.tar.gz opensim-SC-6e7f1a3ac11b889175c87f59a3c5361c704363a6.tar.bz2 opensim-SC-6e7f1a3ac11b889175c87f59a3c5361c704363a6.tar.xz |
Merge branch 'careminster-presence-refactor' of www.3dhosting.de:/var/git/careminster into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
3 files changed, 58 insertions, 15 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 1459778..b9b3318 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 | |||
3252 | msg.imSessionID = new Guid(friendTransactionID.ToString()); // This is the item we're mucking with here | 3252 | msg.imSessionID = new Guid(friendTransactionID.ToString()); // This is the item we're mucking with here |
3253 | // m_log.Debug("[Scripting IM]: From:" + msg.fromAgentID.ToString() + " To: " + msg.toAgentID.ToString() + " Session:" + msg.imSessionID.ToString() + " Message:" + message); | 3253 | // m_log.Debug("[Scripting IM]: From:" + msg.fromAgentID.ToString() + " To: " + msg.toAgentID.ToString() + " Session:" + msg.imSessionID.ToString() + " Message:" + message); |
3254 | // m_log.Debug("[Scripting IM]: Filling Session: " + msg.imSessionID.ToString()); | 3254 | // m_log.Debug("[Scripting IM]: Filling Session: " + msg.imSessionID.ToString()); |
3255 | msg.timestamp = (uint)Util.UnixTimeSinceEpoch();// timestamp; | 3255 | DateTime dt = DateTime.UtcNow; |
3256 | |||
3257 | // Ticks from UtcNow, but make it look like local. Evil, huh? | ||
3258 | dt = DateTime.SpecifyKind(dt, DateTimeKind.Local); | ||
3259 | |||
3260 | try | ||
3261 | { | ||
3262 | // Convert that to the PST timezone | ||
3263 | TimeZoneInfo timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("America/Los_Angeles"); | ||
3264 | dt = TimeZoneInfo.ConvertTime(dt, timeZoneInfo); | ||
3265 | } | ||
3266 | catch | ||
3267 | { | ||
3268 | // No logging here, as it could be VERY spammy | ||
3269 | } | ||
3270 | |||
3271 | // And make it look local again to fool the unix time util | ||
3272 | dt = DateTime.SpecifyKind(dt, DateTimeKind.Utc); | ||
3273 | |||
3274 | msg.timestamp = (uint)Util.ToUnixTime(dt); | ||
3275 | |||
3256 | //if (client != null) | 3276 | //if (client != null) |
3257 | //{ | 3277 | //{ |
3258 | msg.fromAgentName = m_host.Name;//client.FirstName + " " + client.LastName;// fromAgentName; | 3278 | msg.fromAgentName = m_host.Name;//client.FirstName + " " + client.LastName;// fromAgentName; |
@@ -5247,7 +5267,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5247 | case ',': | 5267 | case ',': |
5248 | if (parens == 0) | 5268 | if (parens == 0) |
5249 | { | 5269 | { |
5250 | result.Add(src.Substring(start,length).Trim()); | 5270 | result.Add(new LSL_String(src.Substring(start,length).Trim())); |
5251 | start += length+1; | 5271 | start += length+1; |
5252 | length = 0; | 5272 | length = 0; |
5253 | } | 5273 | } |
@@ -9369,7 +9389,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9369 | 9389 | ||
9370 | if (aList.Data[i] != null) | 9390 | if (aList.Data[i] != null) |
9371 | { | 9391 | { |
9372 | switch ((ParcelMediaCommandEnum) aList.Data[i]) | 9392 | switch ((ParcelMediaCommandEnum) Convert.ToInt32(aList.Data[i].ToString())) |
9373 | { | 9393 | { |
9374 | case ParcelMediaCommandEnum.Url: | 9394 | case ParcelMediaCommandEnum.Url: |
9375 | list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaURL)); | 9395 | list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaURL)); |
@@ -9804,19 +9824,39 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9804 | public LSL_String llXorBase64StringsCorrect(string str1, string str2) | 9824 | public LSL_String llXorBase64StringsCorrect(string str1, string str2) |
9805 | { | 9825 | { |
9806 | m_host.AddScriptLPS(1); | 9826 | m_host.AddScriptLPS(1); |
9807 | string ret = String.Empty; | 9827 | |
9808 | string src1 = llBase64ToString(str1); | 9828 | if (str1 == String.Empty) |
9809 | string src2 = llBase64ToString(str2); | 9829 | return String.Empty; |
9810 | int c = 0; | 9830 | if (str2 == String.Empty) |
9811 | for (int i = 0; i < src1.Length; i++) | 9831 | return str1; |
9832 | |||
9833 | byte[] data1 = Convert.FromBase64String(str1); | ||
9834 | byte[] data2 = Convert.FromBase64String(str2); | ||
9835 | |||
9836 | byte[] d2 = new Byte[data1.Length]; | ||
9837 | int pos = 0; | ||
9838 | |||
9839 | if (data1.Length <= data2.Length) | ||
9812 | { | 9840 | { |
9813 | ret += (char) (src1[i] ^ src2[c]); | 9841 | Array.Copy(data2, 0, d2, 0, data1.Length); |
9842 | } | ||
9843 | else | ||
9844 | { | ||
9845 | while (pos < data1.Length) | ||
9846 | { | ||
9847 | int len = data1.Length - pos; | ||
9848 | if (len > data2.Length) | ||
9849 | len = data2.Length; | ||
9814 | 9850 | ||
9815 | c++; | 9851 | Array.Copy(data2, 0, d2, pos, len); |
9816 | if (c >= src2.Length) | 9852 | pos += len; |
9817 | c = 0; | 9853 | } |
9818 | } | 9854 | } |
9819 | return llStringToBase64(ret); | 9855 | |
9856 | for (pos = 0 ; pos < data1.Length ; pos++ ) | ||
9857 | data1[pos] ^= d2[pos]; | ||
9858 | |||
9859 | return Convert.ToBase64String(data1); | ||
9820 | } | 9860 | } |
9821 | 9861 | ||
9822 | public LSL_String llHTTPRequest(string url, LSL_List parameters, string body) | 9862 | public LSL_String llHTTPRequest(string url, LSL_List parameters, string body) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs index fe71ed5..1fa8c30 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs | |||
@@ -73,6 +73,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
73 | if (m_ScriptEngine.Config.GetBoolean("AllowLightShareFunctions", false)) | 73 | if (m_ScriptEngine.Config.GetBoolean("AllowLightShareFunctions", false)) |
74 | m_LSFunctionsEnabled = true; | 74 | m_LSFunctionsEnabled = true; |
75 | 75 | ||
76 | if (m_ScriptEngine.Config.GetBoolean("AllowCareminsterFunctions", false)) | ||
77 | m_LSFunctionsEnabled = true; | ||
78 | |||
76 | m_comms = m_ScriptEngine.World.RequestModuleInterface<IScriptModuleComms>(); | 79 | m_comms = m_ScriptEngine.World.RequestModuleInterface<IScriptModuleComms>(); |
77 | if (m_comms == null) | 80 | if (m_comms == null) |
78 | m_LSFunctionsEnabled = false; | 81 | m_LSFunctionsEnabled = false; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index 212dbe3..5927973 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 | |||
663 | Object[] ret; | 663 | Object[] ret; |
664 | 664 | ||
665 | if (start < 0) | 665 | if (start < 0) |
666 | start=m_data.Length-start; | 666 | start=m_data.Length+start; |
667 | 667 | ||
668 | if (start < 0) | 668 | if (start < 0) |
669 | start=0; | 669 | start=0; |
670 | 670 | ||
671 | if (end < 0) | 671 | if (end < 0) |
672 | end=m_data.Length-end; | 672 | end=m_data.Length+end; |
673 | if (end < 0) | 673 | if (end < 0) |
674 | end=0; | 674 | end=0; |
675 | 675 | ||