Skip to content

Commit

Permalink
Update MP compat attributes (#478)
Browse files Browse the repository at this point in the history
I've added `hostOnly` and `version` fields to the sync method and added code to handle them. I may have forgotten to include them previously, and now I've found myself in a situation where a host only sync method was needed.
  • Loading branch information
SokyranTheDragon authored Oct 12, 2024
1 parent d18f40f commit 5a9f885
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Source/MpCompatAttributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ public static void LoadPatch(Type type)
sync.CancelIfNoSelectedWorldObjects();
if (syncMethod.debugOnly)
sync.SetDebugOnly();
if (syncMethod.hostOnly)
sync.SetHostOnly();
if (syncMethod.version > 0)
sync.SetVersion(syncMethod.version);
if (syncMethod.exposeParameters != null)
{
foreach (var index in syncMethod.exposeParameters)
Expand Down Expand Up @@ -414,6 +418,8 @@ public class MpCompatSyncMethodAttribute : Attribute
public bool cancelIfNoSelectedMapObjects;
public bool cancelIfNoSelectedWorldObjects;
public bool debugOnly;
public bool hostOnly;
public int version;
public int[] exposeParameters;

public MpCompatSyncMethodAttribute(SyncContext context = SyncContext.None) => this.context = context;
Expand Down

0 comments on commit 5a9f885

Please sign in to comment.