This commit is contained in:
shoopea 2019-05-30 16:55:38 +08:00
parent d4111c7842
commit 40579dc0e8

12
msg.go
View File

@ -69,24 +69,36 @@ func parseSubTypeMessageGRolesAck(m *ChatWarsMessage, r *regexp.Regexp) (*ChatWa
if strings.compare(`[unassigned]`, r.ReplaceAllString(m.Text, "${Bartender}")) != 0 { if strings.compare(`[unassigned]`, r.ReplaceAllString(m.Text, "${Bartender}")) != 0 {
s := r.ReplaceAllString(m.Text, "${Bartender}") s := r.ReplaceAllString(m.Text, "${Bartender}")
cwm.BartenderID64 = getObjUserID(s[1:]) cwm.BartenderID64 = getObjUserID(s[1:])
} else {
cwm.BartenderID64 = 0
} }
if strings.compare(`[unassigned]`, r.ReplaceAllString(m.Text, "${Commander}")) != 0 { if strings.compare(`[unassigned]`, r.ReplaceAllString(m.Text, "${Commander}")) != 0 {
s := r.ReplaceAllString(m.Text, "${Commander}") s := r.ReplaceAllString(m.Text, "${Commander}")
cwm.CommanderID64 = getObjUserID(s[1:]) cwm.CommanderID64 = getObjUserID(s[1:])
} else {
cwm.CommanderID64 = 0
} }
if strings.compare(`[unassigned]`, r.ReplaceAllString(m.Text, "${Squire}")) != 0 { if strings.compare(`[unassigned]`, r.ReplaceAllString(m.Text, "${Squire}")) != 0 {
s := r.ReplaceAllString(m.Text, "${Bartender}") s := r.ReplaceAllString(m.Text, "${Bartender}")
cwm.SquireID64 = getObjUserID(s[1:]) cwm.SquireID64 = getObjUserID(s[1:])
} else {
cwm.SquireID64 = 0
} }
if strings.compare(`[unassigned]`, r.ReplaceAllString(m.Text, "${Treasurer}")) != 0 { if strings.compare(`[unassigned]`, r.ReplaceAllString(m.Text, "${Treasurer}")) != 0 {
s := r.ReplaceAllString(m.Text, "${Bartender}") s := r.ReplaceAllString(m.Text, "${Bartender}")
cwm.TreasurerID64 = getObjUserID(s[1:]) cwm.TreasurerID64 = getObjUserID(s[1:])
} else {
cwm.TreasurerID64 = 0
} }
log.Printf("parseSubTypeMessageGRolesAck : Guild roles Ack identified\n") log.Printf("parseSubTypeMessageGRolesAck : Guild roles Ack identified\n")
log.Printf("parseSubTypeMessageGRolesAck : Bartender : %s\n", r.ReplaceAllString(m.Text, "${Bartender}")) log.Printf("parseSubTypeMessageGRolesAck : Bartender : %s\n", r.ReplaceAllString(m.Text, "${Bartender}"))
log.Printf("parseSubTypeMessageGRolesAck : Commander : %s\n", r.ReplaceAllString(m.Text, "${Commander}")) log.Printf("parseSubTypeMessageGRolesAck : Commander : %s\n", r.ReplaceAllString(m.Text, "${Commander}"))
log.Printf("parseSubTypeMessageGRolesAck : Squire : %s\n", r.ReplaceAllString(m.Text, "${Squire}")) log.Printf("parseSubTypeMessageGRolesAck : Squire : %s\n", r.ReplaceAllString(m.Text, "${Squire}"))
log.Printf("parseSubTypeMessageGRolesAck : Treasurer : %s\n", r.ReplaceAllString(m.Text, "${Treasurer}")) log.Printf("parseSubTypeMessageGRolesAck : Treasurer : %s\n", r.ReplaceAllString(m.Text, "${Treasurer}"))
log.Printf("cwm.BartenderID64 : %d\n", cwm.BartenderID64)
log.Printf("cwm.CommanderID64 : %d\n", cwm.CommanderID64)
log.Printf("cwm.SquireID64 : %d\n", cwm.SquireID64)
log.Printf("cwm.TreasurerID64 : %d\n", cwm.TreasurerID64)
return &cwm, nil return &cwm, nil
} }