AuthenticationValues should only be set when selfhosting/onprem. userid is ignored by photon cloud.
This commit is contained in:
@@ -145,33 +145,33 @@ namespace undead_universal_patch_il2cpp.Patches
|
|||||||
PhotonConfig.ServerPort.Value,
|
PhotonConfig.ServerPort.Value,
|
||||||
PhotonConfig.AppID.Value,
|
PhotonConfig.AppID.Value,
|
||||||
]);
|
]);
|
||||||
}
|
|
||||||
|
|
||||||
Type authValuesType = AccessTools.TypeByName("AuthenticationValues");
|
Type authValuesType = AccessTools.TypeByName("AuthenticationValues");
|
||||||
if (authValuesType != null)
|
if (authValuesType != null)
|
||||||
{
|
|
||||||
PropertyInfo networkingPeerProperty = photonNetworkType.GetRuntimeProperty("networkingPeer");
|
|
||||||
if (networkingPeerProperty == null)
|
|
||||||
{
|
{
|
||||||
UniversalPatchPlugin.Log.LogError("Cannot patch Photon: networkingPeerProperty was null. Is this build supported?");
|
PropertyInfo networkingPeerProperty = photonNetworkType.GetRuntimeProperty("networkingPeer");
|
||||||
return;
|
if (networkingPeerProperty == null)
|
||||||
|
{
|
||||||
|
UniversalPatchPlugin.Log.LogError("Cannot patch Photon: networkingPeerProperty was null. Is this build supported?");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (networkingPeerProperty.GetValue(null) == null)
|
||||||
|
{
|
||||||
|
UniversalPatchPlugin.Log.LogError("Cannot patch Photon: networkingPeerInstance was null. Is this build supported?");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string id = Util.LocalInstanceGuid;
|
||||||
|
Util.ConditionalDebug($"Instance GUID is {id}");
|
||||||
|
|
||||||
|
PhotonNetwork.AuthValues = new AuthenticationValues
|
||||||
|
{
|
||||||
|
UserId = id
|
||||||
|
};
|
||||||
|
|
||||||
|
Util.ConditionalDebug($"Set the authValues userId to {id}");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (networkingPeerProperty.GetValue(null) == null)
|
|
||||||
{
|
|
||||||
UniversalPatchPlugin.Log.LogError("Cannot patch Photon: networkingPeerInstance was null. Is this build supported?");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
string id = Core.Util.LocalInstanceGuid;
|
|
||||||
Util.ConditionalDebug($"Instance GUID is {id}");
|
|
||||||
|
|
||||||
PhotonNetwork.AuthValues = new AuthenticationValues
|
|
||||||
{
|
|
||||||
UserId = id
|
|
||||||
};
|
|
||||||
|
|
||||||
Util.ConditionalDebug($"Set the authValues userId to {id}");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
UniversalPatchPlugin.Log.LogInfo($"Photon patch ({(PhotonConfig.SelfHosted.Value ? "self-hosted" : "cloud")}) succeeded.");
|
UniversalPatchPlugin.Log.LogInfo($"Photon patch ({(PhotonConfig.SelfHosted.Value ? "self-hosted" : "cloud")}) succeeded.");
|
||||||
|
|||||||
Reference in New Issue
Block a user