Changed zone process window title format, example: 'crushbone :: clients: 6 inst_id: 1 inst_ver: 0 :: port: 7015'

Most of the following changes are QueryServ related, fully implemented its original functionality to be able to offload
	intensive or metric based logging to a remote server process that could exist on another server entirely
Implemented Player Event Logging Types (Go to table `qs_player_events`):
		1 = Player_Log_Quest,
		2 = Player_Log_Zoning,
		3 = Player_Log_Deaths,
		4 = Player_Log_Connect_State,
		5 = Player_Log_Levels,
		6 = Player_Log_Keyring_Addition,
		7 = Player_Log_QGlobal_Update,
		8 = Player_Log_Task_Updates,
		9 = Player_Log_AA_Purchases,
		10 = Player_Log_Trade_Skill_Events,
		11 = Player_Log_Issued_Commands,
		12 = Player_Log_Money_Transactions,
		13 = Player_Log_Alternate_Currency_Transactions,
		- All QueryServ logging will be implemented with a front end in EoC 2.0 very soon
Changed all QS Error related logging to 'QUERYSERV__ERROR'
(Natedog) (Crash Fix) Legacy MySQL bug revert for loading AA's COALESCE( from COALESCE (
Implemented Perl Quest objects (LUA still needed to be exported):
	- quest::qs_send_query("MySQL query") - Will send a raw query to the QueryServ process, useful for custom logging
	- quest::qs_player_event(char_id, event_desc); - Will process a quest type event to table `qs_player_events`
Added MySQL Tables:
	- `qs_player_aa_rate_hourly`
	- `qs_player_events`
	- Source table structures from:
		- utils\sql\git\queryserv\required\08_23_2014_player_events_and_player_aa_rate_hourly
		To get the complete QueryServ schema, source from here:
		- utils\sql\git\queryserv\required\Complete_QueryServ_Table_Structures.sql
Added rules for each logging type, source rules here with them enabled by default:
	- utils\sql\git\queryserv\required\Complete_QueryServ_Rules_Enabled.sql
Spawn related logging cleanup
General code cleanup
Added queryserv.cpp and queryserv.h with QueryServ class
This commit is contained in:
akkadius
2014-08-23 23:59:20 -05:00
parent 16d47a2c47
commit 7f89191ffc
40 changed files with 1316 additions and 779 deletions
+32 -30
View File
@@ -42,6 +42,9 @@
#include "quest_parser_collection.h"
#include "water_map.h"
#include "worldserver.h"
#include "queryserv.h"
extern QueryServ* QServ;
extern WorldServer worldserver;
#ifdef _WINDOWS
@@ -1455,14 +1458,14 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes att
int exploss = 0;
mlog(COMBAT__HITS, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob ? killerMob->GetName() : "Unknown", damage, spell, attack_skill);
//
// #1: Send death packet to everyone
//
/*
#1: Send death packet to everyone
*/
uint8 killed_level = GetLevel();
SendLogoutPackets();
//make our become corpse packet, and queue to ourself before OP_Death.
/* Make self become corpse packet */
EQApplicationPacket app2(OP_BecomeCorpse, sizeof(BecomeCorpse_Struct));
BecomeCorpse_Struct* bc = (BecomeCorpse_Struct*)app2.pBuffer;
bc->spawn_id = GetID();
@@ -1471,7 +1474,7 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes att
bc->z = GetZ();
QueuePacket(&app2);
// make death packet
/* Make Death Packet */
EQApplicationPacket app(OP_Death, sizeof(Death_Struct));
Death_Struct* d = (Death_Struct*)app.pBuffer;
d->spawn_id = GetID();
@@ -1484,9 +1487,9 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes att
app.priority = 6;
entity_list.QueueClients(this, &app);
//
// #2: figure out things that affect the player dying and mark them dead
//
/*
#2: figure out things that affect the player dying and mark them dead
*/
InterruptSpell();
SetPet(0);
@@ -1541,9 +1544,9 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes att
//remove ourself from all proximities
ClearAllProximities();
//
// #3: exp loss and corpse generation
//
/*
#3: exp loss and corpse generation
*/
// figure out if they should lose exp
if(RuleB(Character, UseDeathExpLossMult)){
@@ -1659,27 +1662,21 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes att
LeftCorpse = true;
}
// if(!IsLD())//Todo: make it so an LDed client leaves corpse if its enabled
// MakeCorpse(exploss);
} else {
BuffFadeDetrimental();
}
//
// Finally, send em home
//
/*
Finally, send em home
// we change the mob variables, not pp directly, because Save() will copy
// from these and overwrite what we set in pp anyway
//
We change the mob variables, not pp directly, because Save() will copy
from these and overwrite what we set in pp anyway
*/
if(LeftCorpse && (GetClientVersionBit() & BIT_SoFAndLater) && RuleB(Character, RespawnFromHover))
{
ClearDraggedCorpses();
RespawnFromHoverTimer.Start(RuleI(Character, RespawnFromHoverTimer) * 1000);
ClearDraggedCorpses();
RespawnFromHoverTimer.Start(RuleI(Character, RespawnFromHoverTimer) * 1000);
SendRespawnBinds();
}
else
@@ -1696,17 +1693,22 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes att
if(r)
r->MemberZoned(this);
dead_timer.Start(5000, true);
dead_timer.Start(5000, true);
m_pp.zone_id = m_pp.binds[0].zoneId;
m_pp.zoneInstance = 0;
database.MoveCharacterToZone(this->CharacterID(), database.GetZoneName(m_pp.zone_id));
Save();
database.MoveCharacterToZone(this->CharacterID(), database.GetZoneName(m_pp.zone_id));
Save();
GoToDeath();
}
/* QS: PlayerLogDeaths */
if (RuleB(QueryServ, PlayerLogDeaths)){
const char * killer_name = "";
if (killerMob && killerMob->GetCleanName()){ killer_name = killerMob->GetCleanName(); }
std::string event_desc = StringFormat("Died in zoneid:%i instid:%i by '%s', spellid:%i, damage:%i", this->GetZoneID(), this->GetInstanceID(), killer_name, spell, damage);
QServ->PlayerLogEvent(Player_Log_Deaths, this->CharacterID(), event_desc);
}
parse->EventPlayer(EVENT_DEATH_COMPLETE, this, buffer, 0);
return true;
}