Skip to content

Commit

Permalink
Updated to no longer check version on non-MP Required games.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nagord committed Jan 23, 2023
1 parent d48e646 commit 07d33fd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
6 changes: 3 additions & 3 deletions PulsarModLoader/MPModChecks/MPModCheckManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ public bool ClientClickJoinRoom(RoomInfo room)
MPUserDataBlock HostModData = GetHostModList(room);
if (HostModData.PMLVersion == string.Empty)
{
if (HighestLevelOfMPMods >= (int)MPRequirement.Host)
if (HighestLevelOfMPMods == (int)MPRequirement.Host || HighestLevelOfMPMods == (int)MPRequirement.All)
{
PLNetworkManager.Instance.MainMenu.AddActiveMenu(new PLErrorMessageMenu($"<color=red>FAILED TO JOIN CREW!</color>\nMods requiring host installation or higher have been installed locally"));

Expand Down Expand Up @@ -342,14 +342,14 @@ public bool ClientClickJoinRoom(RoomInfo room)
}
if (!found)
{ //didn't find mod in host list, checking if mod function mandates host installation
if (MyModList[a].MPRequirement >= MPRequirement.Host)
if (MyModList[a].MPRequirement == MPRequirement.Host || MyModList[a].MPRequirement == MPRequirement.All)
{
localMPLimitedMods += $"\n{MyModList[a].ModName}";
}
}
else
{ //found mod in host list, checking if mod versions match.
if (MyModList[a].Version != HostModList[b].Version)
if (MyModList[a].MPRequirement != MPRequirement.None && MyModList[a].Version != HostModList[b].Version)
{
outdatedMods += $"\nLocal: {MyModList[a].ModName} {MyModList[a].Version} Host: {HostModList[b].ModName} {HostModList[b].Version}";
}
Expand Down
12 changes: 11 additions & 1 deletion PulsarModLoader/MPModChecks/MPRequirement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace PulsarModLoader
{
/// <summary>
/// Distinctly organizes MPRequirements.
/// </summary>
[Obsolete]
public enum MPFunction
{
Expand All @@ -25,6 +28,9 @@ public enum MPFunction
}
namespace PulsarModLoader.MPModChecks
{
/// <summary>
/// Distinctly organizes MPRequirements
/// </summary>
public enum MPRequirement
{
/// <summary>
Expand All @@ -42,6 +48,10 @@ public enum MPRequirement
/// <summary>
/// All clients must have installed
/// </summary>
All //3 All clients must have installed
All, //3 All clients must have installed
/// <summary>
/// No Requirements, Versions must match between clients
/// </summary>
MatchVersion //4 No MP requirements, ensure versions match between clients
}
}

0 comments on commit 07d33fd

Please sign in to comment.