Skip to content

Commit

Permalink
-Host mods now synced to client.
Browse files Browse the repository at this point in the history
  • Loading branch information
DragonFire47 committed Sep 5, 2022
1 parent 5d479e1 commit 5ffe0a9
Showing 1 changed file with 4 additions and 31 deletions.
35 changes: 4 additions & 31 deletions PulsarModLoader/MPModChecks/MPModCheckManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -528,17 +528,6 @@ static bool Prefix(RoomInfo room)
}
}

[HarmonyPatch(typeof(PLServer), "ServerOnClientVerified")] //Starts host mod verification coroutine
class ServerOnClientVerifiedPatch
{
static void Postfix(PhotonPlayer client)
{
ModMessageHelper.Instance.photonView.RPC("ClientRecieveModList", client, new object[]
{
Instance.SerializeHashlessUserData()
});
}
}
[HarmonyPatch(typeof(PLServer), "AttemptGetVerified")]
class AttemptGetVerifiedRecievePatch
{
Expand All @@ -548,26 +537,6 @@ static bool Prefix(PhotonMessageInfo pmi)
}
}

/*[HarmonyPatch(typeof(PLServer), "VerifyClient")] //Client sends mod info as early as possible during connection
class ClientJoinPatch
{
static void Postfix(PhotonPlayer player, PhotonMessageInfo pmi)
{
if (pmi.sender != null && pmi.sender.IsMasterClient && player != null)
{
if (player == PhotonNetwork.player)
{
Logger.Info("Sending 'RecieveConnectionMessage' RPC");
ModMessageHelper.Instance.photonView.RPC("ReceiveConnectionMessage", pmi.sender, new object[]
{
MPModCheckManager.Instance.SerializeHashfullUserData()
});
}
player.Verified = true;
}
}
}*/

[HarmonyPatch(typeof(PLServer), "Update")]
class AttemptGetVerifiedSendPatch
{
Expand Down Expand Up @@ -609,6 +578,10 @@ static void Postfix(PhotonPlayer photonPlayer)
{
if(PhotonNetwork.isMasterClient)
{
ModMessageHelper.Instance.photonView.RPC("ClientRecieveModList", photonPlayer, new object[]
{
Instance.SerializeHashlessUserData()
});
return;
}
Instance.RequestedModLists.Add(photonPlayer);
Expand Down

0 comments on commit 5ffe0a9

Please sign in to comment.