do not respawn inactive players
This commit is contained in:
parent
cd12ab7bde
commit
abad2c95c8
11 changed files with 91 additions and 48 deletions
|
@ -22,20 +22,9 @@ internal abstract class WebsocketServerConnection(
|
|||
Logger.LogTrace("done receiving");
|
||||
}
|
||||
|
||||
public abstract ValueTask RemovedAsync();
|
||||
|
||||
protected abstract ValueTask HandleMessageAsync(Memory<byte> buffer);
|
||||
|
||||
protected async ValueTask LockedAsync(Func<ValueTask> action)
|
||||
{
|
||||
await _mutex.WaitAsync();
|
||||
try
|
||||
{
|
||||
await action();
|
||||
}
|
||||
finally
|
||||
{
|
||||
_mutex.Release();
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose() => _mutex.Dispose();
|
||||
public virtual void Dispose() => _mutex.Dispose();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue