This commit is contained in:
shoopea 2019-06-09 00:02:40 +08:00
parent b0f416ecb8
commit 515d5518e9

7
msg.go
View File

@ -275,16 +275,17 @@ func parseSubTypeMessagePillageInc(m *ChatWarsMessage, r *regexp.Regexp) (*ChatW
func zipMessages() ([]byte, error) { func zipMessages() ([]byte, error) {
bkp := DataBackup{} bkp := DataBackup{}
msgs := new([]ChatWarsMessage) s := new([]ChatWarsMessage)
msgs := *s
ids := getSQLListID64(`SELECT om.obj_id id FROM obj_msg om;`) ids := getSQLListID64(`SELECT om.obj_id id FROM obj_msg om;`)
for _, id := range ids { for _, id := range ids {
m, err := getMsg(id) m, err := getMsg(id)
logOnError(err, "zipMessages : getMsg") logOnError(err, "zipMessages : getMsg")
if err == nil { if err == nil {
msgs = append(*msgs, *m) msgs = append(msgs, *m)
} }
} }
bkp.Messages = *msgs bkp.Messages = msgs
b, err := json.Marshal(bkp) b, err := json.Marshal(bkp)
logOnError(err, "exportMessages : Marshal") logOnError(err, "exportMessages : Marshal")
if err != nil { if err != nil {