This commit is contained in:
shoopea 2019-10-11 09:45:22 +08:00
parent c05af367a2
commit 71ebce37bb
2 changed files with 2 additions and 1 deletions

1
msg.go
View File

@ -224,6 +224,7 @@ func parseSubTypeMessageWithdrawRcv(m *ChatWarsMessage, r *regexp.Regexp) (*Chat
items := []ChatWarsItems{} items := []ChatWarsItems{}
re := regexp.MustCompile(`(.*) x (.*)`) re := regexp.MustCompile(`(.*) x (.*)`)
for _, l := range re.FindAllStringSubmatch(m.Text, -1) { for _, l := range re.FindAllStringSubmatch(m.Text, -1) {
log.Printf("parseSubTypeMessageWithdrawRcv : %s x %s\n", l[1], l[2])
i := getObjItemID(``, l[1]) i := getObjItemID(``, l[1])
q, _ := strconv.ParseInt(l[2], 10, 64) q, _ := strconv.ParseInt(l[2], 10, 64)
if i != 0 { if i != 0 {

2
sql.go
View File

@ -585,7 +585,7 @@ func initDB() {
} }
func insertMsgItem(objId int64, itemId int64, quantity int64) error { func insertMsgItem(objId int64, itemId int64, quantity int64) error {
log.Println("insertMsgItem inserting (%d, %d, %d)", objId, itemId, quantity) log.Printf("insertMsgItem inserting (%d, %d, %d)\n", objId, itemId, quantity)
stmt, err := db.Prepare(`INSERT INTO obj_msg_item (obj_id, item_id, quantity) stmt, err := db.Prepare(`INSERT INTO obj_msg_item (obj_id, item_id, quantity)
VALUES (?, ?, ?);`) VALUES (?, ?, ?);`)