summaryrefslogtreecommitdiff
path: root/src/server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server.cpp')
-rw-r--r--src/server.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/server.cpp b/src/server.cpp
index fc01898cc..ed99a7214 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -646,7 +646,7 @@ void Server::AsyncRunStep(bool initial_step)
/*
Send player breath if changed
*/
- if(playersao->m_breath_not_sent){
+ if(playersao->m_breath_not_sent) {
SendPlayerBreath(*i);
}
@@ -2202,6 +2202,7 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
std::istringstream is(datastring, std::ios_base::binary);
u16 breath = readU16(is);
playersao->setBreath(breath);
+ m_script->player_event(playersao,"breath_changed");
}
else if(command == TOSERVER_PASSWORD)
{
@@ -3289,6 +3290,7 @@ void Server::SendHUDAdd(u16 peer_id, u32 id, HudElement *form)
writeV2F1000(os, form->align);
writeV2F1000(os, form->offset);
writeV3F1000(os, form->world_pos);
+ writeV2S32(os,form->size);
// Make data buffer
std::string s = os.str();
@@ -3335,6 +3337,9 @@ void Server::SendHUDChange(u16 peer_id, u32 id, HudElementStat stat, void *value
case HUD_STAT_WORLD_POS:
writeV3F1000(os, *(v3f *)value);
break;
+ case HUD_STAT_SIZE:
+ writeV2S32(os,*(v2s32 *)value);
+ break;
case HUD_STAT_NUMBER:
case HUD_STAT_ITEM:
case HUD_STAT_DIR:
@@ -3445,6 +3450,7 @@ void Server::SendPlayerHP(u16 peer_id)
assert(playersao);
playersao->m_hp_not_sent = false;
SendHP(peer_id, playersao->getHP());
+ m_script->player_event(playersao,"health_changed");
// Send to other clients
std::string str = gob_cmd_punched(playersao->readDamage(), playersao->getHP());
@@ -3458,6 +3464,7 @@ void Server::SendPlayerBreath(u16 peer_id)
PlayerSAO *playersao = getPlayerSAO(peer_id);
assert(playersao);
playersao->m_breath_not_sent = false;
+ m_script->player_event(playersao,"breath_changed");
SendBreath(peer_id, playersao->getBreath());
}
@@ -4588,6 +4595,8 @@ bool Server::hudSetFlags(Player *player, u32 flags, u32 mask) {
return false;
SendHUDSetFlags(player->peer_id, flags, mask);
+
+ m_script->player_event(player->getPlayerSAO(),"hud_changed");
return true;
}