类型 函数 库 gamecircle.* 返回值 SyncableNumber 修订版 2024.3703 版 关键词 最高,SyncableNumber,Whispersync
以 SyncableNumberList 形式返回最高数列表
local syncNumList = gamecircle.Whispersync.GetHighNumberList(key, NT_constant)
String. 用于访问特定最高数的键。
String. NT_constant,即 “INT” 或 “DOUBLE”,确定最高数的存储方式。 “INT” 切断小数。 “DOUBLE” 保留小数完好无损。如果给定的字符串无效,则默认使用 “INT”。
local highListKey = "myFirstHighNumberList" local gamecircle = require("plugin.gamecircle") gamecircle.Init(false, false, true) gamecircle.Whispersync.SetHighNumberListLength(highListKey, 4) gamecircle.Whispersync.AddToHighNumberList(highListKey, 10, "INT") gamecircle.Whispersync.AddToHighNumberList(highListKey, 1000, "INT") gamecircle.Whispersync.AddToHighNumberList(highListKey, 1, "INT") gamecircle.Whispersync.AddToHighNumberList(highListKey, 10000, "INT") gamecircle.Whispersync.AddToHighNumberList(highListKey, 100, "INT") print("Here is the list of numbers as they are stored in the high number list. They should be in the order from highest to lowest.") local highList = gamecircle.Whispersync.GetHighNumberList(highListKey) for i,entry in ipairs(highList) do print("-" entry.value) end local keys = gamecircle.Whispersync.GetHighNumberListKeys() for i,key in ipairs(keys) do print("-" .. key) end