Skip to content

Commit 727b4f1

Browse files
committed
Merge remote-tracking branch 'upstream/beta' into beta-1
2 parents 1de2068 + d279eb2 commit 727b4f1

File tree

15 files changed

+180
-8
lines changed

15 files changed

+180
-8
lines changed

managed/src/SwiftlyS2.Generated/Protobufs/Classes/CDemoFileHeaderImpl.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ public string DemoFileStamp
1818
{ get => Accessor.GetString("demo_file_stamp"); set => Accessor.SetString("demo_file_stamp", value); }
1919

2020

21-
public int NetworkProtocol
22-
{ get => Accessor.GetInt32("network_protocol"); set => Accessor.SetInt32("network_protocol", value); }
21+
public int PatchVersion
22+
{ get => Accessor.GetInt32("patch_version"); set => Accessor.SetInt32("patch_version", value); }
2323

2424

2525
public string ServerName

managed/src/SwiftlyS2.Generated/Protobufs/Classes/CMsgTEFireBulletsImpl.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,8 @@ public uint NumBulletsRemaining
7373
public uint AttackType
7474
{ get => Accessor.GetUInt32("attack_type"); set => Accessor.SetUInt32("attack_type", value); }
7575

76+
77+
public CMsgTEFireBullets_Extra Extra
78+
{ get => new CMsgTEFireBullets_ExtraImpl(NativeNetMessages.GetNestedMessage(Address, "extra"), false); }
79+
7680
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
2+
using SwiftlyS2.Core.Natives;
3+
using SwiftlyS2.Core.NetMessages;
4+
using SwiftlyS2.Shared.Natives;
5+
using SwiftlyS2.Shared.NetMessages;
6+
using SwiftlyS2.Shared.ProtobufDefinitions;
7+
8+
namespace SwiftlyS2.Core.ProtobufDefinitions;
9+
10+
internal class CMsgTEFireBullets_ExtraImpl : TypedProtobuf<CMsgTEFireBullets_Extra>, CMsgTEFireBullets_Extra
11+
{
12+
public CMsgTEFireBullets_ExtraImpl(nint handle, bool isManuallyAllocated): base(handle)
13+
{
14+
}
15+
16+
17+
public QAngle AimPunch
18+
{ get => Accessor.GetQAngle("aim_punch"); set => Accessor.SetQAngle("aim_punch", value); }
19+
20+
21+
public int AttackTickCount
22+
{ get => Accessor.GetInt32("attack_tick_count"); set => Accessor.SetInt32("attack_tick_count", value); }
23+
24+
25+
public float AttackTickFrac
26+
{ get => Accessor.GetFloat("attack_tick_frac"); set => Accessor.SetFloat("attack_tick_frac", value); }
27+
28+
29+
public int RenderTickCount
30+
{ get => Accessor.GetInt32("render_tick_count"); set => Accessor.SetInt32("render_tick_count", value); }
31+
32+
33+
public float RenderTickFrac
34+
{ get => Accessor.GetFloat("render_tick_frac"); set => Accessor.SetFloat("render_tick_frac", value); }
35+
36+
37+
public float InaccuracyMove
38+
{ get => Accessor.GetFloat("inaccuracy_move"); set => Accessor.SetFloat("inaccuracy_move", value); }
39+
40+
41+
public float InaccuracyAir
42+
{ get => Accessor.GetFloat("inaccuracy_air"); set => Accessor.SetFloat("inaccuracy_air", value); }
43+
44+
45+
public int Type
46+
{ get => Accessor.GetInt32("type"); set => Accessor.SetInt32("type", value); }
47+
48+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
using SwiftlyS2.Core.Natives;
3+
using SwiftlyS2.Core.NetMessages;
4+
using SwiftlyS2.Shared.Natives;
5+
using SwiftlyS2.Shared.NetMessages;
6+
using SwiftlyS2.Shared.ProtobufDefinitions;
7+
8+
namespace SwiftlyS2.Core.ProtobufDefinitions;
9+
10+
internal class CSVCMsg_NextMsgPredictedImpl : NetMessage<CSVCMsg_NextMsgPredicted>, CSVCMsg_NextMsgPredicted
11+
{
12+
public CSVCMsg_NextMsgPredictedImpl(nint handle, bool isManuallyAllocated): base(handle, isManuallyAllocated)
13+
{
14+
}
15+
16+
17+
public int PredictedByPlayerSlot
18+
{ get => Accessor.GetInt32("predicted_by_player_slot"); set => Accessor.SetInt32("predicted_by_player_slot", value); }
19+
20+
21+
public uint MessageTypeId
22+
{ get => Accessor.GetUInt32("message_type_id"); set => Accessor.SetUInt32("message_type_id", value); }
23+
24+
}

managed/src/SwiftlyS2.Generated/Protobufs/Enums/SVC_Messages.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,5 @@ public enum SVC_Messages
3333
svc_Broadcast_Command = 74,
3434
svc_HltvFixupOperatorStatus = 75,
3535
svc_UserCmds = 76,
36+
svc_NextMsgPredicted = 77,
3637
}

managed/src/SwiftlyS2.Generated/Protobufs/Interfaces/CDemoFileHeader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public interface CDemoFileHeader : ITypedProtobuf<CDemoFileHeader>
1313
public string DemoFileStamp { get; set; }
1414

1515

16-
public int NetworkProtocol { get; set; }
16+
public int PatchVersion { get; set; }
1717

1818

1919
public string ServerName { get; set; }

managed/src/SwiftlyS2.Generated/Protobufs/Interfaces/CMsgTEFireBullets.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,7 @@ public interface CMsgTEFireBullets : ITypedProtobuf<CMsgTEFireBullets>, INetMess
5959

6060
public uint AttackType { get; set; }
6161

62+
63+
public CMsgTEFireBullets_Extra Extra { get; }
64+
6265
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
using SwiftlyS2.Core.ProtobufDefinitions;
3+
using SwiftlyS2.Shared.Natives;
4+
using SwiftlyS2.Shared.NetMessages;
5+
6+
namespace SwiftlyS2.Shared.ProtobufDefinitions;
7+
8+
public interface CMsgTEFireBullets_Extra : ITypedProtobuf<CMsgTEFireBullets_Extra>
9+
{
10+
static CMsgTEFireBullets_Extra ITypedProtobuf<CMsgTEFireBullets_Extra>.Wrap(nint handle, bool isManuallyAllocated) => new CMsgTEFireBullets_ExtraImpl(handle, isManuallyAllocated);
11+
12+
13+
public QAngle AimPunch { get; set; }
14+
15+
16+
public int AttackTickCount { get; set; }
17+
18+
19+
public float AttackTickFrac { get; set; }
20+
21+
22+
public int RenderTickCount { get; set; }
23+
24+
25+
public float RenderTickFrac { get; set; }
26+
27+
28+
public float InaccuracyMove { get; set; }
29+
30+
31+
public float InaccuracyAir { get; set; }
32+
33+
34+
public int Type { get; set; }
35+
36+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
using SwiftlyS2.Core.ProtobufDefinitions;
3+
using SwiftlyS2.Shared.Natives;
4+
using SwiftlyS2.Shared.NetMessages;
5+
6+
namespace SwiftlyS2.Shared.ProtobufDefinitions;
7+
using SwiftlyS2.Shared.NetMessages;
8+
9+
public interface CSVCMsg_NextMsgPredicted : ITypedProtobuf<CSVCMsg_NextMsgPredicted>, INetMessage<CSVCMsg_NextMsgPredicted>, IDisposable
10+
{
11+
static int INetMessage<CSVCMsg_NextMsgPredicted>.MessageId => 77;
12+
13+
static string INetMessage<CSVCMsg_NextMsgPredicted>.MessageName => "CSVCMsg_NextMsgPredicted";
14+
15+
static CSVCMsg_NextMsgPredicted ITypedProtobuf<CSVCMsg_NextMsgPredicted>.Wrap(nint handle, bool isManuallyAllocated) => new CSVCMsg_NextMsgPredictedImpl(handle, isManuallyAllocated);
16+
17+
18+
public int PredictedByPlayerSlot { get; set; }
19+
20+
21+
public uint MessageTypeId { get; set; }
22+
23+
}

managed/src/SwiftlyS2.Shared/Natives/Structs/CRecipientFilter.cs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,19 @@ public unsafe static bool IsInitMessage( CRecipientFilter* filter )
132132
}
133133

134134
[UnmanagedCallersOnly]
135-
public unsafe static int GetPredictedSlot( CRecipientFilter* filter )
135+
public unsafe static int* GetPredictedSlotWindows( CRecipientFilter* filter, int* pPlayerSlot )
136+
{
137+
*pPlayerSlot = filter->PredictedSlot;
138+
return pPlayerSlot;
139+
}
140+
141+
[UnmanagedCallersOnly]
142+
public unsafe static int GetPredictedSlotLinux( CRecipientFilter* filter )
136143
{
137144
return filter->PredictedSlot;
138145
}
139146

147+
140148
static unsafe CRecipientFilterVtable()
141149
{
142150
pCRecipientFilterVTable = Marshal.AllocHGlobal(sizeof(nint) * 5);
@@ -145,6 +153,13 @@ static unsafe CRecipientFilterVtable()
145153
vtable[1] = (nint)(delegate* unmanaged< CRecipientFilter*, NetChannelBufType_t >)(&GetNetworkBufType);
146154
vtable[2] = (nint)(delegate* unmanaged< CRecipientFilter*, bool >)(&IsInitMessage);
147155
vtable[3] = (nint)(delegate* unmanaged< CRecipientFilter*, ulong* >)(&GetRecipients);
148-
vtable[4] = (nint)(delegate* unmanaged< CRecipientFilter*, int >)(&GetPredictedSlot);
156+
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
157+
{
158+
vtable[4] = (nint)(delegate* unmanaged< CRecipientFilter*, int*, int* >)(&GetPredictedSlotWindows);
159+
}
160+
else
161+
{
162+
vtable[4] = (nint)(delegate* unmanaged< CRecipientFilter*, int >)(&GetPredictedSlotLinux);
163+
}
149164
}
150165
}

0 commit comments

Comments
 (0)