mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Add chat message callback and send functions
This commit is contained in:
parent
ab3911ba9e
commit
05df2ee8a4
5 changed files with 98 additions and 1 deletions
|
@ -3422,6 +3422,13 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
|
|||
// Get player name of this client
|
||||
std::wstring name = narrow_to_wide(player->getName());
|
||||
|
||||
// Run script hook
|
||||
bool ate = scriptapi_on_chat_message(m_lua, player->getName(),
|
||||
wide_to_narrow(message));
|
||||
// If script ate the message, don't proceed
|
||||
if(ate)
|
||||
return;
|
||||
|
||||
// Line to send to players
|
||||
std::wstring line;
|
||||
// Whether to send to the player that sent the line
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue