Skip to content

Commit

Permalink
Register sync methods directly rather than using API
Browse files Browse the repository at this point in the history
I think I must have used the API out of habit when writing this code, my bad. I've changed the code to use `SyncMethod.RegisterSyncMethod` and `SyncMethod.Register` rather than `MP.RegisterSyncMethod`.
  • Loading branch information
SokyranTheDragon committed Aug 24, 2024
1 parent f0221d0 commit 0a7af55
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/Client/Syncing/Game/SyncMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -420,11 +420,11 @@ public static void Init()
.AllNotNull();

foreach (var method in methods)
MP.RegisterSyncMethod(method);
Sync.RegisterSyncMethod(method);

// This OnRenamed method will create a storage group, which needs to be synced.
// No other vanilla rename dialogs need syncing OnRenamed, but modded ones potentially could need it.
MP.RegisterSyncMethod(typeof(Dialog_RenameBuildingStorage_CreateNew), nameof(Dialog_RenameBuildingStorage_CreateNew.OnRenamed))
SyncMethod.Register(typeof(Dialog_RenameBuildingStorage_CreateNew), nameof(Dialog_RenameBuildingStorage_CreateNew.OnRenamed))
.TransformTarget(Serializer.New(
(Dialog_RenameBuildingStorage_CreateNew dialog) => dialog.building,
(IStorageGroupMember member) => new Dialog_RenameBuildingStorage_CreateNew(member)));
Expand Down

0 comments on commit 0a7af55

Please sign in to comment.