mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
[CSM] Client side modding
* rename GameScripting to ServerScripting * Make getBuiltinLuaPath static serverside * Add on_shutdown callback * Add on_receiving_chat_message & on_sending_chat_message callbacks * ScriptApiBase: use IGameDef instead of Server This permits to share common attribute between client & server * Enable mod security in client side modding without conditions
This commit is contained in:
parent
c9492b4d37
commit
2efae3ffd7
37 changed files with 488 additions and 64 deletions
|
@ -30,6 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "server.h"
|
||||
#include "util/strfnd.h"
|
||||
#include "network/clientopcodes.h"
|
||||
#include "script/clientscripting.h"
|
||||
#include "util/serialize.h"
|
||||
#include "util/srp.h"
|
||||
#include "tileanimation.h"
|
||||
|
@ -411,7 +412,10 @@ void Client::handleCommand_ChatMessage(NetworkPacket* pkt)
|
|||
message += (wchar_t)read_wchar;
|
||||
}
|
||||
|
||||
m_chat_queue.push(message);
|
||||
// If chat message not consummed by client lua API
|
||||
if (!m_script->on_receiving_message(wide_to_utf8(message))) {
|
||||
m_chat_queue.push(message);
|
||||
}
|
||||
}
|
||||
|
||||
void Client::handleCommand_ActiveObjectRemoveAdd(NetworkPacket* pkt)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue