小助手内嵌 GM 页:网页重定向 + 物品分页 + 装备强化增幅发放
- 90CN.dll 新增 IE 控件接管,把腾讯小助手页面重定向到本地 GM 页 - gmweb:物品列表改分页(每页 10/20/50,列表固定 6 行高) - 发放走 grant-options,支持强化 0-31、增幅属性+等级、锻造 0-8、品质 - 服务端补齐 amplify_level:等级统一写入 ext_data0/packed_flag_byte/reinforce/upgrade_level - 增幅与强化互斥校验,避免写出客户端无法创建的装备
This commit is contained in:
1 parent
6e570fe820
commit
18e98ca7c9
13 files changed
+1206
-11
No files matched your search
@@ -324,6 +324,7 @@ type GMMailOptions struct {
|
||||
ExpireDays int `json:"expire_days,omitempty"`
|
||||
Reinforce int `json:"reinforce,omitempty"`
|
||||
AmplifyType int `json:"amplify_type,omitempty"`
|
||||
AmplifyLevel int `json:"amplify_level,omitempty"`
|
||||
EquipmentQuality string `json:"equipment_quality,omitempty"`
|
||||
Forging int `json:"forging,omitempty"`
|
||||
EmblemItemIDs []uint32 `json:"emblem_item_ids,omitempty"`
|
||||
@@ -2288,9 +2289,15 @@ func (s *Service) GMSendItemMailWithOptions(
|
||||
return GMMailDeliveryResult{}, fmt.Errorf("%w: equipment mail count must be 1", ErrGMInvalidRequest)
|
||||
}
|
||||
quality := strings.ToLower(strings.TrimSpace(options.EquipmentQuality))
|
||||
if options.ExpireDays < 0 || options.ExpireDays > 3650 || options.Reinforce < 0 || options.Reinforce > 31 || options.AmplifyType < 0 || options.AmplifyType > 4 || options.Forging < 0 || options.Forging > 8 {
|
||||
if options.ExpireDays < 0 || options.ExpireDays > 3650 || options.Reinforce < 0 || options.Reinforce > 31 || options.AmplifyType < 0 || options.AmplifyType > 4 || options.AmplifyLevel < 0 || options.AmplifyLevel > 31 || options.Forging < 0 || options.Forging > 8 {
|
||||
return GMMailDeliveryResult{}, fmt.Errorf("%w: expire_days, reinforce, amplify_type or forging is out of range", ErrGMInvalidRequest)
|
||||
}
|
||||
if options.AmplifyType == 0 && options.AmplifyLevel != 0 {
|
||||
return GMMailDeliveryResult{}, fmt.Errorf("%w: amplify_level requires amplify_type", ErrGMInvalidRequest)
|
||||
}
|
||||
if options.AmplifyType > 0 && options.Reinforce != 0 {
|
||||
return GMMailDeliveryResult{}, fmt.Errorf("%w: reinforce and amplify are mutually exclusive", ErrGMInvalidRequest)
|
||||
}
|
||||
if quality != "" && quality != "default" && quality != "random" && quality != "top" {
|
||||
return GMMailDeliveryResult{}, fmt.Errorf("%w: equipment_quality must be default, random or top", ErrGMInvalidRequest)
|
||||
}
|
||||
@@ -2345,10 +2352,17 @@ func (s *Service) GMSendItemMailWithOptions(
|
||||
stack.Extra["durability"] = strconv.FormatUint(uint64(definition.Durability), 10)
|
||||
stack.Extra["max_durability"] = strconv.FormatUint(uint64(definition.Durability), 10)
|
||||
}
|
||||
if options.Reinforce > 0 {
|
||||
value := strconv.Itoa(options.Reinforce)
|
||||
stack.Extra["reinforce"] = value
|
||||
stack.Extra["ext_data0"] = value
|
||||
// 等级字节只写一次:带增幅时它表示增幅等级,否则是强化等级。
|
||||
level := options.Reinforce
|
||||
if options.AmplifyType > 0 {
|
||||
level = options.AmplifyLevel
|
||||
}
|
||||
if level > 0 {
|
||||
levelText := strconv.Itoa(level)
|
||||
stack.Extra["ext_data0"] = levelText
|
||||
stack.Extra["packed_flag_byte"] = levelText
|
||||
stack.Extra["reinforce"] = levelText
|
||||
stack.Extra["upgrade_level"] = levelText
|
||||
}
|
||||
if options.AmplifyType > 0 {
|
||||
// An amplification option is only real to the game once the row
|
||||
|
||||
Reference in new issue
Block a user