TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
CharacterDeleteActionIpLogger Class Reference

Public Member Functions

 CharacterDeleteActionIpLogger ()
 
void OnDelete (ObjectGuid guid, uint32 accountId) override
 
void OnFailedDelete (ObjectGuid guid, uint32 accountId) override
 
void DeleteIPLogAction (ObjectGuid guid, uint32 playerGuid, IPLoggingTypes aType)
 
- Public Member Functions inherited from PlayerScript
virtual void OnPVPKill (Player *, Player *)
 
virtual void OnCreatureKill (Player *, Creature *)
 
virtual void OnPlayerKilledByCreature (Creature *, Player *)
 
virtual void OnLevelChanged (Player *, uint8)
 
virtual void OnFreeTalentPointsChanged (Player *, uint32)
 
virtual void OnTalentsReset (Player *, bool)
 
virtual void OnMoneyChanged (Player *, int64 &)
 
virtual void OnMoneyLimit (Player *, int64)
 
virtual void OnGiveXP (Player *, uint32 &, Unit *)
 
virtual void OnReputationChange (Player *, uint32, int32 &, bool)
 
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 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 OnClearEmote (Player *)
 
virtual void OnTextEmote (Player *, uint32, uint32, ObjectGuid)
 
virtual void OnSpellCast (Player *, Spell *, bool)
 
virtual void OnLogin (Player *, bool)
 
virtual void OnLogout (Player *)
 
virtual void OnCreate (Player *)
 
virtual void OnSave (Player *)
 
virtual void OnBindToInstance (Player *, Difficulty, uint32, bool, uint8)
 
virtual void OnUpdateZone (Player *, uint32, uint32)
 
virtual void OnMapChanged (Player *)
 
virtual void OnQuestStatusChange (Player *, uint32, QuestStatus)
 
- Public Member Functions inherited from UnitScript
virtual void OnHeal (Unit *, Unit *, uint32 &)
 
virtual void OnDamage (Unit *, Unit *, uint32 &)
 
virtual void ModifyPeriodicDamageAurasTick (Unit *, Unit *, uint32 &)
 
virtual void ModifyMeleeDamage (Unit *, Unit *, uint32 &)
 
virtual void ModifySpellDamageTaken (Unit *, Unit *, int32 &)
 
- Public Member Functions inherited from ScriptObject
const std::string & GetName () const
 

Additional Inherited Members

- Protected Member Functions inherited from PlayerScript
 PlayerScript (const char *name)
 
- Protected Member Functions inherited from UnitScript
 UnitScript (const char *name, bool addToScripts=true)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name)
 
virtual ~ScriptObject ()
 

Constructor & Destructor Documentation

CharacterDeleteActionIpLogger::CharacterDeleteActionIpLogger ( )
inline
247 : PlayerScript("CharacterDeleteActionIpLogger") { }
PlayerScript(const char *name)
Definition: ScriptMgr.cpp:1664

Member Function Documentation

void CharacterDeleteActionIpLogger::DeleteIPLogAction ( ObjectGuid  guid,
uint32  playerGuid,
IPLoggingTypes  aType 
)
inline
262  {
263  // Action IP Logger is only intialized if config is set up
264  // Else, this script isn't loaded in the first place: We require no config check.
265 
266  // Query playerGuid/accountId, as we only have characterGuid
267  std::string systemNote = "ERROR"; // "ERROR" is a placeholder here. We change it later.
268 
269  // With this switch, we change systemNote so that we have a more accurate phrasing of what type it is.
270  // Avoids Magicnumbers in SQL table
271  switch (aType)
272  {
273  case CHARACTER_DELETE:
274  systemNote = "Logged on CharacterDelete";
275  break;
277  systemNote = "Logged on Failed CharacterDelete";
278  break;
279  // Neither should happen. Ever. Period. If it does, call to whatever god you have for mercy and guidance.
280  case UNKNOWN_ACTION:
281  default:
282  systemNote = "ERROR! Unknown action!";
283  break;
284  }
285 
286  // Once we have done everything, we can insert the new log.
288 
289  stmt2->setUInt32(0, playerGuid);
290  stmt2->setUInt64(1, guid.GetCounter());
291  stmt2->setUInt8(2, aType);
292  stmt2->setUInt32(3, playerGuid);
293  stmt2->setString(4, systemNote.c_str());
294  // Seeing as the time differences should be minimal, we do not get unixtime and the timestamp right now;
295  // Rather, we let it be added with the SQL query.
296 
297  LoginDatabase.Execute(stmt2);
298  return;
299  }
void Execute(const char *sql)
Definition: DatabaseWorkerPool.h:87
void setUInt8(const uint8 index, const uint8 value)
Definition: PreparedStatement.cpp:97
void setString(const uint8 index, const std::string &value)
Definition: PreparedStatement.cpp:187
Definition: PreparedStatement.h:74
LoginDatabaseWorkerPool LoginDatabase
Accessor to the realm/login database.
Definition: DatabaseEnv.cpp:22
Definition: action_ip_logger.cpp:39
Definition: action_ip_logger.cpp:37
PreparedStatement * GetPreparedStatement(PreparedStatementIndex index)
Definition: DatabaseWorkerPool.h:263
void setUInt32(const uint8 index, const uint32 value)
Definition: PreparedStatement.cpp:115
Definition: LoginDatabase.h:100
void setUInt64(const uint8 index, const uint64 value)
Definition: PreparedStatement.cpp:124
Definition: action_ip_logger.cpp:36
LowType GetCounter() const
Definition: ObjectGuid.h:221

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CharacterDeleteActionIpLogger::OnDelete ( ObjectGuid  guid,
uint32  accountId 
)
inlineoverridevirtual

Reimplemented from PlayerScript.

251  {
252  DeleteIPLogAction(guid, accountId, CHARACTER_DELETE);
253  }
void DeleteIPLogAction(ObjectGuid guid, uint32 playerGuid, IPLoggingTypes aType)
Definition: action_ip_logger.cpp:261
Definition: action_ip_logger.cpp:36

+ Here is the call graph for this function:

void CharacterDeleteActionIpLogger::OnFailedDelete ( ObjectGuid  guid,
uint32  accountId 
)
inlineoverridevirtual

Reimplemented from PlayerScript.

257  {
258  DeleteIPLogAction(guid, accountId, CHARACTER_FAILED_DELETE);
259  }
void DeleteIPLogAction(ObjectGuid guid, uint32 playerGuid, IPLoggingTypes aType)
Definition: action_ip_logger.cpp:261
Definition: action_ip_logger.cpp:37

+ Here is the call graph for this function:


The documentation for this class was generated from the following file: