}
void Client::handleCommand_DenySudoMode(NetworkPacket* pkt)
{
- m_chat_queue.push(L"Password change denied. Password NOT changed.");
+ pushToChatQueue(L"Password change denied. Password NOT changed.");
// reset everything and be sad
deleteAuthData();
}
}
// If chat message not consummed by client lua API
- if (!m_script->on_receiving_message(wide_to_utf8(message))) {
- m_chat_queue.push(message);
+ if (!moddingEnabled() || !m_script->on_receiving_message(wide_to_utf8(message))) {
+ pushToChatQueue(message);
}
}
player->hp = hp;
+ if (moddingEnabled()) {
+ m_script->on_hp_modification(hp);
+ }
+
if (hp < oldhp) {
// Add to ClientEvent queue
ClientEvent event;
sanity_check(!m_mesh_update_thread.isRunning());
// Decompress node definitions
- std::string datastring(pkt->getString(0), pkt->getSize());
- std::istringstream is(datastring, std::ios_base::binary);
- std::istringstream tmp_is(deSerializeLongString(is), std::ios::binary);
+ std::istringstream tmp_is(pkt->readLongString(), std::ios::binary);
std::ostringstream tmp_os;
decompressZlib(tmp_is, tmp_os);
sanity_check(!m_mesh_update_thread.isRunning());
// Decompress item definitions
- std::string datastring(pkt->getString(0), pkt->getSize());
- std::istringstream is(datastring, std::ios_base::binary);
- std::istringstream tmp_is(deSerializeLongString(is), std::ios::binary);
+ std::istringstream tmp_is(pkt->readLongString(), std::ios::binary);
std::ostringstream tmp_os;
decompressZlib(tmp_is, tmp_os);
if (m_minimap_disabled_by_server && was_minimap_visible) {
// defers a minimap update, therefore only call it if really
// needed, by checking that minimap was visible before
- m_mapper->setMinimapMode(MINIMAP_MODE_OFF);
+ m_minimap->setMinimapMode(MINIMAP_MODE_OFF);
}
}