This commit is contained in:
aozhiwei 2024-09-02 17:42:56 +08:00
parent a664fdb7f9
commit ca8b36b071
2 changed files with 4 additions and 26 deletions

View File

@ -34,6 +34,7 @@ const (
CONTRACT_NAME_FounderTag = "FounderTag" CONTRACT_NAME_FounderTag = "FounderTag"
CONTRACT_NAME_NFTLock = "NFTLock" CONTRACT_NAME_NFTLock = "NFTLock"
CONTRACT_NAME_GameItemMall = "GameItemMall" CONTRACT_NAME_GameItemMall = "GameItemMall"
CONTRACT_NAME_RewardRouter = "rewardRouter"
) )
const ( const (

View File

@ -4,9 +4,7 @@ import (
"q5" "q5"
"f5" "f5"
"main/mt" "main/mt"
"main/service"
"jccommon" "jccommon"
"time"
) )
type stackingCec struct { type stackingCec struct {
@ -20,9 +18,9 @@ type accountStackingCec struct {
func (this* stackingCec) init() { func (this* stackingCec) init() {
this.lockMetas = []*mt.Contract{} this.lockMetas = []*mt.Contract{}
mt.Table.Contract.Traverse(func (ele *mt.Contract) bool { mt.Table.Contract.Traverse(func (ele *mt.Contract) bool {
if ele.GetName() == jccommon.CONTRACT_NAME_NFTLock { if ele.GetName() == jccommon.CONTRACT_NAME_RewardRouter {
q5.AppendSlice(&this.lockMetas, ele) q5.AppendSlice(&this.lockMetas, ele)
f5.GetSysLog().Info("task.contribution.init load lockMetas net_id:%d name:%s contract_address:%s", f5.GetSysLog().Info("task.rewardRouter.init load lockMetas net_id:%d name:%s contract_address:%s",
ele.GetNetId(), ele.GetNetId(),
ele.GetName(), ele.GetName(),
ele.GetAddress()) ele.GetAddress())
@ -30,34 +28,14 @@ func (this* stackingCec) init() {
return true return true
}) })
if len(this.lockMetas) <= 0 { if len(this.lockMetas) <= 0 {
panic("task.contribution.init lockMetas is empty") panic("task.rewardRouter.init lockMetas is empty")
return return
} }
go this.calc()
} }
func (this* stackingCec) unInit() { func (this* stackingCec) unInit() {
} }
func (this* stackingCec) stat(statTime int64, nowTime int64) {
}
func (this* stackingCec) calc() {
for true {
nowTime := f5.GetApp().GetRealSeconds()
this.stat(nowTime - 3600 * 24, nowTime)
nowTime = f5.GetApp().GetRealSeconds()
daySeconds := q5.GetDaySeconds(nowTime, 0)
sleepTime := daySeconds + 3600 * 24 - nowTime + 3
time.Sleep(time.Second * time.Duration(sleepTime))
}
}
func (this* stackingCec) isStatEd(statDaySeconds int64) (error, bool) {
return nil, false
}
func (this* stackingCec) loadFromDb(addressHash *q5.ConcurrentMap[string, *accountStackingCec], func (this* stackingCec) loadFromDb(addressHash *q5.ConcurrentMap[string, *accountStackingCec],
ds *f5.DataSet) bool { ds *f5.DataSet) bool {
accountAddress := ds.GetByName("last_lock_address") accountAddress := ds.GetByName("last_lock_address")
@ -85,4 +63,3 @@ func (this* stackingCec) loadFromDb(addressHash *q5.ConcurrentMap[string, *accou
func (this* stackingCec) saveToDb() { func (this* stackingCec) saveToDb() {
} }
,