aboutsummaryrefslogtreecommitdiff
path: root/src/server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server.cpp')
-rw-r--r--src/server.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/server.cpp b/src/server.cpp
index d9205c895..4bc049e32 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -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));