Warning fixes (#5275)

* Warning fixes in Robust.Shared

* Robust.Client warning fixes

* Fix test failure

Test failures were due to broken system registrations for the client RobustUnitTest. It was accidentally registering some server systems, which means DebugPhysicsSystem wasn't gettings its dependencies properly.

Fixing this meant pulling half a dozen extra dependencies that client ContainerSystem and TransformSystem are supposed to have, but didn't.
This commit is contained in:
Pieter-Jan Briers
2024-07-10 01:38:32 +02:00
committed by GitHub
parent b82bc258db
commit 7fbcfeaa8f
42 changed files with 245 additions and 203 deletions

View File

@@ -115,7 +115,7 @@ internal static class HappyEyeballsHttp
await socket.ConnectAsync(new IPEndPoint(address, port), cancel).ConfigureAwait(false);
return socket;
}
catch (Exception e)
catch (Exception)
{
// Log.Verbose(e, "Happy Eyeballs to {Address} [{Index}] failed", address, index);
socket.Dispose();

View File

@@ -1,6 +1,6 @@
using System;
using System.Buffers;
using System.Runtime.InteropServices;
using System.Buffers.Binary;
using System.Threading;
using Lidgren.Network;
using SpaceWizards.Sodium;
@@ -60,11 +60,10 @@ internal sealed class NetEncryption
ciphertext = message.Data = new byte[encryptedSize];
}
// TODO: this is probably broken for big-endian machines.
Span<byte> nonceData = stackalloc byte[CryptoAeadXChaCha20Poly1305Ietf.NoncePublicBytes];
nonceData.Fill(0);
MemoryMarshal.Write(nonceData, ref nonce);
MemoryMarshal.Write(ciphertext, ref nonce);
BinaryPrimitives.WriteUInt64LittleEndian(nonceData, nonce);
BinaryPrimitives.WriteUInt64LittleEndian(ciphertext, nonce);
CryptoAeadXChaCha20Poly1305Ietf.Encrypt(
// ciphertext
@@ -93,10 +92,9 @@ internal sealed class NetEncryption
var buffer = ArrayPool<byte>.Shared.Rent(cipherText.Length);
cipherText.CopyTo(buffer);
// TODO: this is probably broken for big-endian machines.
Span<byte> nonceData = stackalloc byte[CryptoAeadXChaCha20Poly1305Ietf.NoncePublicBytes];
nonceData.Fill(0);
MemoryMarshal.Write(nonceData, ref nonce);
BinaryPrimitives.WriteUInt64LittleEndian(nonceData, nonce);
var result = CryptoAeadXChaCha20Poly1305Ietf.Decrypt(
// plaintext