Exemple #1
0
func UpdateLv(tx *sql.Tx, playerObj *player.Player) (rowsAffected int64, err error) {
	result, err := tx.Exec(updateLvCommand, playerObj.Lv, playerObj.Id)
	if err != nil {
		dal.WriteExecError(updateLvCommand, err)
		return
	}

	rowsAffected, err = result.RowsAffected()
	return
}
Exemple #2
0
func UpdateInfo(tx *sql.Tx, playerObj *player.Player) (rowsAffected int64, err error) {
	result, err := tx.Exec(updateCommand, playerObj.Name, playerObj.PartnerId, playerObj.ServerId, playerObj.UserId, playerObj.Lv, playerObj.Exp, playerObj.VipExp, playerObj.Diamond, playerObj.Gold, playerObj.Id)
	if err != nil {
		dal.WriteExecError(updateNameCommand, err)
		return
	}

	rowsAffected, err = result.RowsAffected()
	return
}