feat(economy): offer a free offline payment option
Expose free payment in the in-game dialog, local store, and marketplace. Grant the selected item without debiting GJN and reject unknown payment methods. Apply the configured per-purchase limit consistently. Type checking, binary and GUI patch checks, and local purchase checks passed. In-game acceptance is pending.
This commit is contained in:
1 parent
e1468df52b
commit
4d8229ae92
9 files changed
+161
-56
No files matched your search
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"id": "online-shop/free-offline-payment-method",
|
||||
"title": "游戏内支付方式窗口增加「老福爷付过了」免 GJN 直接购买选项",
|
||||
"file": "scripts/onlineshop/onlinepurchase.nut",
|
||||
|
||||
"program_behaviour": {
|
||||
"stock": "scripts/onlineshop/onlinepurchase.nut 的 onOnlinePurchase 根据 yuplay2_get_payment_methods() 的位掩码生成支付方式列表(默认只有 Gaijin 币 YU2_PAY_GJN),再固定追加「其他支付方式」(yuNetwork/payMethod/other),交由 PaymentHandler 展示。",
|
||||
"patched": "在「其他支付方式」之前固定追加一项文字按钮「老福爷付过了」(icon 为空字符串,使 paymentHandler.nut 显示文字标题),点击确认后以 YU2_PAY_NONE(0,PurchaseAction 不附带 pay 参数)调用 doYuplayPurchase,本地服务的 /item_purchase.php 识别无 pay 参数时免扣 GJN 直接发放商品。"
|
||||
},
|
||||
|
||||
"derivation": {
|
||||
"requirement": "用户反馈(反馈20261125.md):在支付方式里除了 Gaijin 币外增加一项「老福爷付过了」,点击即视为已支付并直接买下商品,供不想刷 GJN 的玩家使用。",
|
||||
"cause": "原版 payMethodsCfg 只列出 paypal、webmoney、amazon、gjncoins 四项,且均设置非空 SVG 图标(paymenthandler.nut 第 26 行在 icon 非空时隐藏文字标题只显示图标),无法仅靠登录服务下发位掩码在窗口里显示自定义中文名称「老福爷付过了」。",
|
||||
"lighter_options_ruled_out": [
|
||||
"仅在登录服务返回 autopay_pp 等标签开启原版其他支付位:按钮只会显示 PayPal 等原版图标,不会显示「老福爷付过了」文字。"
|
||||
],
|
||||
"conclusion": "在 scripts/onlineshop/onlinepurchase.nut 的支付列表追加无图标文字项「老福爷付过了」,传入已导出的原生常量 YU2_PAY_NONE(aces.exe 0x17cd280 -> YuSession::buyItemSync 不校验位掩码,PurchaseAction 发送不含 pay 字段的表单),由本地服务免扣 GJN 发放。",
|
||||
"if_not_applied": "游戏内购买金鹰包或 GJN 高级账户弹出「选择支付方式」窗口时只有「Gaijin 币」和「其他支付方式」,没有「老福爷付过了」选项。"
|
||||
},
|
||||
|
||||
"features": ["G-货币", "G-高级账户", "G-礼包商店"],
|
||||
"evidence": [
|
||||
"2.61.0.37 gui.vromfs.bin:scripts/onlineshop/onlinepurchase.nut(onOnlinePurchase、onYuplayPurchase、doYuplayPurchase)、scripts/paymenthandler.nut 第 24-26 行、globalScripts/yuplay2Consts.nut 第 38 行(YU2_PAY_NONE)。",
|
||||
"2.61.0.37 aces.exe:0x17cd280(yuplay2_buy_entitlement 绑定)-> 0x55ecbd0(YuSession::buyItemSync)。",
|
||||
"DagorEngine 公开源码:prog/1stPartyLibs/yuplay2auth/session/yu_session.cpp 第 2175 行、yu_sessionProc.cpp 第 260-296 行(PurchaseAction::run 在 payment 为 YU2_PAY_NONE 时不写 pay 字段)。"
|
||||
],
|
||||
|
||||
"edit": {
|
||||
"find": " let name = \"yuNetwork/payMethod/other\"\r\n items.append({",
|
||||
"replace": " let freePayName = \"老福爷付过了\"\r\n items.append({\r\n name = freePayName\r\n icon = \"\"\r\n callback = @() onYuplayPurchase(product, YU2_PAY_NONE, freePayName)\r\n })\r\n\r\n let name = \"yuNetwork/payMethod/other\"\r\n items.append({"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user