-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #441 from searica/sync_mode_feature
Add SynchronizationModeAttribute to allow mod authors to control how AdminOnly configs are handled.
- Loading branch information
Showing
11 changed files
with
628 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System; | ||
using System.Linq; | ||
using BepInEx; | ||
using Jotunn.Utils; | ||
|
||
namespace Jotunn.Extensions | ||
{ | ||
internal static class PluginExtensions | ||
{ | ||
internal static NetworkCompatibilityAttribute GetNetworkCompatibilityAttribute(this BaseUnityPlugin plugin) | ||
{ | ||
return plugin.GetType() | ||
.GetCustomAttributes(typeof(NetworkCompatibilityAttribute), true) | ||
.Cast<NetworkCompatibilityAttribute>() | ||
.FirstOrDefault(); | ||
} | ||
|
||
internal static SynchronizationModeAttribute GetSynchronizationModeAttribute(this BaseUnityPlugin plugin) | ||
{ | ||
return plugin.GetType() | ||
.GetCustomAttributes(typeof(SynchronizationModeAttribute), true) | ||
.Cast<SynchronizationModeAttribute>() | ||
.FirstOrDefault(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.