test
This commit is contained in:
parent
e5295068be
commit
35f6359d1f
@ -21,6 +21,7 @@ ChirpNestBot
|
||||
- [ ] Vault valuation
|
||||
- [ ] Experience graphs & forecast
|
||||
- [ ] Impersonate
|
||||
- [ ] Link TelegramUserID and UserID
|
||||
- [x] Foray interception
|
||||
- [x] Export/import all messages
|
||||
- [x] Test HTML in message
|
||||
@ -30,4 +31,5 @@ ChirpNestBot
|
||||
- [x] Rewrite MQ connection handling for clients/keep alive/msg recv
|
||||
- Progression :
|
||||
- 0 -> 4 : Forest + Foray ;
|
||||
- 5 -> 20 : Forest + Foray + Arena ;
|
||||
- 5 -> 19 : Forest + Foray + Arena ;
|
||||
- 20 -> .. : Forest + Swamp + Valley + Foray + Arena.
|
11
client.go
11
client.go
@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
@ -115,3 +116,13 @@ func clientMsgGRolesAck(m *ChatWarsMessageGRolesAck) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func clientGetUserID64(tgUserID64 int64) (int64, error) {
|
||||
if _, ok := clientsQueue[tgUserID64]; ok {
|
||||
if v, ok := clientsCW.Load(tgUserID64); ok {
|
||||
c := v.(*ChatWarsClient)
|
||||
return c.UserID64, nil
|
||||
}
|
||||
}
|
||||
return 0, errors.New("Unknown user_id.")
|
||||
}
|
||||
|
@ -400,8 +400,13 @@ func SQLIdentifyMsgWorker(id int, objIds <-chan int64) {
|
||||
cwm, err := parseSubTypeMessageGoQuestAck(m, r)
|
||||
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Parsing objSubTypeMessageMeAck.")
|
||||
cwm.Msg = m
|
||||
clientMsgGoQuestAck(cwm)
|
||||
_, err = addObjQuest(m.UserID64, cwm.QuestTypeID, cwm.Duration, m.Date.UTC())
|
||||
uid, err := clientGetUserID64(cwm.UserID64)
|
||||
if err != nil {
|
||||
err = setObjSubTypeId(objId, objSubTypeMessageUnknown)
|
||||
} else {
|
||||
clientMsgGoQuestAck(cwm)
|
||||
_, err = addObjQuest(cwm.UserID64, cwm.QuestTypeID, cwm.Duration, m.Date.UTC())
|
||||
}
|
||||
case objSubTypeMessageDuelFight:
|
||||
cwm, err := parseSubTypeMessageDuelFight(m, r)
|
||||
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Parsing objSubTypeMessageDuelFight.")
|
||||
|
Loading…
Reference in New Issue
Block a user