public void OnBtnLoginClick() { Net.Login(_data, Password.value, (res) => { Player.Inst.UserData = res.UserData; //Player.Inst.BallsNum = res.UserData.BallsNum; NetPackage.Sid = res.SessionId; _data.Sid = res.SessionId; IOHelperUtil.SaveToJson <RegisterDataReq>(_data, URL.DEBUG_CONFIG); Net.Heartbeat(); ScenesManager.Inst.EnterLoadingScene(SceneName.E_SceneGame_1); }); }
public bool CheckAndFilterResourceFile(ResourceFileList resourceFileListHost, string projResourcePath) { Debug.Log("===>CheckAndFilterResourceFile:\nPath:" + projResourcePath); var folder = new DirectoryInfo(projResourcePath); FileSystemInfo[] fileInfos = folder.GetFileSystemInfos(); foreach (var fileHost in resourceFileListHost.resourceFileList) { if (fileHost.name == "ResourceFileList.json") { continue; } var counter = 0; Debug.Log("File length: " + fileHost.length); foreach (var fileInfo in fileInfos) { if (fileHost.name == fileInfo.Name) { Debug.Log("Local resource name: " + fileInfo.Name); //check md5 var localFileMd5 = IOHelperUtil.GetFileMD5(fileInfo.FullName); if (fileHost.md5 != localFileMd5) { Debug.Log(string.Format("HostMd5: {0}\nLocalMd5: {1}", fileHost.md5, localFileMd5)); _willLoadList.Add(fileHost); _totalBytesLength += long.Parse(fileHost.length); } } else { counter += 1; } } if (counter >= fileInfos.Length) { _willLoadList.Add(fileHost); _totalBytesLength += long.Parse(fileHost.length); } } return(_willLoadList.Count > 0); }
public static void CreateResourceFileList <T>(string inputPath) where T : ResourceFile, new() { Debug.Log("JsonFrom: " + inputPath); var folder = new DirectoryInfo(inputPath); FileSystemInfo[] fileInfos = folder.GetFileSystemInfos(); var bundleFileList = new ResourceFileList <T>(); foreach (var fileInfo in fileInfos) { if (fileInfo.Name.EndsWith(".meta") || fileInfo.Name.EndsWith(".manifest")) { continue; } T bundleFile = new T(); bundleFile.name = fileInfo.Name; bundleFile.md5 = IOHelperUtil.GetFileMD5(fileInfo.FullName); bundleFile.length = ((FileInfo)fileInfo).Length.ToString(); bundleFileList.resourceFileList.Add(bundleFile); } IOHelperUtil.SaveToJson <ResourceFileList>(bundleFileList, inputPath); }
private void LoadLoginConfig() { _data = IOHelperUtil.ReadFromJson <RegisterDataReq>(URL.DEBUG_CONFIG); NetPackage.Sid = _data.Sid; }