aboutsummaryrefslogtreecommitdiff
path: root/src/server.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/server.h')
-rw-r--r--src/server.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/server.h b/src/server.h
index fddb097d0..c5a285490 100644
--- a/src/server.h
+++ b/src/server.h
@@ -398,6 +398,18 @@ public:
//void SendSectorMeta(u16 peer_id, core::list<v2s16> ps, u8 ver);
core::list<PlayerInfo> getPlayerInfo();
+
+ u32 getDayNightRatio()
+ {
+ s32 d = 8;
+ s32 t = (((m_time_of_day.get() + 24000/d/2)%24000)/(24000/d));
+ if(t == d/4 || t == (d-d/4))
+ return 600;
+ else if(t < d/4 || t > (d-d/4))
+ return 300;
+ else
+ return 1000;
+ }
private: