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