Example #1
0
        public int WbUserInfo(string openId, string openKey, string pf, string platform, int appId, string appKey)
        {
            try
            {
                OpenApiV3 sdk = new OpenApiV3(openId, openKey, appId, pf, appKey, UAFactory.Instance.OpenUALog);
                sdk.SetUserIp(UAHelper.GetRealIP());
                RstArray result = GetUserInfo(sdk);
                if (result.Ret != 0)
                {
                    return(result.Ret);
                }
                var json = JsonConvert.DeserializeObject(result.Msg) as JObject;
                if (json == null)
                {
                    return(1);
                }
                //var nickName = JsonUtil.GetJsonValue(json, "nickname");
                //var logo = JsonUtil.GetJsonValue(json, "figureurl");
                //var extraData = BuildExtraData(openkey, pf, pfkey);
                if (pf == "wanba_ts")
                {
                    var result1 = GetWanBaUserInfo(sdk, "1");
                    if (result1.Ret != 0)
                    {
                        return(result1.Ret);
                    }
                    var json1 = JsonConvert.DeserializeObject(result1.Msg) as JObject;
                    if (json1 == null)
                    {
                        return(1);
                    }
                    var data = json1["data"];
                    if (data == null)
                    {
                        return(1);
                    }

                    var is_vip    = JsonUtil.GetJsonValue(data[0], "is_vip").ToLower(); //是否开通游戏达人
                    var vip_level = JsonUtil.GetJsonValue(data[0], "vip_level");        //达人等级
                    //var score = JsonUtil.GetJsonValue(data[0], "score"); //用户积分
                    //var expiredtime = JsonUtil.GetJsonValue(data[0], "vip_level"); //	达人过期时间
                    TxYellowvipMgr.Add(ShareUtil.GetWanBaVipAccount(openId), is_vip == "true", false, false,
                                       ConvertHelper.ConvertToInt(vip_level), "");
                }
                return(0);
            }
            catch (Exception ex)
            {
                SystemlogMgr.Error("腾讯获取用户", ex);
                return(-1);
            }
        }
Example #2
0
 public int WbUserInfo()
 {
     try
     {
         string openId  = "3C12344A556DADF34634CEFB80B05D7D";
         string openKey = "2DC6A89C97E6AAFA9F74C03E15D0CEFA";
         string pf      = "qzone";
         //format
         //userip
         //sig
         //UAFactory
         int       appId      = 1105806369;
         string    appKey     = "uOFRHYPj69tRtk3i";
         string    serverName = "v3/user/buy_playzone_item";
         OpenApiV3 sdk        = new OpenApiV3(openId, openKey, appId, pf, appKey, UAFactory.Instance.OpenUALog);
         sdk.SetUserIp(UAHelper.GetRealIP());
         RstArray result = buyPlayzoneItem(sdk);
         if (result.Ret != 0)
         {
             return(result.Ret);
         }
         var json = JsonConvert.DeserializeObject(result.Msg) as JObject;
         if (json == null)
         {
             return(1);
         }
         var nickName = JsonUtil.GetJsonValue(json, "nickname");
         var logo     = JsonUtil.GetJsonValue(json, "figureurl");
         //var extraData = BuildExtraData(openkey, pf, pfkey);
         if (pf == "wanba")
         {
             var result1 = GetWanBaUserInfo(sdk, "1");
             if (result1.Ret != 0)
             {
                 return(result1.Ret);
             }
             var json1 = JsonConvert.DeserializeObject(result1.Msg) as JObject;
             if (json1 == null)
             {
                 return(1);
             }
             var data = json1["data"];
             if (data == null)
             {
                 return(1);
             }
             var is_vip      = JsonUtil.GetJsonValue(data[0], "is_vip");    //是否开通游戏达人
             var vip_level   = JsonUtil.GetJsonValue(data[0], "vip_level"); //达人等级
             var score       = JsonUtil.GetJsonValue(data[0], "score");     //用户积分
             var expiredtime = JsonUtil.GetJsonValue(data[0], "vip_level"); //	达人过期时间
             TxYellowvipMgr.Add(ShareUtil.GetWanBaVipAccount(openId), is_vip == "true", false, false,
                                ConvertHelper.ConvertToInt(vip_level), "");
         }
         return(0);
     }
     catch (Exception ex)
     {
         SystemlogMgr.Error("腾讯获取用户", ex);
         return(-1);
     }
 }