| | |
| | | public void Init() |
| | | { |
| | | isWhiteListAccount = false; |
| | | if (VersionConfig.Get().debugVersion) |
| | | VersionConfig.GetAsync().ContinueWith(config => |
| | | { |
| | | debugAccount = true; |
| | | } |
| | | else |
| | | { |
| | | var parentDirectory = Directory.GetParent(Application.persistentDataPath); |
| | | debugAccount = File.Exists(parentDirectory + "/Debug"); |
| | | } |
| | | |
| | | if (LocalSave.GetString("#@#BrancH") != string.Empty) |
| | | { |
| | | var branch = LocalSave.GetString("#@#BrancH"); |
| | | int tmpbranch; |
| | | int.TryParse(LocalSave.GetString("#@#BrancH").Substring(1), out tmpbranch); |
| | | if (branch.StartsWith("d") && tmpbranch != 0) |
| | | if (config != null && config.debugVersion) |
| | | { |
| | | debugBranch = tmpbranch; |
| | | debugAccount = true; |
| | | } |
| | | else if (branch.StartsWith("r") && tmpbranch != 0) |
| | | { |
| | | debugBranch = tmpbranch; |
| | | debugAccount = false; |
| | | } |
| | | } |
| | | |
| | | if (debugAccount) |
| | | { |
| | | if (Application.isMobilePlatform) |
| | | else |
| | | { |
| | | var parentDirectory = Directory.GetParent(Application.persistentDataPath); |
| | | if (File.Exists(parentDirectory + "/Debug")) |
| | | debugAccount = File.Exists(parentDirectory + "/Debug"); |
| | | } |
| | | |
| | | if (LocalSave.GetString("#@#BrancH") != string.Empty) |
| | | { |
| | | var branch = LocalSave.GetString("#@#BrancH"); |
| | | int tmpbranch; |
| | | int.TryParse(LocalSave.GetString("#@#BrancH").Substring(1), out tmpbranch); |
| | | if (branch.StartsWith("d") && tmpbranch != 0) |
| | | { |
| | | var content = File.ReadAllText(parentDirectory + "/Debug"); |
| | | if (!string.IsNullOrEmpty(content)) |
| | | debugBranch = tmpbranch; |
| | | debugAccount = true; |
| | | } |
| | | else if (branch.StartsWith("r") && tmpbranch != 0) |
| | | { |
| | | debugBranch = tmpbranch; |
| | | debugAccount = false; |
| | | } |
| | | } |
| | | |
| | | if (debugAccount) |
| | | { |
| | | if (Application.isMobilePlatform) |
| | | { |
| | | var parentDirectory = Directory.GetParent(Application.persistentDataPath); |
| | | if (File.Exists(parentDirectory + "/Debug")) |
| | | { |
| | | var json = JsonMapper.ToObject<DebugBranch>(File.ReadAllText(parentDirectory + "/Debug")); |
| | | debugBranch = json.branch; |
| | | var content = File.ReadAllText(parentDirectory + "/Debug"); |
| | | if (!string.IsNullOrEmpty(content)) |
| | | { |
| | | var json = JsonMapper.ToObject<DebugBranch>(File.ReadAllText(parentDirectory + "/Debug")); |
| | | debugBranch = json.branch; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }).Forget(); |
| | | |
| | | |
| | | |
| | | } |