This commit is contained in:
shoopea 2019-12-15 16:28:05 +08:00
parent 22c1f977b2
commit 7dca664ba6
2 changed files with 5 additions and 4 deletions

View File

@ -30,6 +30,8 @@ func setClientIdle(userID64 int64, from time.Time) error {
clt.CWBusyUntil = from
clt.CWIdle = true
clt.CWLastUpdate = from
} else {
fmt.Printf("setClientIdle : not updated.\n")
}
clt.Mux.Unlock()
return nil
@ -147,6 +149,9 @@ func clientMsgMeAck(m *ChatWarsMessageMeAck) {
if getObjGuildID(``) != m.CWGuildID64 && strings.Compare(clt.CWRole, ``) == 0 {
clientSendCWMsg(m.Msg.TGUserID64, "/g_roles")
}
if m.State == `🛌Rest` {
clt.CWIdle = true
}
}
}
clt.Mux.Unlock()

View File

@ -429,10 +429,6 @@ func SQLIdentifyMsgWorker(id int, objIds <-chan int64) {
clientMsgMeAck(cwm)
_, err = addObjXP(cwm.CWUserID64, cwm.ExpNow, cwm.ExpLvl, cwm.Level, m.Date)
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : addObjXP(MeAck)")
if cwm.State == `🛌Rest` {
err = setClientIdle(m.TGUserID64, cwm.Msg.Date.UTC())
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : setClientIdle")
}
case objSubTypeMessageGoQuestAck:
cwm, err := parseSubTypeMessageGoQuestAck(m, rule.re)
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Parsing objSubTypeMessageGoQuestAck.")