Skip to content

Commit

Permalink
Pick up a few more changes. through 9/5. Merge remote-tracking branch…
Browse files Browse the repository at this point in the history
… 'upstream/master' into develop
  • Loading branch information
mdickson committed Sep 5, 2024
2 parents 8a6ad7a + 8a56d44 commit c70edbe
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 7 deletions.
37 changes: 37 additions & 0 deletions OpenSim/Framework/Util.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1099,14 +1099,18 @@ public static List<UUID> GetUUIDsOnData(byte[] s, int indx, int len)
/// Is the platform Windows?
/// </summary>
/// <returns>true if so, false otherwise</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool IsWindows()
{
return RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
/*
PlatformID platformId = Environment.OSVersion.Platform;
return (platformId == PlatformID.Win32NT
|| platformId == PlatformID.Win32S
|| platformId == PlatformID.Win32Windows
|| platformId == PlatformID.WinCE);
*/
}

public static bool LoadArchSpecificWindowsDll(string libraryName)
Expand Down Expand Up @@ -3100,6 +3104,39 @@ public static bool TryParseHttpRange(string header, out int start, out int end)
return false;
}

[DllImport("winmm.dll")]
private static extern uint timeBeginPeriod(uint period);

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void TimeBeginPeriod(uint period)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
timeBeginPeriod(period);
}

[DllImport("winmm.dll")]
private static extern uint timeEndPeriod(uint period);

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void TimeEndPeriod(uint period)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
timeEndPeriod(period);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void ThreadSleep(int period)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
timeEndPeriod(1);
Thread.Sleep(period);
timeEndPeriod(1);
}
else
Thread.Sleep(period);
}

/// <summary>
/// Used to trigger an early library load on Windows systems.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2336,9 +2336,7 @@ private bool CanDoObjectInvToObjectInv(TaskInventoryItem item, SceneObjectPart s
return false;
}

bool notSameOwner = srcsog.OwnerID.NotEqual(destsog.OwnerID);

if(notSameOwner)
if(srcsog.OwnerID.NotEqual(destsog.OwnerID))
{
if((itperms & (uint)PermissionMask.Transfer) == 0)
return false;
Expand All @@ -2350,7 +2348,8 @@ private bool CanDoObjectInvToObjectInv(TaskInventoryItem item, SceneObjectPart s
}
else
{
if((destsogEffectiveOwnerPerms & (uint)PermissionMask.Modify) == 0)
if((destsogEffectiveOwnerPerms & (uint)PermissionMask.Modify) == 0 &&
(destsog.RootPart.GetEffectiveObjectFlags() & (uint)PrimFlags.AllowInventoryDrop) == 0)
return false;
}

Expand Down
1 change: 0 additions & 1 deletion OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5196,7 +5196,6 @@ public float ScriptExecutionTime()
time += e.GetScriptExecutionTime(ids);
}
}

return time;
}
catch
Expand Down
4 changes: 2 additions & 2 deletions OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public Vector3(ReadOnlySpan<char> str)
while (++comma < str.Length)
{
c = Unsafe.Add(ref MemoryMarshal.GetReference(str), comma);
if (c == ' ' || c == '>')
if (c == '>')
break;
}

Expand Down Expand Up @@ -575,7 +575,7 @@ public Quaternion(ReadOnlySpan<char> str)
while (++comma < str.Length)
{
c = Unsafe.Add(ref MemoryMarshal.GetReference(str), comma);
if (c == ' ' || c == '>')
if (c == '>')
break;
}

Expand Down

0 comments on commit c70edbe

Please sign in to comment.