1
This commit is contained in:
parent
3559513aea
commit
f8c94c32b7
@ -12,35 +12,31 @@ type hero struct {
|
||||
|
||||
func (this* hero) onMint(dbIdx int64, netId int32, contractAddress string, tokenId string,
|
||||
from string, to string) bool {
|
||||
var itemId, heroQuality int32
|
||||
if !service.GetHeroByTokenId(tokenId, &itemId, &heroQuality) {
|
||||
return true
|
||||
}
|
||||
ok := this.internalSendMail(to, constant.MAIL_HERO_MINT, itemId, heroQuality)
|
||||
ok := this.internalSendMail(to, constant.MAIL_HERO_MINT, tokenId)
|
||||
return ok
|
||||
}
|
||||
|
||||
func (this* hero) onLock(dbIdx int64, netId int32, contractAddress string, tokenId string,
|
||||
from string, to string) bool {
|
||||
var itemId, heroQuality int32
|
||||
if !service.GetHeroByTokenId(tokenId, &itemId, &heroQuality) {
|
||||
return true
|
||||
}
|
||||
ok := this.internalSendMail(from, constant.MAIL_HERO_LOCK, itemId, heroQuality)
|
||||
ok := this.internalSendMail(from, constant.MAIL_HERO_LOCK, tokenId)
|
||||
return ok
|
||||
}
|
||||
|
||||
func (this *hero) onUnlock(dbIdx int64, netId int32, contractAddress string, tokenId string,
|
||||
from string, to string) bool {
|
||||
ok := this.internalSendMail(to, constant.MAIL_HERO_UNLOCK, tokenId)
|
||||
return ok
|
||||
}
|
||||
|
||||
func (this* hero) internalSendMail(accountAddress string, mailName string, tokenId string) bool {
|
||||
var itemId, heroQuality int32
|
||||
if !service.GetHeroByTokenId(tokenId, &itemId, &heroQuality) {
|
||||
return true
|
||||
}
|
||||
ok := this.internalSendMail(to, constant.MAIL_HERO_UNLOCK, itemId, heroQuality)
|
||||
return ok
|
||||
}
|
||||
|
||||
func (this* hero) internalSendMail(accountAddress string, mailName string, itemId int32, heroQuality int32) bool {
|
||||
itemMeta := mt.Table.Item.GetById(q5.ToInt64(itemId))
|
||||
if itemMeta == nil {
|
||||
return true
|
||||
}
|
||||
accountId := service.GetAccountIdByAddress(accountAddress)
|
||||
if accountId == "" {
|
||||
return true
|
||||
@ -49,10 +45,6 @@ func (this* hero) internalSendMail(accountAddress string, mailName string, itemI
|
||||
if mailMeta == nil {
|
||||
return true
|
||||
}
|
||||
itemMeta := mt.Table.Item.GetById(q5.ToInt64(itemId))
|
||||
if itemMeta == nil {
|
||||
return true
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user