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,
|
func (this* hero) onMint(dbIdx int64, netId int32, contractAddress string, tokenId string,
|
||||||
from string, to string) bool {
|
from string, to string) bool {
|
||||||
var itemId, heroQuality int32
|
ok := this.internalSendMail(to, constant.MAIL_HERO_MINT, tokenId)
|
||||||
if !service.GetHeroByTokenId(tokenId, &itemId, &heroQuality) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
ok := this.internalSendMail(to, constant.MAIL_HERO_MINT, itemId, heroQuality)
|
|
||||||
return ok
|
return ok
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this* hero) onLock(dbIdx int64, netId int32, contractAddress string, tokenId string,
|
func (this* hero) onLock(dbIdx int64, netId int32, contractAddress string, tokenId string,
|
||||||
from string, to string) bool {
|
from string, to string) bool {
|
||||||
var itemId, heroQuality int32
|
ok := this.internalSendMail(from, constant.MAIL_HERO_LOCK, tokenId)
|
||||||
if !service.GetHeroByTokenId(tokenId, &itemId, &heroQuality) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
ok := this.internalSendMail(from, constant.MAIL_HERO_LOCK, itemId, heroQuality)
|
|
||||||
return ok
|
return ok
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *hero) onUnlock(dbIdx int64, netId int32, contractAddress string, tokenId string,
|
func (this *hero) onUnlock(dbIdx int64, netId int32, contractAddress string, tokenId string,
|
||||||
from string, to string) bool {
|
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
|
var itemId, heroQuality int32
|
||||||
if !service.GetHeroByTokenId(tokenId, &itemId, &heroQuality) {
|
if !service.GetHeroByTokenId(tokenId, &itemId, &heroQuality) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
ok := this.internalSendMail(to, constant.MAIL_HERO_UNLOCK, itemId, heroQuality)
|
itemMeta := mt.Table.Item.GetById(q5.ToInt64(itemId))
|
||||||
return ok
|
if itemMeta == nil {
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this* hero) internalSendMail(accountAddress string, mailName string, itemId int32, heroQuality int32) bool {
|
|
||||||
accountId := service.GetAccountIdByAddress(accountAddress)
|
accountId := service.GetAccountIdByAddress(accountAddress)
|
||||||
if accountId == "" {
|
if accountId == "" {
|
||||||
return true
|
return true
|
||||||
@ -49,10 +45,6 @@ func (this* hero) internalSendMail(accountAddress string, mailName string, itemI
|
|||||||
if mailMeta == nil {
|
if mailMeta == nil {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
itemMeta := mt.Table.Item.GetById(q5.ToInt64(itemId))
|
|
||||||
if itemMeta == nil {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user