/// <summary> /// 读取本地账号文件 /// </summary> private void LoadAccountConfig() { #if !WINDOWS_GUEST string accountInipath = GameDefine.AppPersistentDataPath + GameDefine.AccountInfoFile; //检测文件是否存在 /* if (!File.Exists(accountInipath)) * { * Debug.Log("LoadAccountConfig no file "); * GetPlayerData().SetPlayerID(0); * return; * } * StreamReader sr = File.OpenText(path); * uint playerid; * uint.TryParse(sr.ReadLine(), out playerid); * GetPlayerData().SetPlayerID(playerid); * Debug.Log("LoadAccountConfig PlayerID:" + playerid); * sr.Close(); * sr.Dispose();*/ INIParser IniFile = new INIParser(); IniFile.Open(accountInipath); VisitorAccountId = IniFile.ReadUIntValue("Account", "VisitorId", 0); BindMobileAccountId = IniFile.ReadUIntValue("Account", "BindPlayerId", 0); IniFile.Close(); CWechatUserAuth.GetInstance().ReadWeChatAuthInfo(); //如果游客账号与绑定状态的账号ID一致说明上次登陆进行了绑定操作 //if (VisitorAccountId == BindMobileAccountId && VisitorAccountId !=0) // VisitorAccountId = 0; //Debug.Log("AccountConfig VisitorId:" + VisitorAccountId + ",BindPlayerId:" + BindMobileAccountId); #endif }