cloud_file_save 云端文件保存


描述

这个函数将提交一个文件到所选云服务用于存储。该函数将返回惟一的id 值,那么应该使用适当的异步事件识别 ds_map 返回作为云服务的“回调(call back)”。The file should contain all the information that you need to save for your game as you can only store one single "data blob" to the cloud, and running this function again will overwrite any previously stored values (as will using the cloud_string_save function). The description should be a short string of information that describes the save, eg: "Level2, Stage2".

For further information on the returned asynchronous data, please see the function cloud_synchronise.


语法:

cloud_file_save(file, description);

参数 描述
string 将被上传的文件(同i符串)。
描述 所存储数据的简要说明。


Returns:

实数


例如:

var t_str = "";
for (var i = 0; i < 10; i++;)
   {
   t_str += string(global.Highscore[i]) + "|"
   }
var file = file_text_open_write("Highscores.txt");
file_text_write_string(file, t_str);
file_text_close(file);
save_check = cloud_file_save("Highscores.txt", "Current Highscores");

以上的代码创建了一个字符串的值存储在全局数组“Highscores”中,然后将该字符串写入本地存储。该文件之后被提交到云端服务器中存储。