aboutsummaryrefslogtreecommitdiff
path: root/src/server.h
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2016-10-08 12:21:41 +0200
committerNer'zhul <nerzhul@users.noreply.github.com>2016-10-08 15:57:50 +0200
commit656faf7373587bc59b47986a28dbd2fce4c45474 (patch)
tree0d2414db105bfeaa1112576725da61bfdfc1edec /src/server.h
parent9393e4a0a8e32905d32a9dc58131218aee318686 (diff)
downloadminetest-656faf7373587bc59b47986a28dbd2fce4c45474.tar.gz
minetest-656faf7373587bc59b47986a28dbd2fce4c45474.tar.bz2
minetest-656faf7373587bc59b47986a28dbd2fce4c45474.zip
Player/LocalPlayer/RemotePlayer inheritance cleanup (part 2 on X)
* Server/Client Environments now have an helper to cast Player object in the right type to use it * Server: use RemotePlayer everywhere and remove previous added casts * Client: use LocalPlayer where needed * Environment: remove unused functions (getPlayers(), getRandomConnectedPlayer(), getNearestConnectedPlayer())
Diffstat (limited to 'src/server.h')
-rw-r--r--src/server.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/server.h b/src/server.h
index 555aab692..8eb1afc9f 100644
--- a/src/server.h
+++ b/src/server.h
@@ -307,25 +307,26 @@ public:
Map & getMap() { return m_env->getMap(); }
ServerEnvironment & getEnv() { return *m_env; }
- u32 hudAdd(Player *player, HudElement *element);
- bool hudRemove(Player *player, u32 id);
- bool hudChange(Player *player, u32 id, HudElementStat stat, void *value);
+ u32 hudAdd(RemotePlayer *player, HudElement *element);
+ bool hudRemove(RemotePlayer *player, u32 id);
+ bool hudChange(RemotePlayer *player, u32 id, HudElementStat stat, void *value);
bool hudSetFlags(RemotePlayer *player, u32 flags, u32 mask);
bool hudSetHotbarItemcount(RemotePlayer *player, s32 hotbar_itemcount);
s32 hudGetHotbarItemcount(RemotePlayer *player) const
{ return player->getHotbarItemcount(); }
- void hudSetHotbarImage(Player *player, std::string name);
- std::string hudGetHotbarImage(Player *player);
- void hudSetHotbarSelectedImage(Player *player, std::string name);
- std::string hudGetHotbarSelectedImage(Player *player);
+ void hudSetHotbarImage(RemotePlayer *player, std::string name);
+ std::string hudGetHotbarImage(RemotePlayer *player);
+ void hudSetHotbarSelectedImage(RemotePlayer *player, std::string name);
+ std::string hudGetHotbarSelectedImage(RemotePlayer *player);
inline Address getPeerAddress(u16 peer_id)
{ return m_con.GetPeerAddress(peer_id); }
- bool setLocalPlayerAnimations(Player *player, v2s32 animation_frames[4], f32 frame_speed);
- bool setPlayerEyeOffset(Player *player, v3f first, v3f third);
+ bool setLocalPlayerAnimations(RemotePlayer *player, v2s32 animation_frames[4],
+ f32 frame_speed);
+ bool setPlayerEyeOffset(RemotePlayer *player, v3f first, v3f third);
- bool setSky(Player *player, const video::SColor &bgcolor,
+ bool setSky(RemotePlayer *player, const video::SColor &bgcolor,
const std::string &type, const std::vector<std::string> &params);
bool overrideDayNightRatio(RemotePlayer *player, bool do_override, float brightness);