Files
bd2/go/internal/server/events/owned_items.go
T
Flechazo d8771caef2 feat(all): add hunting and events, commerce and rewards, binary calendars, GameData caching and login diagnostics
Implement hunting AP and progress, event tasks, exchanges, games, stories and actions; connect battle and reward handling.

Add CashShop plugin and installation, server purchases and entitlements, recharge rules and plugin version metadata.

Distribute binary calendars independently; cache GameData in memory and fix single-connection query deadlocks.

Improve automatic login and recovery diagnostics; document configuration and release flows.
2026-10-05 11:50:31 +08:00

29 lines
796 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 {
out = wire.AppendBytes(out, 2, player.ItemWire(item))
}
}
return 467, out, true, nil
}