nanoMMO 0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
weather.h
Go to the documentation of this file.
1#ifndef NANOMMO_SERVER_WEATHER_H_
2#define NANOMMO_SERVER_WEATHER_H_
3
4#include <cstdint>
5
6#include "protocol/nanommo.pb.h"
7
8namespace nanommo {
9
10/// From one midnight to the next, in milliseconds of the wall clock.
11inline constexpr int64_t kDayMs = 40 * 60 * 1000;
12
13/// The weather comes in spells, at most one in each slot of this many
14/// milliseconds, starting at the slot's start and lasting from the shortest
15/// to the whole slot. The rest of the slot is clear.
16inline constexpr int64_t kSlotMs = 15 * 60 * 1000;
17inline constexpr int64_t kShortestSpellMs = 6 * 60 * 1000;
18
19/// How long a spell takes to come, and to go, in milliseconds.
20inline constexpr int64_t kRampMs = 90 * 1000;
21
22/// The sky over a land, by its place in the lands, at a moment of the wall
23/// clock, in milliseconds since 1970. It's worked out from those two alone,
24/// so every server that runs the land agrees, even after a restart, and
25/// there's nothing to save.
26protocol::Sky SkyAt(int land, int64_t unix_ms);
27
28/// Now, by the wall clock, in milliseconds since 1970.
29int64_t UnixMs();
30
31} // namespace nanommo
32
33#endif // NANOMMO_SERVER_WEATHER_H_
Definition chat.cc:9
constexpr int64_t kShortestSpellMs
Definition weather.h:17
int64_t UnixMs()
Now, by the wall clock, in milliseconds since 1970.
Definition weather.cc:130
constexpr int64_t kDayMs
From one midnight to the next, in milliseconds of the wall clock.
Definition weather.h:11
protocol::Sky SkyAt(int land, int64_t unix_ms)
Definition weather.cc:87
constexpr int64_t kSlotMs
Definition weather.h:16
constexpr int64_t kRampMs
How long a spell takes to come, and to go, in milliseconds.
Definition weather.h:20