public static void UpdateUserInfo() { if (userID == 0 || userName == null) { try { if (vRPlatformHelper.vrPlatformSDK == VRPlatformHelper.VRPlatformSDK.OpenVR || Environment.CommandLine.Contains("-vrmode oculus")) { Logger.Log("Attempting to Grab Steam User", LogLevel.Debug); GetSteamUser(); } else if (vRPlatformHelper.vrPlatformSDK == VRPlatformHelper.VRPlatformSDK.Oculus) { Logger.Log("Attempting to Grab Oculus User", LogLevel.Debug); GetOculusUser(); } else if (Environment.CommandLine.Contains("fpfc") && vRPlatformHelper.vrPlatformSDK == VRPlatformHelper.VRPlatformSDK.Unknown) { Logger.Log("Attempting to Grab Steam User", LogLevel.Debug); GetSteamUser(); } } catch (Exception e) { Logger.Log("Unable to grab user! Exception: " + e, LogLevel.Error); } } }
internal static void DisableScoreSaberScoreSubmission() { StandardLevelScenesTransitionSetupDataSO setupDataSO = Resources.FindObjectsOfTypeAll <StandardLevelScenesTransitionSetupDataSO>().FirstOrDefault(); if (setupDataSO == null) { Logger.Log("ScoreSubmission: StandardLevelScenesTransitionSetupDataSO not found - exiting...", LogLevel.Warning); return; } DisableEvent(setupDataSO, "didFinishEvent", "Five"); }
internal static void GetSteamUser() { if (SteamManager.Initialized) { var steamUser = SteamUser.GetSteamID(); userName = SteamFriends.GetPersonaName(); userID = steamUser.m_SteamID; userAvatar = GetAvatar(steamUser); } else { Logger.Log("Steam is not initialized!", LogLevel.Warning); } }
public static void UpdateUserInfo() { if (getUserActive) { return; // Already retrieving user info. } if (userID == 0 || userName == null) { try { SharedCoroutineStarter.instance.StartCoroutine(GetUserCoroutine()); } catch (Exception e) { Logger.Log("Unable to grab user! Exception: " + e, LogLevel.Error); } } }
// Used for debugging purposes private static void LogEvents(object target, string eventName) { FieldInfo fieldInfo = target.GetType().GetField(eventName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static); var eventDelegate = fieldInfo.GetValue(target) as MulticastDelegate; if (eventDelegate == null) { Logger.Log("ScoreSubmission: Unable to get eventDelegate from StandardLevelScenesTransitionSetupDataSO - exiting...", LogLevel.Debug); } var delegates = eventDelegate.GetInvocationList(); Logger.Log("ScoreSubmission: Getting list of delegates for didFinish event...", LogLevel.Debug); foreach (var item in delegates) { Logger.Log(String.Format("ScoreSubmission: Found delegate named '{0}' by Module '{1}', part of Assembly '{2}'", item.Method.Name, item.Method.Module.Name, item.Method.Module.Assembly.FullName), LogLevel.Debug); } }