diff options
author | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-09-27 19:47:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-27 19:47:36 +0200 |
commit | ad7daf7b52348e1b71aa803be10de5b2134cba11 (patch) | |
tree | e5a528d0e9be11f678d113dde3ec4b49f3d96c26 /src/modchannels.h | |
parent | 50b2185ced9dc64e054ce743bbc22d15ecdf6192 (diff) | |
download | minetest-ad7daf7b52348e1b71aa803be10de5b2134cba11.tar.gz minetest-ad7daf7b52348e1b71aa803be10de5b2134cba11.tar.bz2 minetest-ad7daf7b52348e1b71aa803be10de5b2134cba11.zip |
Add session_t typedef + remove unused functions (#6470)
* Add session_t typedef + remove unused functions
u16 peer_id is used everywhere, to be more consistent and permit some evolutions on this type in the future (i'm working on a PoC), uniformize u16 peer_id to SessionId peer_id
Diffstat (limited to 'src/modchannels.h')
-rw-r--r-- | src/modchannels.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/modchannels.h b/src/modchannels.h index 5f1aa884e..735609b59 100644 --- a/src/modchannels.h +++ b/src/modchannels.h @@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include <string> #include <vector> #include <memory> +#include "network/networkprotocol.h" #include "irrlichttypes.h" enum ModChannelState : u8 @@ -40,8 +41,8 @@ public: ~ModChannel() = default; const std::string &getName() const { return m_name; } - bool registerConsumer(u16 peer_id); - bool removeConsumer(u16 peer_id); + bool registerConsumer(session_t peer_id); + bool removeConsumer(session_t peer_id); const std::vector<u16> &getChannelPeers() const { return m_client_consumers; } bool canWrite() const; void setState(ModChannelState state); @@ -70,8 +71,8 @@ public: void registerChannel(const std::string &channel); bool setChannelState(const std::string &channel, ModChannelState state); - bool joinChannel(const std::string &channel, u16 peer_id); - bool leaveChannel(const std::string &channel, u16 peer_id); + bool joinChannel(const std::string &channel, session_t peer_id); + bool leaveChannel(const std::string &channel, session_t peer_id); bool channelRegistered(const std::string &channel) const; ModChannel *getModChannel(const std::string &channel); /** @@ -81,7 +82,7 @@ public: * @return true if write is allowed */ bool canWriteOnChannel(const std::string &channel) const; - void leaveAllChannels(u16 peer_id); + void leaveAllChannels(session_t peer_id); const std::vector<u16> &getChannelPeers(const std::string &channel) const; private: |