示例#1
0
        public override async Task <LogintomembercenterRes> Send(params string[] args)
        {
            var url = "/rongame_beta//rgfate/60_member/logintomembercenter.php";

            PlatfromInfos["type"]    = "token";
            PlatfromInfos["version"] = PlatfromInfos["dataVer"];
            PlatfromInfos["dateVer"] = PlatfromInfos["dataVer"];

            Dictionary <string, string> postParam = null;

            postParam = getPlatfromInfoDic(new string[] { "deviceid", "t", "v", "s", "mac", "os", "ptype", "imei", "username", "type", "rkuid", "access_token", "rksdkid", "rkchannel", "appVer", "dateVer", "lastAccessTime", "try", "developmentAuthCode", "version", "dataVer" });

            var response = await Post(url, postParam);

            if (response.response != null && response.response.Count > 0 && !string.IsNullOrEmpty(response.response[0].usk))
            {
                PlatfromInfos["rgusk"]   = response.response[0].usk;
                PlatfromInfos["rguid"]   = response.response[0].success.rguid;
                PlatfromInfos["usk"]     = response.response[0].usk;
                PlatfromInfos["dateVer"] = response.response[0].success.dateVer.ToString();
            }
            else
            {
                PlatfromInfos.Remove("rgusk");
                PlatfromInfos.Remove("rguid");
                PlatfromInfos.Remove("usk");
                PlatfromInfos.Remove("access_token");
                PlatfromInfos.Remove("access_key");
            }
            return(response);
        }
示例#2
0
        public Dictionary <string, string> SaveData()
        {
            var data = new Dictionary <string, string>();

            foreach (var item in PlatfromInfos.Where(d => saveNames.Contains(d.Key)))
            {
                data.Add(item.Key, item.Value);
            }
            return(data);
        }
示例#3
0
 public Dictionary <string, string> getPlatfromInfoDic(string[] names, Dictionary <string, string> dic = null)
 {
     if (dic == null)
     {
         dic = new Dictionary <string, string>();
     }
     foreach (var item in names)
     {
         if (string.IsNullOrEmpty(item) || !PlatfromInfos.ContainsKey(item))
         {
             continue;
         }
         var data = PlatfromInfos[item];
         dic[item] = data == null ? string.Empty : data;
     }
     return(dic);
 }