mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-19 13:28:25 +00:00
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:
+232
-225
@@ -16,16 +16,16 @@
|
||||
*/
|
||||
|
||||
#include "../common/debug.h"
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <zlib.h>
|
||||
#include <assert.h>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <math.h>
|
||||
#include <set>
|
||||
#include <sstream>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <zlib.h>
|
||||
|
||||
#ifdef _WINDOWS
|
||||
#define snprintf _snprintf
|
||||
@@ -38,8 +38,6 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "masterentity.h"
|
||||
#include "zonedb.h"
|
||||
#include "../common/packet_functions.h"
|
||||
#include "../common/packet_dump.h"
|
||||
#include "worldserver.h"
|
||||
@@ -59,17 +57,21 @@
|
||||
#include "../common/faction.h"
|
||||
#include "../common/crc32.h"
|
||||
#include "string_ids.h"
|
||||
#include "map.h"
|
||||
#include "titles.h"
|
||||
#include "pets.h"
|
||||
#include "water_map.h"
|
||||
#include "worldserver.h"
|
||||
#include "zone.h"
|
||||
#include "zone_config.h"
|
||||
#include "guild_mgr.h"
|
||||
#include "pathing.h"
|
||||
#include "water_map.h"
|
||||
#include "merc.h"
|
||||
#include "pets.h"
|
||||
#include "../common/zone_numbers.h"
|
||||
#include "quest_parser_collection.h"
|
||||
#include "queryserv.h"
|
||||
|
||||
extern QueryServ* QServ;
|
||||
extern Zone* zone;
|
||||
extern volatile bool ZoneLoaded;
|
||||
extern WorldServer worldserver;
|
||||
@@ -5687,8 +5689,8 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app)
|
||||
safe_delete(outapp);
|
||||
|
||||
// start QS code
|
||||
if(RuleB(QueryServ, MerchantLogTransactions)) {
|
||||
ServerPacket* qspack = new ServerPacket(ServerOP_QSMerchantLogTransactions, sizeof(QSMerchantLogTransaction_Struct) + sizeof(QSTransactionItems_Struct));
|
||||
if(RuleB(QueryServ, PlayerLogMerchantTransactions)) {
|
||||
ServerPacket* qspack = new ServerPacket(ServerOP_QSPlayerLogMerchantTransactions, sizeof(QSMerchantLogTransaction_Struct) + sizeof(QSTransactionItems_Struct));
|
||||
QSMerchantLogTransaction_Struct* qsaudit = (QSMerchantLogTransaction_Struct*)qspack->pBuffer;
|
||||
|
||||
qsaudit->zone_id = zone->GetZoneID();
|
||||
@@ -5823,8 +5825,8 @@ void Client::Handle_OP_ShopPlayerSell(const EQApplicationPacket *app)
|
||||
}
|
||||
|
||||
// start QS code
|
||||
if(RuleB(QueryServ, MerchantLogTransactions)) {
|
||||
ServerPacket* qspack = new ServerPacket(ServerOP_QSMerchantLogTransactions, sizeof(QSMerchantLogTransaction_Struct) + sizeof(QSTransactionItems_Struct));
|
||||
if(RuleB(QueryServ, PlayerLogMerchantTransactions)) {
|
||||
ServerPacket* qspack = new ServerPacket(ServerOP_QSPlayerLogMerchantTransactions, sizeof(QSMerchantLogTransaction_Struct) + sizeof(QSTransactionItems_Struct));
|
||||
QSMerchantLogTransaction_Struct* qsaudit = (QSMerchantLogTransaction_Struct*)qspack->pBuffer;
|
||||
|
||||
qsaudit->zone_id = zone->GetZoneID();
|
||||
@@ -9180,8 +9182,7 @@ bool Client::FinishConnState2(DBAsyncWork* dbaw) {
|
||||
if(!GetAA(aaPersistentMinion))
|
||||
memset(&m_suspendedminion, 0, sizeof(PetInfo));
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Server Zone Entry Packet
|
||||
/* Server Zone Entry Packet */
|
||||
outapp = new EQApplicationPacket(OP_ZoneEntry, sizeof(ServerZoneEntry_Struct));
|
||||
ServerZoneEntry_Struct* sze = (ServerZoneEntry_Struct*)outapp->pBuffer;
|
||||
|
||||
@@ -9191,43 +9192,31 @@ bool Client::FinishConnState2(DBAsyncWork* dbaw) {
|
||||
sze->player.spawn.z += 6; //arbitrary lift, seems to help spawning under zone.
|
||||
outapp->priority = 6;
|
||||
FastQueuePacket(&outapp);
|
||||
//safe_delete(outapp);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Zone Spawns Packet
|
||||
/* Zone Spawns Packet */
|
||||
entity_list.SendZoneSpawnsBulk(this);
|
||||
entity_list.SendZoneCorpsesBulk(this);
|
||||
entity_list.SendZonePVPUpdates(this); //hack until spawn struct is fixed.
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Time of Day packet
|
||||
/* Time of Day packet */
|
||||
outapp = new EQApplicationPacket(OP_TimeOfDay, sizeof(TimeOfDay_Struct));
|
||||
TimeOfDay_Struct* tod = (TimeOfDay_Struct*)outapp->pBuffer;
|
||||
zone->zone_time.getEQTimeOfDay(time(0), tod);
|
||||
outapp->priority = 6;
|
||||
FastQueuePacket(&outapp);
|
||||
//safe_delete(outapp);
|
||||
|
||||
//I think this should happen earlier, not sure
|
||||
/* if(GetHideMe())
|
||||
SetHideMe(true); */
|
||||
// Moved to Handle_Connect_OP_SendExpZonein();
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Tribute Packets
|
||||
/* Tribute Packets */
|
||||
DoTributeUpdate();
|
||||
if(m_pp.tribute_active) {
|
||||
//restart the tribute timer where we left off
|
||||
tribute_timer.Start(m_pp.tribute_time_remaining);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Character Inventory Packet
|
||||
//this is not quite where live sends inventory, they do it after tribute
|
||||
if (loaditems) {//dont load if a length error occurs
|
||||
/*
|
||||
Character Inventory Packet
|
||||
this is not quite where live sends inventory, they do it after tribute
|
||||
*/
|
||||
if (loaditems) { //dont load if a length error occurs
|
||||
BulkSendInventoryItems();
|
||||
|
||||
// Send stuff on the cursor which isnt sent in bulk
|
||||
@@ -9241,9 +9230,7 @@ bool Client::FinishConnState2(DBAsyncWork* dbaw) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Task Packets
|
||||
/* Task Packets */
|
||||
LoadClientTaskState();
|
||||
|
||||
if (GetClientVersion() >= EQClientRoF)
|
||||
@@ -9261,10 +9248,11 @@ bool Client::FinishConnState2(DBAsyncWork* dbaw) {
|
||||
FastQueuePacket(&outapp);
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Weather Packet
|
||||
// This shouldent be moved, this seems to be what the client
|
||||
// uses to advance to the next state (sending ReqNewZone)
|
||||
/*
|
||||
Weather Packet
|
||||
This shouldent be moved, this seems to be what the client
|
||||
uses to advance to the next state (sending ReqNewZone)
|
||||
*/
|
||||
outapp = new EQApplicationPacket(OP_Weather, 12);
|
||||
Weather_Struct *ws = (Weather_Struct *) outapp->pBuffer;
|
||||
ws->val1 = 0x000000FF;
|
||||
@@ -9279,16 +9267,6 @@ bool Client::FinishConnState2(DBAsyncWork* dbaw) {
|
||||
QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Group Roles
|
||||
//
|
||||
//////////////////////////////////////
|
||||
/*if(group){
|
||||
group->NotifyMainTank(this, 1);
|
||||
group->NotifyMainAssist(this, 1);
|
||||
group->NotifyPuller(this, 1);
|
||||
}*/
|
||||
|
||||
SetAttackTimer();
|
||||
|
||||
conn_state = ZoneInfoSent;
|
||||
@@ -9296,9 +9274,8 @@ bool Client::FinishConnState2(DBAsyncWork* dbaw) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Finish client connecting state
|
||||
void Client::CompleteConnect()
|
||||
{
|
||||
/* Finish client connecting state */
|
||||
void Client::CompleteConnect() {
|
||||
UpdateWho();
|
||||
client_state = CLIENT_CONNECTED;
|
||||
|
||||
@@ -9311,14 +9288,14 @@ void Client::CompleteConnect()
|
||||
EnteringMessages(this);
|
||||
LoadZoneFlags();
|
||||
|
||||
// Sets GM Flag if needed & Sends Petition Queue
|
||||
/* Sets GM Flag if needed & Sends Petition Queue */
|
||||
UpdateAdmin(false);
|
||||
|
||||
if(IsInAGuild()){
|
||||
if (IsInAGuild()){
|
||||
SendAppearancePacket(AT_GuildID, GuildID(), false);
|
||||
SendAppearancePacket(AT_GuildRank, GuildRank(), false);
|
||||
}
|
||||
for(uint32 spellInt= 0; spellInt < MAX_PP_SPELLBOOK; spellInt++)
|
||||
for (uint32 spellInt = 0; spellInt < MAX_PP_SPELLBOOK; spellInt++)
|
||||
{
|
||||
if (m_pp.spell_book[spellInt] < 3 || m_pp.spell_book[spellInt] > 50000)
|
||||
m_pp.spell_book[spellInt] = 0xFFFFFFFF;
|
||||
@@ -9329,35 +9306,37 @@ void Client::CompleteConnect()
|
||||
|
||||
uint32 raidid = database.GetRaidID(GetName());
|
||||
Raid *raid = nullptr;
|
||||
if(raidid > 0){
|
||||
if (raidid > 0){
|
||||
raid = entity_list.GetRaidByID(raidid);
|
||||
if(!raid){
|
||||
if (!raid){
|
||||
raid = new Raid(raidid);
|
||||
if(raid->GetID() != 0){
|
||||
if (raid->GetID() != 0){
|
||||
entity_list.AddRaid(raid, raidid);
|
||||
}
|
||||
else
|
||||
raid = nullptr;
|
||||
}
|
||||
if(raid){
|
||||
if (raid){
|
||||
SetRaidGrouped(true);
|
||||
raid->LearnMembers();
|
||||
raid->VerifyRaid();
|
||||
raid->GetRaidDetails();
|
||||
//only leader should get this; send to all for now till
|
||||
//I figure out correct creation; can probably also send a no longer leader packet for non leaders
|
||||
//but not important for now.
|
||||
/*
|
||||
Only leader should get this; send to all for now till
|
||||
I figure out correct creation; can probably also send a no longer leader packet for non leaders
|
||||
but not important for now.
|
||||
*/
|
||||
raid->SendRaidCreate(this);
|
||||
raid->SendMakeLeaderPacketTo(raid->leadername, this);
|
||||
raid->SendRaidAdd(GetName(), this);
|
||||
raid->SendBulkRaid(this);
|
||||
raid->SendGroupUpdate(this);
|
||||
uint32 grpID = raid->GetGroup(GetName());
|
||||
if(grpID < 12){
|
||||
if (grpID < 12){
|
||||
raid->SendRaidGroupRemove(GetName(), grpID);
|
||||
raid->SendRaidGroupAdd(GetName(), grpID);
|
||||
}
|
||||
if(raid->IsLocked())
|
||||
if (raid->IsLocked())
|
||||
raid->SendRaidLockTo(this);
|
||||
}
|
||||
}
|
||||
@@ -9366,154 +9345,155 @@ void Client::CompleteConnect()
|
||||
|
||||
//reapply some buffs
|
||||
uint32 buff_count = GetMaxTotalSlots();
|
||||
for (uint32 j1=0; j1 < buff_count; j1++) {
|
||||
if (buffs[j1].spellid > (uint32)SPDAT_RECORDS)
|
||||
for (uint32 j1 = 0; j1 < buff_count; j1++) {
|
||||
if (buffs[j1].spellid >(uint32)SPDAT_RECORDS)
|
||||
continue;
|
||||
|
||||
const SPDat_Spell_Struct &spell = spells[buffs[j1].spellid];
|
||||
|
||||
for (int x1=0; x1 < EFFECT_COUNT; x1++) {
|
||||
for (int x1 = 0; x1 < EFFECT_COUNT; x1++) {
|
||||
switch (spell.effectid[x1]) {
|
||||
case SE_IllusionCopy:
|
||||
case SE_Illusion: {
|
||||
if (spell.base[x1] == -1) {
|
||||
if (gender == 1)
|
||||
gender = 0;
|
||||
else if (gender == 0)
|
||||
gender = 1;
|
||||
SendIllusionPacket(GetRace(), gender, 0xFF, 0xFF);
|
||||
}
|
||||
else if (spell.base[x1] == -2)
|
||||
{
|
||||
if (GetRace() == 128 || GetRace() == 130 || GetRace() <= 12)
|
||||
SendIllusionPacket(GetRace(), GetGender(), spell.max[x1], spell.max[x1]);
|
||||
}
|
||||
else if (spell.max[x1] > 0)
|
||||
{
|
||||
SendIllusionPacket(spell.base[x1], 0xFF, spell.max[x1], spell.max[x1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
SendIllusionPacket(spell.base[x1], 0xFF, 0xFF, 0xFF);
|
||||
}
|
||||
switch(spell.base[x1]){
|
||||
case OGRE:
|
||||
SendAppearancePacket(AT_Size, 9);
|
||||
break;
|
||||
case TROLL:
|
||||
SendAppearancePacket(AT_Size, 8);
|
||||
break;
|
||||
case VAHSHIR:
|
||||
case BARBARIAN:
|
||||
SendAppearancePacket(AT_Size, 7);
|
||||
break;
|
||||
case HALF_ELF:
|
||||
case WOOD_ELF:
|
||||
case DARK_ELF:
|
||||
case FROGLOK:
|
||||
SendAppearancePacket(AT_Size, 5);
|
||||
break;
|
||||
case DWARF:
|
||||
SendAppearancePacket(AT_Size, 4);
|
||||
break;
|
||||
case HALFLING:
|
||||
case GNOME:
|
||||
SendAppearancePacket(AT_Size, 3);
|
||||
break;
|
||||
default:
|
||||
SendAppearancePacket(AT_Size, 6);
|
||||
break;
|
||||
}
|
||||
case SE_IllusionCopy:
|
||||
case SE_Illusion: {
|
||||
if (spell.base[x1] == -1) {
|
||||
if (gender == 1)
|
||||
gender = 0;
|
||||
else if (gender == 0)
|
||||
gender = 1;
|
||||
SendIllusionPacket(GetRace(), gender, 0xFF, 0xFF);
|
||||
}
|
||||
else if (spell.base[x1] == -2)
|
||||
{
|
||||
if (GetRace() == 128 || GetRace() == 130 || GetRace() <= 12)
|
||||
SendIllusionPacket(GetRace(), GetGender(), spell.max[x1], spell.max[x1]);
|
||||
}
|
||||
else if (spell.max[x1] > 0)
|
||||
{
|
||||
SendIllusionPacket(spell.base[x1], 0xFF, spell.max[x1], spell.max[x1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
SendIllusionPacket(spell.base[x1], 0xFF, 0xFF, 0xFF);
|
||||
}
|
||||
switch (spell.base[x1]){
|
||||
case OGRE:
|
||||
SendAppearancePacket(AT_Size, 9);
|
||||
break;
|
||||
case TROLL:
|
||||
SendAppearancePacket(AT_Size, 8);
|
||||
break;
|
||||
case VAHSHIR:
|
||||
case BARBARIAN:
|
||||
SendAppearancePacket(AT_Size, 7);
|
||||
break;
|
||||
case HALF_ELF:
|
||||
case WOOD_ELF:
|
||||
case DARK_ELF:
|
||||
case FROGLOK:
|
||||
SendAppearancePacket(AT_Size, 5);
|
||||
break;
|
||||
case DWARF:
|
||||
SendAppearancePacket(AT_Size, 4);
|
||||
break;
|
||||
case HALFLING:
|
||||
case GNOME:
|
||||
SendAppearancePacket(AT_Size, 3);
|
||||
break;
|
||||
default:
|
||||
SendAppearancePacket(AT_Size, 6);
|
||||
break;
|
||||
}
|
||||
case SE_SummonHorse: {
|
||||
SummonHorse(buffs[j1].spellid);
|
||||
//hasmount = true; //this was false, is that the correct thing?
|
||||
break;
|
||||
break;
|
||||
}
|
||||
case SE_SummonHorse: {
|
||||
SummonHorse(buffs[j1].spellid);
|
||||
//hasmount = true; //this was false, is that the correct thing?
|
||||
break;
|
||||
}
|
||||
case SE_Silence:
|
||||
{
|
||||
Silence(true);
|
||||
break;
|
||||
}
|
||||
case SE_Amnesia:
|
||||
{
|
||||
Amnesia(true);
|
||||
break;
|
||||
}
|
||||
case SE_DivineAura:
|
||||
{
|
||||
invulnerable = true;
|
||||
break;
|
||||
}
|
||||
case SE_Invisibility2:
|
||||
case SE_Invisibility:
|
||||
{
|
||||
invisible = true;
|
||||
SendAppearancePacket(AT_Invis, 1);
|
||||
break;
|
||||
}
|
||||
case SE_Levitate:
|
||||
{
|
||||
if (!zone->CanLevitate())
|
||||
{
|
||||
if (!GetGM())
|
||||
{
|
||||
SendAppearancePacket(AT_Levitate, 0);
|
||||
BuffFadeByEffect(SE_Levitate);
|
||||
Message(13, "You can't levitate in this zone.");
|
||||
}
|
||||
}
|
||||
case SE_Silence:
|
||||
{
|
||||
Silence(true);
|
||||
break;
|
||||
}
|
||||
case SE_Amnesia:
|
||||
{
|
||||
Amnesia(true);
|
||||
break;
|
||||
}
|
||||
case SE_DivineAura:
|
||||
{
|
||||
invulnerable = true;
|
||||
break;
|
||||
}
|
||||
case SE_Invisibility2:
|
||||
case SE_Invisibility:
|
||||
{
|
||||
invisible = true;
|
||||
SendAppearancePacket(AT_Invis, 1);
|
||||
break;
|
||||
}
|
||||
case SE_Levitate:
|
||||
{
|
||||
if( !zone->CanLevitate() )
|
||||
{
|
||||
if(!GetGM())
|
||||
{
|
||||
SendAppearancePacket(AT_Levitate, 0);
|
||||
BuffFadeByEffect(SE_Levitate);
|
||||
Message(13, "You can't levitate in this zone.");
|
||||
}
|
||||
}else{
|
||||
SendAppearancePacket(AT_Levitate, 2);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SE_InvisVsUndead2:
|
||||
case SE_InvisVsUndead:
|
||||
{
|
||||
invisible_undead = true;
|
||||
break;
|
||||
}
|
||||
case SE_InvisVsAnimals:
|
||||
{
|
||||
invisible_animals = true;
|
||||
break;
|
||||
}
|
||||
case SE_AddMeleeProc:
|
||||
case SE_WeaponProc:
|
||||
{
|
||||
AddProcToWeapon(GetProcID(buffs[j1].spellid, x1), false, 100+spells[buffs[j1].spellid].base2[x1], buffs[j1].spellid);
|
||||
break;
|
||||
}
|
||||
case SE_DefensiveProc:
|
||||
{
|
||||
AddDefensiveProc(GetProcID(buffs[j1].spellid, x1), 100+spells[buffs[j1].spellid].base2[x1],buffs[j1].spellid);
|
||||
break;
|
||||
}
|
||||
case SE_RangedProc:
|
||||
{
|
||||
AddRangedProc(GetProcID(buffs[j1].spellid, x1), 100+spells[buffs[j1].spellid].base2[x1],buffs[j1].spellid);
|
||||
break;
|
||||
}
|
||||
else{
|
||||
SendAppearancePacket(AT_Levitate, 2);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SE_InvisVsUndead2:
|
||||
case SE_InvisVsUndead:
|
||||
{
|
||||
invisible_undead = true;
|
||||
break;
|
||||
}
|
||||
case SE_InvisVsAnimals:
|
||||
{
|
||||
invisible_animals = true;
|
||||
break;
|
||||
}
|
||||
case SE_AddMeleeProc:
|
||||
case SE_WeaponProc:
|
||||
{
|
||||
AddProcToWeapon(GetProcID(buffs[j1].spellid, x1), false, 100 + spells[buffs[j1].spellid].base2[x1], buffs[j1].spellid);
|
||||
break;
|
||||
}
|
||||
case SE_DefensiveProc:
|
||||
{
|
||||
AddDefensiveProc(GetProcID(buffs[j1].spellid, x1), 100 + spells[buffs[j1].spellid].base2[x1], buffs[j1].spellid);
|
||||
break;
|
||||
}
|
||||
case SE_RangedProc:
|
||||
{
|
||||
AddRangedProc(GetProcID(buffs[j1].spellid, x1), 100 + spells[buffs[j1].spellid].base2[x1], buffs[j1].spellid);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//sends appearances for all mobs not doing anim_stand aka sitting, looting, playing dead
|
||||
/* Sends appearances for all mobs not doing anim_stand aka sitting, looting, playing dead */
|
||||
entity_list.SendZoneAppearance(this);
|
||||
|
||||
//sends the Nimbus particle effects (up to 3) for any mob using them
|
||||
/* Sends the Nimbus particle effects (up to 3) for any mob using them */
|
||||
entity_list.SendNimbusEffects(this);
|
||||
|
||||
entity_list.SendUntargetable(this);
|
||||
|
||||
client_data_loaded = true;
|
||||
int x;
|
||||
for(x=0;x<8;x++)
|
||||
for (x = 0; x < 8; x++)
|
||||
SendWearChange(x);
|
||||
Mob *pet = GetPet();
|
||||
if(pet != nullptr) {
|
||||
for(x=0;x<8;x++)
|
||||
if (pet != nullptr) {
|
||||
for (x = 0; x < 8; x++)
|
||||
pet->SendWearChange(x);
|
||||
}
|
||||
|
||||
@@ -9521,14 +9501,14 @@ void Client::CompleteConnect()
|
||||
|
||||
zoneinpacket_timer.Start();
|
||||
|
||||
if(GetPet()){
|
||||
if (GetPet()){
|
||||
GetPet()->SendPetBuffsToClient();
|
||||
}
|
||||
|
||||
if(GetGroup())
|
||||
if (GetGroup())
|
||||
database.RefreshGroupFromDB(this);
|
||||
|
||||
if(RuleB(TaskSystem, EnableTaskSystem))
|
||||
if (RuleB(TaskSystem, EnableTaskSystem))
|
||||
TaskPeriodic_Timer.Start();
|
||||
else
|
||||
TaskPeriodic_Timer.Disable();
|
||||
@@ -9536,51 +9516,50 @@ void Client::CompleteConnect()
|
||||
conn_state = ClientConnectFinished;
|
||||
|
||||
//enforce some rules..
|
||||
if(!CanBeInZone()) {
|
||||
if (!CanBeInZone()) {
|
||||
_log(CLIENT__ERROR, "Kicking char from zone, not allowed here");
|
||||
GoToSafeCoords(database.GetZoneID("arena"), 0);
|
||||
return;
|
||||
}
|
||||
|
||||
if(zone)
|
||||
if (zone)
|
||||
zone->weatherSend();
|
||||
|
||||
TotalKarma = database.GetKarma(AccountID());
|
||||
|
||||
SendDisciplineTimers();
|
||||
|
||||
parse->EventPlayer(EVENT_ENTER_ZONE, this, "", 0);
|
||||
|
||||
//This sub event is for if a player logs in for the first time since entering world.
|
||||
if(firstlogon == 1)
|
||||
parse->EventPlayer(EVENT_CONNECT, this, "", 0);
|
||||
/* This sub event is for if a player logs in for the first time since entering world. */
|
||||
if (firstlogon == 1){
|
||||
parse->EventPlayer(EVENT_CONNECT, this, "", 0);
|
||||
/* QS: PlayerLogConnectDisconnect */
|
||||
if (RuleB(QueryServ, PlayerLogConnectDisconnect)){
|
||||
std::string event_desc = StringFormat("Connect :: Logged into zoneid:%i instid:%i", this->GetZoneID(), this->GetInstanceID());
|
||||
QServ->PlayerLogEvent(Player_Log_Connect_State, this->CharacterID(), event_desc);
|
||||
}
|
||||
}
|
||||
|
||||
if(zone)
|
||||
{
|
||||
if(zone->GetInstanceTimer())
|
||||
{
|
||||
if(zone) {
|
||||
if(zone->GetInstanceTimer()) {
|
||||
uint32 ttime = zone->GetInstanceTimer()->GetRemainingTime();
|
||||
uint32 day = (ttime/86400000);
|
||||
uint32 hour = (ttime/3600000)%24;
|
||||
uint32 minute = (ttime/60000)%60;
|
||||
uint32 second = (ttime/1000)%60;
|
||||
if(day)
|
||||
{
|
||||
if(day) {
|
||||
Message(15, "%s(%u) will expire in %u days, %u hours, %u minutes, and %u seconds.",
|
||||
zone->GetLongName(), zone->GetInstanceID(), day, hour, minute, second);
|
||||
}
|
||||
else if(hour)
|
||||
{
|
||||
else if(hour) {
|
||||
Message(15, "%s(%u) will expire in %u hours, %u minutes, and %u seconds.",
|
||||
zone->GetLongName(), zone->GetInstanceID(), hour, minute, second);
|
||||
}
|
||||
else if(minute)
|
||||
{
|
||||
else if(minute) {
|
||||
Message(15, "%s(%u) will expire in %u minutes, and %u seconds.",
|
||||
zone->GetLongName(), zone->GetInstanceID(), minute, second);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
Message(15, "%s(%u) will expire in in %u seconds.",
|
||||
zone->GetLongName(), zone->GetInstanceID(), second);
|
||||
}
|
||||
@@ -9603,8 +9582,7 @@ void Client::CompleteConnect()
|
||||
if(GetClientVersion() >= EQClientSoD)
|
||||
entity_list.SendFindableNPCList(this);
|
||||
|
||||
if(IsInAGuild())
|
||||
{
|
||||
if(IsInAGuild()) {
|
||||
SendGuildRanks();
|
||||
guild_mgr.SendGuildMemberUpdateToWorld(GetName(), GuildID(), zone->GetZoneID(), time(nullptr));
|
||||
guild_mgr.RequestOnlineGuildMembers(this->CharacterID(), this->GuildID());
|
||||
@@ -9616,8 +9594,7 @@ void Client::CompleteConnect()
|
||||
worldserver.SendPacket(pack);
|
||||
delete pack;
|
||||
|
||||
if(IsClient() && CastToClient()->GetClientVersionBit() & BIT_UnderfootAndLater)
|
||||
{
|
||||
if(IsClient() && CastToClient()->GetClientVersionBit() & BIT_UnderfootAndLater) {
|
||||
EQApplicationPacket *outapp = MakeBuffsPacket(false);
|
||||
CastToClient()->FastQueuePacket(&outapp);
|
||||
}
|
||||
@@ -12749,6 +12726,12 @@ void Client::Handle_OP_AltCurrencyPurchase(const EQApplicationPacket *app) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* QS: PlayerLogAlternateCurrencyTransactions :: Merchant Purchase */
|
||||
if (RuleB(QueryServ, PlayerLogAlternateCurrencyTransactions)){
|
||||
std::string event_desc = StringFormat("Merchant Purchase :: Spent alt_currency_id:%i cost:%i for itemid:%i in zoneid:%i instid:%i", alt_cur_id, cost, item->ID, this->GetZoneID(), this->GetInstanceID());
|
||||
QServ->PlayerLogEvent(Player_Log_Alternate_Currency_Transactions, this->CharacterID(), event_desc);
|
||||
}
|
||||
|
||||
AddAlternateCurrencyValue(alt_cur_id, -((int32)cost));
|
||||
int16 charges = 1;
|
||||
if(item->MaxCharges != 0)
|
||||
@@ -12780,20 +12763,37 @@ void Client::Handle_OP_AltCurrencyReclaim(const EQApplicationPacket *app) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(reclaim->reclaim_flag == 1) { //item -> altcur
|
||||
/* Item to Currency Storage */
|
||||
if(reclaim->reclaim_flag == 1) {
|
||||
uint32 removed = NukeItem(item_id, invWhereWorn | invWherePersonal | invWhereCursor);
|
||||
if(removed > 0) {
|
||||
AddAlternateCurrencyValue(reclaim->currency_id, removed);
|
||||
|
||||
/* QS: PlayerLogAlternateCurrencyTransactions :: Item to Currency */
|
||||
if (RuleB(QueryServ, PlayerLogAlternateCurrencyTransactions)){
|
||||
std::string event_desc = StringFormat("Reclaim :: Item to Currency :: alt_currency_id:%i amount:%i to currency tab in zoneid:%i instid:%i", reclaim->currency_id, removed, this->GetZoneID(), this->GetInstanceID());
|
||||
QServ->PlayerLogEvent(Player_Log_Alternate_Currency_Transactions, this->CharacterID(), event_desc);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
}
|
||||
/* Cursor to Item storage */
|
||||
else {
|
||||
uint32 max_currency = GetAlternateCurrencyValue(reclaim->currency_id);
|
||||
|
||||
/* If you input more than you have currency wise, just give the max of the currency you currently have */
|
||||
if(reclaim->count > max_currency) {
|
||||
SummonItem(item_id, max_currency);
|
||||
SetAlternateCurrencyValue(reclaim->currency_id, 0);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
SummonItem(item_id, reclaim->count, 0, 0, 0, 0, 0, false, MainCursor);
|
||||
AddAlternateCurrencyValue(reclaim->currency_id, -((int32)reclaim->count));
|
||||
}
|
||||
/* QS: PlayerLogAlternateCurrencyTransactions :: Cursor to Item Storage */
|
||||
if (RuleB(QueryServ, PlayerLogAlternateCurrencyTransactions)){
|
||||
std::string event_desc = StringFormat("Reclaim :: Cursor to Item :: alt_currency_id:%i amount:-%i in zoneid:%i instid:%i", reclaim->currency_id, reclaim->count, this->GetZoneID(), this->GetInstanceID());
|
||||
QServ->PlayerLogEvent(Player_Log_Alternate_Currency_Transactions, this->CharacterID(), event_desc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12829,6 +12829,7 @@ void Client::Handle_OP_AltCurrencySell(const EQApplicationPacket *app) {
|
||||
uint32 cost = 0;
|
||||
uint32 current_currency = GetAlternateCurrencyValue(alt_cur_id);
|
||||
uint32 merchant_id = tar->MerchantType;
|
||||
uint32 npc_id = tar->GetNPCTypeID();
|
||||
bool found = false;
|
||||
std::list<MerchantList> merlist = zone->merchanttable[merchant_id];
|
||||
std::list<MerchantList>::const_iterator itr;
|
||||
@@ -12881,6 +12882,12 @@ void Client::Handle_OP_AltCurrencySell(const EQApplicationPacket *app) {
|
||||
|
||||
sell->cost = cost;
|
||||
|
||||
/* QS: PlayerLogAlternateCurrencyTransactions :: Sold to Merchant*/
|
||||
if (RuleB(QueryServ, PlayerLogAlternateCurrencyTransactions)){
|
||||
std::string event_desc = StringFormat("Sold to Merchant :: itemid:%i npcid:%i alt_currency_id:%i cost:%i in zoneid:%i instid:%i", item->ID, npc_id, alt_cur_id, cost, this->GetZoneID(), this->GetInstanceID());
|
||||
QServ->PlayerLogEvent(Player_Log_Alternate_Currency_Transactions, this->CharacterID(), event_desc);
|
||||
}
|
||||
|
||||
FastQueuePacket(&outapp);
|
||||
AddAlternateCurrencyValue(alt_cur_id, cost);
|
||||
Save(1);
|
||||
@@ -12940,7 +12947,7 @@ void Client::Handle_OP_LFGuild(const EQApplicationPacket *app)
|
||||
switch(Command)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
{
|
||||
VERIFY_PACKET_LENGTH(OP_LFGuild, app, LFGuild_PlayerToggle_Struct);
|
||||
LFGuild_PlayerToggle_Struct *pts = (LFGuild_PlayerToggle_Struct *)app->pBuffer;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user