Beispiel #1
0
    private void OnInitResult(int code, string msg)
    {
        log(string.Format("UCCallbackMessage - OnInitResult: code={0}, msg={1}", code, msg));
        //输出初始化结果到页面(接入后删除)
        SendMessage("setMessage", string.Format("UCCallbackMessage - OnInitResult: code={0}, msg={1}", code, msg));

        if (code == UCStatusCode.SUCCESS)
        {
            log("init succeeded");

            // //TODO: 可把创建和显示悬浮按钮移到合适的逻辑中
            // UCGameSdk.createFloatButton ();

            Debug.Log("UCCallbackMessage::OnInitResult");


            // 游戏自身逻辑
            ThirdPartyPlatform.OnInitSDK(true);
        }
        else
        {
            log(string.Format("Failed initing UC game sdk, code={0}, msg={1}", code, msg));

            //初始化失败处理
            ThirdPartyPlatform.OnInitSDK(false);
        }
    }
Beispiel #2
0
    private void OnPayCallback(int code, JsonData jsonOrder)
    {
        log(string.Format("UCCallbackMessage - OnPayCallback: code={0}", code));

        ////输出支付回调信息到页面(接入后删除)
        //GameMain.setSdkMessage (string.Format ("UCCallbackMessage - OnPayCallback: code={0}", code));

        if (code == UCStatusCode.SUCCESS)
        {
            string orderId     = (string)jsonOrder ["orderId"];
            float  orderAmount = (float)jsonOrder ["orderAmount"];
            int    payWayId    = (int)jsonOrder ["payWayId"];
            string payWayName  = (string)jsonOrder ["payWayName"];

            //充值下单成功,游戏应对下单结果进行处理,一般需把订单号、下单金额、支付渠道ID、支付渠道名称等信息上传到游戏服务器进行保存
            log(string.Format("UCCallbackMessage - received order info: code={0}, orderId={1}, orderAmount={2:0.00}, payWayId={3}, payWayName={4}",
                              code, orderId, orderAmount, payWayId, payWayName));

            ThirdPartyPlatform.OnPayForCommodity(true, orderId);
            //游戏根据需要进行订单处理,一般需要把订单号传回游戏服务器,在服务器上保存
        }
        else if (code == UCStatusCode.PAY_USER_EXIT)
        {
            //充值界面已关闭,回到游戏画面,游戏应根据实际需要决定是否进行画面刷新
        }
        else
        {
            //充值调用失败
        }
    }
Beispiel #3
0
    void OnRegister(JsonData json)
    {
        int code = (int)json[SDKConstants.KEY_ERROR_CODE];

        switch (code)
        {
        case NdErrorCode.ND_COM_PLATFORM_SUCCESS:

            JsonData data      = json[SDKConstants.KEY_JSON_DATA];
            string   userId    = (string)data[SDKConstants.KEY_USER_ID];
            string   sessionId = (string)data[SDKConstants.KEY_USER_SESSION_ID];
            string   nickName  = (string)data[SDKConstants.KEY_USER_NICKNAME];

            ThirdPartyPlatform.OnRegister(true);
            // Log.e("91","登陆成功 " + userId);
            break;

        case NdErrorCode.ND_COM_PLATFORM_ERROR_LOGIN_FAIL:
            // Log.e("91","登陆失败");
            break;

        case NdErrorCode.ND_COM_PLATFORM_ERROR_CANCEL:
            // Log.e("91","用户取消登陆");
            break;

        default:
            break;
        }
    }
    public void modifyUserInfoNotify(string args)
    {
        ParseReceiveParams(args);

        U3dGfanSender.ShowToast("modifyUserInfoNotify finishi...IsSuccess " + IsSuccess());
        ThirdPartyPlatform.OnModifyUserInfo(IsSuccess());
    }
    public void rechargeNotify(string args)
    {
        ParseReceiveParams(args);

        U3dGfanSender.ShowToast("rechargeNotify finishi...IsSuccess " + IsSuccess());
        ThirdPartyPlatform.OnRecharge(IsSuccess());
    }
    public void paymentNotify(string args)
    {
        ParseReceiveParams(args);

        string result = GetReceiveParam(KeyResult);
        string error  = GetReceiveParam(KeyError);

        Debug.Log("[U3d2NdReceiver]: paymentNotify------------------- the result is " + result);
        Debug.Log("[U3d2NdReceiver]: paymentNotify------------------- the error is " + error);

        string orderId        = GetReceiveParam(KeyOrderId);
        string productId      = GetReceiveParam(KeyProductId);
        string productName    = GetReceiveParam(KeyProductName);
        string price          = GetReceiveParam(KeyProductPrice);
        string origPrice      = GetReceiveParam(KeyProductOrigPrice);
        string count          = GetReceiveParam(KeyProductCount);
        string payDescription = GetReceiveParam(KeyPayDescription);

        Debug.Log("[U3d2NdReceiver]: paymentNotify------------------- the orderId is " + orderId);
        Debug.Log("[U3d2NdReceiver]: paymentNotify------------------- the productId is " + productId);
        Debug.Log("[U3d2NdReceiver]: paymentNotify------------------- the productName is " + productName);
        Debug.Log("[U3d2NdReceiver]: paymentNotify------------------- the price is " + price);
        Debug.Log("[U3d2NdReceiver]: paymentNotify------------------- the origPrice is " + origPrice);
        Debug.Log("[U3d2NdReceiver]: paymentNotify------------------- the count is " + count);

        if (IsSuccess())
        {
            ThirdPartyPlatform.OnPayForCommodity(IsSuccess(), orderId);

            Statistics.INSTANCE.ChargeEvent(orderId, "91", productName, count, price);
        }
        else
        {
            ThirdPartyPlatform.OnPayForCommodity(IsSuccess(), orderId);
        }


        /*
         * switch(code){
         *                      case NdErrorCode.ND_COM_PLATFORM_SUCCESS:
         *                      Toast.makeText(mCtx, "购买成功", Toast.LENGTH_SHORT).show();
         *                      break;
         *              case NdErrorCode.ND_COM_PLATFORM_ERROR_PAY_FAILURE:
         *                      Toast.makeText(mCtx, "购买失败", Toast.LENGTH_SHORT).show();
         *                      break;
         *              case NdErrorCode.ND_COM_PLATFORM_ERROR_PAY_CANCEL:
         *                      Toast.makeText(mCtx, "取消购买", Toast.LENGTH_SHORT).show();
         *                      break;
         *              case NdErrorCode.ND_COM_PLATFORM_ERROR_PAY_ASYN_SMS_SENT:
         *                      Toast.makeText(mCtx, "订单已提交,充值短信已发送", Toast.LENGTH_SHORT).show();
         *                      break;
         *              case NdErrorCode.ND_COM_PLATFORM_ERROR_PAY_REQUEST_SUBMITTED:
         *                      Toast.makeText(mCtx, "订单已提交", Toast.LENGTH_SHORT).show();
         *                      break;
         *              default:
         *                      Toast.makeText(mCtx, "购买失败", Toast.LENGTH_SHORT).show();
         *              }
         * */
    }
Beispiel #7
0
    void OnLogout(JsonData json)
    {
        int code = (int)json[SDKConstants.KEY_ERROR_CODE];

        if (code == NdErrorCode.ND_COM_PLATFORM_SUCCESS)
        {
            ThirdPartyPlatform.OnLogout(true);
        }
    }
    /*
     * All callback methods from 91SDK
     * */
    public void initSdkNotify(string args)
    {
        ParseReceiveParams(args);
        string result = GetReceiveParam(KeyResult);

        Debug.Log("[U3d2NdReceiver]: initSdkNotify------------------- the result is " + result);

        ThirdPartyPlatform.OnInitSDK(IsSuccess());
    }
    public void loginNotify(string args)
    {
        if (!ParseReceiveParams(args))
        {
            U3dGfanSender.ShowToast("loginNotify ParseReceiveParams error...");
        }

        U3dGfanSender.ShowToast("loginNotify finishi...IsSuccess " + IsSuccess());
        ThirdPartyPlatform.OnLogin(IsSuccess());
    }
    void OnApplicationQuit()
    {
        publisher.NotifyMonoQuit();
        // release Debug information
        Debug.Release();

        Globals.Instance.QuitGame();
        TalkingDataGA.SessionStoped();
        ThirdPartyPlatform.CloseSDK();
    }
Beispiel #11
0
    void OnCloseSDK(JsonData json)
    {
        int code = (int)json[SDKConstants.KEY_ERROR_CODE];

        // JsonData data = json[SDKConstants.KEY_JSON_DATA];
        if (code == MiErrorCode.MI_XIAOMI_GAMECENTER_SUCCESS)
        {
            ThirdPartyPlatform.OnCloseSDK(true);
        }
    }
Beispiel #12
0
    public static void InitSDK()
    {
        Debug.Log("NdSDKAgent:InitSDK");
        ThirdPartyPlatform.OnInitSDK(true);

        // init SDK before in java native
        // com.gfan.game.battleatlantic_91.U3dNdSDK
        //
        //Debug.Log("NdSDKAgent:InitSDK");
        //AndroidNativeCallStatic(JavaClassUnity2NdSDK,"ndInitSDK", AppId, AppKey, DebugMode, (int)NdScreenOrientation.Landscape);
    }
    public void appVersionUpdateNotify(string args)
    {
        ParseReceiveParams(args);

        // 自己处理更新接口回调的逻辑
        string updateResult = GetReceiveParam(KeyUpdateResult);

        Debug.Log("[U3d2NdReceiver]: paymentNotify------------------- the updateResult is " + updateResult);

        ThirdPartyPlatform.OnNdCheckAppVersion(updateResult);
    }
    public void searchPayResultNotify(string args)
    {
        ParseReceiveParams(args);

        string isPaySuccess  = GetReceiveParam(KeyIsPaySuccess);
        bool   bIsPaySuccess = string.IsNullOrEmpty(isPaySuccess) ? false : bool.Parse(isPaySuccess);

        string orderId        = GetReceiveParam(KeyOrderId);
        string productId      = GetReceiveParam(KeyProductId);
        string productName    = GetReceiveParam(KeyProductName);
        string price          = GetReceiveParam(KeyProductPrice);
        string origPrice      = GetReceiveParam(KeyProductOrigPrice);
        string count          = GetReceiveParam(KeyProductCount);
        string payDescription = GetReceiveParam(KeyPayDescription);

        Debug.Log("[U3d2NdReceiver]: paymentNotify------------------- the orderId is " + orderId);
        Debug.Log("[U3d2NdReceiver]: paymentNotify------------------- the productId is " + productId);
        Debug.Log("[U3d2NdReceiver]: paymentNotify------------------- the productName is " + productName);
        Debug.Log("[U3d2NdReceiver]: paymentNotify------------------- the price is " + price);
        Debug.Log("[U3d2NdReceiver]: paymentNotify------------------- the origPrice is " + origPrice);
        Debug.Log("[U3d2NdReceiver]: paymentNotify------------------- the count is " + count);

        if (IsSuccess())
        {
            ThirdPartyPlatform.OnSearchPayResult(IsSuccess(), bIsPaySuccess, orderId);
        }
        else
        {
            ThirdPartyPlatform.OnSearchPayResult(IsSuccess(), bIsPaySuccess, orderId);
        }

        // ThirdPartyPlatform.ErrorCode resultCode = U3dNdSender.Convert2ResultCode(0);
        //
        // string orderId = "";
        // ThirdPartyPlatform.OnSearchPayResult(resultCode, orderId);

        /*
         * switch(responseCode){
         *      case NdErrorCode.ND_COM_PLATFORM_SUCCESS://查询成功
         *              if(isPay){
         *                      //购买成功
         *              }else{
         *              //购买失败
         *              }
         *              break;
         *      case NdErrorCode.ND_COM_PLATFORM_ERROR_UNEXIST_ORDER:
         *              //无此订单
         *              break;
         *      default :
         *              //查询失败
         *      }
         * */
    }
    void ShowCompanyLogo()
    {
        companyLogoRoot.gameObject.SetActiveRecursively(true);
        companyLogoRoot.localScale = new Vector3(Screen.width / GUIManager.DEFAULT_SCREEN_WIDTH, Screen.height / GUIManager.DEFAULT_SCREEN_HEIGHT, 1.0f);
        //logoAnimitation.Reset();
        //StartCoroutine(DoPlayLogoAnim());

        EventDelegate.Add(TweenAlpha.Begin(logoName.gameObject, 2f, 0.0f).onFinished, delegate() {
            ToLoading();
            ThirdPartyPlatform.InitSDK();
            Destroy(companyLogoRoot.gameObject);
        });
    }
    public void Restart()
    {
        Debug.Log("[Globals]: Restart begin...");

        GameDefines.WriteConfigFile();
        //GUIVipStore.WritePendingOrderIds();

        ThirdPartyPlatform.CloseSDK();


        Debug.Log("[Globals]: Restart call Release()...");
        Globals.Instance.Release();
        GameObject dontAutoDelObj = GameObject.Find("GlobalScripts");

        if (null != dontAutoDelObj)
        {
            GameObject.Destroy(dontAutoDelObj);
        }

        dontAutoDelObj = GameObject.Find("StaticRes");
        if (null != dontAutoDelObj)
        {
            GameObject.Destroy(dontAutoDelObj);
        }

        dontAutoDelObj = GameObject.Find("UI Root");
        if (null != dontAutoDelObj)
        {
            GameObject.Destroy(dontAutoDelObj);
        }

        dontAutoDelObj = GameObject.Find("CameraControl");
        if (null != dontAutoDelObj)
        {
            GameObject.Destroy(dontAutoDelObj);
        }

        dontAutoDelObj = GameObject.Find("TaskCameraControl");
        if (null != dontAutoDelObj)
        {
            GameObject.Destroy(dontAutoDelObj);
//			GameObject.DestroyImmediate(dontAutoDelObj);
        }

        Debug.Log("[Globals]: Restart call Application.LoadLevel...");
        Application.LoadLevel("SceneStart");

        Debug.Log("[Globals]: Restart End...");
    }
Beispiel #17
0
    void OnLogin(JsonData json)
    {
        int code = (int)json[SDKConstants.KEY_ERROR_CODE];

        switch (code)
        {
        case MiErrorCode.MI_XIAOMI_GAMECENTER_SUCCESS:
            JsonData data = json[SDKConstants.KEY_JSON_DATA];
            if (null == data)
            {
                Debug.Log("Get error information form Android native OnLogin");
                break;
            }
            // Debug.Log("MiErrorCode.MI_XIAOMI_GAMECENTER_SUCCESS data.IsObject : " + data.IsObject);
            // Debug.Log("MiErrorCode.MI_XIAOMI_GAMECENTER_SUCCESS data.IsArray : " + data.IsArray);
            Debug.Log("MiErrorCode.MI_XIAOMI_GAMECENTER_SUCCESS data.Count : " + data.Count);

            string userId    = (string)data[SDKConstants.KEY_USER_ID];
            string sessionId = (string)data[SDKConstants.KEY_USER_SESSION_ID];
            string nickName  = (string)data[SDKConstants.KEY_USER_NICKNAME];

            ThirdPartyPlatform.UserUniqId = userId;
            ThirdPartyPlatform.SessionId  = sessionId;
            ThirdPartyPlatform.NickName   = nickName;

            ThirdPartyPlatform.OnLogin(true);
            break;

        case MiErrorCode.MI_XIAOMI_GAMECENTER_ERROR_LOGIN_FAIL:
            // 登陆失败
            ThirdPartyPlatform.OnLogin(false);
            break;

        case MiErrorCode.MI_XIAOMI_GAMECENTER_ERROR_CANCEL:
            // 取消登录
            ThirdPartyPlatform.OnLogin(false);
            break;

        case MiErrorCode.MI_XIAOMI_GAMECENTER_ERROR_ACTION_EXECUTED:
            //登录操作正在进行中
            ThirdPartyPlatform.OnLogin(false);
            break;

        default:
            // 登录失败
            break;
        }
    }
Beispiel #18
0
    void OnAppVersionUpdate(JsonData json)
    {
        ThirdPartyPlatform.isNdCheckintVer = false;

        int code = (int)json[SDKConstants.KEY_ERROR_CODE];

        Debug.Log("NdSDKAgent: OnAppVersionUpdate/code " + code);
        switch (code)
        {
        case NdErrorCode.UPDATESTATUS_NONE:
            // Log.e("91","没有更新");
            ThirdPartyPlatform.Login(true);
            break;

        case NdErrorCode.UPDATESTATUS_UNMOUNTED_SDCARD:
            // Log.e("91","没有SD卡");
            break;

        case NdErrorCode.UPDATESTATUS_CANCEL_UPDATE:
            // Log.e("91","用户取消普通更新");
            Globals.Instance.MGUIManager.CreateGUIDialog(delegate(GUIDialog gui)
            {
                gui.SetTextAnchor(ETextAnchor.MiddleLeft, false);
                gui.SetDialogType(EDialogType.ND_NORMAL_UPDATE);
            }, EDialogStyle.DialogOkCancel, delegate()
            {
                ThirdPartyPlatform.Login(true);
            });
            break;

        case NdErrorCode.UPDATESTATUS_CHECK_FAILURE:
            // Log.e("91","新版本检测失败");
            break;

        case NdErrorCode.UPDATESTATUS_FORCES_LOADING:
            // Log.e("91","强制更新正在下载");
            break;

        case NdErrorCode.UPDATESTATUS_RECOMMEND_LOADING:
            // Log.e("91","普通更新正在下载");
            break;

        default:
            // Log.e("91","检查更新失败DEFAULT");
            break;
        }
    }
    IEnumerator DoPlayLogoAnim()
    {
        NGUITools.SetActive(logoName.transform.gameObject, false);

        yield return(new WaitForSeconds(1.5f));

        NGUITools.SetActive(logoName.transform.gameObject, true);


        Color c_Start = new Color(1, 1, 1, 0.0f);
        Color c_End   = new Color(1, 1, 1, 1);


        EventDelegate.Add(TweenAlpha.Begin(logoName.gameObject, 2f, 0.0f).onFinished, delegate() {
            ToLoading();
            ThirdPartyPlatform.InitSDK();
            Destroy(companyLogoRoot.gameObject);
        });
    }
Beispiel #20
0
    void OnPayForOrderIAP(string args)
    {
        ParseReceiveParams(args);

        string orderId    = GetReceiveParam(KeyOrderId);
        string payName    = GetReceiveParam(KeyPayName);
        string receiptMD5 = GetReceiveParam(KeyiOSReceiptMD5);
        string count      = "1";    // GetReceiveParam(KeyCount);

        if (IsSuccess())
        {
            ThirdPartyPlatform.OnPayForCommodity(IsSuccess(), orderId);
            // Statistics.INSTANCE.ChargeEvent(orderId, "GFanApple", payName, count, gfanMoney);
        }
        else
        {
            ThirdPartyPlatform.OnPayForCommodity(IsSuccess(), "");
        }
    }
Beispiel #21
0
 public static void OnInitSDK(bool isSuccess)
 {
     Debug.Log("ThirdPartyPlatform::OnInitSDK!!!!!!");
     //if (GameDefines.OutputVerDefs == OutputVersionDefs.Nd91iPhone
     //	|| GameDefines.OutputVerDefs == OutputVersionDefs.Nd91Android)
     //{
     //ThirdPartyPlatform.NdCheckAppVersion();
     //}
     //else
     if (GameDefines.OutputVerDefs == OutputVersionDefs.AppStore)
     {
         Globals.Instance.MGUIManager.CreateWindow <GUIPreLogin>(delegate(GUIPreLogin gui)
         {
             gui.enterAccountGUI();
         });
     }
     {
         ThirdPartyPlatform.Login(true);
     }
 }
Beispiel #22
0
    void OnLogin(string args)
    {
        ParseReceiveParams(args);

        Debug.Log("U3dGfaniSDK OnLogin args: " + args);

        long userId = -1;

        long.TryParse(GetReceiveParam(KeyUserId), out userId);

        ThirdPartyPlatform.UserUniqId = userId.ToString();
        ThirdPartyPlatform.SessionId  = "";
        ThirdPartyPlatform.NickName   = GetReceiveParam(KeyUserName);

        // get the guest state
        string keyGuestValue = GetReceiveParam(KeyIsGuest);

        U3dGfaniOSSender.IsGuestAccount = keyGuestValue.Equals("1") || string.Compare(keyGuestValue, "true", true) == 0;

        ThirdPartyPlatform.OnLogin(IsSuccess(), GetReceiveParam(KeyResult));
    }
Beispiel #23
0
    void OnPayProduct(JsonData json)
    {
        int code = (int)json[SDKConstants.KEY_ERROR_CODE];

        switch (code)
        {
        case NdErrorCode.ND_COM_PLATFORM_SUCCESS:
            JsonData data = json[SDKConstants.KEY_JSON_DATA];

            string orderId     = (string)data[SDKConstants.KEY_ORDER_ID];
            string product     = (string)data[SDKConstants.KEY_PRODUCT_ID];
            string productName = (string)data[SDKConstants.KEY_PRODUCT_NAME];
            float  price       = (float)data[SDKConstants.KEY_PAY_MONEY];
            int    count       = (int)data[SDKConstants.KEY_PRODUCT_COUNT];

            ThirdPartyPlatform.OnPayForCommodity(true, orderId);
            // Toast.makeText(UnityPlayer.currentActivity, "购买成功", Toast.LENGTH_SHORT).show();
            break;

        case NdErrorCode.ND_COM_PLATFORM_ERROR_PAY_FAILURE:
            // Toast.makeText(UnityPlayer.currentActivity, "购买失败", Toast.LENGTH_SHORT).show();
            break;

        case NdErrorCode.ND_COM_PLATFORM_ERROR_PAY_CANCEL:
            // Toast.makeText(UnityPlayer.currentActivity, "取消购买", Toast.LENGTH_SHORT).show();
            break;

        case NdErrorCode.ND_COM_PLATFORM_ERROR_PAY_ASYN_SMS_SENT:
            // Toast.makeText(UnityPlayer.currentActivity, "订单已提交,充值短信已发送", Toast.LENGTH_SHORT).show();
            break;

        case NdErrorCode.ND_COM_PLATFORM_ERROR_PAY_REQUEST_SUBMITTED:
            // Toast.makeText(UnityPlayer.currentActivity, "订单已提交", Toast.LENGTH_SHORT).show();
            break;

        default:
            // Toast.makeText(UnityPlayer.currentActivity, "购买失败", Toast.LENGTH_SHORT).show();
            break;
        }
    }
Beispiel #24
0
    private void OnLoginResult(int code, string msg)
    {
        log(string.Format("UCCallbackMessage - OnLoginResult: code={0}, msg={1}", code, msg));

        //输出登录结果到页面(接入后删除)
        SendMessage("setMessage", string.Format("UCCallbackMessage - OnLoginResult: code={0}, msg={1}", code, msg));

        if (code == UCStatusCode.SUCCESS)
        {
            UCConfig.logined = true;

            //显示悬浮按钮
            //UCGameSdk.showFloatButton (100, 20, true);

            //进入分区通知,//TODO: 应在进入分区时进行该调用
            //UCGameSdk.notifyZone ("66区-风起云涌", "R29924", "Role-大漠孤烟");

            Debug.Log("uc sid is " + UCGameSdk.getSid());

            // 缺少获取用户基本信息的接口
            ThirdPartyPlatform.UserUniqId = "";
            ThirdPartyPlatform.SessionId  = UCGameSdk.getSid();
            ThirdPartyPlatform.NickName   = "";

            ThirdPartyPlatform.OnLogin(true);
        }
        else if (code == UCStatusCode.LOGIN_EXIT)
        {
            //登录界面退出,返回到游戏画面
            log("login UI exit, back to game UI");
        }
        else
        {
            log(string.Format("Failed login, code={0}, msg={1}", code, msg));

            //登录失败
            //
        }
    }
Beispiel #25
0
    private void OnLogout(int code, string msg)
    {
        log(string.Format("UCCallbackMessage - OnLogout: code={0}, msg={1}", code, msg));

        ////输出退出登录结果到页面(接入后删除)
        //GameMain.setSdkMessage (string.Format ("UCCallbackMessage - OnLogout: code={0}, msg={1}", code, msg));

        if (code == UCStatusCode.SUCCESS)
        {
            //当前登录用户已退出,应将游戏切换到未登录的状态。

            UCConfig.logined = false;

            //UCGameSdk.destroyFloatButton ();
            //DemoControl.Restart();
            ThirdPartyPlatform.OnLogout(true);
        }
        else
        {
            //unknown error
            log(string.Format("unknown error: code={0}, msg={1}", code, msg));
        }
    }
Beispiel #26
0
    void OnPayProduct(JsonData json)
    {
        int code = (int)json[SDKConstants.KEY_ERROR_CODE];

        switch (code)
        {
        case MiErrorCode.MI_XIAOMI_GAMECENTER_SUCCESS:
            //购买成功
            JsonData data = json[SDKConstants.KEY_JSON_DATA];

            string orderId    = (string)data[SDKConstants.KEY_ORDER_ID];
            int    mibi       = (int)data[SDKConstants.KEY_PAY_MONEY];
            string customInfo = (string)data[SDKConstants.KEY_PAY_CUSTOM_INFO];

            ThirdPartyPlatform.OnPayForCommodity(true, orderId);
            break;

        case MiErrorCode.MI_XIAOMI_GAMECENTER_ERROR_PAY_CANCEL:
            //取消购买
            ThirdPartyPlatform.OnPayForCommodity(false);
            break;

        case MiErrorCode.MI_XIAOMI_GAMECENTER_ERROR_PAY_FAILURE:
            //购买失败
            ThirdPartyPlatform.OnPayForCommodity(false);
            break;

        case MiErrorCode.MI_XIAOMI_GAMECENTER_ERROR_ACTION_EXECUTED:
            //操作正在进行中
            ThirdPartyPlatform.OnPayForCommodity(false);
            break;

        default:
            //购买失败
            break;
        }
    }
    // Use this for initialization
    protected void Start()
    {
        if (!CheckGoogleResource())
        {
            return;
        }

        if (!TapjoyUnity.Tapjoy.IsConnected)
        {
            TapjoyUnity.Tapjoy.Connect();
        }

        UnityEngine.Profiling.Profiler.enabled = false;
        publisher.NotifyMonoStart();
        // read game defined setting
        GameDefines.ReadConfigFile();


        // Unified the login logic, move it to ThirdPartyPlatform.AtlanticLogin
        // FadeInLogo();

        if (!Globals.Instance.Initialize())
        {
            return;
        }

        Debug.Log("/var/mobile/Applications/3D2A01DB-BDCB-40CE-A537-E04FCAD5EBD0/Documents");
        Debug.Log("Application.persistentDataPath is :" + Application.persistentDataPath);

        //PlayTitleMovie();
        ThirdPartyPlatform.InitSDK();

        GameStatusManager.Instance.Initialize();
        GameStatusManager.Instance.SetGameState(GameState.GAME_STATE_INITIAL);

//		AndroidSDKAgent.getMacAddress ();
    }
Beispiel #28
0
    void OnLogout(JsonData json)
    {
        int code = (int)json[SDKConstants.KEY_ERROR_CODE];

        switch (code)
        {
        case MiErrorCode.MI_XIAOMI_GAMECENTER_ERROR_LOGINOUT_FAIL:
            // 注销失败
            ThirdPartyPlatform.OnLogout(false);
            break;

        case MiErrorCode.MI_XIAOMI_GAMECENTER_ERROR_LOGINOUT_SUCCESS:
            // 注销成功
            ThirdPartyPlatform.OnLogout(true);
            break;

        case MiErrorCode.MI_XIAOMI_GAMECENTER_ERROR_ACTION_EXECUTED:
            //操作正在进行中
            break;

        default:
            break;
        }
    }
    public void paymentNotify(string args)
    {
        ParseReceiveParams(args);

        U3dGfanSender.ShowToast("paymentNotify finishi...IsSuccess " + IsSuccess());
        if (IsSuccess())
        {
            string orderId        = receiveParams[KEY_ORDER_ID];
            string payName        = receiveParams[KEY_PAY_NAME];
            string payDescription = receiveParams[KEY_PAY_DESCRIPTION];
            string gfanMoney      = receiveParams[KEY_PAY_MONEY];
            string count          = receiveParams[KEY_PRODUCT_COUNT];

            ThirdPartyPlatform.OnPayForCommodity(IsSuccess(), orderId);

            Statistics.INSTANCE.ChargeEvent(orderId, "GFan", payName, count, gfanMoney);
        }
        else
        {
            string error = receiveParams[KEY_ERROR_CODE];

            ThirdPartyPlatform.OnPayForCommodity(IsSuccess(), "");
        }
    }
Beispiel #30
0
 void AutoSkipAccount()
 {
     SetVisible(false);
     ThirdPartyPlatform.AtlanticLogin(false, GameDefines.Setting_LoginName, GameDefines.Setting_LoginPass);
 }