This commit is contained in:
shoopea 2019-05-30 17:26:42 +08:00
parent f21a3bf864
commit 59c583f8f8

8
msg.go
View File

@ -71,6 +71,7 @@ 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}")
_, i := utf8.DecodeRuneInString(s) _, i := utf8.DecodeRuneInString(s)
_, i = utf8.DecodeRuneInString(s[i:])
cwm.BartenderID64 = getObjUserID(s[i:]) cwm.BartenderID64 = getObjUserID(s[i:])
} else { } else {
cwm.BartenderID64 = 0 cwm.BartenderID64 = 0
@ -78,20 +79,23 @@ func parseSubTypeMessageGRolesAck(m *ChatWarsMessage, r *regexp.Regexp) (*ChatWa
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}")
_, i := utf8.DecodeRuneInString(s) _, i := utf8.DecodeRuneInString(s)
_, i = utf8.DecodeRuneInString(s[i:])
cwm.CommanderID64 = getObjUserID(s[i:]) cwm.CommanderID64 = getObjUserID(s[i:])
} else { } else {
cwm.CommanderID64 = 0 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, "${Squire}")
_, i := utf8.DecodeRuneInString(s) _, i := utf8.DecodeRuneInString(s)
_, i = utf8.DecodeRuneInString(s[i:])
cwm.SquireID64 = getObjUserID(s[i:]) cwm.SquireID64 = getObjUserID(s[i:])
} else { } else {
cwm.SquireID64 = 0 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, "${Treasurer}")
_, i := utf8.DecodeRuneInString(s) _, i := utf8.DecodeRuneInString(s)
_, i = utf8.DecodeRuneInString(s[i:])
cwm.TreasurerID64 = getObjUserID(s[i:]) cwm.TreasurerID64 = getObjUserID(s[i:])
} else { } else {
cwm.TreasurerID64 = 0 cwm.TreasurerID64 = 0