Example #1
0
 public void Exit()
 {
     if (mInitialized)
     {
         VFPKSDK.Exit();
     }
 }
Example #2
0
        public void Login(Action <string, object> callback)
        {
            EB.Debug.Log("VFPKSDKManager.Login");
            if (!mInitialized)
            {
                EB.Debug.LogError("VFPKSDKManager.Login: not initialized");
                callback("VFPKSDKManager not initialized", null);
                return;
            }
            if (mLoggedIn)
            {
                Hashtable data = new Hashtable()
                {
                    { "sessionid", mSid },
                    { "accountid", mAid }
                };
                callback(null, data);
                return;
            }
            mAuthCallback      += callback;
            Hub.RunInBackground = true;
#if UNITY_ANDROID
            VFPKSDK.Login();
#endif
#if UNITY_IPHONE
            VFPKSDK.Login();
#endif
        }
Example #3
0
        public void OnJoinQQGroup(string key)
        {
#if UNITY_ANDROID
            VFPKSDK.joinQQGroup(key);
#endif
#if UNITY_IPHONE
            VFPKSDK.joinQQGroup();
#endif
        }
Example #4
0
        public void Logout()
        {
#if UNITY_ANDROID
            VFPKSDK.LoginOut();
#endif
#if UNITY_IPHONE
            VFPKSDK.Logout();
#endif
        }
Example #5
0
        public void Pay(EB.IAP.Item item, EB.IAP.Transaction transaction, System.Action <int> callback)
        {
            EB.Debug.Log("VFPKSDKManager.Pay");
            if (!mInitialized)
            {
                EB.Debug.LogError("VFPKSDKManager.Pay: not initialized");
                callback(VFPKSDKResultCode.Failed);
                return;
            }
            mPayCallback += callback;

            object extraInfo  = EB.JSON.Parse(transaction.payload);
            float  cost       = item.cost;
            string name       = item.longName;
            string serverId   = string.Empty;
            var    gameWorlds = Hub.Instance.LoginManager.GameWorlds;
            var    gameWorld  = System.Array.Find(gameWorlds, w => w.Default);

            if (gameWorld != null)
            {
                serverId = gameWorld.Id.ToString();
            }
            string charId    = EB.Sparx.LoginManager.Instance.LocalUserId.Value.ToString();
            string cporderId = transaction.transactionId;

            string callbackInfo = EB.Dot.String("callbackInfo", extraInfo, string.Empty);

            EB.Debug.Log("VFPKSDKManager.Pay: cost = {0},name = {1}", cost, name);
#if UNITY_ANDROID
            VFPKSDK.Pay(cost, name, serverId, charId, cporderId, callbackInfo);
#endif

#if UNITY_IPHONE
            //rmb 充值金额 单位元
            //productID iTunes 苹果后台配置的内购物品的产品ID
            //name 商品名
            //charid 角色ID
            //serverid 服务器ID
            //info 扩展信息
            //cporderid 游戏商订单ID
            string payInfo = cost + ";"
                             + transaction.productId + ";"
                             + name + ";"
                             + charId + ";"
                             + serverId + ";"
                             + callbackInfo + ";"
                             + cporderId;
            Debug.LogError("支付内容:payInfo:" + payInfo);
            VFPKSDK.Pay(payInfo);
#endif
        }
Example #6
0
        public void Init(Action <string, bool> callback, Action <string> tipCallBack)
        {
            EB.Debug.Log("VFPKSDKManager.Init");
            if (mInitialized)
            {
                EB.Debug.LogWarning("VFPKSDKManager.Init: Initialized");
                callback(null, true);
                return;
            }
            mInitCallback      += callback;
            mTipCallback       += tipCallBack;
            Hub.RunInBackground = true;
            new GameObject("VFPK_listener", typeof(SparxVFPKSDKManager));

#if UNITY_ANDROID
            VFPKSDK.Init();
#endif
#if UNITY_IPHONE
            VFPKSDK.Init("544");
#endif
        }
Example #7
0
 public void SetRoleData(string serverId, string serverName, string roleId, string roleName, string roleLevel, string roleCTime)
 {
     VFPKSDK.SetRoleData(serverId, serverName, roleId, roleName, roleLevel, roleCTime);
 }