public void UnlockPrivilege(String p_key, Int32 p_expectedPrivilegeId) { if (m_isRendezVousConnected) { RendezVousInvokes.LegacyRendezVousActivateKey(p_key, p_expectedPrivilegeId); } }
public void SendTrackingData(String tagName, String attributes) { if (m_isUplayConnected) { RendezVousInvokes.LegacyRendezVousSendTag(tagName, attributes); } }
public void UnlockPrivilege(String p_key) { if (m_isRendezVousConnected) { LegacyLogger.LogError("try to unlock key"); RendezVousInvokes.LegacyRendezVousActivateAnyKey(p_key); } }
public EActivateKeyResult GetUnlockPrivilegeState() { if (m_isRendezVousConnected) { return((EActivateKeyResult)RendezVousInvokes.LegacyRendezVousGetActivateKeyState()); } return(EActivateKeyResult.ACTIVATE_UNEXPECTED_ERROR); }
public void SendTrackingDataAndWait(String tagName, String attributes) { if (m_isUplayConnected) { RendezVousInvokes.LegacyRendezVousSendTag(tagName, attributes); Thread.Sleep(500); } }
public String GetActionName(Int32 p_actionId) { if (m_isRendezVousConnected) { IntPtr ptr = RendezVousInvokes.LegacyRendezVousGetActionName(p_actionId); return(Marshal.PtrToStringAnsi(ptr)); } return(String.Empty); }
private void DoneLogin() { m_isOfflineMode = (UplayInvokes.UPLAY_USER_IsInOfflineMode() != 0); m_isRendezVousConnected = !m_isOfflineMode; m_connectingToRendezVous = false; UpdatePrivilegesRewards(); IntPtr ptr = RendezVousInvokes.LegacyRendezVousGetLocation(); LegacyLogic.Instance.TrackingManager.TrackGameStart(Marshal.PtrToStringAnsi(ptr)); }
private void ConnectToServer() { String languageCode = GetLanguageCode(); try { RendezVousInvokes.LegacyRendezVousStartUp("a95554daed1b42848ecd43690d2ca976", "3zLCAurt", languageCode, "MMX", "PC", ConfigManager.Instance.Game.EnableRendezVousLogging); m_startingRendezVous = true; } catch (Exception exception) { Debug.LogException(exception); Debug.Log("Exception connecting!"); } }
public void Close() { if (m_isUplayConnected) { RendezVousInvokes.LegacyRendezVousShutDown(); UplayInvokes.UPLAY_Quit(); } foreach (IntPtr hglobal in overlappedMap.Keys) { Marshal.FreeHGlobal(hglobal); } overlappedMap.Clear(); LegacyLogic.Instance.EventManager.UnregisterEvent(EEventType.TOKEN_ADDED, new EventHandler(OnTokenAdded)); LegacyLogic.Instance.EventManager.UnregisterEvent(EEventType.SAVEGAME_LOADED, new EventHandler(OnSaveGameLoaded)); }
public void Update() { if (m_startingRendezVous) { StartUpState startUpState = (StartUpState)RendezVousInvokes.LegacyRendezVousGetStartUpState(); if (startUpState == StartUpState.SUCCESSFUL) { m_startingRendezVous = false; LegacyLogic.Instance.TrackingManager.TrackGameStart("China"); } else if (startUpState == StartUpState.FAILURE) { m_startingRendezVous = false; } } }
public void UpdateActions() { if (m_isRendezVousConnected) { TokenHandler tokenHandler = LegacyLogic.Instance.WorldManager.Party.TokenHandler; Boolean flag = tokenHandler.GetTokens(7) > 0; Boolean flag2 = tokenHandler.GetTokens(8) > 0; Boolean flag3 = tokenHandler.GetTokens(9) > 0; Boolean flag4 = tokenHandler.GetTokens(10) > 0; if (flag || flag2 || flag3 || flag4) { RendezVousInvokes.LegacyRendezVousSetActionsCompleted(flag, flag2, flag3, flag4); m_isSettingAction = true; } } }
public void UpdatePrivilegesRewards() { if (m_isRendezVousConnected) { Int32 num; IntPtr source = RendezVousInvokes.LegacyRendezVousGetPrivileges(out num); m_privileges = new Int32[num]; if (num > 0) { Marshal.Copy(source, m_privileges, 0, num); } Int32 num2; IntPtr source2 = RendezVousInvokes.LegacyRendezVousGetRewards(out num2); m_rewards = new Int32[num2]; if (num2 > 0) { Marshal.Copy(source2, m_rewards, 0, num2); } SavePrivilegesRewards(); } }
public void SendTrackingData(String tagName, String attributes) { RendezVousInvokes.LegacyRendezVousSendTag(tagName, attributes); }
public void Close() { RendezVousInvokes.LegacyRendezVousShutDown(); }
public void CancelUnlockPrivilege() { RendezVousInvokes.LegacyRendezVousCancelActivateKey(); }
public void Init() { RendezVousInvokes.LegacyRendezVousStartUpTrackingOnly("a95554daed1b42848ecd43690d2ca976", "3zLCAurt", ConfigManager.Instance.Game.EnableRendezVousLogging); m_startingRendezVous = true; }
public void Update() { if (m_startingRendezVous) { StartUpState startUpState = (StartUpState)RendezVousInvokes.LegacyRendezVousGetStartUpState(); if (startUpState == StartUpState.SUCCESSFUL) { m_startingRendezVous = false; String userName = GetUserName(); String password = GetPassword(); GetCDKeyList(); if (m_keys.Count > 0) { RendezVousInvokes.LegacyRendezVousLogIn(userName, password, m_keys[0]); m_connectingToRendezVous = true; m_unlockingKeyNr = -1; } } else if (startUpState == StartUpState.FAILURE) { m_startingRendezVous = false; m_isOfflineMode = true; } } if (m_connectingToRendezVous) { if (m_unlockingKeyNr == -1) { LogInState logInState = (LogInState)RendezVousInvokes.LegacyRendezVousGetLogInState(); if (logInState == LogInState.SUCCESSFUL) { m_unlockingKeyNr = 0; RendezVousInvokes.LegacyRendezVousActivateAnyKey(m_keys[m_unlockingKeyNr]); } else if (logInState == LogInState.FAILURE) { m_isOfflineMode = true; m_connectingToRendezVous = false; } } else { EActivateKeyResult unlockPrivilegeState = GetUnlockPrivilegeState(); if (unlockPrivilegeState != EActivateKeyResult.ACTIVATE_WAITING) { m_unlockingKeyNr++; if (m_unlockingKeyNr < m_keys.Count) { RendezVousInvokes.LegacyRendezVousActivateAnyKey(m_keys[m_unlockingKeyNr]); } else { DoneLogin(); } } } } if (m_isSettingAction) { SetActionState setActionState = (SetActionState)RendezVousInvokes.LegacyRendezVousGetActionsState(); if (setActionState == SetActionState.SUCCESSFUL) { if (OnActionCompleted != null && m_settingActionID >= 0) { ActionCompletedEventArgs e = new ActionCompletedEventArgs(m_settingActionID, true); OnActionCompleted(this, e); } m_isSettingAction = false; m_settingActionID = -1; } else if (setActionState == SetActionState.FAILURE) { if (OnActionCompleted != null && m_settingActionID >= 0) { ActionCompletedEventArgs e2 = new ActionCompletedEventArgs(m_settingActionID, false); OnActionCompleted(this, e2); } m_isSettingAction = false; m_settingActionID = -1; } } List <IntPtr> list = new List <IntPtr>(); foreach (IntPtr intPtr in overlappedMap.Keys) { if (UplayInvokes.UPLAY_HasOverlappedOperationCompleted(intPtr)) { list.Add(intPtr); } } foreach (IntPtr intPtr2 in list) { overlappedMap.Remove(intPtr2); Marshal.FreeHGlobal(intPtr2); } list.Clear(); if (UplayInvokes.UPLAY_Update() == 0) { m_isForceQuit = true; } UPLAY_Event uplay_Event; while (UplayInvokes.UPLAY_GetNextEvent(out uplay_Event)) { Debug.Log("Received uplay Event! : " + uplay_Event.type); if (uplay_Event.type == UPLAY_EventType.UPLAY_Event_UserAccountSharing) { m_isRendezVousConnected = false; m_isOfflineMode = true; } } }