From be10c0893e2e6d1852a027abccc4cd3cdc85a140 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Sat, 30 Sep 2017 12:00:05 +0200 Subject: Make Player::peer_id server-side only and add getters and setters (#6478) * Make Player::peer_id server-side only and add getters and setters Player::peer_id has no sense client side, move it to server, make it private and add setter and getter Also add some PEER_ID_INEXISTENT instead of harcoded 0 --- src/remoteplayer.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/remoteplayer.h') diff --git a/src/remoteplayer.h b/src/remoteplayer.h index 84978f343..59870f14b 100644 --- a/src/remoteplayer.h +++ b/src/remoteplayer.h @@ -135,6 +135,10 @@ public: u16 protocol_version = 0; + session_t getPeerId() const { return m_peer_id; } + + void setPeerId(session_t peer_id) { m_peer_id = peer_id; } + private: /* serialize() writes a bunch of text that can contain @@ -166,4 +170,6 @@ private: bool m_sky_clouds; CloudParams m_cloud_params; + + session_t m_peer_id = PEER_ID_INEXISTENT; }; -- cgit v1.2.3