mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Prepare Protocol v25 init & authentication.
* TOSERVER_INIT and TOCLIENT_INIT renamed to _LEGACY * TOSERVER_PASSWORD merged from dev-0.5, can use protocol v24 and v25 * TOCLIENT_ACCESS_DENIED merged from dev-0.5, can use protocol v24 and v25, with normalized strings an a custom id for custom errors * new TOSERVER_INIT packet only send MT version, supported compressions, protocols and serialization, this permit to rework everything later without break the _INIT packet * new TOSERVER_AUTH packet which auth the client * new TOCLIENT_HELLO packet which send server serialization version atm * new TOCLIENT_AUTH_ACCEPTED which is send when TOCLIENT_AUTH was okay. After this packet, the client load datas from servers, like after TOCLIENT_INIT_LEGACY packet
This commit is contained in:
parent
9f3fc7201b
commit
74d34da6cb
10 changed files with 448 additions and 70 deletions
|
@ -110,14 +110,21 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
ContentFeatures: change number of special tiles to 6 (CF_SPECIAL_COUNT)
|
||||
PROTOCOL_VERSION 25:
|
||||
Rename TOCLIENT_ACCESS_DENIED to TOCLIENT_ACCESS_DENIED_LEGAGY
|
||||
Rename TOCLIENT_DELETE_PARTICLESPAWNER to TOCLIENT_DELETE_PARTICLESPAWNER_LEGACY
|
||||
Rename TOCLIENT_DELETE_PARTICLESPAWNER to
|
||||
TOCLIENT_DELETE_PARTICLESPAWNER_LEGACY
|
||||
Rename TOSERVER_PASSWORD to TOSERVER_PASSWORD_LEGACY
|
||||
Rename TOSERVER_INIT to TOSERVER_INIT_LEGACY
|
||||
Rename TOCLIENT_INIT to TOCLIENT_INIT_LEGACY
|
||||
Add TOCLIENT_ACCESS_DENIED new opcode (0x0A), using error codes
|
||||
for standard error, keeping customisation possible. This
|
||||
permit translation
|
||||
Add TOCLIENT_DELETE_PARTICLESPAWNER (0x53), fixing the u16 read and
|
||||
reading u32
|
||||
Add TOSERVER_INIT new opcode (0x02) for client presentation to server
|
||||
Add TOSERVER_AUTH new opcode (0x03) for client authentication
|
||||
Add TOCLIENT_HELLO for presenting server to client after client
|
||||
presentation
|
||||
Add TOCLIENT_AUTH_ACCEPT to accept connexion from client
|
||||
*/
|
||||
|
||||
#define LATEST_PROTOCOL_VERSION 24
|
||||
|
@ -143,6 +150,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
enum ToClientCommand
|
||||
{
|
||||
TOCLIENT_HELLO = 0x02,
|
||||
TOCLIENT_AUTH_ACCEPT = 0x03,
|
||||
TOCLIENT_ACCESS_DENIED = 0x0A,
|
||||
/*
|
||||
u16 command
|
||||
|
@ -150,7 +159,7 @@ enum ToClientCommand
|
|||
wstring reason
|
||||
*/
|
||||
|
||||
TOCLIENT_INIT = 0x10,
|
||||
TOCLIENT_INIT_LEGACY = 0x10,
|
||||
/*
|
||||
Server's reply to TOSERVER_INIT.
|
||||
Sent second after connected.
|
||||
|
@ -585,17 +594,22 @@ enum ToClientCommand
|
|||
|
||||
enum ToServerCommand
|
||||
{
|
||||
TOSERVER_INIT = 0x0F,
|
||||
TOSERVER_INIT = 0x02,
|
||||
/*
|
||||
Sent first after connected.
|
||||
|
||||
[0] u16 TOSERVER_INIT
|
||||
[2] u8 SER_FMT_VER_HIGHEST_READ
|
||||
[3] u8 compression_modes
|
||||
[4] std::string player_name
|
||||
[4+*] std::string password (new in some version)
|
||||
[4+*+*] u16 minimum supported network protocol version (added sometime)
|
||||
[4+*+*+2] u16 maximum supported network protocol version (added later than the previous one)
|
||||
*/
|
||||
|
||||
TOSERVER_AUTH = 0x03,
|
||||
/*
|
||||
Sent first after presentation (INIT).
|
||||
[0] std::string player_name
|
||||
[0+*] std::string password (new in some version)
|
||||
[0+*+*] u16 minimum supported network protocol version (added sometime)
|
||||
[0+*+*+2] u16 maximum supported network protocol version (added later than the previous one)
|
||||
*/
|
||||
|
||||
TOSERVER_INIT_LEGACY = 0x10,
|
||||
|
@ -856,8 +870,9 @@ enum AccessDeniedCode {
|
|||
SERVER_ACCESSDENIED_TOO_MANY_USERS = 6,
|
||||
SERVER_ACCESSDENIED_EMPTY_PASSWORD = 7,
|
||||
SERVER_ACCESSDENIED_ALREADY_CONNECTED = 8,
|
||||
SERVER_ACCESSDENIED_CUSTOM_STRING = 9,
|
||||
SERVER_ACCESSDENIED_MAX = 10,
|
||||
SERVER_ACCESSDENIED_SERVER_FAIL = 9,
|
||||
SERVER_ACCESSDENIED_CUSTOM_STRING = 10,
|
||||
SERVER_ACCESSDENIED_MAX = 11,
|
||||
};
|
||||
|
||||
enum NetProtoCompressionMode {
|
||||
|
@ -874,6 +889,7 @@ const static std::wstring accessDeniedStrings[SERVER_ACCESSDENIED_MAX] = {
|
|||
L"Too many users.",
|
||||
L"Empty passwords are disallowed. Set a password and try again.",
|
||||
L"Another client is connected with this name. If your client closed unexpectedly, try again in a minute.",
|
||||
L"Server authenticator failed. Maybe the servers has some problems."
|
||||
L"",
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue