Skip to content

Commit cb3baa6

Browse files
authored
Merge pull request #199 from ZehMatt/generate-network-classes
Use source generator to generate the network classes
2 parents 7124c44 + def0fcb commit cb3baa6

63 files changed

Lines changed: 357 additions & 147 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Game.Client/C_BaseAnimating.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ private static void RecvProxy_Sequence(ref readonly RecvProxyData data, object i
965965
public virtual void DoMuzzleFlash() => MuzzleFlashParity = unchecked((byte)((MuzzleFlashParity + 1) & ((1 << (int)EntityEffects.MuzzleflashBits) - 1)));
966966

967967

968-
public static readonly new ClientClass ClientClass = new ClientClass(null, null, DT_BaseAnimating);
968+
public static readonly new ClientClass ClientClass = new ClientClass(DT_BaseAnimating);
969969
protected override StudioHdr? OnNewModel() {
970970
InvalidateMdlCache();
971971
int i;

‎Game.Client/C_BaseAnimatingOverlay.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ private static void ResizeAnimationLayerCallback(object instance, object list, i
7474

7575
public static readonly RecvTable DT_BaseAnimatingOverlay = new(DT_BaseAnimating, [
7676
RecvPropDataTable("overlay_vars", DT_OverlayVars)
77-
]); public static readonly new ClientClass ClientClass = new ClientClass(null, null, DT_BaseAnimatingOverlay);
77+
]); public static readonly new ClientClass ClientClass = new ClientClass(DT_BaseAnimatingOverlay);
7878

7979
[NetworkName("m_AnimOverlay")]
8080
readonly List<AnimationLayerRef> AnimOverlay = [];

‎Game.Client/C_BaseCombatCharacter.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public partial class C_BaseCombatCharacter : C_BaseFlex
3131
RecvPropArray3(FIELD.OF_ARRAY(nameof(MyWeapons)), RecvPropEHandle( FIELD.OF_ARRAY(nameof(MyWeapons)))),
3232
RecvPropInt(FIELD.OF(nameof(BloodColor)))
3333
]);
34-
public static readonly new ClientClass ClientClass = new ClientClass(null, null, DT_BaseCombatCharacter);
34+
public static readonly new ClientClass ClientClass = new ClientClass(DT_BaseCombatCharacter);
3535

3636
public C_BaseCombatWeapon? GetWeapon(int i) => MyWeapons[i].Get();
3737

‎Game.Client/C_BaseEntity.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ private static void RecvProxy_MoveType(ref readonly RecvProxyData data, object i
675675

676676
public void SetCollisionBounds(in Vector3 mins, in Vector3 maxs) => CollisionProp().SetCollisionBounds(in mins, in maxs);
677677

678-
public static readonly ClientClass ClientClass = new ClientClass(null, null, DT_BaseEntity);
678+
public static readonly ClientClass ClientClass = new ClientClass(DT_BaseEntity);
679679
const float coordTolerance = 2.0f / (float)(1 << (int)COORD_FRACTIONAL_BITS);
680680

681681
public float GetGravity() => Gravity;

‎Game.Client/C_BaseFlex.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ public partial class C_BaseFlex : C_BaseAnimatingOverlay, IHasLocalToGlobalFlexS
169169
RecvPropVector ( FIELD.OF(nameof(Lean))),
170170
RecvPropVector ( FIELD.OF(nameof(Shift))),
171171
]);
172-
public static readonly new ClientClass ClientClass = new ClientClass(null, null, DT_BaseFlex);
172+
public static readonly new ClientClass ClientClass = new ClientClass(DT_BaseFlex);
173173
[NetworkName("m_flexWeight")]
174174
public InlineArray96<float> FlexWeight;
175175
[NetworkName("m_blinktoggle")]

‎Game.Client/C_BasePlayer.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ private void PlayPlayerJingle() {
475475

476476
RecvPropBool(FIELD.OF(nameof(UseWeaponsInVehicle))),
477477
RecvPropDataTable("localdata", DT_LocalPlayerExclusive),
478-
]); public static readonly new ClientClass ClientClass = new ClientClass(null, null, DT_BasePlayer);
478+
]); public static readonly new ClientClass ClientClass = new ClientClass(DT_BasePlayer);
479479

480480

481481
static C_BasePlayer? localPlayer;

‎Game.Client/C_EnvTonemapController.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class C_EnvTonemapController : C_BaseEntity
1818
RecvPropFloat(FIELD.OF(nameof(CustomAutoExposureMax))),
1919
RecvPropFloat(FIELD.OF(nameof(CustomBloomScale))),
2020
RecvPropFloat(FIELD.OF(nameof(CustomBloomScaleMinimum))),
21-
]); public static readonly new ClientClass ClientClass = new ClientClass(null, null, DT_EnvTonemapController);
21+
]); public static readonly new ClientClass ClientClass = new ClientClass(DT_EnvTonemapController);
2222

2323
[NetworkName("m_bUseCustomAutoExposureMin")]
2424
public bool UseCustomAutoExposureMin;

‎Game.Client/C_PlayerResource.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class C_PlayerResource : C_BaseEntity
2929
RecvPropArray3(FIELD.OF_ARRAY(nameof(Health)), RecvPropInt(FIELD.OF_ARRAYINDEX(nameof(Health), 0))),
3030
RecvPropArray3(FIELD.OF_ARRAY(nameof(Armor)), RecvPropInt(FIELD.OF_ARRAYINDEX(nameof(Armor)))),
3131
]);
32-
public static readonly new ClientClass ClientClass = new ClientClass(null, null, DT_PlayerResource);
32+
public static readonly new ClientClass ClientClass = new ClientClass(DT_PlayerResource);
3333

3434
[NetworkName("m_iPing")]
3535
InlineArrayMaxPlayersPlusOne<int> Ping = new();

‎Game.Client/C_Team.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ private static void RecvProxy_PlayerList(ref readonly RecvProxyData data, object
6868
team.Players[data.Element] = data.Value.Int;
6969
}
7070

71-
public static readonly new ClientClass ClientClass = new ClientClass(null, null, DT_Team);
71+
public static readonly new ClientClass ClientClass = new ClientClass(DT_Team);
7272

7373
public readonly List<int> Players = [];
7474
[NetworkName("m_szTeamname")]

‎Game.Client/C_World.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public C_World() : base() {
3434
RecvPropString(FIELD.OF(nameof(DetailSpriteMaterial))),
3535
]);
3636

37-
public static new readonly ClientClass ClientClass = new ClientClass(null, null, DT_WORLD);
37+
public static new readonly ClientClass ClientClass = new ClientClass(DT_WORLD);
3838

3939
public override bool Init(int entNum, int serialNum) {
4040
WaveHeight = 0.0f;

0 commit comments

Comments
 (0)