This commit is contained in:
shoopea 2019-05-20 22:16:49 +08:00
parent 779144ccc8
commit efc04717f7
4 changed files with 21 additions and 5 deletions

14
def.go
View File

@ -207,11 +207,15 @@ const (
objSubTypeMessageSellReq = 337 // /wts_xx (done) objSubTypeMessageSellReq = 337 // /wts_xx (done)
objSubTypeMessageOrderbookReq = 338 // /t_xx (done) objSubTypeMessageOrderbookReq = 338 // /t_xx (done)
objSubTypeMessageOrderbookAck = 339 // orderbook summary (not done) objSubTypeMessageOrderbookAck = 339 // orderbook summary (not done)
objSubTypeMessageWithdrawReq = 340 // /g_withdraw (not done) objSubTypeMessageWithdrawReq = 340 // /g_withdraw (done)
objSubTypeMessageWithdrawCode = 341 // code to receive (not done) objSubTypeMessageWithdrawCode = 341 // code to receive (done)
objSubTypeMessageWithdrawRcv = 342 // Received msg (not done) objSubTypeMessageWithdrawRcv = 342 // Received msg (done)
objSubTypeMessageDepositReq = 343 // /g_deposit (not done) objSubTypeMessageDepositReq = 343 // /g_deposit (done)
objSubTypeMessageDepositAck = 344 // Deposited successfully (not done) objSubTypeMessageDepositAck = 344 // Deposited successfully (done)
objSubTypeMessageStockReq = 345 // /stock (done)
objSubTypeMessageStockAck = 346 // result from /stock (not done)
objSubTypeMessageMiscReq = 347 // /misc (done)
objSubTypeMEssageMiscAck = 348 // result from /misc (not done)
objSubTypeJobPillage = 601 objSubTypeJobPillage = 601
objSubTypeJobTribute = 602 objSubTypeJobTribute = 602
objSubTypeJobStatus = 603 objSubTypeJobStatus = 603

View File

@ -94,6 +94,8 @@ func resetMsgParsingRules() {
,(5000, ` + strconv.Itoa(objSubTypeMessageDepositReq) + `, "Deposit Req", "^/g_deposit (?P<Item>[a-z0-9]+) (?P<Quantity>[0-9]+)$") ,(5000, ` + strconv.Itoa(objSubTypeMessageDepositReq) + `, "Deposit Req", "^/g_deposit (?P<Item>[a-z0-9]+) (?P<Quantity>[0-9]+)$")
,(5000, ` + strconv.Itoa(objSubTypeMessageDepositAck) + `, "Deposit Ack #2", "^Deposited successfully: (?P<Item>.*) \\((?P<Quantity>[0-9]+)\\)$") ,(5000, ` + strconv.Itoa(objSubTypeMessageDepositAck) + `, "Deposit Ack #2", "^Deposited successfully: (?P<Item>.*) \\((?P<Quantity>[0-9]+)\\)$")
,(5000, ` + strconv.Itoa(objSubTypeMessageDepositAck) + `, "Deposit Ack #1", "^Deposited (?P<Item>.*) \\((?P<Quantity>[0-9]+)\\) successfully$") ,(5000, ` + strconv.Itoa(objSubTypeMessageDepositAck) + `, "Deposit Ack #1", "^Deposited (?P<Item>.*) \\((?P<Quantity>[0-9]+)\\) successfully$")
,(5000, ` + strconv.Itoa(objSubTypeMessageStockReq) + `, "Stock Req", "^/stock$")
,(5000, ` + strconv.Itoa(objSubTypeMessageMiscReq) + `, "Misc Req", "^/misc$")
;`) ;`)
failOnError(err, "resetMsgParsingRules : populate table msg_rules") failOnError(err, "resetMsgParsingRules : populate table msg_rules")
} }

4
sql.go
View File

@ -365,6 +365,10 @@ func initDB() {
,(` + strconv.Itoa(objSubTypeMessageWithdrawRcv) + `, "withdraw_rcv", "Withdraw Received", ` + strconv.Itoa(objTypeMessage) + `) ,(` + strconv.Itoa(objSubTypeMessageWithdrawRcv) + `, "withdraw_rcv", "Withdraw Received", ` + strconv.Itoa(objTypeMessage) + `)
,(` + strconv.Itoa(objSubTypeMessageDepositReq) + `, "deposit_req", "Deposit Req", ` + strconv.Itoa(objTypeMessage) + `) ,(` + strconv.Itoa(objSubTypeMessageDepositReq) + `, "deposit_req", "Deposit Req", ` + strconv.Itoa(objTypeMessage) + `)
,(` + strconv.Itoa(objSubTypeMessageDepositAck) + `, "deposit_ack", "Deposit Ack", ` + strconv.Itoa(objTypeMessage) + `) ,(` + strconv.Itoa(objSubTypeMessageDepositAck) + `, "deposit_ack", "Deposit Ack", ` + strconv.Itoa(objTypeMessage) + `)
,(` + strconv.Itoa(objSubTypeMessageStockReq) + `, "stock_req", "Stock Req", ` + strconv.Itoa(objTypeMessage) + `)
,(` + strconv.Itoa(objSubTypeMessageStockAck) + `, "stock_ack", "Stock Ack", ` + strconv.Itoa(objTypeMessage) + `)
,(` + strconv.Itoa(objSubTypeMessageMiscReq) + `, "misc_req", "Misc Req", ` + strconv.Itoa(objTypeMessage) + `)
,(` + strconv.Itoa(objSubTypeMEssageMiscAck) + `, "misc_ack", "Misc Ack", ` + strconv.Itoa(objTypeMessage) + `)
,(` + strconv.Itoa(objSubTypeJobPillage) + `, "job_pillage", "Pillage job", ` + strconv.Itoa(objTypeJob) + `) ,(` + strconv.Itoa(objSubTypeJobPillage) + `, "job_pillage", "Pillage job", ` + strconv.Itoa(objTypeJob) + `)
,(` + strconv.Itoa(objSubTypeJobTribute) + `, "job_tribute", "Tribute job", ` + strconv.Itoa(objTypeJob) + `) ,(` + strconv.Itoa(objSubTypeJobTribute) + `, "job_tribute", "Tribute job", ` + strconv.Itoa(objTypeJob) + `)
,(` + strconv.Itoa(objSubTypeJobWithdrawal) + `, "job_withdraw", "Withdrawal job", ` + strconv.Itoa(objTypeJob) + `) ,(` + strconv.Itoa(objSubTypeJobWithdrawal) + `, "job_withdraw", "Withdrawal job", ` + strconv.Itoa(objTypeJob) + `)

View File

@ -211,6 +211,12 @@ func SQLIdentifyMsgWorker(id int, objIds <-chan int64) {
case objSubTypeMessageDepositAck: case objSubTypeMessageDepositAck:
err = setObjSubTypeId(objId, objSubTypeMessageDepositAck) err = setObjSubTypeId(objId, objSubTypeMessageDepositAck)
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : setObjSubTypeId(DepositAck)") logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : setObjSubTypeId(DepositAck)")
case objSubTypeMessageStockReq:
err = setObjSubTypeId(objId, objSubTypeMessageStockReq)
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : setObjSubTypeId(StockReq)")
case objSubTypeMessageMiscReq:
err = setObjSubTypeId(objId, objSubTypeMessageMiscReq)
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : setObjSubTypeId(MiscReq)")
case objSubTypeMessageAuctionAnnounce: case objSubTypeMessageAuctionAnnounce:
cwm := ChatWarsMessageAuctionAnnounce{ cwm := ChatWarsMessageAuctionAnnounce{
ObjID64: objId, ObjID64: objId,