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"`
}
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 {
ObjID64 int64 `json:"obj_id"`
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
}
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) {
cwm := ChatWarsMessageStockAnyAck{}
items := []ChatWarsItems{}

View File

@ -474,6 +474,9 @@ func SQLIdentifyMsgWorker(id int, objIds <-chan int64) {
case objSubTypeMessageExchangeAck:
_, err := parseSubTypeMessageExchangeAck(m, rule.re)
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Parsing objSubTypeMessageExchangeAck.")
case objSubTypeMessageQuestResult:
_, err := parseSubTypeMessageQuestResult(m, rule.re)
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Parsing objSubTypeMessageQuestResult.")
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)
}