aboutsummaryrefslogtreecommitdiff
path: root/src/network/networkprotocol.h
diff options
context:
space:
mode:
authorred-001 <red-001@outlook.ie>2017-06-08 14:30:09 +0100
committerLoïc Blot <nerzhul@users.noreply.github.com>2017-06-08 15:30:09 +0200
commit4221c1b4412f2bf889bd603a26424003f5367f6a (patch)
tree622775e473bf073ed704afded90b050b51d63266 /src/network/networkprotocol.h
parent5bd33a158688f5fb950613278eefb95b0594a765 (diff)
downloadminetest-4221c1b4412f2bf889bd603a26424003f5367f6a.tar.xz
Have the server send the player list to the client (#5924)
* Have the server send the player list to the client Currently the client generates the player list based on the Client active object list, the issue with this is that we can't be sure all player active objects will be sent to the client, so this could result in players showing up when someone run `/status` but auto complete not working with their nick and CSM not being aware of the player
Diffstat (limited to 'src/network/networkprotocol.h')
-rw-r--r--src/network/networkprotocol.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/network/networkprotocol.h b/src/network/networkprotocol.h
index 7126c237b..f003cf26a 100644
--- a/src/network/networkprotocol.h
+++ b/src/network/networkprotocol.h
@@ -155,9 +155,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
Stop sending TOSERVER_CLIENT_READY
PROTOCOL VERSION 32:
Add fading sounds
+ PROTOCOL VERSION 33:
+ Add TOCLIENT_UPDATE_PLAYER_LIST and send the player list to the client,
+ instead of guessing based on the active object list.
+
*/
-#define LATEST_PROTOCOL_VERSION 32
+#define LATEST_PROTOCOL_VERSION 33
// Server's supported network protocol range
#define SERVER_PROTOCOL_VERSION_MIN 24
@@ -629,6 +633,14 @@ enum ToClientCommand
float step
float gain
*/
+ TOCLIENT_UPDATE_PLAYER_LIST = 0x56,
+ /*
+ u8 type
+ u16 number of players
+ for each player
+ u16 len
+ u8[len] player name
+ */
TOCLIENT_SRP_BYTES_S_B = 0x60,
/*
@@ -965,4 +977,12 @@ const static std::string accessDeniedStrings[SERVER_ACCESSDENIED_MAX] = {
"This server has experienced an internal error. You will now be disconnected."
};
+enum PlayerListModifer: u8
+{
+ PLAYER_LIST_INIT,
+ PLAYER_LIST_ADD,
+ PLAYER_LIST_REMOVE,
+};
+
+
#endif