From b8b875748f81842dc379cc828c39ed71afe2250b Mon Sep 17 00:00:00 2001 From: shoopea Date: Mon, 8 Jul 2019 18:29:23 +0800 Subject: [PATCH] test --- README.md | 6 +++--- def.go | 4 +++- msg.go | 10 +++++++--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index f72167b..a3c0333 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ ChirpNestBot - [ ] Check for not launching concurrent msg rescan jobs -- [ ] MQTGCmdWorker[2] : Publishing message.: Exception (504) Reason: "channel/connection is not open" (add check in MQKeepAliveWorker ?) -- [ ] Rewrite MQ connection handling for clients/keep alive/msg recv - [ ] Make sure refresh message receives the message later (jobMsgRefresh) - [ ] Adjust /time clock for auctions/... (delay between cw and real time ?) - [ ] Update old auctions with client @@ -28,6 +26,8 @@ ChirpNestBot - [x] Test HTML in message - [x] Update auction from broadcast - [x] Items parsing/identification +- [x] MQTGCmdWorker[2] : Publishing message.: Exception (504) Reason: "channel/connection is not open" (add check in MQKeepAliveWorker ?) +- [x] Rewrite MQ connection handling for clients/keep alive/msg recv - Progression : - 0 -> 4 : Forest + Foray ; - - 5 -> 10 : Forest + Foray + Arena ; \ No newline at end of file + - 5 -> 20 : Forest + Foray + Arena ; \ No newline at end of file diff --git a/def.go b/def.go index 9260622..690f56a 100644 --- a/def.go +++ b/def.go @@ -121,7 +121,9 @@ type ChatWarsMessageGRolesAck struct { } type ChatWarsMessageGoQuestAck struct { - ObjID64 int64 `json:"obj_id"` + ObjID64 int64 `json:"obj_id"` + Quest string `json:"quest"` + Duration time.Duration `json:"duration"` } type ChatWarsMessageDuelFight struct { diff --git a/msg.go b/msg.go index 4d49ece..e91e924 100644 --- a/msg.go +++ b/msg.go @@ -166,9 +166,13 @@ func parseSubTypeMessageGRolesAck(m *ChatWarsMessage, r *regexp.Regexp) (*ChatWa func parseSubTypeMessageGoQuestAck(m *ChatWarsMessage, r *regexp.Regexp) (*ChatWarsMessageGoQuestAck, error) { cwm := ChatWarsMessageGoQuestAck{} - log.Printf("parseSubTypeMessageGoQuestAck : Go Quest Ack report identified\n") - log.Printf("parseSubTypeMessageGoQuestAck : Place : %s\n", r.ReplaceAllString(m.Text, "${Place}")) - log.Printf("parseSubTypeMessageGoQuestAck : Time : %s\n", r.ReplaceAllString(m.Text, "${Time}")) + /* + log.Printf("parseSubTypeMessageGoQuestAck : Go Quest Ack report identified\n") + log.Printf("parseSubTypeMessageGoQuestAck : Place : %s\n", r.ReplaceAllString(m.Text, "${Place}")) + log.Printf("parseSubTypeMessageGoQuestAck : Time : %s\n", r.ReplaceAllString(m.Text, "${Time}")) + */ + cwm.Quest = strings.ToLower(r.ReplaceAllString(m.Text, "${Place}")) + cwm.Duration, _ = strconv.ParseInt(r.ReplaceAllString(m.Text, "${Time}"), 10, 64) return &cwm, nil }