mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-13 03:32:28 -04:00
Core: Fixed some level 4 warnings (msvc)
This commit is contained in:
@@ -347,11 +347,11 @@ private:
|
||||
_mm_free(ptr);
|
||||
}
|
||||
|
||||
__m128i mask; // AND mask
|
||||
__m128i state[SFMT_N]; // State vector for SFMT generator
|
||||
uint32_t ix; // Index into state array
|
||||
uint32_t LastInterval; // Last interval length for IRandom
|
||||
uint32_t RLimit; // Rejection limit used by IRandom
|
||||
__m128i mask; // AND mask
|
||||
__m128i state[SFMT_N]; // State vector for SFMT generator
|
||||
};
|
||||
|
||||
#endif // SFMT_H
|
||||
|
||||
@@ -87,7 +87,7 @@ class BIH
|
||||
tree.clear();
|
||||
objects.clear();
|
||||
// create space for the first node
|
||||
tree.push_back(3 << 30); // dummy leaf
|
||||
tree.push_back(3u << 30u); // dummy leaf
|
||||
tree.insert(tree.end(), 2, 0);
|
||||
}
|
||||
public:
|
||||
|
||||
@@ -170,7 +170,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
|
||||
condMeets = instance->GetData64(ConditionValue1) == ConditionValue2;
|
||||
break;
|
||||
case INSTANCE_INFO_BOSS_STATE:
|
||||
condMeets = instance->GetBossState(ConditionValue1) == ConditionValue2;
|
||||
condMeets = instance->GetBossState(ConditionValue1) == EncounterState(ConditionValue2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,13 +64,6 @@ enum CreatureFlagsExtra
|
||||
CREATURE_FLAG_EXTRA_NO_SKILLGAIN | CREATURE_FLAG_EXTRA_TAUNT_DIMINISH | CREATURE_FLAG_EXTRA_ALL_DIMINISH | \
|
||||
CREATURE_FLAG_EXTRA_GUARD)
|
||||
|
||||
// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push, N), also any gcc version not support it at some platform
|
||||
#if defined(__GNUC__)
|
||||
#pragma pack(1)
|
||||
#else
|
||||
#pragma pack(push, 1)
|
||||
#endif
|
||||
|
||||
#define MAX_KILL_CREDIT 2
|
||||
#define CREATURE_REGEN_INTERVAL 2 * IN_MILLISECONDS
|
||||
|
||||
@@ -180,6 +173,13 @@ typedef UNORDERED_MAP<uint32, CreatureTemplate> CreatureTemplateContainer;
|
||||
// TODO: Add MAX_EXPANSION constant.
|
||||
#define MAX_CREATURE_BASE_HP 3
|
||||
|
||||
// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push, N), also any gcc version not support it at some platform
|
||||
#if defined(__GNUC__)
|
||||
#pragma pack(1)
|
||||
#else
|
||||
#pragma pack(push, 1)
|
||||
#endif
|
||||
|
||||
// Defines base stats for creatures (used to calculate HP/mana/armor).
|
||||
struct CreatureBaseStats
|
||||
{
|
||||
@@ -241,7 +241,7 @@ typedef UNORDERED_MAP<uint16, EquipmentInfo> EquipmentInfoContainer;
|
||||
// from `creature` table
|
||||
struct CreatureData
|
||||
{
|
||||
explicit CreatureData() : dbData(true) {}
|
||||
CreatureData() : dbData(true) {}
|
||||
uint32 id; // entry in creature_template
|
||||
uint16 mapid;
|
||||
uint16 phaseMask;
|
||||
@@ -264,19 +264,6 @@ struct CreatureData
|
||||
bool dbData;
|
||||
};
|
||||
|
||||
// `creature_addon` table
|
||||
struct CreatureAddon
|
||||
{
|
||||
uint32 path_id;
|
||||
uint32 mount;
|
||||
uint32 bytes1;
|
||||
uint32 bytes2;
|
||||
uint32 emote;
|
||||
std::vector<uint32> auras;
|
||||
};
|
||||
|
||||
typedef UNORDERED_MAP<uint32, CreatureAddon> CreatureAddonContainer;
|
||||
|
||||
struct CreatureModelInfo
|
||||
{
|
||||
float bounding_radius;
|
||||
@@ -316,6 +303,19 @@ enum ChatType
|
||||
#pragma pack(pop)
|
||||
#endif
|
||||
|
||||
// `creature_addon` table
|
||||
struct CreatureAddon
|
||||
{
|
||||
uint32 path_id;
|
||||
uint32 mount;
|
||||
uint32 bytes1;
|
||||
uint32 bytes2;
|
||||
uint32 emote;
|
||||
std::vector<uint32> auras;
|
||||
};
|
||||
|
||||
typedef UNORDERED_MAP<uint32, CreatureAddon> CreatureAddonContainer;
|
||||
|
||||
// Vendors
|
||||
struct VendorItem
|
||||
{
|
||||
|
||||
@@ -28,13 +28,6 @@
|
||||
|
||||
class GameObjectAI;
|
||||
|
||||
// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push, N), also any gcc version not support it at some platform
|
||||
#if defined(__GNUC__)
|
||||
#pragma pack(1)
|
||||
#else
|
||||
#pragma pack(push, 1)
|
||||
#endif
|
||||
|
||||
#define MAX_GAMEOBJECT_QUEST_ITEMS 6
|
||||
|
||||
// from `gameobject_template`
|
||||
@@ -549,13 +542,6 @@ union GameObjectValue
|
||||
} Building;
|
||||
};
|
||||
|
||||
// GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform
|
||||
#if defined(__GNUC__)
|
||||
#pragma pack()
|
||||
#else
|
||||
#pragma pack(pop)
|
||||
#endif
|
||||
|
||||
struct GameObjectLocale
|
||||
{
|
||||
StringVector Name;
|
||||
|
||||
@@ -578,6 +578,13 @@ struct _Socket
|
||||
uint32 Content;
|
||||
};
|
||||
|
||||
// GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform
|
||||
#if defined(__GNUC__)
|
||||
#pragma pack()
|
||||
#else
|
||||
#pragma pack(pop)
|
||||
#endif
|
||||
|
||||
#define MAX_ITEM_PROTO_DAMAGES 2 // changed in 3.1.0
|
||||
#define MAX_ITEM_PROTO_SOCKETS 3
|
||||
#define MAX_ITEM_PROTO_SPELLS 5
|
||||
@@ -589,7 +596,7 @@ struct ItemTemplate
|
||||
uint32 Class; // id from ItemClass.dbc
|
||||
uint32 SubClass; // id from ItemSubClass.dbc
|
||||
int32 SoundOverrideSubclass; // < 0: id from ItemSubClass.dbc, used to override weapon sound from actual SubClass
|
||||
std::string Name1;
|
||||
std::string Name1;
|
||||
uint32 DisplayInfoID; // id from ItemDisplayInfo.dbc
|
||||
uint32 Quality;
|
||||
uint32 Flags;
|
||||
@@ -761,10 +768,4 @@ struct ItemSetNameLocale
|
||||
StringVector Name;
|
||||
};
|
||||
|
||||
// GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform
|
||||
#if defined(__GNUC__)
|
||||
#pragma pack()
|
||||
#else
|
||||
#pragma pack(pop)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -2380,6 +2380,7 @@ GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float
|
||||
sLog->outError(LOG_FILTER_SQL, "Gameobject template %u not found in database!", entry);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Map* map = GetMap();
|
||||
GameObject* go = new GameObject();
|
||||
if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), entry, map, GetPhaseMask(), x, y, z, ang, rotation0, rotation1, rotation2, rotation3, 100, GO_STATE_READY))
|
||||
@@ -2387,13 +2388,14 @@ GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float
|
||||
delete go;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
go->SetRespawnTime(respawnTime);
|
||||
if (GetTypeId() == TYPEID_PLAYER || GetTypeId() == TYPEID_UNIT) //not sure how to handle this
|
||||
((Unit*)this)->AddGameObject(go);
|
||||
ToUnit()->AddGameObject(go);
|
||||
else
|
||||
go->SetSpawnedByDefault(false);
|
||||
map->AddToMap(go);
|
||||
|
||||
map->AddToMap(go);
|
||||
return go;
|
||||
}
|
||||
|
||||
|
||||
@@ -17068,8 +17068,8 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)
|
||||
else // This can happen during Player::_LoadAuras
|
||||
{
|
||||
int32 bp0[MAX_SPELL_EFFECTS];
|
||||
for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
bp0[i] = spellEntry->Effects[i].BasePoints;
|
||||
for (uint32 j = 0; j < MAX_SPELL_EFFECTS; ++j)
|
||||
bp0[j] = spellEntry->Effects[j].BasePoints;
|
||||
|
||||
bp0[i] = seatId;
|
||||
Aura::TryRefreshStackOrCreate(spellEntry, MAX_EFFECT_MASK, this, clicker, bp0, NULL, origCasterGUID);
|
||||
|
||||
@@ -189,7 +189,7 @@ void WorldSession::HandleGameObjectQueryOpcode(WorldPacket& recvData)
|
||||
data << IconName; // 2.0.3, string. Icon name to use instead of default icon for go's (ex: "Attack" makes sword)
|
||||
data << CastBarCaption; // 2.0.3, string. Text will appear in Cast Bar when using GO (ex: "Collecting")
|
||||
data << info->unk1; // 2.0.3, string
|
||||
data.append(info->raw.data, 24);
|
||||
data.append(info->raw.data, MAX_GAMEOBJECT_DATA);
|
||||
data << float(info->size); // go size
|
||||
for (uint32 i = 0; i < MAX_GAMEOBJECT_QUEST_ITEMS; ++i)
|
||||
data << uint32(info->questItems[i]); // itemId[6], quest drop
|
||||
|
||||
@@ -666,7 +666,7 @@ void Loot::DeleteLootItemFromContainerItemDB(uint32 itemID)
|
||||
// Mark the item looted to prevent resaving
|
||||
for (LootItemList::iterator _itr = items.begin(); _itr != items.end(); _itr++)
|
||||
{
|
||||
if (!_itr->itemid == itemID)
|
||||
if (_itr->itemid != itemID)
|
||||
continue;
|
||||
|
||||
_itr->canSave = true;
|
||||
@@ -1272,7 +1272,7 @@ void LootTemplate::CopyConditions(LootItem* li) const
|
||||
// Copies the conditions list from a template item to a LootItem
|
||||
for (LootStoreItemList::const_iterator _iter = Entries.begin(); _iter != Entries.end(); ++_iter)
|
||||
{
|
||||
if (!_iter->itemid == li->itemid)
|
||||
if (_iter->itemid != li->itemid)
|
||||
continue;
|
||||
|
||||
li->conditions = _iter->conditions;
|
||||
|
||||
@@ -50,7 +50,7 @@ void HomeMovementGenerator<Creature>::_setTargetLocation(Creature & owner)
|
||||
init.Launch();
|
||||
|
||||
arrived = false;
|
||||
owner.ClearUnitState(UNIT_STATE_ALL_STATE & ~UNIT_STATE_EVADE);
|
||||
owner.ClearUnitState(uint32(UNIT_STATE_ALL_STATE & ~UNIT_STATE_EVADE));
|
||||
}
|
||||
|
||||
bool HomeMovementGenerator<Creature>::DoUpdate(Creature &owner, const uint32 /*time_diff*/)
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace Movement
|
||||
|
||||
// add fake Enter_Cycle flag - needed for client-side cyclic movement (client will erase first spline vertex after first cycle done)
|
||||
splineflags.enter_cycle = move_spline.isCyclic();
|
||||
data << uint32(splineflags & ~MoveSplineFlag::Mask_No_Monster_Move);
|
||||
data << uint32(splineflags & uint32(~MoveSplineFlag::Mask_No_Monster_Move));
|
||||
|
||||
if (splineflags.animation)
|
||||
{
|
||||
|
||||
@@ -606,8 +606,8 @@ class World
|
||||
/// Get the maximum skill level a player can reach
|
||||
uint16 GetConfigMaxSkillValue() const
|
||||
{
|
||||
uint8 lvl = getIntConfig(CONFIG_MAX_PLAYER_LEVEL);
|
||||
return lvl > 60 ? 300 + ((lvl - 60) * 75) / 10 : lvl*5;
|
||||
uint16 lvl = uint16(getIntConfig(CONFIG_MAX_PLAYER_LEVEL));
|
||||
return lvl > 60 ? 300 + ((lvl - 60) * 75) / 10 : lvl * 5;
|
||||
}
|
||||
|
||||
void SetInitialWorldSettings();
|
||||
|
||||
@@ -150,7 +150,7 @@ class npc_winterfin_playmate : public CreatureScript
|
||||
|
||||
struct npc_winterfin_playmateAI : public ScriptedAI
|
||||
{
|
||||
npc_winterfin_playmateAI(Creature* creature) : ScriptedAI (creature) {}
|
||||
npc_winterfin_playmateAI(Creature* creature) : ScriptedAI(creature) {}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
@@ -167,7 +167,8 @@ class npc_winterfin_playmate : public CreatureScript
|
||||
if (player->GetQuestStatus(QUEST_PLAYMATE_ORACLE) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
playerGUID = player->GetGUID();
|
||||
if ((orphanGUID = getOrphanGUID(player, ORPHAN_ORACLE)))
|
||||
orphanGUID = getOrphanGUID(player, ORPHAN_ORACLE);
|
||||
if (orphanGUID)
|
||||
phase = 1;
|
||||
}
|
||||
}
|
||||
@@ -247,7 +248,7 @@ class npc_snowfall_glade_playmate : public CreatureScript
|
||||
|
||||
struct npc_snowfall_glade_playmateAI : public ScriptedAI
|
||||
{
|
||||
npc_snowfall_glade_playmateAI(Creature* creature) : ScriptedAI (creature) {}
|
||||
npc_snowfall_glade_playmateAI(Creature* creature) : ScriptedAI(creature) {}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
@@ -264,7 +265,8 @@ class npc_snowfall_glade_playmate : public CreatureScript
|
||||
if (player->GetQuestStatus(QUEST_PLAYMATE_WOLVAR) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
playerGUID = player->GetGUID();
|
||||
if ((orphanGUID = getOrphanGUID(player, ORPHAN_WOLVAR)))
|
||||
orphanGUID = getOrphanGUID(player, ORPHAN_WOLVAR);
|
||||
if (orphanGUID)
|
||||
phase = 1;
|
||||
}
|
||||
}
|
||||
@@ -343,7 +345,7 @@ class npc_the_biggest_tree : public CreatureScript
|
||||
|
||||
struct npc_the_biggest_treeAI : public ScriptedAI
|
||||
{
|
||||
npc_the_biggest_treeAI(Creature* creature) : ScriptedAI (creature)
|
||||
npc_the_biggest_treeAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
me->SetDisplayId(DISPLAY_INVISIBLE);
|
||||
}
|
||||
@@ -363,7 +365,8 @@ class npc_the_biggest_tree : public CreatureScript
|
||||
if (player->GetQuestStatus(QUEST_THE_BIGGEST_TREE_EVER) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
playerGUID = player->GetGUID();
|
||||
if ((orphanGUID = getOrphanGUID(player, ORPHAN_ORACLE)))
|
||||
orphanGUID = getOrphanGUID(player, ORPHAN_ORACLE);
|
||||
if (orphanGUID)
|
||||
phase = 1;
|
||||
}
|
||||
}
|
||||
@@ -431,7 +434,7 @@ class npc_high_oracle_soo_roo : public CreatureScript
|
||||
|
||||
struct npc_high_oracle_soo_rooAI : public ScriptedAI
|
||||
{
|
||||
npc_high_oracle_soo_rooAI(Creature* creature) : ScriptedAI (creature) {}
|
||||
npc_high_oracle_soo_rooAI(Creature* creature) : ScriptedAI(creature) {}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
@@ -448,7 +451,8 @@ class npc_high_oracle_soo_roo : public CreatureScript
|
||||
if (player->GetQuestStatus(QUEST_THE_BRONZE_DRAGONSHRINE_ORACLE) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
playerGUID = player->GetGUID();
|
||||
if ((orphanGUID = getOrphanGUID(player, ORPHAN_ORACLE)))
|
||||
orphanGUID = getOrphanGUID(player, ORPHAN_ORACLE);
|
||||
if (orphanGUID)
|
||||
phase = 1;
|
||||
}
|
||||
}
|
||||
@@ -518,7 +522,7 @@ class npc_elder_kekek : public CreatureScript
|
||||
|
||||
struct npc_elder_kekekAI : public ScriptedAI
|
||||
{
|
||||
npc_elder_kekekAI(Creature* creature) : ScriptedAI (creature) {}
|
||||
npc_elder_kekekAI(Creature* creature) : ScriptedAI(creature) {}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
@@ -535,7 +539,8 @@ class npc_elder_kekek : public CreatureScript
|
||||
if (player->GetQuestStatus(QUEST_THE_BRONZE_DRAGONSHRINE_WOLVAR) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
playerGUID = player->GetGUID();
|
||||
if ((orphanGUID = getOrphanGUID(player, ORPHAN_WOLVAR)))
|
||||
orphanGUID = getOrphanGUID(player, ORPHAN_WOLVAR);
|
||||
if (orphanGUID)
|
||||
phase = 1;
|
||||
}
|
||||
}
|
||||
@@ -605,7 +610,7 @@ class npc_the_etymidian : public CreatureScript
|
||||
|
||||
struct npc_the_etymidianAI : public ScriptedAI
|
||||
{
|
||||
npc_the_etymidianAI(Creature* creature) : ScriptedAI (creature) {}
|
||||
npc_the_etymidianAI(Creature* creature) : ScriptedAI(creature) {}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
@@ -622,7 +627,8 @@ class npc_the_etymidian : public CreatureScript
|
||||
if (player->GetQuestStatus(QUEST_MEETING_A_GREAT_ONE) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
playerGUID = player->GetGUID();
|
||||
if ((orphanGUID = getOrphanGUID(player, ORPHAN_ORACLE)))
|
||||
orphanGUID = getOrphanGUID(player, ORPHAN_ORACLE);
|
||||
if (orphanGUID)
|
||||
phase = 1;
|
||||
}
|
||||
}
|
||||
@@ -700,7 +706,7 @@ class npc_alexstraza_the_lifebinder : public CreatureScript
|
||||
|
||||
struct npc_alexstraza_the_lifebinderAI : public ScriptedAI
|
||||
{
|
||||
npc_alexstraza_the_lifebinderAI(Creature* creature) : ScriptedAI (creature) {}
|
||||
npc_alexstraza_the_lifebinderAI(Creature* creature) : ScriptedAI(creature) {}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
@@ -734,15 +740,17 @@ class npc_alexstraza_the_lifebinder : public CreatureScript
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_THE_DRAGON_QUEEN_ORACLE) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
if ((orphanGUID = getOrphanGUID(player, ORPHAN_ORACLE)))
|
||||
playerGUID = player->GetGUID();
|
||||
orphanGUID = getOrphanGUID(player, ORPHAN_ORACLE);
|
||||
if (orphanGUID)
|
||||
phase = 1;
|
||||
playerGUID = player->GetGUID();
|
||||
}
|
||||
else if (player->GetQuestStatus(QUEST_THE_DRAGON_QUEEN_WOLVAR) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
if ((orphanGUID = getOrphanGUID(player, ORPHAN_WOLVAR)))
|
||||
playerGUID = player->GetGUID();
|
||||
orphanGUID = getOrphanGUID(player, ORPHAN_WOLVAR);
|
||||
if (orphanGUID)
|
||||
phase = 7;
|
||||
playerGUID = player->GetGUID();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -915,7 +923,7 @@ class npc_cw_area_trigger : public CreatureScript
|
||||
|
||||
struct npc_cw_area_triggerAI : public ScriptedAI
|
||||
{
|
||||
npc_cw_area_triggerAI(Creature* creature) : ScriptedAI (creature)
|
||||
npc_cw_area_triggerAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
me->SetDisplayId(DISPLAY_INVISIBLE);
|
||||
}
|
||||
@@ -1011,7 +1019,7 @@ class npc_grizzlemaw_cw_trigger : public CreatureScript
|
||||
|
||||
struct npc_grizzlemaw_cw_triggerAI : public ScriptedAI
|
||||
{
|
||||
npc_grizzlemaw_cw_triggerAI(Creature* creature) : ScriptedAI (creature)
|
||||
npc_grizzlemaw_cw_triggerAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
me->SetDisplayId(DISPLAY_INVISIBLE);
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ class boss_ossirian : public CreatureScript
|
||||
CrystalCoordinates[CrystalIterator].GetPositionX(),
|
||||
CrystalCoordinates[CrystalIterator].GetPositionY(),
|
||||
CrystalCoordinates[CrystalIterator].GetPositionZ(),
|
||||
0, 0, 0, 0, 0, -1))
|
||||
0, 0, 0, 0, 0, uint32(-1)))
|
||||
{
|
||||
CrystalGUID = Crystal->GetGUID();
|
||||
++CrystalIterator;
|
||||
|
||||
@@ -28,7 +28,7 @@ BigNumber::BigNumber()
|
||||
, _array(NULL)
|
||||
{ }
|
||||
|
||||
BigNumber::BigNumber(const BigNumber &bn)
|
||||
BigNumber::BigNumber(BigNumber const& bn)
|
||||
: _bn(BN_dup(bn._bn))
|
||||
, _array(NULL)
|
||||
{ }
|
||||
@@ -58,44 +58,45 @@ void BigNumber::SetQword(uint64 val)
|
||||
BN_add_word(_bn, (uint32)(val & 0xFFFFFFFF));
|
||||
}
|
||||
|
||||
void BigNumber::SetBinary(const uint8 *bytes, int len)
|
||||
void BigNumber::SetBinary(uint8 const* bytes, int32 len)
|
||||
{
|
||||
uint8 t[1000];
|
||||
for (int i = 0; i < len; i++) t[i] = bytes[len - 1 - i];
|
||||
BN_bin2bn(t, len, _bn);
|
||||
}
|
||||
|
||||
void BigNumber::SetHexStr(const char *str)
|
||||
void BigNumber::SetHexStr(char const* str)
|
||||
{
|
||||
BN_hex2bn(&_bn, str);
|
||||
}
|
||||
|
||||
void BigNumber::SetRand(int numbits)
|
||||
void BigNumber::SetRand(int32 numbits)
|
||||
{
|
||||
BN_rand(_bn, numbits, 0, 1);
|
||||
}
|
||||
|
||||
BigNumber& BigNumber::operator=(const BigNumber &bn)
|
||||
BigNumber& BigNumber::operator=(BigNumber const& bn)
|
||||
{
|
||||
if (this == &bn)
|
||||
return *this;
|
||||
|
||||
BN_copy(_bn, bn._bn);
|
||||
return *this;
|
||||
}
|
||||
|
||||
BigNumber BigNumber::operator+=(const BigNumber &bn)
|
||||
BigNumber BigNumber::operator+=(BigNumber const& bn)
|
||||
{
|
||||
BN_add(_bn, _bn, bn._bn);
|
||||
return *this;
|
||||
}
|
||||
|
||||
BigNumber BigNumber::operator-=(const BigNumber &bn)
|
||||
BigNumber BigNumber::operator-=(BigNumber const& bn)
|
||||
{
|
||||
BN_sub(_bn, _bn, bn._bn);
|
||||
return *this;
|
||||
}
|
||||
|
||||
BigNumber BigNumber::operator*=(const BigNumber &bn)
|
||||
BigNumber BigNumber::operator*=(BigNumber const& bn)
|
||||
{
|
||||
BN_CTX *bnctx;
|
||||
|
||||
@@ -106,7 +107,7 @@ BigNumber BigNumber::operator*=(const BigNumber &bn)
|
||||
return *this;
|
||||
}
|
||||
|
||||
BigNumber BigNumber::operator/=(const BigNumber &bn)
|
||||
BigNumber BigNumber::operator/=(BigNumber const& bn)
|
||||
{
|
||||
BN_CTX *bnctx;
|
||||
|
||||
@@ -117,7 +118,7 @@ BigNumber BigNumber::operator/=(const BigNumber &bn)
|
||||
return *this;
|
||||
}
|
||||
|
||||
BigNumber BigNumber::operator%=(const BigNumber &bn)
|
||||
BigNumber BigNumber::operator%=(BigNumber const& bn)
|
||||
{
|
||||
BN_CTX *bnctx;
|
||||
|
||||
@@ -128,7 +129,7 @@ BigNumber BigNumber::operator%=(const BigNumber &bn)
|
||||
return *this;
|
||||
}
|
||||
|
||||
BigNumber BigNumber::Exp(const BigNumber &bn)
|
||||
BigNumber BigNumber::Exp(BigNumber const& bn)
|
||||
{
|
||||
BigNumber ret;
|
||||
BN_CTX *bnctx;
|
||||
@@ -140,7 +141,7 @@ BigNumber BigNumber::Exp(const BigNumber &bn)
|
||||
return ret;
|
||||
}
|
||||
|
||||
BigNumber BigNumber::ModExp(const BigNumber &bn1, const BigNumber &bn2)
|
||||
BigNumber BigNumber::ModExp(BigNumber const& bn1, BigNumber const& bn2)
|
||||
{
|
||||
BigNumber ret;
|
||||
BN_CTX *bnctx;
|
||||
@@ -152,7 +153,7 @@ BigNumber BigNumber::ModExp(const BigNumber &bn1, const BigNumber &bn2)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int BigNumber::GetNumBytes(void)
|
||||
int32 BigNumber::GetNumBytes(void)
|
||||
{
|
||||
return BN_num_bytes(_bn);
|
||||
}
|
||||
@@ -167,7 +168,7 @@ bool BigNumber::isZero() const
|
||||
return BN_is_zero(_bn);
|
||||
}
|
||||
|
||||
uint8 *BigNumber::AsByteArray(int minSize, bool reverse)
|
||||
uint8* BigNumber::AsByteArray(int32 minSize, bool reverse)
|
||||
{
|
||||
int length = (minSize >= GetNumBytes()) ? minSize : GetNumBytes();
|
||||
|
||||
|
||||
@@ -28,45 +28,49 @@ class BigNumber
|
||||
{
|
||||
public:
|
||||
BigNumber();
|
||||
BigNumber(const BigNumber &bn);
|
||||
BigNumber(BigNumber const& bn);
|
||||
BigNumber(uint32);
|
||||
~BigNumber();
|
||||
|
||||
void SetDword(uint32);
|
||||
void SetQword(uint64);
|
||||
void SetBinary(const uint8 *bytes, int len);
|
||||
void SetHexStr(const char *str);
|
||||
void SetBinary(uint8 const* bytes, int32 len);
|
||||
void SetHexStr(char const* str);
|
||||
|
||||
void SetRand(int numbits);
|
||||
void SetRand(int32 numbits);
|
||||
|
||||
BigNumber& operator=(const BigNumber &bn);
|
||||
BigNumber& operator=(BigNumber const& bn);
|
||||
|
||||
BigNumber operator+=(const BigNumber &bn);
|
||||
BigNumber operator+(const BigNumber &bn)
|
||||
BigNumber operator+=(BigNumber const& bn);
|
||||
BigNumber operator+(BigNumber const& bn)
|
||||
{
|
||||
BigNumber t(*this);
|
||||
return t += bn;
|
||||
}
|
||||
BigNumber operator-=(const BigNumber &bn);
|
||||
BigNumber operator-(const BigNumber &bn)
|
||||
|
||||
BigNumber operator-=(BigNumber const& bn);
|
||||
BigNumber operator-(BigNumber const& bn)
|
||||
{
|
||||
BigNumber t(*this);
|
||||
return t -= bn;
|
||||
}
|
||||
BigNumber operator*=(const BigNumber &bn);
|
||||
BigNumber operator*(const BigNumber &bn)
|
||||
|
||||
BigNumber operator*=(BigNumber const& bn);
|
||||
BigNumber operator*(BigNumber const& bn)
|
||||
{
|
||||
BigNumber t(*this);
|
||||
return t *= bn;
|
||||
}
|
||||
BigNumber operator/=(const BigNumber &bn);
|
||||
BigNumber operator/(const BigNumber &bn)
|
||||
|
||||
BigNumber operator/=(BigNumber const& bn);
|
||||
BigNumber operator/(BigNumber const& bn)
|
||||
{
|
||||
BigNumber t(*this);
|
||||
return t /= bn;
|
||||
}
|
||||
BigNumber operator%=(const BigNumber &bn);
|
||||
BigNumber operator%(const BigNumber &bn)
|
||||
|
||||
BigNumber operator%=(BigNumber const& bn);
|
||||
BigNumber operator%(BigNumber const& bn)
|
||||
{
|
||||
BigNumber t(*this);
|
||||
return t %= bn;
|
||||
@@ -74,15 +78,15 @@ class BigNumber
|
||||
|
||||
bool isZero() const;
|
||||
|
||||
BigNumber ModExp(const BigNumber &bn1, const BigNumber &bn2);
|
||||
BigNumber Exp(const BigNumber &);
|
||||
BigNumber ModExp(BigNumber const& bn1, BigNumber const& bn2);
|
||||
BigNumber Exp(BigNumber const&);
|
||||
|
||||
int GetNumBytes(void);
|
||||
int32 GetNumBytes(void);
|
||||
|
||||
struct bignum_st *BN() { return _bn; }
|
||||
|
||||
uint32 AsDword();
|
||||
uint8* AsByteArray(int minSize = 0, bool reverse = true);
|
||||
uint8* AsByteArray(int32 minSize = 0, bool reverse = true);
|
||||
|
||||
char * AsHexStr() const;
|
||||
char * AsDecStr() const;
|
||||
|
||||
@@ -28,20 +28,20 @@
|
||||
|
||||
struct SqlDbc
|
||||
{
|
||||
const std::string * formatString;
|
||||
const std::string * indexName;
|
||||
std::string const* formatString;
|
||||
std::string const* indexName;
|
||||
std::string sqlTableName;
|
||||
int32 indexPos;
|
||||
int32 sqlIndexPos;
|
||||
SqlDbc(const std::string * _filename, const std::string * _format, const std::string * _idname, const char * fmt)
|
||||
:formatString(_format), indexName (_idname), sqlIndexPos(0)
|
||||
SqlDbc(std::string const* _filename, std::string const* _format, std::string const* _idname, char const* fmt)
|
||||
: formatString(_format), indexName (_idname), sqlIndexPos(0)
|
||||
{
|
||||
// Convert dbc file name to sql table name
|
||||
sqlTableName = *_filename;
|
||||
for (uint32 i = 0; i< sqlTableName.size(); ++i)
|
||||
{
|
||||
if (isalpha(sqlTableName[i]))
|
||||
sqlTableName[i] = tolower(sqlTableName[i]);
|
||||
sqlTableName[i] = char(tolower(sqlTableName[i]));
|
||||
else if (sqlTableName[i] == '.')
|
||||
sqlTableName[i] = '_';
|
||||
}
|
||||
@@ -70,22 +70,24 @@ class DBCStorage
|
||||
{
|
||||
typedef std::list<char*> StringPoolList;
|
||||
public:
|
||||
explicit DBCStorage(const char *f) :
|
||||
fmt(f), nCount(0), fieldCount(0), dataTable(NULL)
|
||||
explicit DBCStorage(char const* f)
|
||||
: fmt(f), nCount(0), fieldCount(0), dataTable(NULL)
|
||||
{
|
||||
indexTable.asT = NULL;
|
||||
}
|
||||
|
||||
~DBCStorage() { Clear(); }
|
||||
|
||||
T const* LookupEntry(uint32 id) const
|
||||
{
|
||||
return (id >= nCount) ? NULL : indexTable.asT[id];
|
||||
}
|
||||
|
||||
uint32 GetNumRows() const { return nCount; }
|
||||
char const* GetFormat() const { return fmt; }
|
||||
uint32 GetFieldCount() const { return fieldCount; }
|
||||
|
||||
bool Load(char const* fn, SqlDbc * sql)
|
||||
bool Load(char const* fn, SqlDbc* sql)
|
||||
{
|
||||
DBCFileLoader dbc;
|
||||
// Check if load was sucessful, only then continue
|
||||
@@ -114,8 +116,9 @@ class DBCStorage
|
||||
fields = result->Fetch();
|
||||
sqlHighestIndex = fields[sql->sqlIndexPos].GetUInt32();
|
||||
}
|
||||
|
||||
// Check if sql index pos is valid
|
||||
if (int32(result->GetFieldCount()-1) < sql->sqlIndexPos)
|
||||
if (int32(result->GetFieldCount() - 1) < sql->sqlIndexPos)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_SERVER_LOADING, "Invalid index pos for dbc:'%s'", sql->sqlTableName.c_str());
|
||||
return false;
|
||||
@@ -123,13 +126,13 @@ class DBCStorage
|
||||
}
|
||||
}
|
||||
|
||||
char * sqlDataTable;
|
||||
char* sqlDataTable = NULL;
|
||||
fieldCount = dbc.GetCols();
|
||||
|
||||
dataTable = (T*)dbc.AutoProduceData(fmt, nCount, indexTable.asChar,
|
||||
sqlRecordCount, sqlHighestIndex, sqlDataTable);
|
||||
dataTable = reinterpret_cast<T*>(dbc.AutoProduceData(fmt, nCount, indexTable.asChar,
|
||||
sqlRecordCount, sqlHighestIndex, sqlDataTable));
|
||||
|
||||
stringPoolList.push_back(dbc.AutoProduceStrings(fmt, (char*)dataTable));
|
||||
stringPoolList.push_back(dbc.AutoProduceStrings(fmt, reinterpret_cast<char*>(dataTable)));
|
||||
|
||||
// Insert sql data into arrays
|
||||
if (result)
|
||||
@@ -151,10 +154,12 @@ class DBCStorage
|
||||
sLog->outError(LOG_FILTER_SERVER_LOADING, "Index %d already exists in dbc:'%s'", id, sql->sqlTableName.c_str());
|
||||
return false;
|
||||
}
|
||||
indexTable.asT[id]=(T*)&sqlDataTable[offset];
|
||||
|
||||
indexTable.asT[id] = reinterpret_cast<T*>(&sqlDataTable[offset]);
|
||||
}
|
||||
else
|
||||
indexTable.asT[rowIndex]=(T*)&sqlDataTable[offset];
|
||||
indexTable.asT[rowIndex]= reinterpret_cast<T*>(&sqlDataTable[offset]);
|
||||
|
||||
uint32 columnNumber = 0;
|
||||
uint32 sqlColumnNumber = 0;
|
||||
|
||||
@@ -165,22 +170,22 @@ class DBCStorage
|
||||
switch (fmt[columnNumber])
|
||||
{
|
||||
case FT_FLOAT:
|
||||
*((float*)(&sqlDataTable[offset]))= 0.0f;
|
||||
offset+=4;
|
||||
*reinterpret_cast<float*>(&sqlDataTable[offset]) = 0.0f;
|
||||
offset += 4;
|
||||
break;
|
||||
case FT_IND:
|
||||
case FT_INT:
|
||||
*((uint32*)(&sqlDataTable[offset]))=uint32(0);
|
||||
offset+=4;
|
||||
*reinterpret_cast<uint32*>(&sqlDataTable[offset]) = uint32(0);
|
||||
offset += 4;
|
||||
break;
|
||||
case FT_BYTE:
|
||||
*((uint8*)(&sqlDataTable[offset]))=uint8(0);
|
||||
offset+=1;
|
||||
*reinterpret_cast<uint8*>(&sqlDataTable[offset]) = uint8(0);
|
||||
offset += 1;
|
||||
break;
|
||||
case FT_STRING:
|
||||
// Beginning of the pool - empty string
|
||||
*((char**)(&sqlDataTable[offset]))=stringPoolList.back();
|
||||
offset+=sizeof(char*);
|
||||
*reinterpret_cast<char**>(&sqlDataTable[offset]) = stringPoolList.back();
|
||||
offset += sizeof(char*);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -190,17 +195,17 @@ class DBCStorage
|
||||
switch (fmt[columnNumber])
|
||||
{
|
||||
case FT_FLOAT:
|
||||
*((float*)(&sqlDataTable[offset]))=fields[sqlColumnNumber].GetFloat();
|
||||
offset+=4;
|
||||
*reinterpret_cast<float*>(&sqlDataTable[offset]) = fields[sqlColumnNumber].GetFloat();
|
||||
offset += 4;
|
||||
break;
|
||||
case FT_IND:
|
||||
case FT_INT:
|
||||
*((uint32*)(&sqlDataTable[offset]))=fields[sqlColumnNumber].GetUInt32();
|
||||
offset+=4;
|
||||
*reinterpret_cast<uint32*>(&sqlDataTable[offset]) = fields[sqlColumnNumber].GetUInt32();
|
||||
offset += 4;
|
||||
break;
|
||||
case FT_BYTE:
|
||||
*((uint8*)(&sqlDataTable[offset]))=fields[sqlColumnNumber].GetUInt8();
|
||||
offset+=1;
|
||||
*reinterpret_cast<uint8*>(&sqlDataTable[offset]) = fields[sqlColumnNumber].GetUInt8();
|
||||
offset += 1;
|
||||
break;
|
||||
case FT_STRING:
|
||||
sLog->outError(LOG_FILTER_SERVER_LOADING, "Unsupported data type in table '%s' at char %d", sql->sqlTableName.c_str(), columnNumber);
|
||||
@@ -209,6 +214,7 @@ class DBCStorage
|
||||
break;
|
||||
default:
|
||||
validSqlColumn = false;
|
||||
break;
|
||||
}
|
||||
if (validSqlColumn && (columnNumber != (sql->formatString->size()-1)))
|
||||
sqlColumnNumber++;
|
||||
@@ -219,7 +225,8 @@ class DBCStorage
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (sqlColumnNumber != (result->GetFieldCount()-1))
|
||||
|
||||
if (sqlColumnNumber != (result->GetFieldCount() - 1))
|
||||
{
|
||||
sLog->outError(LOG_FILTER_SERVER_LOADING, "SQL and DBC format strings are not matching for table: '%s'", sql->sqlTableName.c_str());
|
||||
return false;
|
||||
@@ -227,7 +234,7 @@ class DBCStorage
|
||||
|
||||
fields = NULL;
|
||||
++rowIndex;
|
||||
}while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,7 +253,7 @@ class DBCStorage
|
||||
if (!dbc.Load(fn, fmt))
|
||||
return false;
|
||||
|
||||
stringPoolList.push_back(dbc.AutoProduceStrings(fmt, (char*)dataTable));
|
||||
stringPoolList.push_back(dbc.AutoProduceStrings(fmt, reinterpret_cast<char*>(dataTable)));
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -256,9 +263,9 @@ class DBCStorage
|
||||
if (!indexTable.asT)
|
||||
return;
|
||||
|
||||
delete[] ((char*)indexTable.asT);
|
||||
delete[] reinterpret_cast<char*>(indexTable.asT);
|
||||
indexTable.asT = NULL;
|
||||
delete[] ((char*)dataTable);
|
||||
delete[] reinterpret_cast<char*>(dataTable);
|
||||
dataTable = NULL;
|
||||
|
||||
while (!stringPoolList.empty())
|
||||
@@ -266,6 +273,7 @@ class DBCStorage
|
||||
delete[] stringPoolList.front();
|
||||
stringPoolList.pop_front();
|
||||
}
|
||||
|
||||
nCount = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ void PreparedStatement::BindParameters()
|
||||
{
|
||||
ASSERT (m_stmt);
|
||||
|
||||
uint32 i = 0;
|
||||
uint8 i = 0;
|
||||
for (; i < statement_data.size(); i++)
|
||||
{
|
||||
switch (statement_data[i].type)
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
#include "AppenderDB.h"
|
||||
#include "Database/DatabaseEnv.h"
|
||||
|
||||
AppenderDB::AppenderDB(uint8 id, std::string const& name, LogLevel level, uint8 realmId):
|
||||
Appender(id, name, APPENDER_DB, level), realm(realmId), enable(false)
|
||||
AppenderDB::AppenderDB(uint8 id, std::string const& name, LogLevel level, uint32 realmId)
|
||||
: Appender(id, name, APPENDER_DB, level), realm(realmId), enable(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -41,8 +41,8 @@ void AppenderDB::_write(LogMessage& message)
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_LOG);
|
||||
stmt->setUInt64(0, message.mtime);
|
||||
stmt->setUInt32(1, realm);
|
||||
stmt->setUInt8(2, message.type);
|
||||
stmt->setUInt8(3, message.level);
|
||||
stmt->setUInt8(2, uint8(message.type));
|
||||
stmt->setUInt8(3, uint8(message.level));
|
||||
stmt->setString(4, message.text);
|
||||
LoginDatabase.Execute(stmt);
|
||||
break;
|
||||
|
||||
@@ -23,12 +23,12 @@
|
||||
class AppenderDB: public Appender
|
||||
{
|
||||
public:
|
||||
AppenderDB(uint8 _id, std::string const& _name, LogLevel level, uint8 realmId);
|
||||
AppenderDB(uint8 _id, std::string const& _name, LogLevel level, uint32 realmId);
|
||||
~AppenderDB();
|
||||
void setEnable(bool enable);
|
||||
|
||||
private:
|
||||
uint8 realm;
|
||||
uint32 realm;
|
||||
bool enable;
|
||||
void _write(LogMessage& message);
|
||||
};
|
||||
|
||||
@@ -169,7 +169,7 @@ void Log::CreateLoggerFromConfig(const char* name)
|
||||
return;
|
||||
|
||||
LogLevel level = LOG_LEVEL_DISABLED;
|
||||
int32 type = -1;
|
||||
uint8 type = uint8(-1);
|
||||
|
||||
std::string options = "Logger.";
|
||||
options.append(name);
|
||||
@@ -190,7 +190,7 @@ void Log::CreateLoggerFromConfig(const char* name)
|
||||
return;
|
||||
}
|
||||
|
||||
type = atoi(*iter);
|
||||
type = uint8(atoi(*iter));
|
||||
if (type > MaxLogFilter)
|
||||
{
|
||||
fprintf(stderr, "Log::CreateLoggerFromConfig: Wrong type %u for logger %s\n", type, name);
|
||||
@@ -334,7 +334,7 @@ bool Log::SetLogLevel(std::string const& name, const char* newLevelc, bool isLog
|
||||
|
||||
bool Log::ShouldLog(LogFilterType type, LogLevel level) const
|
||||
{
|
||||
LoggerMap::const_iterator it = loggers.find(type);
|
||||
LoggerMap::const_iterator it = loggers.find(uint8(type));
|
||||
if (it != loggers.end())
|
||||
{
|
||||
LogLevel loggerLevel = it->second.getLogLevel();
|
||||
|
||||
@@ -163,9 +163,9 @@ int32 MoneyStringToMoney(const std::string& moneyString)
|
||||
for (Tokenizer::const_iterator itr = tokens.begin(); itr != tokens.end(); ++itr)
|
||||
{
|
||||
std::string tokenString(*itr);
|
||||
uint32 gCount = std::count(tokenString.begin(), tokenString.end(), 'g');
|
||||
uint32 sCount = std::count(tokenString.begin(), tokenString.end(), 's');
|
||||
uint32 cCount = std::count(tokenString.begin(), tokenString.end(), 'c');
|
||||
size_t gCount = std::count(tokenString.begin(), tokenString.end(), 'g');
|
||||
size_t sCount = std::count(tokenString.begin(), tokenString.end(), 's');
|
||||
size_t cCount = std::count(tokenString.begin(), tokenString.end(), 'c');
|
||||
if (gCount + sCount + cCount != 1)
|
||||
return 0;
|
||||
|
||||
|
||||
@@ -254,7 +254,7 @@ int Master::Run()
|
||||
}
|
||||
|
||||
///- Launch the world listener socket
|
||||
uint16 wsport = sWorld->getIntConfig(CONFIG_PORT_WORLD);
|
||||
uint16 wsport = uint16(sWorld->getIntConfig(CONFIG_PORT_WORLD));
|
||||
std::string bind_ip = ConfigMgr::GetStringDefault("BindIP", "0.0.0.0");
|
||||
|
||||
if (sWorldSocketMgr->StartNetwork(wsport, bind_ip.c_str()) == -1)
|
||||
@@ -364,7 +364,7 @@ bool Master::_StartDB()
|
||||
return false;
|
||||
}
|
||||
|
||||
async_threads = ConfigMgr::GetIntDefault("WorldDatabase.WorkerThreads", 1);
|
||||
async_threads = uint8(ConfigMgr::GetIntDefault("WorldDatabase.WorkerThreads", 1));
|
||||
if (async_threads < 1 || async_threads > 32)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_WORLDSERVER, "World database: invalid number of worker threads specified. "
|
||||
@@ -372,7 +372,7 @@ bool Master::_StartDB()
|
||||
return false;
|
||||
}
|
||||
|
||||
synch_threads = ConfigMgr::GetIntDefault("WorldDatabase.SynchThreads", 1);
|
||||
synch_threads = uint8(ConfigMgr::GetIntDefault("WorldDatabase.SynchThreads", 1));
|
||||
///- Initialise the world database
|
||||
if (!WorldDatabase.Open(dbstring, async_threads, synch_threads))
|
||||
{
|
||||
@@ -388,7 +388,7 @@ bool Master::_StartDB()
|
||||
return false;
|
||||
}
|
||||
|
||||
async_threads = ConfigMgr::GetIntDefault("CharacterDatabase.WorkerThreads", 1);
|
||||
async_threads = uint8(ConfigMgr::GetIntDefault("CharacterDatabase.WorkerThreads", 1));
|
||||
if (async_threads < 1 || async_threads > 32)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_WORLDSERVER, "Character database: invalid number of worker threads specified. "
|
||||
@@ -396,7 +396,7 @@ bool Master::_StartDB()
|
||||
return false;
|
||||
}
|
||||
|
||||
synch_threads = ConfigMgr::GetIntDefault("CharacterDatabase.SynchThreads", 2);
|
||||
synch_threads = uint8(ConfigMgr::GetIntDefault("CharacterDatabase.SynchThreads", 2));
|
||||
|
||||
///- Initialise the Character database
|
||||
if (!CharacterDatabase.Open(dbstring, async_threads, synch_threads))
|
||||
@@ -413,7 +413,7 @@ bool Master::_StartDB()
|
||||
return false;
|
||||
}
|
||||
|
||||
async_threads = ConfigMgr::GetIntDefault("LoginDatabase.WorkerThreads", 1);
|
||||
async_threads = uint8(ConfigMgr::GetIntDefault("LoginDatabase.WorkerThreads", 1));
|
||||
if (async_threads < 1 || async_threads > 32)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_WORLDSERVER, "Login database: invalid number of worker threads specified. "
|
||||
@@ -421,7 +421,7 @@ bool Master::_StartDB()
|
||||
return false;
|
||||
}
|
||||
|
||||
synch_threads = ConfigMgr::GetIntDefault("LoginDatabase.SynchThreads", 1);
|
||||
synch_threads = uint8(ConfigMgr::GetIntDefault("LoginDatabase.SynchThreads", 1));
|
||||
///- Initialise the login database
|
||||
if (!LoginDatabase.Open(dbstring, async_threads, synch_threads))
|
||||
{
|
||||
|
||||
@@ -61,7 +61,7 @@ void RARunnable::run()
|
||||
|
||||
ACE_Acceptor<RASocket, ACE_SOCK_ACCEPTOR> acceptor;
|
||||
|
||||
uint16 raport = ConfigMgr::GetIntDefault("Ra.Port", 3443);
|
||||
uint16 raport = uint16(ConfigMgr::GetIntDefault("Ra.Port", 3443));
|
||||
std::string stringip = ConfigMgr::GetStringDefault("Ra.IP", "0.0.0.0");
|
||||
ACE_INET_Addr listen_addr(raport, stringip.c_str());
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
RASocket::RASocket()
|
||||
{
|
||||
_minLevel = ConfigMgr::GetIntDefault("RA.MinLevel", 3);
|
||||
_minLevel = uint8(ConfigMgr::GetIntDefault("RA.MinLevel", 3));
|
||||
}
|
||||
|
||||
RASocket::~RASocket()
|
||||
@@ -332,7 +332,7 @@ int RASocket::subnegotiate()
|
||||
|
||||
//! Just send back end of subnegotiation packet
|
||||
uint8 const reply[2] = {0xFF, 0xF0};
|
||||
return peer().send(reply, 2);
|
||||
return int(peer().send(reply, 2));
|
||||
}
|
||||
|
||||
int RASocket::svc(void)
|
||||
|
||||
Reference in New Issue
Block a user