mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-15 08:21:28 +00:00
Fix formatting
This commit is contained in:
parent
fc33a10ec0
commit
7ad33f2445
@ -802,31 +802,32 @@ bool SharedDatabase::LoadItems(const std::string &prefix) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_item_id) {
|
||||
EQEmu::FixedMemoryHashSet<Item_Struct> hash(reinterpret_cast<uint8*>(data), size, items, max_item_id);
|
||||
void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_item_id)
|
||||
{
|
||||
EQEmu::FixedMemoryHashSet<Item_Struct> hash(reinterpret_cast<uint8 *>(data), size, items, max_item_id);
|
||||
|
||||
char ndbuffer[4];
|
||||
bool disableNoRent = false;
|
||||
if(GetVariable("disablenorent", ndbuffer, 4)) {
|
||||
if(ndbuffer[0] == '1' && ndbuffer[1] == '\0') {
|
||||
if (GetVariable("disablenorent", ndbuffer, 4)) {
|
||||
if (ndbuffer[0] == '1' && ndbuffer[1] == '\0') {
|
||||
disableNoRent = true;
|
||||
}
|
||||
}
|
||||
bool disableNoDrop = false;
|
||||
if(GetVariable("disablenodrop", ndbuffer, 4)) {
|
||||
if(ndbuffer[0] == '1' && ndbuffer[1] == '\0') {
|
||||
if (GetVariable("disablenodrop", ndbuffer, 4)) {
|
||||
if (ndbuffer[0] == '1' && ndbuffer[1] == '\0') {
|
||||
disableNoDrop = true;
|
||||
}
|
||||
}
|
||||
bool disableLoreGroup = false;
|
||||
if(GetVariable("disablelore", ndbuffer, 4)) {
|
||||
if(ndbuffer[0] == '1' && ndbuffer[1] == '\0') {
|
||||
if (GetVariable("disablelore", ndbuffer, 4)) {
|
||||
if (ndbuffer[0] == '1' && ndbuffer[1] == '\0') {
|
||||
disableLoreGroup = true;
|
||||
}
|
||||
}
|
||||
bool disableNoTransfer = false;
|
||||
if(GetVariable("disablenotransfer", ndbuffer, 4)) {
|
||||
if(ndbuffer[0] == '1' && ndbuffer[1] == '\0') {
|
||||
if (GetVariable("disablenotransfer", ndbuffer, 4)) {
|
||||
if (ndbuffer[0] == '1' && ndbuffer[1] == '\0') {
|
||||
disableNoTransfer = true;
|
||||
}
|
||||
}
|
||||
@ -834,7 +835,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
|
||||
Item_Struct item;
|
||||
|
||||
const std::string query = "SELECT source,"
|
||||
#define F(x) "`"#x"`,"
|
||||
#define F(x) "`" #x "`,"
|
||||
#include "item_fieldlist.h"
|
||||
#undef F
|
||||
"updated FROM items ORDER BY id";
|
||||
@ -843,13 +844,13 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
|
||||
return;
|
||||
}
|
||||
|
||||
for(auto row = results.begin(); row != results.end(); ++row) {
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
memset(&item, 0, sizeof(Item_Struct));
|
||||
|
||||
item.ItemClass = (uint8)atoi(row[ItemField::itemclass]);
|
||||
strcpy(item.Name,row[ItemField::name]);
|
||||
strcpy(item.Lore,row[ItemField::lore]);
|
||||
strcpy(item.IDFile,row[ItemField::idfile]);
|
||||
strcpy(item.Name, row[ItemField::name]);
|
||||
strcpy(item.Lore, row[ItemField::lore]);
|
||||
strcpy(item.IDFile, row[ItemField::idfile]);
|
||||
|
||||
item.ID = (uint32)atoul(row[ItemField::id]);
|
||||
item.Weight = (uint8)atoi(row[ItemField::weight]);
|
||||
@ -860,7 +861,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
|
||||
item.Price = (uint32)atoul(row[ItemField::price]);
|
||||
item.Icon = (uint32)atoul(row[ItemField::icon]);
|
||||
item.BenefitFlag = (atoul(row[ItemField::benefitflag]) != 0);
|
||||
item.Tradeskills = (atoi(row[ItemField::tradeskills])==0) ? false : true;
|
||||
item.Tradeskills = (atoi(row[ItemField::tradeskills]) == 0) ? false : true;
|
||||
item.CR = (int8)atoi(row[ItemField::cr]);
|
||||
item.DR = (int8)atoi(row[ItemField::dr]);
|
||||
item.PR = (int8)atoi(row[ItemField::pr]);
|
||||
@ -883,7 +884,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
|
||||
item.BaneDmgRace = (uint32)atoul(row[ItemField::banedmgrace]);
|
||||
item.BaneDmgAmt = (int8)atoi(row[ItemField::banedmgamt]);
|
||||
item.BaneDmgBody = (uint32)atoul(row[ItemField::banedmgbody]);
|
||||
item.Magic = (atoi(row[ItemField::magic])==0) ? false : true;
|
||||
item.Magic = (atoi(row[ItemField::magic]) == 0) ? false : true;
|
||||
item.CastTime_ = (int32)atoul(row[ItemField::casttime_]);
|
||||
item.ReqLevel = (uint8)atoi(row[ItemField::reqlevel]);
|
||||
item.BardType = (uint32)atoul(row[ItemField::bardtype]);
|
||||
@ -927,7 +928,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
|
||||
item.FactionAmt3 = (int32)atoul(row[ItemField::factionamt3]);
|
||||
item.FactionAmt4 = (int32)atoul(row[ItemField::factionamt4]);
|
||||
|
||||
strcpy(item.CharmFile,row[ItemField::charmfile]);
|
||||
strcpy(item.CharmFile, row[ItemField::charmfile]);
|
||||
|
||||
item.AugType = (uint32)atoul(row[ItemField::augtype]);
|
||||
item.AugSlotType[0] = (uint8)atoi(row[ItemField::augslot1type]);
|
||||
@ -959,17 +960,17 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
|
||||
item.Book = (uint8)atoi(row[ItemField::book]);
|
||||
item.BookType = (uint32)atoul(row[ItemField::booktype]);
|
||||
|
||||
strcpy(item.Filename,row[ItemField::filename]);
|
||||
strcpy(item.Filename, row[ItemField::filename]);
|
||||
|
||||
item.BaneDmgRaceAmt = (uint32)atoul(row[ItemField::banedmgraceamt]);
|
||||
item.AugRestrict = (uint32)atoul(row[ItemField::augrestrict]);
|
||||
item.LoreGroup = disableLoreGroup ? (uint8)atoi("0") : atoi(row[ItemField::loregroup]);
|
||||
item.LoreFlag = item.LoreGroup!=0;
|
||||
item.PendingLoreFlag = (atoi(row[ItemField::pendingloreflag])==0) ? false : true;
|
||||
item.ArtifactFlag = (atoi(row[ItemField::artifactflag])==0) ? false : true;
|
||||
item.SummonedFlag = (atoi(row[ItemField::summonedflag])==0) ? false : true;
|
||||
item.LoreFlag = item.LoreGroup != 0;
|
||||
item.PendingLoreFlag = (atoi(row[ItemField::pendingloreflag]) == 0) ? false : true;
|
||||
item.ArtifactFlag = (atoi(row[ItemField::artifactflag]) == 0) ? false : true;
|
||||
item.SummonedFlag = (atoi(row[ItemField::summonedflag]) == 0) ? false : true;
|
||||
item.Favor = (uint32)atoul(row[ItemField::favor]);
|
||||
item.FVNoDrop = (atoi(row[ItemField::fvnodrop])==0) ? false : true;
|
||||
item.FVNoDrop = (atoi(row[ItemField::fvnodrop]) == 0) ? false : true;
|
||||
item.Endur = (uint32)atoul(row[ItemField::endur]);
|
||||
item.DotShielding = (uint32)atoul(row[ItemField::dotshielding]);
|
||||
item.Attack = (uint32)atoul(row[ItemField::attack]);
|
||||
@ -982,20 +983,20 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
|
||||
item.RecastType = (uint32)atoul(row[ItemField::recasttype]);
|
||||
item.GuildFavor = (uint32)atoul(row[ItemField::guildfavor]);
|
||||
item.AugDistiller = (uint32)atoul(row[ItemField::augdistiller]);
|
||||
item.Attuneable = (atoi(row[ItemField::attuneable])==0) ? false : true;
|
||||
item.NoPet = (atoi(row[ItemField::nopet])==0) ? false : true;
|
||||
item.Attuneable = (atoi(row[ItemField::attuneable]) == 0) ? false : true;
|
||||
item.NoPet = (atoi(row[ItemField::nopet]) == 0) ? false : true;
|
||||
item.PointType = (uint32)atoul(row[ItemField::pointtype]);
|
||||
item.PotionBelt = (atoi(row[ItemField::potionbelt])==0) ? false : true;
|
||||
item.PotionBeltSlots = (atoi(row[ItemField::potionbeltslots])==0) ? false : true;
|
||||
item.PotionBelt = (atoi(row[ItemField::potionbelt]) == 0) ? false : true;
|
||||
item.PotionBeltSlots = (atoi(row[ItemField::potionbeltslots]) == 0) ? false : true;
|
||||
item.StackSize = (uint16)atoi(row[ItemField::stacksize]);
|
||||
item.NoTransfer = disableNoTransfer ? false : (atoi(row[ItemField::notransfer])==0) ? false : true;
|
||||
item.Stackable = (atoi(row[ItemField::stackable])==0) ? false : true;
|
||||
item.NoTransfer = disableNoTransfer ? false : (atoi(row[ItemField::notransfer]) == 0) ? false : true;
|
||||
item.Stackable = (atoi(row[ItemField::stackable]) == 0) ? false : true;
|
||||
item.Click.Effect = (uint32)atoul(row[ItemField::clickeffect]);
|
||||
item.Click.Type = (uint8)atoul(row[ItemField::clicktype]);
|
||||
item.Click.Level = (uint8)atoul(row[ItemField::clicklevel]);
|
||||
item.Click.Level2 = (uint8)atoul(row[ItemField::clicklevel2]);
|
||||
|
||||
strcpy(item.CharmFile,row[ItemField::charmfile]);
|
||||
strcpy(item.CharmFile, row[ItemField::charmfile]);
|
||||
|
||||
item.Proc.Effect = (int32)atoul(row[ItemField::proceffect]);
|
||||
item.Proc.Type = (uint8)atoul(row[ItemField::proctype]);
|
||||
@ -1017,7 +1018,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
|
||||
item.Bard.Type = (uint8)atoul(row[ItemField::bardtype]);
|
||||
item.Bard.Level = (uint8)atoul(row[ItemField::bardlevel]);
|
||||
item.Bard.Level2 = (uint8)atoul(row[ItemField::bardlevel2]);
|
||||
item.QuestItemFlag = (atoi(row[ItemField::questitemflag])==0) ? false : true;
|
||||
item.QuestItemFlag = (atoi(row[ItemField::questitemflag]) == 0) ? false : true;
|
||||
item.SVCorruption = (int32)atoi(row[ItemField::svcorruption]);
|
||||
item.Purity = (uint32)atoul(row[ItemField::purity]);
|
||||
item.EvolvingItem = (uint8)atoul(row[ItemField::evoitem]);
|
||||
@ -1046,20 +1047,19 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
|
||||
item.ExpendableArrow = (uint16)atoul(row[ItemField::expendablearrow]);
|
||||
item.Clairvoyance = (uint32)atoul(row[ItemField::clairvoyance]);
|
||||
|
||||
strcpy(item.ClickName,row[ItemField::clickname]);
|
||||
strcpy(item.ProcName,row[ItemField::procname]);
|
||||
strcpy(item.WornName,row[ItemField::wornname]);
|
||||
strcpy(item.FocusName,row[ItemField::focusname]);
|
||||
strcpy(item.ScrollName,row[ItemField::scrollname]);
|
||||
strcpy(item.ClickName, row[ItemField::clickname]);
|
||||
strcpy(item.ProcName, row[ItemField::procname]);
|
||||
strcpy(item.WornName, row[ItemField::wornname]);
|
||||
strcpy(item.FocusName, row[ItemField::focusname]);
|
||||
strcpy(item.ScrollName, row[ItemField::scrollname]);
|
||||
|
||||
try {
|
||||
hash.insert(item.ID, item);
|
||||
} catch(std::exception &ex) {
|
||||
} catch (std::exception &ex) {
|
||||
Log.Out(Logs::General, Logs::Error, "Database::LoadItems: %s", ex.what());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const Item_Struct* SharedDatabase::GetItem(uint32 id) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user