从本地国服 Beta 客户端(内部代号 Camelot)的 CASC 数据中提取,供插件开发参考。数据来源:Blizzard_APIDocumentationGenerated 插件、WowT.exe 字符串、Blizzard 插件 Lua 源码。
脚本引擎是标准 Lua 5.1.4(exe 内版权字符串 $Lua: Lua 5.1.4),与正式服相同。客户端是 Mainline 代码库,Housing、Mythic+ 等 12.0 时代的 API 都在,再通过 GameType 为 camelot 的规则关闭。
stringtablemathcoroutinebit (band, bor, bxor, bnot, lshift, rshift, arshift)没有 io,没有 os(只保留 date、time、difftime 作为全局),没有 package.loadlib、dofile、require。debug 库只剩 debugstack、debuglocals、debugprofilestart、debugprofilestop。
strsplitstrjoinstrconcatstrtrimstrlenutf8strcmputf8itostringallwipetinserttremovegetnformatgsubstrfindstrmatchstrsubstrlenstrupperstrlowerstrbytestrcharstrrepfloorceilabssqrtmaxminrandomfastrandomdatetimedifftimedebugstackdebuglocalsdebugprofilestartdebugprofilestopgeterrorhandlerseterrorhandlerloadstringsetfenvgetfenvnewproxygcinfocollectgarbageCopyTabletContainstInverttDeleteItemtIndexOfsecurecallsecurecallfunctionsecureexecuterangeissecureissecurevariableforceinsecurehooksecurefuncscrubcanaccessobjectissecretvalueissecrettablecanaccessvaluecanaccesstablesecretwrapsecretunwrapInCombatLockdownRunScript插件代码默认是"受污染"的。调用受保护函数或向安全框架写入会触发 ADDON_ACTION_BLOCKED 或 ADDON_ACTION_FORBIDDEN。查看 taint 用 CVar taintLog,脚本错误用 scriptErrors。
这是 12.0 引入、无限客户端完整继承的机制。在战斗、首领战、PvP 对局、聊天锁定等受限状态下,部分 API 不再返回明文,而是返回 <secret>。机密值可以原样传回 Blizzard API,但不能比较、运算、拼接或存表,相关调用会被阻断并写入 taint 日志。
issecretvalue(v)、issecrettable(t)、canaccessvalue(v)、canaccesstable(t):判断一个值能否读取。secretwrap、secretunwrap:exe 中存在,供安全环境使用。SecretArguments 字段:AllowedWhenUntainted(默认,只有未污染代码可传机密)、AllowedWhenTainted(插件也可传入)、NotAllowed(永远不接受机密)。SecretReturns 与 SecretWhen* 系列字段说明哪些返回值在什么条件下会变成机密,例如 SecretWhenUnitStatsRestricted、SecretWhenUnitAuraRestricted、SecretInChatMessagingLockdown。C_RestrictedActions 暴露:Enum.AddOnRestrictionType 有 Combat、Encounter、ChallengeMode、PvPMatch、Map、Chat 六种,事件 ADDON_RESTRICTION_STATE_CHANGED 通知状态变化。C_DamageMeter、C_CooldownViewer、C_EncounterTimeline、C_EncounterWarnings,第三方插件只能消费它们给出的、带机密标记的数据。启动日志显示 LimitedLuaResources 机制存在但当前关闭(Enabled = false)。预设配额:每插件 Frame 10000、Texture 40000、FontString 5000、Font 300、Timer 500、AnimGroup 2000、Animation 5000;全局 Frame 100000、Texture 400000。另有 CVar luaScriptBucketThrottleEnabled 系列控制脚本每秒执行时间上限,受限状态下阈值更低。
scriptErrorsscriptWarningsscriptProfiletaintLogcheckAddonVersionluaErrorExceptionsluaScriptBucketThrottleEnabledluaScriptBucketThrottleMaxMsPerSecondNormalluaScriptBucketThrottleMaxMsPerSecondRestrictedluaScriptBucketThrottleMaxMsBurstNormalluaScriptBucketThrottleMaxMsBurstRestrictedallowUntaintedCreationenableDeprecationAddonsexe 内识别的 TOC 指令:
## Interface## Title## Author## Version## Notes## Category## Dependencies## OptionalDeps## SavedVariables## SavedVariablesPerCharacter## LoadOnDemand## LoadWith## LoadManagers## DefaultState## IconTexture## IconAtlas## AddonCompartmentFunc## AddonCompartmentFuncOnEnter## AddonCompartmentFuncOnLeave## AllowLoad## AllowLoadGameType## LoadSavedVariablesFirst## Secure游戏类型标签集合为 standard、classic、vanilla、mainline、camelot、wowlabs、plunderstorm。无限对应 camelot。暴雪自己的插件用 ## AllowLoadGameType: camelot 限定加载,并用 [Family] 占位符和 camelot 子目录放差异文件,例如 [Family]\GameModeSelectConstants.lua。
Interface 版本号:Blizzard 插件 TOC 不写版本。按既有规则(主版本×10000 + 次版本×100 + 修订),1.60.1 对应 16001。这是推算值,登录后用 select(4, GetBuildInfo()) 确认。版本检查受 CVar checkAddonVersion 控制,不匹配只会标记"过期",不会阻止加载。
文件名后缀:exe 字符串表里有 Camelot、Classic、Mainline、Standard、Vanilla、WoWLabs、Plunderstorm 这组首字母大写标记,和既有的 MyAddon_Mainline.toc、MyAddon_Vanilla.toc 规则同源,因此无限专用 TOC 很可能是 MyAddon_Camelot.toc。未在本地验证,建议同时保留无后缀 TOC。
Enum.GameRule.UserAddonsDisabled 与 UserScriptsDisabled:由服务器下发的游戏规则,可整体关闭第三方插件或 /run、/script 脚本。本地 Cfg_GameRules 表有 203 条默认值,但枚举编号不在文档里,实际生效值要登录后用 C_GameRules.IsGameRuleActive 读取。C_AddOns.GetScriptsDisallowedForBeta():Beta 专用开关,为真时聊天命令 /run 和 /script 被禁用。这个函数在插件列表与聊天框代码中都有引用。Enum.GameRule.MacrosDisabled:宏开关。enableDeprecationAddons:加载 Blizzard_Deprecated* 兼容层,为旧 API 提供回退。本客户端带 18 个 Deprecated 插件,包括 SpellBook、UnitScript、CombatLog、ActionBar、Transmog、PartyInfo。只能由安全代码或硬件事件触发的安全按钮调用,插件直接调用会被 FORBIDDEN。以下是 exe 内存在的经典受保护函数:
AcceptBattlefieldPortAcceptDuelAssistUnitAttackTargetBuyMerchantItemCameraOrSelectOrMoveStartCancelShapeshiftFormCancelUnitBuffCastPetActionCastShapeshiftFormCastSpellByIDCastSpellByNameClearTargetFocusUnitFollowUnitInteractUnitInviteUnitJumpOrAscendStartMoveForwardStartPetAttackPetFollowPickupActionPickupContainerItemPickupInventoryItemPickupSpellPlaceActionRunMacroRunMacroTextRunScriptSetTradeMoneySetViewSpellStopCastingStartAttackStartDuelStopAttackTargetNearestEnemyTargetUnitToggleRunToggleSheathTurnLeftStartUseActionUseContainerItemUseInventoryItemUseQuestLogSpecialItem文档中另有 74 个标记 IsProtectedFunction 的方法,几乎全是 Frame 控件方法(Show、Hide、SetPoint、SetScale、SetParent、SetFrameStrata、RegisterForClicks 等),在战斗锁定时对安全框架不可用。
Blizzard_RestrictedAddOnEnvironment 插件在 camelot 下加载,提供完整的安全环境:
SecureActionButtonTemplateSecureUnitButtonTemplateSecureAuraButtonTemplateSecureAuraHeaderTemplateSecureFrameTemplateSecureGroupHeaderTemplateSecureGroupPetHeaderTemplateSecurePartyHeaderTemplateSecurePartyPetHeaderTemplateSecureRaidGroupHeaderTemplateSecureRaidPetHeaderTemplateSecureHandlerBaseTemplateSecureHandlerAttributeTemplateSecureHandlerClickTemplateSecureHandlerDoubleClickTemplateSecureHandlerDragTemplateSecureHandlerEnterLeaveTemplateSecureHandlerMouseUpDownTemplateSecureHandlerMouseWheelTemplateSecureHandlerShowHideTemplateSecureHandlerStateTemplateTOC 中 SecureAuraHeader 只在 classic 类型下加载,无限(camelot)不含它。
exe 内 GameRule 枚举约 150 项。以下是与玩法和界面开关直接相关的一部分,可用 C_GameRules.IsGameRuleActive(Enum.GameRule.X) 或 GetGameRuleAsFloat 读取:
UserAddonsDisabledUserScriptsDisabledMacrosDisabledEditModeDisabledTransmogEnabledSummoningStonesEnableAmmoSystemDisableCampsitesHousingEnabledHousingDashboardDisabledPetBattlesDisabledEncounterJournalDisabledEjDungeonsDisabledEjRaidsDisabledTalentsPanelDisabledAchievementsPanelDisabledProfessionsPanelDisabledCollectionsPanelDisabledCompactRaidFrameManagerDisabledPersonalResourceDisplayDisabledTargetCastBarDisabledNameplateCastBarDisabledPlayerCastBarDisabledObjectiveTrackerDisabledQuestLogSuperTrackingDisabledWorldMapTrackingPinDisabledMaximizeWorldMapDisabledBagsUIDisabledAeLootDisabledLootMethodStyleVanillaRageGenerationModifierManaRegenBonusStatMeansMp5BinarySpellPushbackResistNoDebuffLimitSingleTargetComboPointsVanillaNpcKnockbackHardcoreRulesetSelfFoundAllowedDisableHonorDecayTalentRespecCostMinTalentRespecCostMaxTalentRespecCostStepTrivialGroupXPPercentPreventXPAndLootForExcessiveOutsideHelpMaxLootDropLevelCharNameReservationEnabledMaxCharReservationsPerRealmRecommendLeastPopulatedRealmDisableRealmSelectionUseSimpleCharacterSelectListFullCharacterCreateDisabledAlwaysAllowAlliedRacesRaceAlteredFormsDisabledForceAlteredFormsOnC_GameRules.GetForeverExperiencePreset() / SetForeverExperiencePreset(preset),枚举 Enum.ForeverExperiencePreset:Classic = 0,Modern = 1。C_GameRules.IsSDHDToggleEnabled()、AccountHasSDEnabled()、SetSDHDToggleValue(setToSD):标清 / 高清角色模型切换。C_GameRules.GetActiveGameMode()、GetCurrentGameModeRecordID()、IsHardcoreActive()、IsSelfFoundAllowed():GameMode 表有 standard、wf、wfhc 三种标签。Constants.LegacyConsts.LEGACY_TREE_PROFESSIONS_ID、LEGACY_TREE_ADVENTURE_ID、LEGACY_TREE_PROGRESSION_ID,货币 CURRENCY_ID_RENOWN_LEGACY、LEGACY_POINTS_TRAIT_CURRENCY_ID。PLAYER_CAMPING 是登出倒计时(CAMP_TIMER),不是篝火。篝火露营在本构建没有独立 Lua 接口,只有种族技能图标。