Example #1
0
        public int SetRequestOTPInfoCallback(Session.RequestOTPInfoDelegate callback)
        {
            if (null == callback)
            {
                return(0);
            }

            int handlerNum = CallbackManager.AddHandler(delegate(CallbackMessage message)
            {
                Log.Debug("[SessionCallback] RequestOTPInfoCallback: " + message.ToString());

                Result result = message.GetResult();

                IDictionary otpInfoDic = message.GetDictionary("otpInfo");
                OTPInfo otpInfo        = null;
                if (null != otpInfoDic)
                {
                    string otp      = otpInfoDic.GetString("otp");
                    string playerId = otpInfoDic.GetString("playerId");
                    string region   = otpInfoDic.GetString("region");

                    List <OTPAuthenticationHistory> otpAuthenticationHistoryList = null;
                    IList historyList = otpInfoDic["otpAuthenticationHistoryList"] as IList;
                    if (historyList != null)
                    {
                        otpAuthenticationHistoryList = new List <OTPAuthenticationHistory>();
                        foreach (IDictionary history in historyList)
                        {
                            string historyGameCode = history.GetString("gameCode");
                            string historyPlayerId = history.GetString("playerId");
                            string creationDate    = history.GetString("creationDate");
                            otpAuthenticationHistoryList.Add(new OTPAuthenticationHistory(historyGameCode, historyPlayerId, creationDate));
                        }
                    }
                    otpInfo = new OTPInfo(otp, playerId, region, otpAuthenticationHistoryList);
                }

                IDictionary restrictOTPInputDic   = message.GetDictionary("restrictOTPInput");
                RestrictOTPInput restrictOTPInput = null;
                if (null != restrictOTPInputDic)
                {
                    int failCount        = restrictOTPInputDic.GetInt("failCount");
                    string retryDateTime = restrictOTPInputDic.GetString("retryDateTime");

                    restrictOTPInput = new RestrictOTPInput(failCount, retryDateTime);
                }

                if (null != callback)
                {
                    callback(result, otpInfo, restrictOTPInput);
                }
            });

            return(handlerNum);
        }
        public void RequestOTPInfo(string otp, Session.RequestOTPInfoDelegate callback)
        {
            int handlerNum = sessionCallback.SetRequestOTPInfoCallback(callback);

            nmg_session_requestOTPInfo(otp, handlerNum);
        }
Example #3
0
 public void RequestOTPInfo(string otp, Session.RequestOTPInfoDelegate callback)
 {
 }
        public void RequestOTPInfo(string otp, Session.RequestOTPInfoDelegate callback)
        {
            int handlerNum = sessionCallback.SetRequestOTPInfoCallback(callback);

            sessionAndroidClass.CallStatic("nmg_session_requestOTPInfo", otp, handlerNum);
        }