Core/Misc:

* Fix some codestyle, fix some typos

* Change CMakeLists for: Custom (can be uncommented), Events, World
** Custom is theoretically unchanged. You can, however, uncomment the glob_recurse that initializes every file within. This might be easier for beginners.

* Introducing the IP Based Action Log System:
** On several different actions, e.g. Login, Character Login, etc., a new entry is added
** Can be logged on and off in worldserver config
*** Disabled by default to prevent increased log db size for unknowing users.

* Add a new row to account table called 'last_attempt_ip'
** Lists the last ip trying to connect to the account

* Add a new type of HookScripts: AccountScript
** Includes: OnAccountLogin, OnFailedAccountLogin, OnEmailChange, OnFailedChange, OnPasswordChange, OnFailedPasswordChange

* Added new Hook to PlayerScripts: OnFailedPlayerDelete

* Added new variables to PlayerScripts: OnPlayerDelete
This commit is contained in:
Ascathor
2014-05-02 03:44:21 +02:00
parent 5804372042
commit 6949735098
23 changed files with 618 additions and 52 deletions

View File

@@ -29,6 +29,7 @@
#include "World.h"
#include "Weather.h"
class AccountMgr;
class AuctionHouseObject;
class AuraScript;
class Battleground;
@@ -753,7 +754,10 @@ class PlayerScript : public UnitScript
virtual void OnCreate(Player* /*player*/) { }
// Called when a player is deleted.
virtual void OnDelete(uint64 /*guid*/) { }
virtual void OnDelete(uint64 /*guid*/, uint32 /*accountId*/) { }
// Called when a player delete failed
virtual void OnFailedDelete(uint64 /*guid*/, uint32 /*accountId*/) { }
// Called when a player is about to be saved.
virtual void OnSave(Player* /*player*/) { }
@@ -768,6 +772,33 @@ class PlayerScript : public UnitScript
virtual void OnMapChanged(Player* /*player*/) { }
};
class AccountScript : public ScriptObject
{
protected:
AccountScript(const char* name);
public:
// Called when an account logged in succesfully
virtual void OnAccountLogin(uint32 accountId) {}
// Called when an account login failed
virtual void OnFailedAccountLogin(uint32 accountId) {}
// Called when Email is successfully changed for Account
virtual void OnEmailChange(uint32 accountId) {}
// Called when Email failed to change for Account
virtual void OnFailedEmailChange(uint32 accountId) {}
// Called when Password is successfully changed for Account
virtual void OnPasswordChange(uint32 accountId) {}
// Called when Password failed to change for Account
virtual void OnFailedPasswordChange(uint32 accountId) {}
};
class GuildScript : public ScriptObject
{
protected:
@@ -1037,11 +1068,21 @@ class ScriptMgr
void OnPlayerLogin(Player* player);
void OnPlayerLogout(Player* player);
void OnPlayerCreate(Player* player);
void OnPlayerDelete(uint64 guid);
void OnPlayerDelete(uint64 guid, uint32 accountId);
void OnPlayerFailedDelete(uint64 guid, uint32 accountId);
void OnPlayerSave(Player* player);
void OnPlayerBindToInstance(Player* player, Difficulty difficulty, uint32 mapid, bool permanent);
void OnPlayerUpdateZone(Player* player, uint32 newZone, uint32 newArea);
public: /* AccountScript */
void OnAccountLogin(uint32 accountId);
void OnFailedAccountLogin(uint32 accountId);
void OnEmailChange(uint32 accountId);
void OnFailedEmailChange(uint32 accountId);
void OnPasswordChange(uint32 accountId);
void OnFailedPasswordChange(uint32 accountId);
public: /* GuildScript */
void OnGuildAddMember(Guild* guild, Player* player, uint8& plRank);