fix: Fixes snooping staff (#900)

* Not allowed to snoop staff
* Staff that snoop won't broadcast messages
* Benchmarks RNG for double vs fixed int
This commit is contained in:
Kamron Batman 2021-12-28 02:09:25 -08:00 committed by GitHub
parent dc6caf5766
commit 79dc9fa0f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 88 additions and 66 deletions

View file

@ -0,0 +1,28 @@
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using Server.Random;
namespace Benchmarks.Benchmarks.Rng
{
[MemoryDiagnoser]
[SimpleJob(RuntimeMoniker.Net60)]
public class BenchmarkDoubleVsFixed
{
private Xoshiro256PlusPlus _xoshiro256PlusPlus;
[GlobalSetup]
public void Setup()
{
_xoshiro256PlusPlus = new Xoshiro256PlusPlus();
}
[Benchmark]
public bool NextDouble() => 50.1 < _xoshiro256PlusPlus.NextDouble() * 100;
[Benchmark]
public bool NextFixedInt() => 501 < _xoshiro256PlusPlus.Next(1000);
[Benchmark]
public bool NextHighResDouble() => 50.1 < _xoshiro256PlusPlus.NextDoubleHighRes() * 100;
}
}