mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-15 04:38:21 +00:00
dc526aeec1
Fix up other large tables to have proper backup lookups Revert "idk im just dumb ig" This reverts commit 5d5be5df53b8959b42b291613d7db749a65a3585. idk im just dumb ig
27 lines
937 B
C++
27 lines
937 B
C++
#include "CDEmoteTable.h"
|
|
|
|
void CDEmoteTableTable::LoadValuesFromDatabase() {
|
|
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM Emotes");
|
|
while (!tableData.eof()) {
|
|
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));
|
|
tableData.nextRow();
|
|
}
|
|
|
|
tableData.finalize();
|
|
}
|
|
|
|
CDEmoteTable* CDEmoteTableTable::GetEmote(int id) {
|
|
auto itr = entries.find(id);
|
|
return itr != entries.end() ? &itr->second : nullptr;
|
|
}
|