nanoMMO 0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
shown.h
Go to the documentation of this file.
1#ifndef NANOMMO_SERVER_SHOWN_H_
2#define NANOMMO_SERVER_SHOWN_H_
3
4#include <cstdint>
5#include <optional>
6
7#include "protocol/nanommo.pb.h"
8#include "server/world.h"
9
10namespace nanommo {
11
12// What each player is shown of a world, as the protocol has it, whoever runs
13// the world: a world server, or a client that plays on its own.
14
15protocol::Motion ToProtocol(Motion motion);
16protocol::Player ToProtocol(uint32_t id, const Player& player);
17protocol::Monster ToProtocol(uint32_t id, const Monster& monster);
18protocol::Npc ToProtocol(uint32_t id, const Npc& npc);
19
20/// What a player's own client is told about them each tick, beside the world
21/// near them: who they are, their experience and the next level's, their
22/// skills and how long each has left to cool down, how long until they rise
23/// again, what they're making and how far it's got, the land and its ground's
24/// seed, the last of their numbered inputs applied, if any, and where they are
25/// with it applied.
26protocol::World YouIn(uint32_t id, const Player& player, uint32_t seed,
27 int land, std::optional<uint32_t> acked);
28
29/// Their bag, and their quests, each as it goes when it's changed.
30protocol::World BagOf(const Player& player);
31protocol::World QuestsOf(const Player& player);
32
33/// The event as the players near it get it, or nothing for a kind they don't
34/// see, such as a quest taken.
35std::optional<protocol::Event> ForPlayers(const Event& event);
36
37} // namespace nanommo
38
39#endif // NANOMMO_SERVER_SHOWN_H_
Definition chat.cc:9
std::optional< protocol::Event > ForPlayers(const Event &event)
Definition shown.cc:151
Motion
Definition world.h:36
protocol::World YouIn(uint32_t id, const Player &player, uint32_t seed, int land, std::optional< uint32_t > acked)
Definition shown.cc:94
protocol::World BagOf(const Player &player)
Their bag, and their quests, each as it goes when it's changed.
Definition shown.cc:136
protocol::World QuestsOf(const Player &player)
Definition shown.cc:142
protocol::Motion ToProtocol(Motion motion)
Definition shown.cc:11