SnapTo(position, minSid);
// Broadcast to all clients.
- var writer = _game.StartRpc(NetId, RpcCalls.SnapTo);
- WriteVector2(writer, position);
- writer.Write(_lastSequenceId);
- await _game.FinishRpcAsync(writer);
+ using (var writer = _game.StartRpc(NetId, RpcCalls.SnapTo))
+ {
+ WriteVector2(writer, position);
+ writer.Write(_lastSequenceId);
+ await _game.FinishRpcAsync(writer);
+ }
}
}
}
public async ValueTask SetMurderedAsync()
{
- var writer = _game.StartRpc(NetId, RpcCalls.MurderPlayer);
+ using var writer = _game.StartRpc(NetId, RpcCalls.MurderPlayer);
writer.Write((byte)NetId);
await _game.FinishRpcAsync(writer);
}
namespace Impostor.Server.Net.State
{
- internal partial class Game : IGame
+ internal partial class Game
{
private readonly ILogger<Game> _logger;
private readonly IServiceProvider _serviceProvider;
.Select(p => p.Client.Connection);
}
}
-}
\ No newline at end of file
+}