Exemplo n.º 1
0
 // public UserInfo userInfo = new UserInfo();
 // public UserGame userGame = new UserGame();
 public SyncPlayDataBody(string _playdata, string name, string url = null) : base(name, url)
 {
     if (!string.IsNullOrEmpty(_playdata))
     {
         this.playdata = _playdata;
         this.sign     = AssetUtils.EncryptWithMD5("wb" + _playdata);
         JSONNode jObj = JSONNode.Parse(_playdata);
         this.gameUid = jObj["StorageAccountInfo"]["_Uid"];
         // this.userInfo.gameUid = jObj["userInfo"]["gameUid"];
         // this.userGame.level = jObj["userGame"]["level"];
         // this.userGame.stamina = jObj["userGame"]["stamina"];
         // this.userGame.staminaRecoverTime = jObj["userGame"]["staminaRecoverTime"];
         // this.userGame.stars = jObj["userGame"]["stars"];
         // this.userGame.coin = jObj["userGame"]["coin"];
         // this.userGame.continuedWinCount = jObj["userGame"]["continuedWinCount"];
     }
 }
Exemplo n.º 2
0
    /// <summary>
    /// appid
    /// time
    /// sign
    /// prvc
    /// session
    /// </summary>
    /// 默认的Header
    /// <returns></returns>
    public static Header GetHeader()
    {
        Dictionary <string, string> headerDic = new Dictionary <string, string>();
        string timeStr = ((int)SystemClock.Now).ToString();

        headerDic["appid"] = GameConfig.Inst.Appid;
        headerDic["time"]  = timeStr;
        headerDic["pver"]  = GameConfig.Inst.Pver;
        headerDic["sign"]  = AssetUtils.EncryptWithMD5(GameConfig.Inst.Appid + timeStr + ClientKey);

        //if (string.IsNullOrEmpty(LoginManager.Instance.Session))
        //{
        //    //headerDic["sign"] = AssetUtils.EncryptWithMD5(GameConfig.Instance.Appid + timeStr + ClientKey);
        //}
        //else
        //{
        //    headerDic["session"] = LoginManager.Instance.Session;
        //   // headerDic["sign"] = AssetUtils.EncryptWithMD5(GameConfig.Instance.Appid + timeStr + ClientKey + Session);
        //}

        return(new Header(headerDic));
    }