fix: Fixes .net 6 compilation (#860)
This commit is contained in:
parent
c8043e8dd2
commit
c8a6d4c696
7 changed files with 36 additions and 17 deletions
|
|
@ -34,7 +34,7 @@
|
|||
<Delete Files="..\..\Distribution\zlib.dll" ContinueOnError="true" />
|
||||
</Target>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Toolkit.HighPerformance" Version="7.1.0" />
|
||||
<PackageReference Include="Microsoft.Toolkit.HighPerformance" Version="7.1.2" />
|
||||
<PackageReference Include="PollGroup" Version="1.1.0" />
|
||||
<PackageReference Include="Zlib.Bindings" Version="1.5.0" />
|
||||
</ItemGroup>
|
||||
|
|
|
|||
|
|
@ -1049,6 +1049,21 @@ namespace Server
|
|||
return min + (int)RandomSources.Source.Next((uint)(max - min + 1));
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static long RandomMinMax(long min, long max)
|
||||
{
|
||||
if (min > max)
|
||||
{
|
||||
(min, max) = (max, min);
|
||||
}
|
||||
else if (min == max)
|
||||
{
|
||||
return min;
|
||||
}
|
||||
|
||||
return min + RandomSources.Source.Next(max - min + 1);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static int Random(int from, int count) => RandomSources.Source.Next(from, count);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue