summaryrefslogtreecommitdiff
path: root/src/remoteplayer.h
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-09-30 12:00:05 +0200
committerGitHub <noreply@github.com>2017-09-30 12:00:05 +0200
commitbe10c0893e2e6d1852a027abccc4cd3cdc85a140 (patch)
treeeabfe8164007c420326f52bfc7e13e9be0f6bfb6 /src/remoteplayer.h
parentf729b5d2bdc65ce3c51f1004c58cb93a37504b49 (diff)
downloadminetest-be10c0893e2e6d1852a027abccc4cd3cdc85a140.tar.gz
minetest-be10c0893e2e6d1852a027abccc4cd3cdc85a140.tar.bz2
minetest-be10c0893e2e6d1852a027abccc4cd3cdc85a140.zip
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
Diffstat (limited to 'src/remoteplayer.h')
-rw-r--r--src/remoteplayer.h6
1 files changed, 6 insertions, 0 deletions
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;
};