コード例 #1
0
        public void onConnectDone(ConnectEvent eventObj)
        {
            Debug.WriteLine("Connect Done: " + eventObj.getResult());
            String subMessage = "";

            switch (eventObj.getResult())
            {
            case WarpResponseResultCode.AUTH_ERROR:
                if (eventObj.getReasonCode() == WarpReasonCode.WAITING_FOR_PAUSED_USER)
                {
                    Debug.WriteLine("Connection state : " + WarpClient.GetInstance().GetConnectionState());
                    subMessage = "Auth Error Waiting for Paused User";

                    //int sessionID = (int)DBManager.getDBData("SessionID");
                    //Debug.WriteLine("Auth Error for paused user " + sessionID);
                    //WarpClient.GetInstance().RecoverConnectionWithSessionId(sessionID, "rahul");
                }
                else
                {
                    Debug.WriteLine("Auth Error session id expired");
                }
                break;

            case WarpResponseResultCode.SUCCESS:
                subMessage = "success";
                WarpClient.GetInstance().Disconnect();
                //DBManager.saveData("SessionID", WarpClient.GetInstance().GetSessionId());
                // _page.showResult("connection success");
                break;

            case WarpResponseResultCode.CONNECTION_ERROR_RECOVERABLE:
                subMessage = "connection error recoverable";
                // _page.showResult("connection recoverable " + eventObj.getResult());
                // Deployment.Current.Dispatcher.BeginInvoke(delegate() {   RecoverConnection(); });
                break;

            case WarpResponseResultCode.SUCCESS_RECOVERED:
                subMessage = "connection success recoverd";
                break;

            default:

                break;
            }
            UIDispatcher.Execute(delegate() {
                if (tblmessage.Text.Length > 200)
                {
                    tblmessage.Text = "";
                }
                tblmessage.Text = tblmessage.Text + "\nConnect Done: " + subMessage;
            });
        }
コード例 #2
0
 public void onConnectDone(ConnectEvent e)
 {
     switch (e.getResult ()) {
             case WarpResponseResultCode.AUTH_ERROR:
                     if (e.getReasonCode () == WarpReasonCode.WAITING_FOR_PAUSED_USER) {
                             Log ("Auth Error:Server is waiting from previous session");
                     } else {
                             Log ("Auth Error:SessionId Expired");
                     }
                     break;
             case WarpResponseResultCode.SUCCESS:
                     PlayerPrefs.SetInt ("SessionID", WarpClient.GetInstance ().GetSessionId ());
                     PlayerPrefs.Save ();
                     Log ("Connect Done ");
                     break;
             case WarpResponseResultCode.CONNECTION_ERROR_RECOVERABLE:
                     Log ("Connect Error Recoverable ");
         //RecoverConnection();
                     break;
             case WarpResponseResultCode.SUCCESS_RECOVERED:
                     Log ("Connection Success Recovered");
         //ConnectionRecovered();
                     break;
             default:
                     Log ("Connect Failed " + e.getResult ());
                     break;
             }
 }