Exemplo n.º 1
0
 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());
 }