Syroot issueshttps://gitlab.com/groups/Syroot/-/issues2023-06-02T08:57:24Zhttps://gitlab.com/Syroot/Worms/-/issues/1Worms 2 Server - Unable to join games, weird characters in messages2023-06-02T08:57:24ZCarl NortonWorms 2 Server - Unable to join games, weird characters in messagesWith v1.0.0 of the Worms 2 server, I am able to run it on my server mostly without issue.
With v1.1.0, people are unable to join games and when sending messages it replaces some of the letters with strange characters when there is more t...With v1.0.0 of the Worms 2 server, I am able to run it on my server mostly without issue.
With v1.1.0, people are unable to join games and when sending messages it replaces some of the letters with strange characters when there is more than 1 person there.https://gitlab.com/Syroot/BinaryData/-/issues/43Port compatible optimizations from new Memory package to Syroot.BinaryData2019-03-01T05:06:27ZRayPort compatible optimizations from new Memory package to Syroot.BinaryDataSeveral optimizations compatible with the `Syroot.BinaryData` package were found when writing the new Memory package. They should be ported for the 6.0.0 release (it will focus support only newer .NET versions which have proper support f...Several optimizations compatible with the `Syroot.BinaryData` package were found when writing the new Memory package. They should be ported for the 6.0.0 release (it will focus support only newer .NET versions which have proper support for `Span` functionality) and maybe put into the new `Syroot.BinaryData.Core` package if the logic can be reused (without any performance cost):
- [x] ~~Enum parsing can use Unsafe.SizeOf<TEnum>() and MemoryMarshal to prevent type switching on the underlying type.~~ Cannot be ported, optimization needs generic method, but library requires type passed as parameter.
- [ ] `byte*` overloads should be used were possible to prevent buffer copies.
- [ ] String decoding can use the `Decoder.Convert` method. This method also supports `byte*`.
- [ ] Probably a few more. Check remaining parts of the library.
The following changes would be incompatible with the current API and cause big breaking changes, so they're currently not part of this issue:
- `ByteConverter` could make use of `System.Buffers.Binary.BinaryPrimitives` functionality to convert bytes to primitive values and vice versa, but this depends if it the methods provided by this class can fulfill the needs of a `ByteConverter`, which would probably need backwards-incompatible changes (if not being removed completely). It should be checked if the converters can be optimized with `MemoryMarshal` anyway.
- Using only an `Endian` enum value instead of a `ByteConverter` instance to determine endianness (again), together with the above mentioned `ByteConverter` redesign / removal.futurehttps://gitlab.com/Syroot/BinaryData/-/issues/20Add exception tags to XML summaries2019-04-21T14:53:43ZRayAdd exception tags to XML summaries*Created by: RayKoopa*
The XML summaries to the methods are missing expectable exceptions (<exception> tags). Add them to all of them.*Created by: RayKoopa*
The XML summaries to the methods are missing expectable exceptions (<exception> tags). Add them to all of them.futurehttps://gitlab.com/Syroot/BinaryData/-/issues/14Support IEnumerable on ReadObject2019-01-16T13:10:24ZRaySupport IEnumerable on ReadObject*Created by: micdenny*
Now it is possible to WriteObject every IEnumerable while you can't ReadObject for instance on List this because under the wood the ReadObject creates an Array of T and then simply set on the instance property.
...*Created by: micdenny*
Now it is possible to WriteObject every IEnumerable while you can't ReadObject for instance on List this because under the wood the ReadObject creates an Array of T and then simply set on the instance property.
We could support every IEnumerable that has an implementation with a constructor that accept an array.
repro:
```csharp
using System;
using System.Collections.Generic;
using System.IO;
using Newtonsoft.Json;
using Syroot.BinaryData;
using Syroot.BinaryData.Extensions;
namespace ConsoleApp3
{
class Program
{
static void Main(string[] args)
{
var message = new MessageWithList
{
Numbers = new List<ushort> { 123, 32, 12 }
};
Console.WriteLine(JsonConvert.SerializeObject(message, Formatting.Indented));
Console.WriteLine();
Console.WriteLine();
byte[] bytes;
using (var stream = new MemoryStream())
{
stream.WriteObject(message);
bytes = stream.ToArray();
}
for (int i = 0; i < bytes.Length; i++)
{
Console.WriteLine($"[{i}]={bytes[i]}");
}
Console.WriteLine();
Console.WriteLine();
MessageWithList m;
using (var stream = new MemoryStream(bytes))
{
m = stream.ReadObject<MessageWithList>();
}
Console.WriteLine(JsonConvert.SerializeObject(m, Formatting.Indented));
}
}
[BinaryObject(Explicit = true)]
public class MessageWithList
{
[BinaryMember(Order = 1, Length = 3)]
public List<ushort> Numbers { get; set; }
}
[BinaryObject(Explicit = true)]
public class MessageWithArray
{
[BinaryMember(Order = 1, Length = 3)]
public ushort[] Numbers { get; set; }
}
}
```
if you run with `MessageWithArray` everything's fine, instead if you run with `MessageWithList` you get the exception:
```
Unhandled Exception: System.ArgumentException: Object of type 'System.UInt16[]' cannot be converted to type 'System.Collections.Generic.List`1[System.UInt16]'.
at System.RuntimeType.TryChangeType(Object value, Binder binder, CultureInfo culture, Boolean needsSpecialCast)
at System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo culture, BindingFlags invokeAttr)
at System.Reflection.MethodBase.CheckArguments(Object[] parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig)
at System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index)
at Syroot.BinaryData.Extensions.StreamExtensions.ReadMember(Stream stream, Object instance, Int64 startOffset, ByteConverter converter, MemberData member)
at Syroot.BinaryData.Extensions.StreamExtensions.ReadCustomObject(Stream stream, Type type, Object instance, Int64 startOffset, ByteConverter converter)
at Syroot.BinaryData.Extensions.StreamExtensions.ReadObject(Stream stream, Object instance, BinaryMemberAttribute attribute, Type type, ByteConverter converter)
at Syroot.BinaryData.Extensions.StreamExtensions.ReadObject[T](Stream stream, ByteConverter converter)
at ConsoleApp3.Program.Main(String[] args) in ConsoleApp3\ConsoleApp3\Program.cs:line 42
```new-serialization-features