limiteditems.go 505 B

1234567891011121314151617181920212223242526
  1. package limiteditems
  2. import (
  3. "bet24.com/log"
  4. )
  5. func Run() {
  6. getManager()
  7. }
  8. func Dump(param1, param2 string) {
  9. getManager().dump(param1, param2)
  10. }
  11. // 添加道具,返回可添加数量
  12. func AddItem(userId int, itemId int, count int) int {
  13. newCount := getManager().addItem(userId, itemId, count)
  14. if newCount != count {
  15. log.Debug("limiteditems.AddItem userId[%d] itemId[%d],count[%d],newCount[%d]", userId, itemId, count, newCount)
  16. }
  17. return newCount
  18. }
  19. func Flush() {
  20. getManager().flush()
  21. }