insert msg shop main ack

This commit is contained in:
shoopea 2020-02-06 16:52:18 +08:00
parent 9aab1a3bbf
commit 917d8e4dec

40
sql.go
View File

@ -726,30 +726,26 @@ func insertMsgShopMainAck(m *ChatWarsMessageShopMainAck) error {
return errors.New("Message type mismatch")
}
stmt, err := db.Prepare(`INSERT INTO obj_msg_shop_main (obj_id, name, number, user, mana, mana_total, class, castle_id, fees, open)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?);`)
logOnError(err, "insertMsgShopMainAck : Prepare")
if err != nil {
return err
}
defer stmt.Close()
var open int
if cwm.Open {
open = 1
} else {
open = 0
}
_, err = stmt.Exec(m.Msg.ID64, m.Name, m.ShopNumber, m.User, m.Mana, m.ManaTotal, m.Class, m.CastleID64, m.Fees, open)
logOnError(err, "insertMsgShopMainAck Exec")
return nil
/*
stmt, err := db.Prepare(`INSERT INTO obj_msg_shop_main (obj_id, name, quantity, user, mana, mana_total, class, castle_id, fees, open)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?);`)
logOnError(err, "insertMsgShopMainAck : Prepare")
if err != nil {
return err
}
defer stmt.Close()
var open int
if cwm.Open {
open = 1
} else {
open = 0
}
_, err = stmt.Exec(m.Msg.ID64, t.ItemID64, t.Quantity, t.Exp, t.Date)
logOnError(err, "insertMsgShopMainAck Exec")
return nil
*/
}
func insertMsgAuctionAnnounce(m *ChatWarsMessageAuctionAnnounce) error {