test
This commit is contained in:
parent
e5295068be
commit
35f6359d1f
@ -21,6 +21,7 @@ ChirpNestBot
|
|||||||
- [ ] Vault valuation
|
- [ ] Vault valuation
|
||||||
- [ ] Experience graphs & forecast
|
- [ ] Experience graphs & forecast
|
||||||
- [ ] Impersonate
|
- [ ] Impersonate
|
||||||
|
- [ ] Link TelegramUserID and UserID
|
||||||
- [x] Foray interception
|
- [x] Foray interception
|
||||||
- [x] Export/import all messages
|
- [x] Export/import all messages
|
||||||
- [x] Test HTML in message
|
- [x] Test HTML in message
|
||||||
@ -30,4 +31,5 @@ ChirpNestBot
|
|||||||
- [x] Rewrite MQ connection handling for clients/keep alive/msg recv
|
- [x] Rewrite MQ connection handling for clients/keep alive/msg recv
|
||||||
- Progression :
|
- Progression :
|
||||||
- 0 -> 4 : Forest + Foray ;
|
- 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
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"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)
|
cwm, err := parseSubTypeMessageGoQuestAck(m, r)
|
||||||
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Parsing objSubTypeMessageMeAck.")
|
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Parsing objSubTypeMessageMeAck.")
|
||||||
cwm.Msg = m
|
cwm.Msg = m
|
||||||
clientMsgGoQuestAck(cwm)
|
uid, err := clientGetUserID64(cwm.UserID64)
|
||||||
_, err = addObjQuest(m.UserID64, cwm.QuestTypeID, cwm.Duration, m.Date.UTC())
|
if err != nil {
|
||||||
|
err = setObjSubTypeId(objId, objSubTypeMessageUnknown)
|
||||||
|
} else {
|
||||||
|
clientMsgGoQuestAck(cwm)
|
||||||
|
_, err = addObjQuest(cwm.UserID64, cwm.QuestTypeID, cwm.Duration, m.Date.UTC())
|
||||||
|
}
|
||||||
case objSubTypeMessageDuelFight:
|
case objSubTypeMessageDuelFight:
|
||||||
cwm, err := parseSubTypeMessageDuelFight(m, r)
|
cwm, err := parseSubTypeMessageDuelFight(m, r)
|
||||||
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Parsing objSubTypeMessageDuelFight.")
|
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Parsing objSubTypeMessageDuelFight.")
|
||||||
|
Loading…
Reference in New Issue
Block a user