public EzUnlockResult( UnlockResult result ) { if (result.item != null) { Item = new EzMutex(result.item); } }
public void Execute() { AuthInfo info = AuthInfo[0]; int unlockResult = HP_UnlockPlugin(ref info); Result[0] = new UnlockResult { Value = unlockResult < 0 ? UnlockResult.Status.NoSubscription : UnlockResult.Status.Unlocked, NumDaysRemaining = unlockResult }; AuthInfo[0] = info; }
private void ShowPopup(UnlockResult newUnlock) { UIPopup popup = UIPopup.GetPopup(Popups.UNLOCK_POPUP); if (popup == null) { return; } PopupUnlock popupUnlock = popup.GetComponent <PopupUnlock>(); popupUnlock.Setup(newUnlock); popup.Show(); }
public bool Unlock() { UnlockResult result = lockFile.Unlock(); if (result is UnlockResult.Fail fail) { App.Logger.Error(fail.Exception.ToString()); return(false); } else if (result != UnlockResult.Success) { return(false); } return(true); }
public ActionResult Unlock(Packet p) { UnlockResult r = AssetManager.UnlockAsset(p.Guid, p.Holder); switch (r) { case UnlockResult.Success: return(Ok("Success")); case UnlockResult.AlreadyUnlocked: return(Ok("Already unlocked")); case UnlockResult.NotExist: return(NotFound($"{p.Guid} is not founded")); case UnlockResult.WrongHolder: return(BadRequest($"{p.Guid},{p.Holder}, wrong holder")); default: return(BadRequest("${r} is not supported")); } }
// Schedule the job public Unlocker() { UserInfo?userInfo = GetUserInfo(); if (!userInfo.HasValue) { m_Result[0] = new UnlockResult { Value = UnlockResult.Status.NoUser }; return; } var authInfo = new AuthInfo(userInfo.Value); if (UnityEngine.PlayerPrefs.HasKey("Havok.Auth.Token") && UnityEngine.PlayerPrefs.HasKey("Havok.Auth.TokenExpiry")) { try { authInfo.HavokToken = Convert.ToUInt64(UnityEngine.PlayerPrefs.GetString("Havok.Auth.Token")); authInfo.HavokTokenExpiry = Convert.ToInt64(UnityEngine.PlayerPrefs.GetString("Havok.Auth.TokenExpiry")); authInfo.HavokSubscriptionExpiry = Convert.ToInt64(UnityEngine.PlayerPrefs.GetString("Havok.Auth.SubscriptionExpiry")); } catch (FormatException) { // The saved prefs don't match what we expect, just ignore them } } m_AuthInfo[0] = authInfo; m_Result[0] = new UnlockResult { Value = UnlockResult.Status.Invalid }; m_jobHandle = new UnlockJob() { AuthInfo = m_AuthInfo, Result = m_Result }.Schedule(); }
internal void Setup(UnlockResult newUnlock) { unlockMessageField.text = newUnlock.ResultToUnlock.Name; }