Files
bd2/go/internal/server/transport/commerce.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

24 lines
657 B
Go

package transport
import (
"encoding/json"
"net/http"
)
func (h HTTP) clientCommerce(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodGet {
w.Header().Set("Allow", http.MethodGet)
http.Error(w, "GET required", http.StatusMethodNotAllowed)
return
}
if h.CommerceManifest == nil {
http.Error(w, "server purchases are unavailable", http.StatusServiceUnavailable)
return
}
w.Header().Set("Content-Type", "application/json; charset=utf-8")
w.Header().Set("Cache-Control", "no-store")
if err := json.NewEncoder(w).Encode(h.CommerceManifest()); err != nil {
h.logger().Error("encode commerce manifest", "error", err)
}
}