1
This commit is contained in:
parent
2f89a8b2f0
commit
ed8d603742
@ -2,7 +2,7 @@ package mail
|
||||
|
||||
import (
|
||||
"f5"
|
||||
"fmt"
|
||||
//"fmt"
|
||||
"main/common"
|
||||
"main/constant"
|
||||
"q5"
|
||||
@ -48,6 +48,7 @@ func (mm *MailMgr) FetchMailFromDB() {
|
||||
var lastIdx int64 = 0
|
||||
|
||||
func (mm *MailMgr) LoadFromDB() {
|
||||
/*
|
||||
unixSec := time.Now().Unix()
|
||||
limit := 1000
|
||||
|
||||
@ -92,6 +93,7 @@ func (mm *MailMgr) LoadFromDB() {
|
||||
},
|
||||
)
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
func (mm *MailMgr) InternalGMDeleteMail(mailId int64) {
|
||||
|
@ -2,12 +2,12 @@ package player
|
||||
|
||||
import (
|
||||
"f5"
|
||||
"fmt"
|
||||
"google.golang.org/protobuf/proto"
|
||||
"main/constant"
|
||||
//"fmt"
|
||||
//"google.golang.org/protobuf/proto"
|
||||
//"main/constant"
|
||||
"main/global"
|
||||
"main/mail"
|
||||
"main/ss"
|
||||
//"main/ss"
|
||||
"q5"
|
||||
"strings"
|
||||
"sync"
|
||||
@ -134,6 +134,7 @@ func (p *Player) GetAttachment(mailIds string) []interface{} {
|
||||
return attachments
|
||||
}
|
||||
|
||||
/*
|
||||
func (p *Player) Deserialize(accountPB *ss.MFAccountData) {
|
||||
var nextDaySec int32 = 3600 * 24
|
||||
nowUnixSec := int32(time.Now().Unix())
|
||||
@ -169,8 +170,10 @@ func (p *Player) Deserialize(accountPB *ss.MFAccountData) {
|
||||
p.DeletedMailHash[deleteMail.mailId] = deleteMail
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
func (p *Player) Serialize(accountPB *ss.MFAccountData) {
|
||||
var nextDaySec int32 = 3600 * 24
|
||||
nowUnixSec := int32(time.Now().Unix())
|
||||
@ -196,6 +199,7 @@ func (p *Player) Serialize(accountPB *ss.MFAccountData) {
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
func (p *Player) UpdateExpire() {
|
||||
p.CacheExpiration = time.Now().Add(20 * time.Second)
|
||||
@ -230,7 +234,7 @@ func (p *Player) ScheduleSave() {
|
||||
p.Lock()
|
||||
defer p.Unlock()
|
||||
if p.dirty {
|
||||
p.SaveToDB() // Persistence, Save TO DB
|
||||
//p.SaveToDB() // Persistence, Save TO DB
|
||||
p.dirty = false // 重置标志
|
||||
}
|
||||
}
|
||||
@ -238,6 +242,7 @@ func (p *Player) ScheduleSave() {
|
||||
p.attacher)
|
||||
}
|
||||
|
||||
/*
|
||||
func (p *Player) SaveToDB() {
|
||||
accountPB := ss.MFAccountData{}
|
||||
p.Serialize(&accountPB)
|
||||
@ -260,4 +265,5 @@ func (p *Player) SaveToDB() {
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
@ -3,10 +3,10 @@ package player
|
||||
import (
|
||||
"f5"
|
||||
"fmt"
|
||||
"github.com/golang/protobuf/proto"
|
||||
//"github.com/golang/protobuf/proto"
|
||||
"main/constant"
|
||||
"main/ss"
|
||||
"q5"
|
||||
//"main/ss"
|
||||
//"q5"
|
||||
)
|
||||
|
||||
func (pm *PlayerMgr) LoadPlayer(accountId string, cb func(err error, p *Player)) {
|
||||
@ -20,6 +20,7 @@ func (pm *PlayerMgr) LoadPlayer(accountId string, cb func(err error, p *Player))
|
||||
cb(fmt.Errorf("loadPlayer err"), nil)
|
||||
return
|
||||
}
|
||||
/*
|
||||
if rows.Next() {
|
||||
aId := q5.ToString(*rows.GetByName("accountid"))
|
||||
data := q5.ToString(*rows.GetByName("blobdata"))
|
||||
@ -31,7 +32,7 @@ func (pm *PlayerMgr) LoadPlayer(accountId string, cb func(err error, p *Player))
|
||||
cb(nil, profile)
|
||||
} else {
|
||||
cb(fmt.Errorf("player nil"), nil)
|
||||
}
|
||||
}*/
|
||||
},
|
||||
)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user