Skip to content

Commit

Permalink
Throw an exception when the plugin isn't compatible with the server
Browse files Browse the repository at this point in the history
  • Loading branch information
Moneylover3246 committed Nov 3, 2022
1 parent 73901ce commit 2dea857
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Crossplay/CrossplayPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ public CrossplayPlugin(Main game) : base(game)

public override void Initialize()
{
if (!_supportedVersions.TryGetValue(Main.curRelease, out string version) || version != Main.versionNumber)
{
throw new NotSupportedException("The provided version of this plugin is outdated and will not function properly. Check for any updates here: https://github.com/Moneylover3246/Crossplay");
}

On.Terraria.Net.NetManager.Broadcast_NetPacket_int += NetModuleHandler.OnBroadcast;
On.Terraria.Net.NetManager.SendToClient += NetModuleHandler.OnSendToClient;

Expand Down

0 comments on commit 2dea857

Please sign in to comment.