cloud_string_save 云端字符串保存


描述

该函数将提交一个字符串到所选的云服务用于存储。该函数将返回惟一的id 值,那么应该使用适当的异步事件识别 ds_map 返回作为云服务的“回调(call back)”。The string 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_file_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_string_save(string, description);

参数 描述
string 将要被上传的字符串。
描述 所存储数据的简要说明。


Returns:

实数


例如:

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

以上的代码创建了一个字符串的值存储在全局数组“Highscores”中,然后将该字符串写入存储的云服务中,并且在本地文件中保存了一份。