private void Start() { //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Invalid comparison between Unknown and I4 avatars[0] = new Avatar(GameObject.Find("UserAvatar")); avatars[1] = new Avatar(GameObject.Find("RemoteUserAvatar")); menuMain = new MenuLayout(this, 500, 34); menuStack = new MenuStack(); menuStack.SetMenu(menuMain); Main.OnNPInitialized += OnNPInitialized; OnScreenLog.Add("Initializing NP"); Main.enableInternalLogging = true; Main.OnLog += OnLog; Main.OnLogWarning += OnLogWarning; Main.OnLogError += OnLogError; int kNpToolkitCreate_CacheTrophyIcons = Main.kNpToolkitCreate_CacheTrophyIcons; Main.Initialize(kNpToolkitCreate_CacheTrophyIcons); string sessionImage = Application.streamingAssetsPath + "/PSP2SessionImage.jpg"; Main.SetSessionImage(sessionImage); Sony.NP.System.OnConnectionUp += OnSomeEvent; Sony.NP.System.OnConnectionDown += OnConnectionDown; Sony.NP.System.OnSysResume += OnSomeEvent; Sony.NP.System.OnSysNpMessageArrived += OnSomeEvent; Sony.NP.System.OnSysStorePurchase += OnSomeEvent; Sony.NP.System.OnSysStoreRedemption += OnSomeEvent; Sony.NP.System.OnSysEvent += OnSomeEvent; Messaging.OnSessionInviteMessageRetrieved += OnMessagingSessionInviteRetrieved; Messaging.OnMessageSessionInviteReceived += OnMessagingSessionInviteReceived; Messaging.OnMessageSessionInviteAccepted += OnMessagingSessionInviteAccepted; User.OnSignedIn += OnSignedIn; User.OnSignedOut += OnSomeEvent; User.OnSignInError += OnSignInError; user = new SonyNpUser(); friends = new SonyNpFriends(); trophies = new SonyNpTrophy(); ranking = new SonyNpRanking(); sessions = new SonyNpSession(); messaging = new SonyNpMessaging(); commerce = new SonyNpCommerce(); cloudStorage = new SonyNpCloud(); utilities = new SonyNpUtilities(); Utility.SkuFlags skuFlags = Utility.skuFlags; if ((int)skuFlags == 1) { OnScreenLog.Add("Trial Mode, purchase the full app to get extra features."); } }
private IEnumerator DoJoinSessionFromInvite() { if (Matching.InSession) { OnScreenLog.Add("Leaving current session..."); Matching.LeaveSession(); while (Matching.SessionIsBusy) { yield return(null); } } OnScreenLog.Add("Setting invited member attributes..."); Matching.ClearSessionAttributes(); Matching.AddSessionAttribute(new Matching.SessionAttribute { name = "CAR_TYPE", binValue = "CATMOB" }); OnScreenLog.Add("Joining invited session..."); if (Matching.GetSessionInviteSessionAttribute("PASSWORD", out Matching.SessionAttributeInfo passAttribute) == ErrorCode.NP_OK) { OnScreenLog.Add("Found PASSWORD attribute ..." + passAttribute.attributeBinValue); if (passAttribute.attributeBinValue == "YES") { OnScreenLog.Add("Session requires password..."); Matching.JoinInvitedSession(sessions.sessionPassword); } else { OnScreenLog.Add("No password required..."); Matching.JoinInvitedSession(); } } else { Matching.JoinInvitedSession(); } menuStack.SetMenu(menuMain); menuStack.PushMenu(sessions.GetMenu()); }