2021-12-05 17:54:36 +00:00
|
|
|
#include "CDEmoteTable.h"
|
|
|
|
|
2023-08-11 04:27:40 +00:00
|
|
|
void CDEmoteTableTable::LoadValuesFromDatabase() {
|
2021-12-05 17:54:36 +00:00
|
|
|
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM Emotes");
|
|
|
|
while (!tableData.eof()) {
|
2023-08-11 04:27:40 +00:00
|
|
|
CDEmoteTable entry;
|
|
|
|
entry.ID = tableData.getIntField("id", -1);
|
|
|
|
entry.animationName = tableData.getStringField("animationName", "");
|
|
|
|
entry.iconFilename = tableData.getStringField("iconFilename", "");
|
|
|
|
entry.channel = tableData.getIntField("channel", -1);
|
|
|
|
entry.locked = tableData.getIntField("locked", -1) != 0;
|
|
|
|
entry.localize = tableData.getIntField("localize", -1) != 0;
|
|
|
|
entry.locState = tableData.getIntField("locStatus", -1);
|
|
|
|
entry.gateVersion = tableData.getStringField("gate_version", "");
|
|
|
|
|
|
|
|
entries.insert(std::make_pair(entry.ID, entry));
|
2021-12-05 17:54:36 +00:00
|
|
|
tableData.nextRow();
|
|
|
|
}
|
|
|
|
|
|
|
|
tableData.finalize();
|
|
|
|
}
|
|
|
|
|
|
|
|
CDEmoteTable* CDEmoteTableTable::GetEmote(int id) {
|
2023-08-11 04:27:40 +00:00
|
|
|
auto itr = entries.find(id);
|
|
|
|
return itr != entries.end() ? &itr->second : nullptr;
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|