mirror of
https://github.com/luanti-org/luanti.git
synced 2025-11-30 04:35:20 +01:00
Add API to control shadow intensity from the game/mod (#11944)
* Also Disable shadows when sun/moon is hidden. Fixes #11972.
This commit is contained in:
@@ -1795,6 +1795,16 @@ void Server::SendOverrideDayNightRatio(session_t peer_id, bool do_override,
|
||||
Send(&pkt);
|
||||
}
|
||||
|
||||
void Server::SendSetLighting(session_t peer_id, const Lighting &lighting)
|
||||
{
|
||||
NetworkPacket pkt(TOCLIENT_SET_LIGHTING,
|
||||
4, peer_id);
|
||||
|
||||
pkt << lighting.shadow_intensity;
|
||||
|
||||
Send(&pkt);
|
||||
}
|
||||
|
||||
void Server::SendTimeOfDay(session_t peer_id, u16 time, f32 time_speed)
|
||||
{
|
||||
NetworkPacket pkt(TOCLIENT_TIME_OF_DAY, 0, peer_id);
|
||||
@@ -3386,6 +3396,13 @@ void Server::overrideDayNightRatio(RemotePlayer *player, bool do_override,
|
||||
SendOverrideDayNightRatio(player->getPeerId(), do_override, ratio);
|
||||
}
|
||||
|
||||
void Server::setLighting(RemotePlayer *player, const Lighting &lighting)
|
||||
{
|
||||
sanity_check(player);
|
||||
player->setLighting(lighting);
|
||||
SendSetLighting(player->getPeerId(), lighting);
|
||||
}
|
||||
|
||||
void Server::notifyPlayers(const std::wstring &msg)
|
||||
{
|
||||
SendChatMessage(PEER_ID_INEXISTENT, ChatMessage(msg));
|
||||
|
||||
Reference in New Issue
Block a user