类型 函数 库 gamecircle.* 返回值 无 修订版本 版本 2024.3703 关键词 最新, 列表, 可同步数字列表, 长度, Whispersync
设置 LatestNumber 列表的最大长度。此数字上限为 1,000,由 Amazon GameCircle SDK 限制。默认长度为 5。
gamecircle.Whispersync.SetLatestNumberListLength(key, value) gamecircle.Whispersync.SetLatestNumberListLength(key, value)
字符串. 用于访问特定最新数字的键。
数字. 要分配给最新数字的值。
local latestListKey = "myFirstLatestNumberList" local gamecircle = require("plugin.gamecircle") gamecircle.Init(false, false, true) gamecircle.Whispersync.SetLatestNumberListLength(latestListKey, 4) gamecircle.Whispersync.AddToLatestNumberList(latestListKey, 10, "INT") gamecircle.Whispersync.AddToLatestNumberList(latestListKey, 1000, "INT") gamecircle.Whispersync.AddToLatestNumberList(latestListKey, 1, "INT") gamecircle.Whispersync.AddToLatestNumberList(latestListKey, 10000, "INT") gamecircle.Whispersync.AddToLatestNumberList(latestListKey, 100, "INT") print("Here is the list of numbers as they are stored in the latest number list. They should be in the order from latest to oldest.") local latestList = gamecircle.Whispersync.GetLatestNumberList(latestListKey) for i,entry in ipairs(latestList) do print("-" entry.value) end local keys = gamecircle.Whispersync.GetLatestNumberListKeys() for i,key in ipairs(keys) do print("-" .. key) end