aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Server
diff options
context:
space:
mode:
authorSpp <none@none>2010-09-15 13:23:07 +0200
committerSpp <none@none>2010-09-15 13:23:07 +0200
commitcc3d4cc8237f4b5eef391eddeb51ae63874bd5a7 (patch)
treea5a8a77103da3df21ee897d7b70e75c5a753d25b /src/server/game/Server
parent9d9f18f9d28b496312c13d7e639c244b8fc33f3a (diff)
Core/Scripts: Add OnPlayerLogin, OnPlayerLogout, OnPlayerCreate and OnPlayerDelete
--HG-- branch : trunk
Diffstat (limited to 'src/server/game/Server')
-rw-r--r--src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp5
-rw-r--r--src/server/game/Server/WorldSession.cpp1
2 files changed, 5 insertions, 1 deletions
diff --git a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp
index 4c76cc077d8..120341d96ee 100644
--- a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp
+++ b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp
@@ -471,8 +471,9 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
SendPacket(&data);
std::string IP_str = GetRemoteAddress();
- sLog.outBasic("Account: %d (IP: %s) Create Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), name.c_str(), pNewChar->GetGUIDLow());
+ sLog.outDetail("Account: %d (IP: %s) Create Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), name.c_str(), pNewChar->GetGUIDLow());
sLog.outChar("Account: %d (IP: %s) Create Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), name.c_str(), pNewChar->GetGUIDLow());
+ sScriptMgr.OnPlayerCreate(pNewChar);
delete pNewChar; // created only to call SaveToDB()
}
@@ -522,6 +523,7 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket & recv_data)
std::string IP_str = GetRemoteAddress();
sLog.outDetail("Account: %d (IP: %s) Delete Character:[%s] (GUID: %u)",GetAccountId(),IP_str.c_str(),name.c_str(),GUID_LOPART(guid));
sLog.outChar("Account: %d (IP: %s) Delete Character:[%s] (GUID: %u)",GetAccountId(),IP_str.c_str(),name.c_str(),GUID_LOPART(guid));
+ sScriptMgr.OnPlayerDelete(guid);
if (sLog.IsOutCharDump()) // optimize GetPlayerDump call
{
@@ -801,6 +803,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder)
m_playerLoading = false;
+ sScriptMgr.OnPlayerLogin(pCurrChar);
delete holder;
}
diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp
index f1642641143..7a6502a0279 100644
--- a/src/server/game/Server/WorldSession.cpp
+++ b/src/server/game/Server/WorldSession.cpp
@@ -479,6 +479,7 @@ void WorldSession::LogoutPlayer(bool Save)
CharacterDatabase.PExecute("UPDATE characters SET online = 0 WHERE account = '%u'",
GetAccountId());
sLog.outDebug("SESSION: Sent SMSG_LOGOUT_COMPLETE Message");
+ sScriptMgr.OnPlayerLogout(GetPlayer());
}
m_playerLogout = false;