Dzapi server save load

From Crainax/War3Lib · View interactive version

Dzapi server save load is an AI agent skill from the GitHub repository Crainax/War3Lib. War3/KK DzAPI 服务器存档读写与防刷设计规范。用于在 JASS/Zinc 中新增或重构服务器存档、每英雄/每角色成长经验、多 Key 共享每日/每局限制、只增存档、版本阶段封顶与未来扩展时,严格使用 DzAPI_Map_SaveServerValue、DzAPI_Map_GetServerValue、DzAPI_Map_StoreInteger、DzAPI_Map_GetStoredInteger、DzAPI_Map_StoreString、DzAPI_Map_GetStoredString,并遵循开局一次读取+内存缓存、63 位字符串限制、短 Key、存档 Key 宏常量、位串拼

How to use this skill

Skill file

DzAPI 服务器存档读写规范

执行入口

强制规则

Xlimon 项目兼容例外(老写法白名单)

标准流程

  1. 在模块头定义宏常量(存档 Key、版本、上下限)。
  2. 在所有客户端都会一致执行的开局延迟回调(如 0.1~0.3 秒)中,按固定顺序遍历玩家,直接读取每名玩家的服务器存档到同步缓存数组;不要使用 GetLocalPlayer,也不要发包同步读档结果。
  3. 业务逻辑只改缓存,并在需要落盘时调用 Store*。
  4. 对字符串型存档做长度保护与格式保护(版本前缀、字符合法性)。
  5. 若启用防篡改:写入时编码+签名,读取时验签失败即回退默认值。

生成代码要求

参考

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.