Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Server/mods/deathmatch/logic/CGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1697,7 +1697,7 @@ void CGame::AddBuiltInEvents()

// Account events
m_Events.AddEvent("onAccountDataChange", "account, key, value", NULL, false);

m_Events.AddEvent("onAccountNameChange", "account, previousName, newName", nullptr, false);
m_Events.AddEvent("onAccountCreate", "account", NULL, false);
m_Events.AddEvent("onAccountRemove", "account", NULL, false);

Expand Down
8 changes: 8 additions & 0 deletions Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11674,7 +11674,15 @@ bool CStaticFunctionDefinitions::SetAccountName(CAccount* pAccount, SString strN
}
else
{
CLuaArguments arguments;
arguments.PushAccount(pAccount);
arguments.PushString(pAccount->GetName().c_str());
arguments.PushString(strNewName);
if (!m_pMapManager->GetRootElement()->CallEvent("onAccountNameChange", arguments))
return false;

pAccount->SetName(strNewName);

return true;
}
}
Expand Down