update g deposit
This commit is contained in:
parent
6d3c4ceedf
commit
ebf928ca57
31
bot.go
31
bot.go
@ -638,12 +638,33 @@ func botGDepositAll(m *tb.Message) {
|
||||
Status: 0,
|
||||
}
|
||||
|
||||
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`01`, `Thread`))
|
||||
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`02`, `Stick`))
|
||||
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`03`, `Pelt`))
|
||||
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`04`, `Bone`))
|
||||
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`07`, `Powder`))
|
||||
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`08`, `Iron Ore`))
|
||||
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`09`, `Cloth`))
|
||||
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`39`, `Stinky Sumac`))
|
||||
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`s01`, `📕Scroll of Rage`))
|
||||
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`r01`, `Champion Sword recipe`))
|
||||
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`k01`, `Champion blade`))
|
||||
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`w07`, `Rapier`))
|
||||
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`10`, `Silver Ore`))
|
||||
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`11`, `Bauxite`))
|
||||
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`13`, `Magic Stone`))
|
||||
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`14`, `Wooden Shaft`))
|
||||
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`15`, `Sapphire`))
|
||||
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`17`, `Ruby`))
|
||||
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`18`, `Hardener`))
|
||||
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`19`, `Steel`))
|
||||
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`21`, `Bone Powder`))
|
||||
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`22`, `String`))
|
||||
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`23`, `Coke`))
|
||||
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`24`, `Purified Powder`))
|
||||
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`31`, `Rope`))
|
||||
/*
|
||||
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`39`, `Stinky Sumac`))
|
||||
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`s01`, `📕Scroll of Rage`))
|
||||
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`r01`, `Champion Sword recipe`))
|
||||
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`k01`, `Champion blade`))
|
||||
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`w07`, `Rapier`))
|
||||
*/
|
||||
|
||||
b, _ := json.Marshal(p)
|
||||
t := time.Now().UTC()
|
||||
|
5
job.go
5
job.go
@ -851,11 +851,10 @@ func jobGDeposit(j Job) {
|
||||
if cwm.Stock[stockIdx].ItemID64 == p.ResObjID64[resIdx] {
|
||||
log.Printf("jobGDeposit : objSubTypeMessageStockAck : Matching ItemID %d (%d).\n", p.ResObjID64[resIdx], cwm.Stock[stockIdx].Quantity)
|
||||
item, _ := getObjItem(p.ResObjID64[resIdx])
|
||||
clientSendCWMsg(p.ChatID64, fmt.Sprintf("/g_deposit %s 1", item.Code))
|
||||
clientSendCWMsg(p.ChatID64, fmt.Sprintf("/g_deposit %s %d", item.Code, cwm.Stock[stockIdx].Quantity))
|
||||
p2 := JobPayloadGDepositForward{
|
||||
ItemID64: p.ResObjID64[resIdx],
|
||||
Quantity: 1,
|
||||
//Quantity: cwm.Stock[stockIdx].Quantity,
|
||||
Quantity: cwm.Stock[stockIdx].Quantity,
|
||||
}
|
||||
b2, _ := json.Marshal(p2)
|
||||
err = createJobCallback(objSubTypeJobGDepositForward, j.UserID64, objSubTypeMessageGDepositAck, b2, time.Duration(1*time.Minute))
|
||||
|
@ -247,7 +247,7 @@ func MQTGCmdWorker(id int, cmds <-chan TGCommand) {
|
||||
if clt, ok := getLockedClient(c.FromUserID64, false); ok {
|
||||
j, err := json.Marshal(c)
|
||||
logOnError(err, "MQTGCmdWorker["+strconv.Itoa(id)+"] : Marshal(c)")
|
||||
log.Printf("MQTGCmdWorker["+strconv.Itoa(id)+"] : new command.\n%s\n", string(j))
|
||||
//log.Printf("MQTGCmdWorker["+strconv.Itoa(id)+"] : new command.\n%s\n", string(j))
|
||||
for clt.MQ.Connection.IsClosed() {
|
||||
clt.Active = false
|
||||
log.Printf("MQTGCmdWorker : Resetting MQ connection for #%d.\n", c.FromUserID64)
|
||||
@ -510,7 +510,7 @@ func JobWorker(id int, jobs <-chan Job) {
|
||||
//log.Printf("jobWorker[" + strconv.Itoa(id) + "] : Starting.")
|
||||
// FIXME : discard timed out jobs
|
||||
for j := range jobs {
|
||||
log.Printf("JobWorker[%d] : Starting job %d (timeout : %s).\n", id, j.ID64, j.Timeout.Format(time.RFC3339))
|
||||
//log.Printf("JobWorker[%d] : Starting job %d (timeout : %s).\n", id, j.ID64, j.Timeout.Format(time.RFC3339))
|
||||
if time.Now().UTC().Before(j.Timeout) {
|
||||
switch j.JobTypeID {
|
||||
case objSubTypeJobRescanMsg:
|
||||
|
Loading…
Reference in New Issue
Block a user