//Rich User Presence stuff public void SetRichUserPresence(CharacterIndex aChar) { PresenceData data; if (aChar.LevelIndex == 9) { data = PresenceService.CreatePresenceData(ConsoleUtilsManager.PrimaryServiceConfigId(), "default", null); } else { ManagerManager.Log("setting RUP for " + aChar.LevelIndex + "_" + aChar.Choice); data = PresenceService.CreatePresenceData(ConsoleUtilsManager.PrimaryServiceConfigId(), aChar.LevelIndex + "_" + aChar.Choice, null); } PresenceService.SetPresenceAsync(ActiveUser.Id, true, data, OnPresenceDataSet); }
static public void SetString(string str) { //if (XBUser.Self.currentUser == null) return; //int userID = XBUser.Self.currentUser.Id; try { if (!_initialized) { UsersManager.SetTraceLevelForUsersLiveContext(UsersManager.GetAppCurrentUser().Id, XboxServicesDiagnosticsTraceLevel.Verbose); _initialized = true; } Debug.LogError("Set RP string: " + str); PresenceData data = PresenceService.CreatePresenceData(ConsoleUtilsManager.PrimaryServiceConfigId(), str, null); PresenceService.SetPresenceAsync(UsersManager.GetAppCurrentUser().Id, true, data, OnPresenceDataSet); Debug.LogError("-- -- RP OK"); } catch (Exception ex) { } }
//OTHER bool SanityCheckApplicationSetup() { // We sanity check some things before we allow you to run, achievements and other live services // really do not like to be used against the wrong sandbox or with the wrong TID/SCID. string warningText = ""; if (ConsoleUtilsManager.SandboxId() != "PRFW.0") { warningText += "\n\nERROR: SandboxId not set to PRFW.0 sample will not run"; warningText += "\n >> Current Id: \"" + ConsoleUtilsManager.SandboxId() + "\""; warningText += "\n >> Suppose to be: \"PRFW.0\""; } if (ConsoleUtilsManager.PrimaryServiceConfigId() != "f3530100-c251-40ff-9d13-078c4a0a3432") { warningText += "\n\nERROR: SCID not set to f3530100-c251-40ff-9d13-078c4a0a3432 sample will not run"; warningText += "\n >> Current Id: " + ConsoleUtilsManager.PrimaryServiceConfigId(); } if (ConsoleUtilsManager.TitleIdHex() != "4A0A3432") { warningText += "\n\nERROR: TID not set to 4A0A3432 sample will not run"; warningText += "\n >> Current Id: " + ConsoleUtilsManager.TitleIdHex(); } bool ok = warningText == "" && UsersManager.IsSomeoneSignedIn; if (!ok) { ManagerManager.Log(warningText); return(false); } ManagerManager.Log("Sanity check OK"); return(ok); }