Conflicts:
	common/eqemu_logsys.h
This commit is contained in:
Akkadius
2015-02-01 15:56:05 -06:00
53 changed files with 366 additions and 302 deletions
+3 -3
View File
@@ -107,9 +107,9 @@ public:
/* General Information Queries */
bool AddBannedIP(char* bannedIP, const char* notes); //Lieka Edit: Add IP address to the Banned_IPs table.
bool AddBannedIP(char* bannedIP, const char* notes); //Add IP address to the Banned_IPs table.
bool AddGMIP(char* ip_address, char* name);
bool CheckBannedIPs(const char* loginIP); //Lieka Edit: Check incoming connection against banned IP table.
bool CheckBannedIPs(const char* loginIP); //Check incoming connection against banned IP table.
bool CheckGMIPs(const char* loginIP, uint32 account_id);
bool CheckNameFilter(const char* name, bool surname = false);
bool CheckUsedName(const char* name);
@@ -118,7 +118,7 @@ public:
uint32 GetAccountIDByChar(uint32 char_id);
uint32 GetAccountIDByName(const char* accname, int16* status = 0, uint32* lsid = 0);
uint32 GetCharacterID(const char *name);
uint32 GetCharacterInfo(const char* iName, uint32* oAccID = 0, uint32* oZoneID = 0, uint32* oInstanceID = 0,float* oX = 0, float* oY = 0, float* oZ = 0);
uint32 GetCharacterInfo(const char* iName, uint32* oAccID = 0, uint32* oZoneID = 0, uint32* oInstanceID = 0, float* oX = 0, float* oY = 0, float* oZ = 0);
uint32 GetGuildIDByCharID(uint32 char_id);
void GetAccountName(uint32 accountid, char* name, uint32* oLSAccountID = 0);
+1 -1
View File
@@ -368,7 +368,7 @@ enum {
#define AT_DamageState 44 // The damage state of a destructible object (0 through 4)
//#define AT_Trader 300 // Bazzar Trader Mode
// solar: animations for AT_Anim
// animations for AT_Anim
#define ANIM_FREEZE 102
#define ANIM_STAND 0x64
#define ANIM_SIT 0x6e
+4 -4
View File
@@ -540,7 +540,7 @@ struct SpawnAppearance_Struct
};
// solar: this is used inside profile
// this is used inside profile
struct SpellBuff_Struct
{
/*000*/ uint8 slotid; //badly named... seems to be 2 for a real buff, 0 otherwise
@@ -1268,7 +1268,7 @@ struct Animation_Struct {
/*04*/
};
// solar: this is what causes the caster to animate and the target to
// this is what causes the caster to animate and the target to
// get the particle effects around them when a spell is cast
// also causes a buff icon
struct Action_Struct
@@ -1292,7 +1292,7 @@ struct Action_Struct
/* 31 */
};
// solar: this is what prints the You have been struck. and the regular
// this is what prints the You have been struck. and the regular
// melee messages like You try to pierce, etc. It's basically the melee
// and spell damage message
struct CombatDamage_Struct
@@ -1811,7 +1811,7 @@ struct RandomReq_Struct {
uint32 high;
};
/* solar: 9/23/03 reply to /random command; struct from Zaphod */
/* 9/23/03 reply to /random command */
struct RandomReply_Struct {
/* 00 */ uint32 low;
/* 04 */ uint32 high;
+5 -5
View File
@@ -72,7 +72,7 @@ namespace Console {
LightRed = 12,
LightMagenta = 13,
Yellow = 14,
White = 15,
White = 15
};
}
@@ -174,7 +174,7 @@ void EQEmuLogSys::ProcessLogWrite(uint16 debug_level, uint16 log_category, const
process_log << time_stamp << " " << message << std::endl;
}
uint16 EQEmuLogSys::GetWindowsConsoleColorFromCategory(uint16 log_category){
uint16 EQEmuLogSys::GetWindowsConsoleColorFromCategory(uint16 log_category) {
switch (log_category) {
case Logs::Status:
case Logs::Normal:
@@ -197,7 +197,7 @@ uint16 EQEmuLogSys::GetWindowsConsoleColorFromCategory(uint16 log_category){
}
}
std::string EQEmuLogSys::GetLinuxConsoleColorFromCategory(uint16 log_category){
std::string EQEmuLogSys::GetLinuxConsoleColorFromCategory(uint16 log_category) {
switch (log_category) {
case Logs::Status:
case Logs::Normal:
@@ -220,7 +220,7 @@ std::string EQEmuLogSys::GetLinuxConsoleColorFromCategory(uint16 log_category){
}
}
uint16 EQEmuLogSys::GetGMSayColorFromCategory(uint16 log_category){
uint16 EQEmuLogSys::GetGMSayColorFromCategory(uint16 log_category) {
switch (log_category) {
case Logs::Status:
case Logs::Normal:
@@ -317,7 +317,7 @@ void EQEmuLogSys::MakeDirectory(const std::string &directory_name)
void EQEmuLogSys::CloseFileLogs()
{
if (process_log.is_open()){
if (process_log.is_open()) {
process_log.close();
}
}
+4 -3
View File
@@ -26,11 +26,11 @@
#include "types.h"
namespace Logs{
namespace Logs {
enum DebugLevel {
General = 1, /* 1 - Low-Level general debugging, useful info on single line */
Moderate, /* 2 - Informational based, used in functions, when particular things load */
Detail, /* 3 - Use this for extreme detail in logging, usually in extreme debugging in the stack or interprocess communication */
Detail /* 3 - Use this for extreme detail in logging, usually in extreme debugging in the stack or interprocess communication */
};
/*
@@ -124,6 +124,7 @@ namespace Logs{
"MySQL Query",
"Mercenaries",
"Quest Debug",
"Quest Debug"
"Packet :: Server -> Client",
"Packet :: Client -> Server Unhandled",
};
@@ -160,7 +161,7 @@ public:
log_to_gmsay[category_id] = [1-3] - Sets debug level for category to output to gmsay
*/
struct LogSettings{
struct LogSettings {
uint8 log_to_file;
uint8 log_to_console;
uint8 log_to_gmsay;
+4
View File
@@ -1441,6 +1441,7 @@ ItemInst::ItemInst(const Item_Struct* item, int16 charges) {
m_ornamenticon = 0;
m_ornamentidfile = 0;
m_ornament_hero_model = 0;
m_recast_timestamp = 0;
}
ItemInst::ItemInst(SharedDatabase *db, uint32 item_id, int16 charges) {
@@ -1466,6 +1467,7 @@ ItemInst::ItemInst(SharedDatabase *db, uint32 item_id, int16 charges) {
m_ornamenticon = 0;
m_ornamentidfile = 0;
m_ornament_hero_model = 0;
m_recast_timestamp = 0;
}
ItemInst::ItemInst(ItemInstTypes use_type) {
@@ -1486,6 +1488,7 @@ ItemInst::ItemInst(ItemInstTypes use_type) {
m_ornamenticon = 0;
m_ornamentidfile = 0;
m_ornament_hero_model = 0;
m_recast_timestamp = 0;
}
// Make a copy of an ItemInst object
@@ -1539,6 +1542,7 @@ ItemInst::ItemInst(const ItemInst& copy)
m_ornamenticon = copy.m_ornamenticon;
m_ornamentidfile = copy.m_ornamentidfile;
m_ornament_hero_model = copy.m_ornament_hero_model;
m_recast_timestamp = copy.m_recast_timestamp;
}
// Clean up container contents
+3
View File
@@ -403,6 +403,8 @@ public:
void SetOrnamentationIDFile(uint32 ornament_idfile) { m_ornamentidfile = ornament_idfile; }
uint32 GetOrnamentHeroModel(int32 material_slot = -1) const;
void SetOrnamentHeroModel(uint32 ornament_hero_model) { m_ornament_hero_model = ornament_hero_model; }
uint32 GetRecastTimestamp() const { return m_recast_timestamp; }
void SetRecastTimestamp(uint32 in) { m_recast_timestamp = in; }
void Initialize(SharedDatabase *db = nullptr);
void ScaleItem();
@@ -450,6 +452,7 @@ protected:
uint32 m_ornamenticon;
uint32 m_ornamentidfile;
uint32 m_ornament_hero_model;
uint32 m_recast_timestamp;
//
// Items inside of this item (augs or contents);
+1 -1
View File
@@ -5000,7 +5000,7 @@ namespace RoF
hdr.scaled_value = inst->IsScaling() ? inst->GetExp() / 100 : 0;
hdr.instance_id = (merchant_slot == 0) ? inst->GetSerialNumber() : merchant_slot;
hdr.unknown028 = 0;
hdr.last_cast_time = ((item->RecastDelay > 1) ? 1212693140 : 0);
hdr.last_cast_time = inst->GetRecastTimestamp();
hdr.charges = (stackable ? (item->MaxCharges ? 1 : 0) : charges);
hdr.inst_nodrop = inst->IsAttuned() ? 1 : 0;
hdr.unknown044 = 0;
+1 -1
View File
@@ -5069,7 +5069,7 @@ namespace RoF2
hdr.scaled_value = inst->IsScaling() ? inst->GetExp() / 100 : 0;
hdr.instance_id = (merchant_slot == 0) ? inst->GetSerialNumber() : merchant_slot;
hdr.unknown028 = 0;
hdr.last_cast_time = ((item->RecastDelay > 1) ? 1212693140 : 0);
hdr.last_cast_time = inst->GetRecastTimestamp();
hdr.charges = (stackable ? (item->MaxCharges ? 1 : 0) : charges);
hdr.inst_nodrop = inst->IsAttuned() ? 1 : 0;
hdr.unknown044 = 0;
+3 -3
View File
@@ -1394,7 +1394,7 @@ struct Animation_Struct {
/*04*/
};
// solar: this is what causes the caster to animate and the target to
// this is what causes the caster to animate and the target to
// get the particle effects around them when a spell is cast
// also causes a buff icon
struct Action_Struct
@@ -1445,7 +1445,7 @@ struct ActionAlt_Struct
/*56*/
};
// solar: this is what prints the You have been struck. and the regular
// this is what prints the You have been struck. and the regular
// melee messages like You try to pierce, etc. It's basically the melee
// and spell damage message
struct CombatDamage_Struct
@@ -1997,7 +1997,7 @@ struct RandomReq_Struct {
uint32 high;
};
/* solar: 9/23/03 reply to /random command; struct from Zaphod */
/* 9/23/03 reply to /random command */
struct RandomReply_Struct {
/* 00 */ uint32 low;
/* 04 */ uint32 high;
+3 -3
View File
@@ -1425,7 +1425,7 @@ struct Animation_Struct {
/*04*/
};
// solar: this is what causes the caster to animate and the target to
// this is what causes the caster to animate and the target to
// get the particle effects around them when a spell is cast
// also causes a buff icon
struct Action_Struct
@@ -1476,7 +1476,7 @@ struct ActionAlt_Struct
/*56*/
};
// solar: this is what prints the You have been struck. and the regular
// this is what prints the You have been struck. and the regular
// melee messages like You try to pierce, etc. It's basically the melee
// and spell damage message
struct CombatDamage_Struct
@@ -2028,7 +2028,7 @@ struct RandomReq_Struct {
uint32 high;
};
/* solar: 9/23/03 reply to /random command; struct from Zaphod */
/* 9/23/03 reply to /random command */
struct RandomReply_Struct {
/* 00 */ uint32 low;
/* 04 */ uint32 high;
+1 -1
View File
@@ -3548,7 +3548,7 @@ namespace SoD
hdr.scaled_value = inst->IsScaling() ? inst->GetExp() / 100 : 0;
hdr.instance_id = (merchant_slot == 0) ? inst->GetSerialNumber() : merchant_slot;
hdr.unknown028 = 0;
hdr.last_cast_time = ((item->RecastDelay > 1) ? 1212693140 : 0);
hdr.last_cast_time = inst->GetRecastTimestamp();
hdr.charges = (stackable ? (item->MaxCharges ? 1 : 0) : charges);
hdr.inst_nodrop = inst->IsAttuned() ? 1 : 0;
hdr.unknown044 = 0;
+4 -4
View File
@@ -538,7 +538,7 @@ struct SpawnAppearance_Struct
};
// solar: this is used inside profile
// this is used inside profile
struct SpellBuff_Struct
{
/*000*/ uint8 slotid; //badly named... seems to be 2 for a real buff, 0 otherwise
@@ -1196,7 +1196,7 @@ struct Animation_Struct {
/*04*/
};
// solar: this is what causes the caster to animate and the target to
// this is what causes the caster to animate and the target to
// get the particle effects around them when a spell is cast
// also causes a buff icon
struct Action_Struct
@@ -1248,7 +1248,7 @@ struct ActionAlt_Struct // ActionAlt_Struct - Size: 56 bytes
/*0056*/
};
// solar: this is what prints the You have been struck. and the regular
// this is what prints the You have been struck. and the regular
// melee messages like You try to pierce, etc. It's basically the melee
// and spell damage message
struct CombatDamage_Struct
@@ -1791,7 +1791,7 @@ struct RandomReq_Struct {
uint32 high;
};
/* solar: 9/23/03 reply to /random command; struct from Zaphod */
/* 9/23/03 reply to /random command */
struct RandomReply_Struct {
/* 00 */ uint32 low;
/* 04 */ uint32 high;
+1 -1
View File
@@ -2872,7 +2872,7 @@ namespace SoF
hdr.scaled_value = inst->IsScaling() ? inst->GetExp() / 100 : 0;
hdr.instance_id = (merchant_slot == 0) ? inst->GetSerialNumber() : merchant_slot;
hdr.unknown028 = 0;
hdr.last_cast_time = ((item->RecastDelay > 1) ? 1212693140 : 0);
hdr.last_cast_time = inst->GetRecastTimestamp();
hdr.charges = (stackable ? (item->MaxCharges ? 1 : 0) : charges);
hdr.inst_nodrop = inst->IsAttuned() ? 1 : 0;
hdr.unknown044 = 0;
+4 -4
View File
@@ -515,7 +515,7 @@ struct SpawnAppearance_Struct
};
// solar: this is used inside profile
// this is used inside profile
struct SpellBuff_Struct
{
/*000*/ uint8 slotid; //badly named... seems to be 2 for a real buff, 0 otherwise
@@ -1172,7 +1172,7 @@ struct Animation_Struct {
/*04*/
};
// solar: this is what causes the caster to animate and the target to
// this is what causes the caster to animate and the target to
// get the particle effects around them when a spell is cast
// also causes a buff icon
struct Action_Struct
@@ -1224,7 +1224,7 @@ struct ActionAlt_Struct // ActionAlt_Struct - Size: 56 bytes
/*0056*/
};
// solar: this is what prints the You have been struck. and the regular
// this is what prints the You have been struck. and the regular
// melee messages like You try to pierce, etc. It's basically the melee
// and spell damage message
struct CombatDamage_Struct
@@ -1768,7 +1768,7 @@ struct RandomReq_Struct {
uint32 high;
};
/* solar: 9/23/03 reply to /random command; struct from Zaphod */
/* 9/23/03 reply to /random command */
struct RandomReply_Struct {
/* 00 */ uint32 low;
/* 04 */ uint32 high;
+1 -1
View File
@@ -2004,7 +2004,7 @@ namespace Titanium
inst->IsScaling() ? inst->GetExp() / 100 : 0,
//merchant_slot, //instance ID, bullshit for now
(merchant_slot == 0) ? inst->GetSerialNumber() : merchant_slot,
0, // item recast timer timestamp field (aka..last_cast_time field in SoF+ clients)
inst->GetRecastTimestamp(),
(stackable ? ((inst->GetItem()->ItemType == ItemTypePotion) ? 1 : 0) : charges),
inst->IsAttuned() ? 1 : 0,
0
+4 -4
View File
@@ -438,7 +438,7 @@ struct SpawnAppearance_Struct
};
// solar: this is used inside profile
// this is used inside profile
struct SpellBuff_Struct
{
/*000*/ uint8 slotid; //badly named... seems to be 2 for a real buff, 0 otherwise
@@ -1054,7 +1054,7 @@ struct Animation_Struct {
/*04*/
};
// solar: this is what causes the caster to animate and the target to
// this is what causes the caster to animate and the target to
// get the particle effects around them when a spell is cast
// also causes a buff icon
struct Action_Struct
@@ -1078,7 +1078,7 @@ struct Action_Struct
/* 31 */
};
// solar: this is what prints the You have been struck. and the regular
// this is what prints the You have been struck. and the regular
// melee messages like You try to pierce, etc. It's basically the melee
// and spell damage message
struct CombatDamage_Struct
@@ -1516,7 +1516,7 @@ struct RandomReq_Struct {
uint32 high;
};
/* solar: 9/23/03 reply to /random command; struct from Zaphod */
/* 9/23/03 reply to /random command */
struct RandomReply_Struct {
/* 00 */ uint32 low;
/* 04 */ uint32 high;
+1 -1
View File
@@ -3793,7 +3793,7 @@ namespace UF
hdr.scaled_value = inst->IsScaling() ? inst->GetExp() / 100 : 0;
hdr.instance_id = (merchant_slot == 0) ? inst->GetSerialNumber() : merchant_slot;
hdr.unknown028 = 0;
hdr.last_cast_time = ((item->RecastDelay > 1) ? 1212693140 : 0);
hdr.last_cast_time = inst->GetRecastTimestamp();
hdr.charges = (stackable ? (item->MaxCharges ? 1 : 0) : charges);
hdr.inst_nodrop = inst->IsAttuned() ? 1 : 0;
hdr.unknown044 = 0;
+3 -3
View File
@@ -1250,7 +1250,7 @@ struct Animation_Struct {
/*04*/
};
// solar: this is what causes the caster to animate and the target to
// this is what causes the caster to animate and the target to
// get the particle effects around them when a spell is cast
// also causes a buff icon
struct Action_Struct
@@ -1305,7 +1305,7 @@ struct ActionAlt_Struct
/*64*/
};
// solar: this is what prints the You have been struck. and the regular
// this is what prints the You have been struck. and the regular
// melee messages like You try to pierce, etc. It's basically the melee
// and spell damage message
struct CombatDamage_Struct
@@ -1849,7 +1849,7 @@ struct RandomReq_Struct {
uint32 high;
};
/* solar: 9/23/03 reply to /random command; struct from Zaphod */
/* 9/23/03 reply to /random command */
struct RandomReply_Struct {
/* 00 */ uint32 low;
/* 04 */ uint32 high;
+1
View File
@@ -79,6 +79,7 @@ public:
inline const uint32 GetTimerTime() const { return timer_time; }
inline const uint32 GetStartTime() const { return start_time; }
inline const pTimerType GetType() const { return _type; }
inline const uint32 GetReadyTimestamp() const { return start_time + timer_time; }
inline bool Enabled() { return enabled; }
+62 -21
View File
@@ -438,30 +438,29 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory *inv, bool is_charid)
}
}
if (!row[9])
continue;
if (row[9]) {
std::string data_str(row[9]);
std::string idAsString;
std::string value;
bool use_id = true;
std::string data_str(row[9]);
std::string idAsString;
std::string value;
bool use_id = true;
for (int i = 0; i < data_str.length(); ++i) {
if (data_str[i] == '^') {
if (!use_id) {
inst->SetCustomData(idAsString, value);
idAsString.clear();
value.clear();
for (int i = 0; i < data_str.length(); ++i) {
if (data_str[i] == '^') {
if (!use_id) {
inst->SetCustomData(idAsString, value);
idAsString.clear();
value.clear();
}
use_id = !use_id;
continue;
}
use_id = !use_id;
continue;
}
char v = data_str[i];
if (use_id)
idAsString.push_back(v);
else
value.push_back(v);
char v = data_str[i];
if (use_id)
idAsString.push_back(v);
else
value.push_back(v);
}
}
put_slot_id = inv->PutItem(slot_id, *inst);
@@ -499,6 +498,8 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory *inv)
return false;
}
auto timestamps = GetItemRecastTimestamps(char_id);
for (auto row = results.begin(); row != results.end(); ++row) {
int16 slot_id = atoi(row[0]);
uint32 item_id = atoi(row[1]);
@@ -583,6 +584,13 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory *inv)
else
inst->SetCharges(charges);
if (item->RecastDelay) {
if (timestamps.count(item->RecastType))
inst->SetRecastTimestamp(timestamps.at(item->RecastType));
else
inst->SetRecastTimestamp(0);
}
if (item->ItemClass == ItemClassCommon) {
for (int i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) {
if (aug[i])
@@ -726,6 +734,39 @@ bool SharedDatabase::GetInventory(uint32 account_id, char *name, Inventory *inv)
return GetSharedBank(account_id, inv, false);
}
std::map<uint32, uint32> SharedDatabase::GetItemRecastTimestamps(uint32 char_id)
{
std::map<uint32, uint32> timers;
std::string query = StringFormat("SELECT recast_type,timestamp FROM character_item_recast WHERE id=%u", char_id);
auto results = QueryDatabase(query);
if (!results.Success() || results.RowCount() == 0)
return timers;
for (auto row = results.begin(); row != results.end(); ++row)
timers[atoul(row[0])] = atoul(row[1]);
return timers; // RVO or move assigned
}
uint32 SharedDatabase::GetItemRecastTimestamp(uint32 char_id, uint32 recast_type)
{
std::string query = StringFormat("SELECT timestamp FROM character_item_recast WHERE id=%u AND recast_type=%u",
char_id, recast_type);
auto results = QueryDatabase(query);
if (!results.Success() || results.RowCount() == 0)
return 0;
auto row = results.begin();
return static_cast<uint32>(atoul(row[0]));
}
void SharedDatabase::ClearOldRecastTimestamps(uint32 char_id)
{
// This actually isn't strictly live-like. Live your recast timestamps are forever
std::string query =
StringFormat("DELETE FROM character_item_recast WHERE id = %u and timestamp < UNIX_TIMESTAMP()", char_id);
QueryDatabase(query);
}
void SharedDatabase::GetItemsCount(int32 &item_count, uint32 &max_id)
{
item_count = -1;
+4
View File
@@ -11,6 +11,7 @@
#include "fixed_memory_variable_hash_set.h"
#include <list>
#include <map>
class EvolveInfo;
class Inventory;
@@ -69,6 +70,9 @@ class SharedDatabase : public Database
bool SetSharedPlatinum(uint32 account_id, int32 amount_to_add);
bool GetInventory(uint32 char_id, Inventory* inv);
bool GetInventory(uint32 account_id, char* name, Inventory* inv);
std::map<uint32, uint32> GetItemRecastTimestamps(uint32 char_id);
uint32 GetItemRecastTimestamp(uint32 char_id, uint32 recast_type);
void ClearOldRecastTimestamps(uint32 char_id);
bool SetStartingItems(PlayerProfile_Struct* pp, Inventory* inv, uint32 si_race, uint32 si_class, uint32 si_deity, uint32 si_current_zone, char* si_name, int admin);
+1 -1
View File
@@ -19,7 +19,7 @@
/*
solar: General outline of spell casting process
General outline of spell casting process
1.
a) Client clicks a spell bar gem, ability, or item. client_process.cpp
+1 -1
View File
@@ -618,7 +618,7 @@ typedef enum {
#define DF_Permanent 50
// solar: note this struct is historical, we don't actually need it to be
// note this struct is historical, we don't actually need it to be
// aligned to anything, but for maintaining it it is kept in the order that
// the fields in the text file are. the numbering is not offset, but field
// number. note that the id field is counted as 0, this way the numbers
+2 -2
View File
@@ -255,7 +255,7 @@ bool atobool(const char* iBool) {
return false;
}
// solar: removes the crap and turns the underscores into spaces.
// removes the crap and turns the underscores into spaces.
char *CleanMobName(const char *in, char *out)
{
unsigned i, j;
@@ -414,4 +414,4 @@ void find_replace(std::string& string_subject, std::string& search_string, std::
string_subject.replace(index, index + 1, replace_string);
index = string_subject.find_first_of(search_string);
}
}
}
+1 -1
View File
@@ -30,7 +30,7 @@
Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
*/
#define CURRENT_BINARY_DATABASE_VERSION 9072
#define CURRENT_BINARY_DATABASE_VERSION 9073
#define COMPILE_DATE __DATE__
#define COMPILE_TIME __TIME__
#ifndef WIN32