update cron with tributes
This commit is contained in:
parent
7b28951acb
commit
fba88dfc42
12
cron.go
12
cron.go
@ -14,6 +14,7 @@ func startCron() *cron.Cron {
|
|||||||
c.AddFunc("58 6,14,22 * * *", cronSetDef)
|
c.AddFunc("58 6,14,22 * * *", cronSetDef)
|
||||||
c.AddFunc("02 1,3,5,9,11,13,17,19,21 * * *", cronGetHammerTime)
|
c.AddFunc("02 1,3,5,9,11,13,17,19,21 * * *", cronGetHammerTime)
|
||||||
c.AddFunc("10 7,15,23 * * *", cronGetHammerTime)
|
c.AddFunc("10 7,15,23 * * *", cronGetHammerTime)
|
||||||
|
c.AddFunc("13 3, 7, 11, 15, 19, 23 * * *", cronTribute)
|
||||||
c.Start()
|
c.Start()
|
||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
@ -40,6 +41,17 @@ func cronSendWarReport() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func cronSendWarReport() {
|
||||||
|
muxClients.RLock()
|
||||||
|
for _, c := range clients {
|
||||||
|
if c.Active && c.Class == `Knight` {
|
||||||
|
clientSendCWMsgDelay(c.TGUserID64, `/tributes`, 0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
muxClients.RUnlock()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func cronSetDef() {
|
func cronSetDef() {
|
||||||
muxClients.RLock()
|
muxClients.RLock()
|
||||||
for _, c := range clients {
|
for _, c := range clients {
|
||||||
|
@ -539,6 +539,11 @@
|
|||||||
"name": "NY 2020 Event Fight is over",
|
"name": "NY 2020 Event Fight is over",
|
||||||
"obj_type": "msg"
|
"obj_type": "msg"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"intl_id": "msg_ny2020_round_done",
|
||||||
|
"name": "NY 2020 Event Round finished",
|
||||||
|
"obj_type": "msg"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"intl_id": "job_pillage",
|
"intl_id": "job_pillage",
|
||||||
"name": "Pillage job",
|
"name": "Pillage job",
|
||||||
|
@ -1774,5 +1774,13 @@
|
|||||||
"msg_type": "msg_ny2020_fight_over",
|
"msg_type": "msg_ny2020_fight_over",
|
||||||
"chat_id": -1001198527605,
|
"chat_id": -1001198527605,
|
||||||
"user_id": 841616455
|
"user_id": 841616455
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"prio": 5000,
|
||||||
|
"descn": "NY2020 Event Round Done",
|
||||||
|
"rule": "^Green creatures are eliminated\\. But slack not\\! There will be an another party\\! All the icicles became timeless\\!",
|
||||||
|
"msg_type": "msg_ny2020_round_done",
|
||||||
|
"chat_id": -1001198527605,
|
||||||
|
"user_id": 841616455
|
||||||
}
|
}
|
||||||
]
|
]
|
1
msg.go
1
msg.go
@ -273,6 +273,7 @@ func parseSubTypeMessageMeAck(m *ChatWarsMessage, r *regexp.Regexp) (*ChatWarsMe
|
|||||||
CWUserID64: getObjUserID(r.ReplaceAllString(m.Text, "${Player}")),
|
CWUserID64: getObjUserID(r.ReplaceAllString(m.Text, "${Player}")),
|
||||||
CWGuildID64: getObjGuildID(r.ReplaceAllString(m.Text, "${Guild}")),
|
CWGuildID64: getObjGuildID(r.ReplaceAllString(m.Text, "${Guild}")),
|
||||||
State: r.ReplaceAllString(m.Text, "${State}"),
|
State: r.ReplaceAllString(m.Text, "${State}"),
|
||||||
|
Class: r.ReplaceAllString(m.Text, "${Class}"),
|
||||||
}
|
}
|
||||||
i, _ = strconv.ParseInt(r.ReplaceAllString(m.Text, "${ExpNow}"), 10, 64)
|
i, _ = strconv.ParseInt(r.ReplaceAllString(m.Text, "${ExpNow}"), 10, 64)
|
||||||
cwm.ExpNow = i
|
cwm.ExpNow = i
|
||||||
|
Loading…
Reference in New Issue
Block a user