Xinux, not sure if this is still an issue. I haven't lost my hotbars (with the starting Abilities anyway) for a while. The bug seems to allude to bars other than the first one (?)
Also, I do still see SQL insert issues on hotbars, so that's why I pushed this. Players are trying to make new hotbar icons and getting SQL insert errors because there's already a key there.
A suggestion to solve this might be to change the SQL insert to a
INSERT ON DUPLICATE KEY UPDATE query instead.
EDIT:
Example usage:
Code: Select all
INSERT INTO `character_hotbars` (`char_id_fk`, `bar_name`, `slot_id`, `ability_id`, `item_unique_id`, `reference`, `command_text`, `icon_id`) VALUES
(1, 'm_wb', 0, 27111, - 1, 'noname', 'noname', 0)
ON DUPLICATE KEY UPDATE
bar_name = 'm_wb', slot_id = 0, ability_id = 27111, item_unique_id = - 1, reference = 'noname', command_text = 'noname', icon_id = 0 ;
This will replace m_wb bar, slot 0 with ability_id 27111 regardless of what was there before. I will implement this on NT for testing today.
Code (I think this gives me the desired results)
Code: Select all
// new way string bar_name = database.Escape(packet_struct->GetString32("bar_name")); int32_t slot_id = packet_struct->GetUInt32("slot_id"); int32_t ability_id = packet_struct->GetInt32("ability_id"); int32_t item_unique_id = packet_struct->GetInt32("item_unique_id"); string reference = database.Escape(packet_struct->GetString32("reference")); string command_text = database.Escape(packet_struct->GetString32("command_text")); int32_t icon_id = packet_struct->GetInt32("icon_id"); if (!database.Query("INSERT INTO `character_hotbars`\n" "(`char_id_fk`, `bar_name`, `slot_id`, `ability_id`, `item_unique_id`, `reference`, `command_text`,`icon_id`)\n" "VALUES (%i,'%s',%i,%i,%i,'%s','%s',%i)\n" "ON DUPLICATE KEY UPDATE\n" "bar_name = '%s',\n" "slot_id = %i,\n" "ability_id = %i,\n" "item_unique_id = %i,\n" "reference = '%s',\n" "command_text = '%s',\n" "icon_id = %i", // INSERT INTO values character->GetCharacterID(), bar_name.c_str(), slot_id, ability_id, item_unique_id, reference.c_str(), command_text.c_str(), icon_id, // ON DUPLICATE UPDATE values bar_name.c_str(), slot_id, ability_id, item_unique_id, reference.c_str(), command_text.c_str(), icon_id)) {
Rev 931