This commit is contained in:
shoopea 2019-05-19 14:35:26 +08:00
parent 4d7f6de54d
commit cec0421f04
4 changed files with 19 additions and 1 deletions

3
def.go
View File

@ -193,6 +193,9 @@ const (
objSubTypeMessageGoArena = 333 // 📯Arena (not done)
objSubTypeMessageTop = 334 // any /topXX (not done)
objSubTypeMessageMenu = 335 // main menu (not done)
objSubTypeMessageBuyReq = 336 // /wtb_xx (done)
objSubTypeMessageSellReq = 337 // /wts_xx (done)
objSubTypeMessageOrderbookReq = 338 // /t_xx (done)
objSubTypeJobPillage = 601
objSubTypeJobTribute = 602
objSubTypeJobStatus = 603

View File

@ -55,7 +55,10 @@ func resetMsgParsingRules() {
,(5000, ` + strconv.Itoa(objSubTypeMessageMeReq) + `, "Me request", "^🏅Me$")
,(5000, ` + strconv.Itoa(objSubTypeMessageInventoryReq) + `, "Inventory request", "^/inv$")
,(5000, ` + strconv.Itoa(objSubTypeMessageTimeReq) + `, "Time request", "^/time$")
,(5000, ` + strconv.Itoa(objSubTypeMessagePledge) + `, "Time request", "^/pledge$")
,(5000, ` + strconv.Itoa(objSubTypeMessagePledge) + `, "Pledge", "^/pledge$")
,(5000, ` + strconv.Itoa(objSubTypeMessageBuyReq) + `, "Buy request", "^/wtb_(?P<Item>[0-9]+)_(?P<Quantity>[0-9]+)$")
,(5000, ` + strconv.Itoa(objSubTypeMessageSellReq) + `, "Sell request", "^/wts_(?P<Item>[0-9]+)_(?P<Quantity>[0-9]+)(_(?P<Price>[0-9]+)){0,1}$")
,(5000, ` + strconv.Itoa(objSubTypeMessageOrderbookReq) + `, "Orderbook request", "^/t_(?P<Item>[0-9]+)$")
;`)
failOnError(err, "resetMsgParsingRules : populate table msg_rules")
}

3
sql.go
View File

@ -337,6 +337,9 @@ func initDB() {
,(` + strconv.Itoa(objSubTypeMessageGoArena) + `, "go_arena", "Go arena", ` + strconv.Itoa(objTypeMessage) + `)
,(` + strconv.Itoa(objSubTypeMessageTop) + `, "top", "Top", ` + strconv.Itoa(objTypeMessage) + `)
,(` + strconv.Itoa(objSubTypeMessageMenu) + `, "menu", "Menu", ` + strconv.Itoa(objTypeMessage) + `)
,(` + strconv.Itoa(objSubTypeMessageBuyReq) + `, "buy_req", "Sell Req", ` + strconv.Itoa(objTypeMessage) + `)
,(` + strconv.Itoa(objSubTypeMessageSellReq) + `, "sell_req", "Buy Req", ` + strconv.Itoa(objTypeMessage) + `)
,(` + strconv.Itoa(objSubTypeMessageOrderbookReq) + `, "orderbook_req", "Buy Req", ` + strconv.Itoa(objTypeMessage) + `)
,(` + strconv.Itoa(objSubTypeJobPillage) + `, "job_pillage", "Pillage job", ` + strconv.Itoa(objTypeJob) + `)
,(` + strconv.Itoa(objSubTypeJobTribute) + `, "job_tribute", "Tribute job", ` + strconv.Itoa(objTypeJob) + `)
,(` + strconv.Itoa(objSubTypeJobWithdrawal) + `, "job_withdraw", "Withdrawal job", ` + strconv.Itoa(objTypeJob) + `)

View File

@ -182,6 +182,15 @@ func SQLIdentifyMsgWorker(id int, objIds <-chan int64) {
case objSubTypeMessageMenu:
err = setObjSubTypeId(objId, objSubTypeMessageMenu)
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : setObjSubTypeId(Menu)")
case objSubTypeMessageBuyReq:
err = setObjSubTypeId(objId, objSubTypeMessageBuyReq)
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : setObjSubTypeId(BuyReq)")
case objSubTypeMessageSellReq:
err = setObjSubTypeId(objId, objSubTypeMessageSellReq)
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : setObjSubTypeId(SellReq)")
case objSubTypeMessageOrderbookReq:
err = setObjSubTypeId(objId, objSubTypeMessageOrderbookReq)
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : setObjSubTypeId(OrderbookReq)")
case objSubTypeMessageAuctionAnnounce:
cwm := ChatWarsMessageAuctionAnnounce{
ObjID64: objId,