Last active
February 7, 2024 21:37
-
-
Save SneWs/5c9baa2945f398c7b4661a450876e0da to your computer and use it in GitHub Desktop.
MessagePack console code example to generate crash on Windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using MessagePack; | |
public static class GameMessages | |
{ | |
[MessagePackObject] | |
public sealed class PlayerSpawned | |
{ | |
[Key(0)] | |
public float Yaw { get; set; } | |
[Key(1)] | |
public float Pitch { get; set; } | |
// ... etc | |
public PlayerSpawned() | |
{ } | |
public PlayerSpawned(float yaw, float pitch) | |
{ | |
Yaw = yaw; | |
Pitch = pitch; | |
} | |
} | |
} | |
public static class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
Console.WriteLine("Hello, World!"); | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>net8.0</TargetFramework> | |
<ImplicitUsings>enable</ImplicitUsings> | |
<Nullable>enable</Nullable> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="MessagePack" Version="2.5.140" /> | |
<PackageReference Include="MessagePack.Annotations" Version="2.5.140" /> | |
</ItemGroup> | |
</Project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment