setup for quest result messages
This commit is contained in:
parent
ffe84fd4e2
commit
309454e67a
9
def.go
9
def.go
@ -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
7
msg.go
@ -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{}
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user