setup for quest result messages

This commit is contained in:
shoopea 2019-10-03 11:35:24 +08:00
parent ffe84fd4e2
commit 309454e67a
3 changed files with 19 additions and 0 deletions

9
def.go
View File

@ -190,6 +190,15 @@ type ChatWarsMessageGoQuestAck struct {
Duration time.Duration `json:"duration"` Duration time.Duration `json:"duration"`
} }
type ChatWarsMessagesQuestRes struct {
Msg *ChatWarsMessage `json:"msg"`
Gold int64 `json:"gold"`
Exp int64 `json:"exp"`
Loot []ChatWarsItems `json:"loot"`
RegenStamina bool `json:"regen_stamina"`
LostTorch bool `json:"lost_torch"`
}
type ChatWarsMessageDuelFight struct { type ChatWarsMessageDuelFight struct {
ObjID64 int64 `json:"obj_id"` ObjID64 int64 `json:"obj_id"`
WinCastle string `json:"win_castle"` WinCastle string `json:"win_castle"`

7
msg.go
View File

@ -55,6 +55,13 @@ func parseSubTypeMessageExchangeAck(m *ChatWarsMessage, r *regexp.Regexp) (*Chat
return &cwm, nil return &cwm, nil
} }
func parseSubTypeMessageQuestResult(m *ChatWarsMessage, r *regexp.Regexp) (*ChatWarsMessageQuestResult, error) {
cwm := ChatWarsMessageQuestResult{}
cwm.Msg = m
return &cwm, nil
}
func parseSubTypeMessageStockAnyAck(m *ChatWarsMessage, r *regexp.Regexp) (*ChatWarsMessageStockAnyAck, error) { func parseSubTypeMessageStockAnyAck(m *ChatWarsMessage, r *regexp.Regexp) (*ChatWarsMessageStockAnyAck, error) {
cwm := ChatWarsMessageStockAnyAck{} cwm := ChatWarsMessageStockAnyAck{}
items := []ChatWarsItems{} items := []ChatWarsItems{}

View File

@ -474,6 +474,9 @@ func SQLIdentifyMsgWorker(id int, objIds <-chan int64) {
case objSubTypeMessageExchangeAck: case objSubTypeMessageExchangeAck:
_, err := parseSubTypeMessageExchangeAck(m, rule.re) _, err := parseSubTypeMessageExchangeAck(m, rule.re)
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Parsing objSubTypeMessageExchangeAck.") logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Parsing objSubTypeMessageExchangeAck.")
case objSubTypeMessageQuestResult:
_, err := parseSubTypeMessageQuestResult(m, rule.re)
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Parsing objSubTypeMessageQuestResult.")
default: default:
//log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Unknwon message type in rule %d : %d (%d)\n%s\n", msgParsingRules[i].ID, msgParsingRules[i].MsgTypeID, objId, m.Text) //log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Unknwon message type in rule %d : %d (%d)\n%s\n", msgParsingRules[i].ID, msgParsingRules[i].MsgTypeID, objId, m.Text)
} }