-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNetCode.cs
More file actions
54 lines (45 loc) · 1.51 KB
/
Copy pathNetCode.cs
File metadata and controls
54 lines (45 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using System.Text.Json.Serialization;
namespace PSM.OTD;
#pragma warning disable CS8618
public static class NetCode
{
public const uint CompatibleVersion = 2;
}
public static class C2SPackets
{
public interface IPacket {}
public class Hi : IPacket
{
[JsonPropertyName("type")] public string Type { get; set; } = "Hi";
[JsonPropertyName("name")] public string Name { get; set; }
}
public class TabletEvent : IPacket
{
[JsonPropertyName("type")] public string Type { get; set; } = "TabletEvent";
[JsonPropertyName("status")] public uint Status { get; set; }
[JsonPropertyName("buttons")] public uint Buttons { get; set; }
[JsonPropertyName("x")] public int X { get; set; }
[JsonPropertyName("y")] public int Y { get; set; }
[JsonPropertyName("z")] public int Z { get; set; }
[JsonPropertyName("normal_pressure")] public int NormalPressure { get; set; }
[JsonPropertyName("tangential_pressure")] public int TangentialPressure { get; set; }
}
public class Proximity : IPacket
{
[JsonPropertyName("type")] public string Type { get; set; } = "Proximity";
[JsonPropertyName("value")] public bool Value { get; set; }
}
}
public static class S2CPackets
{
public class TypeBase
{
[JsonPropertyName("type")]
public string Type { get; set; }
}
public class Hi
{
[JsonPropertyName("compatible")]
public uint Compatible { get; set; }
}
}