AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
CharacterActionIpLogger Class Reference
Inheritance diagram for CharacterActionIpLogger:
PlayerScript ScriptObject

Public Member Functions

 CharacterActionIpLogger ()
 
void OnCreate (Player *player) override
 
void OnLogin (Player *player) override
 
void OnLogout (Player *player) override
 
void CharacterIPLogAction (Player *player, IPLoggingTypes aType)
 Logs a number of actions done by players with an IP.
 
- Public Member Functions inherited from PlayerScript
virtual void OnPlayerReleasedGhost (Player *)
 
virtual void OnSendInitialPacketsBeforeAddToMap (Player *, WorldPacket &)
 
virtual void OnBattlegroundDesertion (Player *, BattlegroundDesertionType const)
 
virtual void OnPlayerCompleteQuest (Player *, Quest const *)
 
virtual void OnPVPKill (Player *, Player *)
 
virtual void OnPlayerPVPFlagChange (Player *, bool)
 
virtual void OnCreatureKill (Player *, Creature *)
 
virtual void OnCreatureKilledByPet (Player *, Creature *)
 
virtual void OnPlayerKilledByCreature (Creature *, Player *)
 
virtual void OnLevelChanged (Player *, uint8)
 
virtual void OnFreeTalentPointsChanged (Player *, uint32)
 
virtual void OnTalentsReset (Player *, bool)
 
virtual void OnAfterSpecSlotChanged (Player *, uint8)
 
virtual void OnBeforeUpdate (Player *, uint32)
 
virtual void OnUpdate (Player *, uint32)
 
virtual void OnMoneyChanged (Player *, int32 &)
 
virtual void OnBeforeLootMoney (Player *, Loot *)
 
virtual void OnGiveXP (Player *, uint32 &, Unit *, uint8)
 
virtual bool OnReputationChange (Player *, uint32, int32 &, bool)
 
virtual void OnReputationRankChange (Player *, uint32, ReputationRank, ReputationRank, bool)
 
virtual void OnLearnSpell (Player *, uint32)
 
virtual void OnForgotSpell (Player *, uint32)
 
virtual void OnDuelRequest (Player *, Player *)
 
virtual void OnDuelStart (Player *, Player *)
 
virtual void OnDuelEnd (Player *, Player *, DuelCompleteType)
 
virtual void OnChat (Player *, uint32, uint32, std::string &)
 
virtual void OnBeforeSendChatMessage (Player *, uint32 &, uint32 &, std::string &)
 
virtual void OnChat (Player *, uint32, uint32, std::string &, Player *)
 
virtual void OnChat (Player *, uint32, uint32, std::string &, Group *)
 
virtual void OnChat (Player *, uint32, uint32, std::string &, Guild *)
 
virtual void OnChat (Player *, uint32, uint32, std::string &, Channel *)
 
virtual void OnEmote (Player *, uint32)
 
virtual void OnTextEmote (Player *, uint32, uint32, ObjectGuid)
 
virtual void OnSpellCast (Player *, Spell *, bool)
 
virtual void OnLoadFromDB (Player *)
 
virtual void OnLogin (Player *)
 
virtual void OnLogout (Player *)
 
virtual void OnCreate (Player *)
 
virtual void OnDelete (ObjectGuid, uint32)
 
virtual void OnFailedDelete (ObjectGuid, uint32)
 
virtual void OnSave (Player *)
 
virtual void OnBindToInstance (Player *, Difficulty, uint32, bool)
 
virtual void OnUpdateZone (Player *, uint32, uint32)
 
virtual void OnUpdateArea (Player *, uint32, uint32)
 
virtual void OnMapChanged (Player *)
 
virtual bool OnBeforeTeleport (Player *, uint32, float, float, float, float, uint32, Unit *)
 
virtual void OnUpdateFaction (Player *)
 
virtual void OnAddToBattleground (Player *, Battleground *)
 
virtual void OnQueueRandomDungeon (Player *, uint32 &)
 
virtual void OnRemoveFromBattleground (Player *, Battleground *)
 
virtual void OnAchiComplete (Player *, AchievementEntry const *)
 
virtual bool OnBeforeAchiComplete (Player *, AchievementEntry const *)
 
virtual void OnCriteriaProgress (Player *, AchievementCriteriaEntry const *)
 
virtual bool OnBeforeCriteriaProgress (Player *, AchievementCriteriaEntry const *)
 
virtual void OnAchiSave (CharacterDatabaseTransaction, Player *, uint16, CompletedAchievementData)
 
virtual void OnCriteriaSave (CharacterDatabaseTransaction, Player *, uint16, CriteriaProgress)
 
virtual void OnGossipSelect (Player *, uint32, uint32, uint32)
 
virtual void OnGossipSelectCode (Player *, uint32, uint32, uint32, const char *)
 
virtual void OnBeingCharmed (Player *, Unit *, uint32, uint32)
 
virtual void OnAfterSetVisibleItemSlot (Player *, uint8, Item *)
 
virtual void OnAfterMoveItemFromInventory (Player *, Item *, uint8, uint8, bool)
 
virtual void OnEquip (Player *, Item *, uint8, uint8, bool)
 
virtual void OnPlayerJoinBG (Player *)
 
virtual void OnPlayerJoinArena (Player *)
 
virtual void GetCustomGetArenaTeamId (Player const *, uint8, uint32 &) const
 
virtual void GetCustomArenaPersonalRating (Player const *, uint8, uint32 &) const
 
virtual void OnGetMaxPersonalArenaRatingRequirement (Player const *, uint32, uint32 &) const
 
virtual void OnLootItem (Player *, Item *, uint32, ObjectGuid)
 
virtual void OnBeforeFillQuestLootItem (Player *, LootItem &)
 
virtual void OnStoreNewItem (Player *, Item *, uint32)
 
virtual void OnCreateItem (Player *, Item *, uint32)
 
virtual void OnQuestRewardItem (Player *, Item *, uint32)
 
virtual bool CanPlaceAuctionBid (Player *, AuctionEntry *)
 
virtual void OnGroupRollRewardItem (Player *, Item *, uint32, RollVote, Roll *)
 
virtual bool OnBeforeOpenItem (Player *, Item *)
 
virtual bool OnBeforeQuestComplete (Player *, uint32)
 
virtual void OnQuestComputeXP (Player *, Quest const *, uint32 &)
 
virtual void OnBeforeDurabilityRepair (Player *, ObjectGuid, ObjectGuid, float &, uint8)
 
virtual void OnBeforeBuyItemFromVendor (Player *, ObjectGuid, uint32, uint32 &, uint8, uint8, uint8)
 
virtual void OnBeforeStoreOrEquipNewItem (Player *, uint32, uint32 &, uint8, uint8, uint8, ItemTemplate const *, Creature *, VendorItem const *, bool)
 
virtual void OnAfterStoreOrEquipNewItem (Player *, uint32, Item *, uint8, uint8, uint8, ItemTemplate const *, Creature *, VendorItem const *, bool)
 
virtual void OnAfterUpdateMaxPower (Player *, Powers &, float &)
 
virtual void OnAfterUpdateMaxHealth (Player *, float &)
 
virtual void OnBeforeUpdateAttackPowerAndDamage (Player *, float &, float &, bool)
 
virtual void OnAfterUpdateAttackPowerAndDamage (Player *, float &, float &, float &, float &, bool)
 
virtual void OnBeforeInitTalentForLevel (Player *, uint8 &, uint32 &)
 
virtual void OnFirstLogin (Player *)
 
virtual void OnSetMaxLevel (Player *, uint32 &)
 
virtual bool CanJoinInBattlegroundQueue (Player *, ObjectGuid, BattlegroundTypeId, uint8, GroupJoinBattlegroundResult &)
 
virtual bool ShouldBeRewardedWithMoneyInsteadOfExp (Player *)
 
virtual void OnBeforeTempSummonInitStats (Player *, TempSummon *, uint32 &)
 
virtual void OnBeforeGuardianInitStatsForLevel (Player *, Guardian *, CreatureTemplate const *, PetType &)
 
virtual void OnAfterGuardianInitStatsForLevel (Player *, Guardian *)
 
virtual void OnBeforeLoadPetFromDB (Player *, uint32 &, uint32 &, bool &, bool &)
 
virtual bool CanJoinInArenaQueue (Player *, ObjectGuid, uint8, BattlegroundTypeId, uint8, uint8, GroupJoinBattlegroundResult &)
 
virtual bool CanBattleFieldPort (Player *, uint8, BattlegroundTypeId, uint8)
 
virtual bool CanGroupInvite (Player *, std::string &)
 
virtual bool CanGroupAccept (Player *, Group *)
 
virtual bool CanSellItem (Player *, Item *, Creature *)
 
virtual bool CanSendMail (Player *, ObjectGuid, ObjectGuid, std::string &, std::string &, uint32, uint32, Item *)
 
virtual void PetitionBuy (Player *, Creature *, uint32 &, uint32 &, uint32 &)
 
virtual void PetitionShowList (Player *, Creature *, uint32 &, uint32 &, uint32 &)
 
virtual void OnRewardKillRewarder (Player *, bool, float &)
 
virtual bool CanGiveMailRewardAtGiveLevel (Player *, uint8)
 
virtual void OnDeleteFromDB (CharacterDatabaseTransaction, uint32)
 
virtual bool CanRepopAtGraveyard (Player *)
 
virtual void OnGetMaxSkillValue (Player *, uint32, int32 &, bool)
 
virtual void OnUpdateGatheringSkill (Player *, uint32, uint32, uint32, uint32, uint32, uint32 &)
 This hook called before gathering skill gain is applied to the character.
 
virtual void OnUpdateCraftingSkill (Player *, SkillLineAbilityEntry const *, uint32, uint32 &)
 This hook is called before crafting skill gain is applied to the character.
 
virtual bool OnUpdateFishingSkill (Player *, int32, int32, int32, int32)
 
virtual bool CanAreaExploreAndOutdoor (Player *)
 
virtual void OnVictimRewardBefore (Player *, Player *, uint32 &, uint32 &)
 
virtual void OnVictimRewardAfter (Player *, Player *, uint32 &, uint32 &, float &)
 
virtual void OnCustomScalingStatValueBefore (Player *, ItemTemplate const *, uint8, bool, uint32 &)
 
virtual void OnCustomScalingStatValue (Player *, ItemTemplate const *, uint32 &, int32 &, uint8, uint32, ScalingStatValuesEntry const *)
 
virtual bool CanArmorDamageModifier (Player *)
 
virtual void OnGetFeralApBonus (Player *, int32 &, int32, ItemTemplate const *, ScalingStatValuesEntry const *)
 
virtual bool CanApplyWeaponDependentAuraDamageMod (Player *, Item *, WeaponAttackType, AuraEffect const *, bool)
 
virtual bool CanApplyEquipSpell (Player *, SpellInfo const *, Item *, bool, bool)
 
virtual bool CanApplyEquipSpellsItemSet (Player *, ItemSetEffect *)
 
virtual bool CanCastItemCombatSpell (Player *, Unit *, WeaponAttackType, uint32, uint32, Item *, ItemTemplate const *)
 
virtual bool CanCastItemUseSpell (Player *, Item *, SpellCastTargets const &, uint8, uint32)
 
virtual void OnApplyAmmoBonuses (Player *, ItemTemplate const *, float &)
 
virtual bool CanEquipItem (Player *, uint8, uint16 &, Item *, bool, bool)
 
virtual bool CanUnequipItem (Player *, uint16, bool)
 
virtual bool CanUseItem (Player *, ItemTemplate const *, InventoryResult &)
 
virtual bool CanSaveEquipNewItem (Player *, Item *, uint16, bool)
 
virtual bool CanApplyEnchantment (Player *, Item *, EnchantmentSlot, bool, bool, bool)
 
virtual void OnGetQuestRate (Player *, float &)
 
virtual bool PassedQuestKilledMonsterCredit (Player *, Quest const *, uint32, uint32, ObjectGuid)
 
virtual bool CheckItemInSlotAtLoadInventory (Player *, Item *, uint8, uint8 &, uint16 &)
 
virtual bool NotAvoidSatisfy (Player *, DungeonProgressionRequirements const *, uint32, bool)
 
virtual bool NotVisibleGloballyFor (Player *, Player const *)
 
virtual void OnGetArenaPersonalRating (Player *, uint8, uint32 &)
 
virtual void OnGetArenaTeamId (Player *, uint8, uint32 &)
 
virtual void OnIsFFAPvP (Player *, bool &)
 
virtual void OnFfaPvpStateUpdate (Player *, bool)
 
virtual void OnIsPvP (Player *, bool &)
 
virtual void OnGetMaxSkillValueForLevel (Player *, uint16 &)
 
virtual bool NotSetArenaTeamInfoField (Player *, uint8, ArenaTeamInfoType, uint32)
 
virtual bool CanJoinLfg (Player *, uint8, std::set< uint32 > &, const std::string &)
 
virtual bool CanEnterMap (Player *, MapEntry const *, InstanceTemplate const *, MapDifficulty const *, bool)
 
virtual bool CanInitTrade (Player *, Player *)
 
virtual void OnSetServerSideVisibility (Player *, ServerSideVisibilityType &, AccountTypes &)
 
virtual void OnSetServerSideVisibilityDetect (Player *, ServerSideVisibilityType &, AccountTypes &)
 
virtual void OnPlayerResurrect (Player *, float, bool)
 
virtual void OnBeforeChooseGraveyard (Player *, TeamId, bool, uint32 &)
 
virtual bool CanPlayerUseChat (Player *, uint32, uint32, std::string &)
 This hook called before player sending message in default chat.
 
virtual bool CanPlayerUseChat (Player *, uint32, uint32, std::string &, Player *)
 This hook called before player sending message to other player via private.
 
virtual bool CanPlayerUseChat (Player *, uint32, uint32, std::string &, Group *)
 This hook called before player sending message to group.
 
virtual bool CanPlayerUseChat (Player *, uint32, uint32, std::string &, Guild *)
 This hook called before player sending message to guild.
 
virtual bool CanPlayerUseChat (Player *, uint32, uint32, std::string &, Channel *)
 This hook called before player sending message to channel.
 
virtual void OnPlayerLearnTalents (Player *, uint32, uint32, uint32)
 This hook called after player learning talents.
 
virtual void OnPlayerEnterCombat (Player *, Unit *)
 This hook called after player entering combat.
 
virtual void OnPlayerLeaveCombat (Player *)
 This hook called after player leave combat.
 
virtual void OnQuestAbandon (Player *, uint32)
 This hook called after player abandoning quest.
 
virtual bool OnCanPlayerFlyInZone (Player *, uint32, uint32, SpellInfo const *)
 This hook called before other CanFlyChecks are applied.
 
virtual void AnticheatSetSkipOnePacketForASH (Player *, bool)
 
virtual void AnticheatSetCanFlybyServer (Player *, bool)
 
virtual void AnticheatSetUnderACKmount (Player *)
 
virtual void AnticheatSetRootACKUpd (Player *)
 
virtual void AnticheatSetJumpingbyOpcode (Player *, bool)
 
virtual void AnticheatUpdateMovementInfo (Player *, MovementInfo const &)
 
virtual bool AnticheatHandleDoubleJump (Player *, Unit *)
 
virtual bool AnticheatCheckMovementInfo (Player *, MovementInfo const &, Unit *, bool)
 
virtual bool CanSendErrorAlreadyLooted (Player *)
 This hook is called, to avoid displaying the error message that the body has already been stripped.
 
virtual void OnAfterCreatureLoot (Player *)
 It is used when an item is taken from a creature.
 
virtual void OnAfterCreatureLootMoney (Player *)
 After a creature's money is taken.
 
- Public Member Functions inherited from ScriptObject
virtual bool IsDatabaseBound () const
 
virtual bool isAfterLoadScript () const
 
virtual void checkValidity ()
 
const std::string & GetName () const
 

Additional Inherited Members

- Protected Member Functions inherited from PlayerScript
 PlayerScript (const char *name)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name)
 
virtual ~ScriptObject ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ CharacterActionIpLogger()

CharacterActionIpLogger::CharacterActionIpLogger ( )
inline
172: PlayerScript("CharacterActionIpLogger") { }
Definition: PlayerScript.h:27

Member Function Documentation

◆ CharacterIPLogAction()

void CharacterActionIpLogger::CharacterIPLogAction ( Player player,
IPLoggingTypes  aType 
)
inline

Logs a number of actions done by players with an IP.

202 {
203 if (!sWorld->getBoolConfig(CONFIG_IP_BASED_ACTION_LOGGING))
204 return;
205
206 // Action IP Logger is only intialized if config is set up
207 // Else, this script isn't loaded in the first place: We require no config check.
208
209 // We declare all the required variables
210 uint32 playerGuid = player->GetSession()->GetAccountId();
211 ObjectGuid::LowType characterGuid = player->GetGUID().GetCounter();
212 const std::string currentIp = player->GetSession()->GetRemoteAddress();
213 std::string systemNote = "ERROR"; // "ERROR" is a placeholder here. We change it...
214
215 // ... with this switch, so that we have a more accurate phrasing of what type it is
216 switch (aType)
217 {
218 case CHARACTER_CREATE:
219 systemNote = "Logged on CharacterCreate";
220 break;
221 case CHARACTER_LOGIN:
222 systemNote = "Logged on CharacterLogin";
223 break;
224 case CHARACTER_LOGOUT:
225 systemNote = "Logged on CharacterLogout";
226 break;
227 case CHARACTER_DELETE:
228 systemNote = "Logged on CharacterDelete";
229 break;
231 systemNote = "Logged on Failed CharacterDelete";
232 break;
233 // Neither should happen. Ever. Period. If it does, call Mythbusters.
234 case UNKNOWN_ACTION:
235 default:
236 systemNote = "ERROR! Unknown action!";
237 break;
238 }
239
240 // Once we have done everything, we can insert the new log.
242
243 stmt->SetData(0, playerGuid);
244 stmt->SetData(1, characterGuid);
245 stmt->SetData(2, aType);
246 stmt->SetData(3, currentIp.c_str()); // We query the ip here.
247 stmt->SetData(4, systemNote.c_str());
248 // Seeing as the time differences should be minimal, we do not get unixtime and the timestamp right now;
249 // Rather, we let it be added with the SQL query.
250
251 LoginDatabase.Execute(stmt);
252 return;
253 }
std::uint32_t uint32
Definition: Define.h:108
DatabaseWorkerPool< LoginDatabaseConnection > LoginDatabase
Accessor to the realm/login database.
Definition: DatabaseEnv.cpp:22
@ LOGIN_INS_CHAR_IP_LOGGING
Definition: LoginDatabase.h:105
@ CONFIG_IP_BASED_ACTION_LOGGING
Definition: IWorld.h:156
@ CHARACTER_DELETE
Definition: action_ip_logger.cpp:40
@ CHARACTER_CREATE
Definition: action_ip_logger.cpp:36
@ CHARACTER_LOGIN
Definition: action_ip_logger.cpp:37
@ CHARACTER_LOGOUT
Definition: action_ip_logger.cpp:38
@ UNKNOWN_ACTION
Definition: action_ip_logger.cpp:43
@ CHARACTER_FAILED_DELETE
Definition: action_ip_logger.cpp:41
#define sWorld
Definition: World.h:447
Definition: PreparedStatement.h:158
Acore::Types::is_default< T > SetData(const uint8 index, T value)
Definition: PreparedStatement.h:78
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:106
LowType GetCounter() const
Definition: ObjectGuid.h:147
uint32 LowType
Definition: ObjectGuid.h:124
WorldSession * GetSession() const
Definition: Player.h:1961
uint32 GetAccountId() const
Definition: WorldSession.h:363
std::string const & GetRemoteAddress()
Definition: WorldSession.h:373

References CHARACTER_CREATE, CHARACTER_DELETE, CHARACTER_FAILED_DELETE, CHARACTER_LOGIN, CHARACTER_LOGOUT, CONFIG_IP_BASED_ACTION_LOGGING, WorldSession::GetAccountId(), ObjectGuid::GetCounter(), Object::GetGUID(), WorldSession::GetRemoteAddress(), Player::GetSession(), LOGIN_INS_CHAR_IP_LOGGING, LoginDatabase, PreparedStatementBase::SetData(), sWorld, and UNKNOWN_ACTION.

Referenced by OnCreate(), OnLogin(), and OnLogout().

◆ OnCreate()

void CharacterActionIpLogger::OnCreate ( Player player)
inlineoverridevirtual

Reimplemented from PlayerScript.

176 {
178 }
void CharacterIPLogAction(Player *player, IPLoggingTypes aType)
Logs a number of actions done by players with an IP.
Definition: action_ip_logger.cpp:201

References CHARACTER_CREATE, and CharacterIPLogAction().

◆ OnLogin()

void CharacterActionIpLogger::OnLogin ( Player player)
inlineoverridevirtual

Reimplemented from PlayerScript.

182 {
184 }

References CHARACTER_LOGIN, and CharacterIPLogAction().

◆ OnLogout()

void CharacterActionIpLogger::OnLogout ( Player player)
inlineoverridevirtual

Reimplemented from PlayerScript.

188 {
190 }

References CHARACTER_LOGOUT, and CharacterIPLogAction().