146 lines
6.1 KiB
Go
146 lines
6.1 KiB
Go
package routers
|
|
|
|
import (
|
|
"context"
|
|
"sync"
|
|
)
|
|
|
|
var _ = sync.Mutex{}
|
|
var _ = context.Background
|
|
|
|
//
|
|
// Shared economy plumbing for build 4229938 mall purchases and gacha draws: currency/wallet mapping,
|
|
// backpack grants, the pushes the client expects, and the snapshot that lets money and items survive
|
|
// a re-login. Retail keeps all of this in its account database; here the session state is the single
|
|
// authority and PlayerProgressStore mirrors it to one JSON file per player.
|
|
//
|
|
// Loads the saved character economy into the session state at login.
|
|
func GameRouter_Economy_RestorePlayerProgress4229938(ctx context.Context, state any, log any) any {
|
|
// Router implementation for GameRouter_Economy_RestorePlayerProgress4229938
|
|
var zero any; return zero
|
|
}
|
|
|
|
//
|
|
// Replays the saved weapon / fight-style choices. Every entry is re-validated against the
|
|
// catalog on purpose: a save written against an older config (or hand-edited) must degrade to
|
|
// the authored default instead of restoring a combination the client refuses to animate.
|
|
//
|
|
func GameRouter_Economy_RestoreCombatLoadout4229938(ctx context.Context, state any, log any) any {
|
|
// Router implementation for GameRouter_Economy_RestoreCombatLoadout4229938
|
|
var zero any; return zero
|
|
}
|
|
|
|
func GameRouter_Economy_TryAdoptWeaponIntoWheel4229938(ctx context.Context, state any, spiritId uint32, instanceId uint64) any {
|
|
// Router implementation for GameRouter_Economy_TryAdoptWeaponIntoWheel4229938
|
|
var zero any; return zero
|
|
}
|
|
|
|
func GameRouter_Economy_NextGmItemUniqueId4229938(ctx context.Context, ) uint64 {
|
|
// Router implementation for GameRouter_Economy_NextGmItemUniqueId4229938
|
|
return 0
|
|
}
|
|
|
|
func GameRouter_Economy_ReserveGmItemUniqueId4229938(ctx context.Context, uniqueId uint64) any {
|
|
// Router implementation for GameRouter_Economy_ReserveGmItemUniqueId4229938
|
|
var zero any; return zero
|
|
}
|
|
|
|
//
|
|
// Charges a price in units. Wallet currencies debit the wallet,
|
|
// everything else debits the granted stack. A shortfall is clamped and logged instead of failing
|
|
// the command: this private server always lets the player through.
|
|
//
|
|
func GameRouter_Economy_ChargeCurrency4229938(ctx context.Context, state any, changes any, currencyItemId uint32, amount float64, log any, context string) any {
|
|
// Router implementation for GameRouter_Economy_ChargeCurrency4229938
|
|
var zero any; return zero
|
|
}
|
|
|
|
// Rolls one drop row times into .
|
|
func GameRouter_Economy_GrantDrop4229938(ctx context.Context, changes any, drop any, rolls uint32, context string, log any) any {
|
|
// Router implementation for GameRouter_Economy_GrantDrop4229938
|
|
var zero any; return zero
|
|
}
|
|
|
|
func GameRouter_Economy_AddGrant4229938(ctx context.Context, changes any, templateId uint32, count uint32, isBind bool) any {
|
|
// Router implementation for GameRouter_Economy_AddGrant4229938
|
|
var zero any; return zero
|
|
}
|
|
|
|
//
|
|
// Applies a pending mutation to the live session state, pushes the resulting wallet/backpack
|
|
// deltas, and snapshots the character. Returns a short summary for the caller's log line.
|
|
// Per-RPC 入口(conn)额外转交给下面的 session 版本;后台任务用 session 版本。
|
|
//
|
|
func GameRouter_Economy_ApplyEconomy4229938Async(ctx context.Context, conn any, state any, changes any, context string) string {
|
|
// Router implementation for GameRouter_Economy_ApplyEconomy4229938Async
|
|
return ""
|
|
}
|
|
|
|
//
|
|
// 后台循环入口(通缉结算等长生命周期调用方,2026-09-23 新增)。
|
|
// Connection 是 per-RPC 包装、构造是 internal、且它持有那一次 RPC 的 token,
|
|
// 后台任务既拿不到也不能用,所以单独留一个 TcpSession 重载;Connection 版委托到这里,
|
|
// 两个入口的行为(含 RuntimeLogs 解码日志)完全一致。
|
|
//
|
|
func GameRouter_Economy_ApplyEconomy4229938Async_2(ctx context.Context, session *GameSession, state any, changes any, context string, token context.Context) string {
|
|
// Router implementation for GameRouter_Economy_ApplyEconomy4229938Async_2
|
|
return ""
|
|
}
|
|
|
|
//
|
|
// GM 面板「发放全货币」:把三种钱包货币各自**补到** 。
|
|
// 之所以是「补到」而不是「累加」:重复点击不会无限叠加到一个最终溢出的数字,
|
|
// 已经达到或超过目标值的币种保持不变(delta=0,不推 pack)。
|
|
// 返回 ApplyEconomy 的摘要串,供调用方写日志。
|
|
//
|
|
func GameRouter_Economy_GrantAllCurrencies4229938Async(ctx context.Context, session *GameSession, state any, amount float64, token context.Context) string {
|
|
// Router implementation for GameRouter_Economy_GrantAllCurrencies4229938Async
|
|
return ""
|
|
}
|
|
|
|
func GameRouter_Economy_SaturatingAdd4229938(ctx context.Context, left uint32, right uint32) uint32 {
|
|
// Router implementation for GameRouter_Economy_SaturatingAdd4229938
|
|
return 0
|
|
}
|
|
|
|
func GameRouter_Economy_SaturatingMultiply4229938(ctx context.Context, value uint32, factor uint32) uint32 {
|
|
// Router implementation for GameRouter_Economy_SaturatingMultiply4229938
|
|
return 0
|
|
}
|
|
|
|
func GameRouter_Economy_RollCount4229938(ctx context.Context, min uint32, max uint32) uint32 {
|
|
// Router implementation for GameRouter_Economy_RollCount4229938
|
|
return 0
|
|
}
|
|
|
|
// Weighted index in [0, count); -1 when every weight is zero.
|
|
func GameRouter_Economy_PickWeightedIndex4229938(ctx context.Context, count int32, weightAt any) int32 {
|
|
// Router implementation for GameRouter_Economy_PickWeightedIndex4229938
|
|
return 0
|
|
}
|
|
|
|
func GameRouter_Economy_ParseEconomyRequest4229938(ctx context.Context, body []byte) any {
|
|
// Router implementation for GameRouter_Economy_ParseEconomyRequest4229938
|
|
var zero any; return zero
|
|
}
|
|
|
|
// A pending economy mutation: what to take away, what to add, how the wallet moves.
|
|
type EconomyChanges4229938 struct {
|
|
Consumed map[uint32]uint32 `json:"consumed"`
|
|
Granted map[uint32]ItemGrant4229938 `json:"granted"`
|
|
MoneyDelta float64 `json:"moneyDelta"`
|
|
GoldDelta float64 `json:"goldDelta"`
|
|
BindingGoldDelta float64 `json:"bindingGoldDelta"`
|
|
}
|
|
|
|
//
|
|
// AskMallBuyCommodity(commodityId, buyCount, isAutoExchange) and AskDrawGacha(poolId, drawCount,
|
|
// isAutoExchange) share the same wire layout: two uint32 ids followed by one bool.
|
|
//
|
|
type EconomyRequest4229938 struct {
|
|
Id uint32 `json:"id"`
|
|
Count uint32 `json:"count"`
|
|
Flag bool `json:"flag"`
|
|
}
|
|
|