r2mods/ilspy_dump/ror2_csproj/UDPTest.cs

42 lines
702 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
public class UDPTest
{
private byte counter = 1;
public void AddByte(ref byte[] bytes, ref int numBytes, ref bool shouldAddToQueue, int channelId)
{
if (numBytes == 1 && bytes[0] == 0)
{
return;
}
if (bytes.Length <= numBytes)
{
byte[] array = new byte[numBytes + 1];
for (int i = 0; i < bytes.Length; i++)
{
array[i] = bytes[i];
}
bytes = array;
}
shouldAddToQueue = TryAdd(ref bytes, ref numBytes, channelId);
}
private bool TryAdd(ref byte[] data, ref int numbytes, int channelId)
{
if (true)
{
data[numbytes] = GetCounter();
}
else
{
data[numbytes] = 0;
}
numbytes++;
return true;
}
private byte GetCounter()
{
return 7;
}
}