Files
bd2/go/internal/server/events/owned_items.go
T
Flechazo 924a42c32e fix(all): complete activity calendars, shop purchases and reward dispatch
Restore event and mini hubs, current shop and hunt calendars, and regular seasons; preserve all published windows. Implement story/quiz routes, native shop purchases, avatar sets, currencies, rank-change items and permanent buffs with rollback and reward coverage tests. Refresh client buff stats and update Cash Shop to 0.1.1.
2026-10-05 15:49:50 +08:00

29 lines
834 B
Go

package events
import (
"bd2server/internal/server/player"
"bd2server/internal/server/wire"
"fmt"
)
func (e *Economy) AttachOwnedItemDesign(d map[uint64]map[uint64]bool) { e.ownedDesign = d }
// ID card items are loaded through ItemInfo; there is no IdCardInfo ownership
// endpoint. AvatarInfo separately includes its owned ItemDBInfo list.
func (e *Economy) OwnedItemInfo(path string, req []byte) (int, []byte, bool, error) {
if path != "/AvatarInfo" {
return 0, nil, false, nil
}
seq, _, err := wire.Varint(req, 1)
if err != nil || seq == 0 {
return 467, nil, true, fmt.Errorf("events: missing sequence")
}
var out []byte
for _, item := range e.items.All() {
if item.Type == 49 || item.Type == 50 || item.Type == 61 {
out = wire.AppendBytes(out, 2, player.ItemWire(item))
}
}
return 467, out, true, nil
}