]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/network/networkprotocol.h
Merge pull request #59 from PrairieAstronomer/readme_irrlicht_change
[dragonfireclient.git] / src / network / networkprotocol.h
index 73523ea4230fe5d8dc3b8e62afd5250e23472b69..3923cb85812e61dfc31d9a3e2ace8ff2522095c6 100644 (file)
@@ -204,9 +204,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
        PROTOCOL VERSION 39:
                Updated set_sky packet
                Adds new sun, moon and stars packets
+               Minimap modes
+       PROTOCOL VERSION 40:
+               TOCLIENT_MEDIA_PUSH changed, TOSERVER_HAVE_MEDIA added
 */
 
-#define LATEST_PROTOCOL_VERSION 39
+#define LATEST_PROTOCOL_VERSION 40
 #define LATEST_PROTOCOL_VERSION_STRING TOSTRING(LATEST_PROTOCOL_VERSION)
 
 // Server's supported network protocol range
@@ -225,21 +228,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define PASSWORD_SIZE 28       // Maximum password length. Allows for
                                // base64-encoded SHA-1 (27+\0).
 
-/*
-       Changes by FORMSPEC_API_VERSION:
-
-       FORMSPEC VERSION 1:
-               (too much)
-       FORMSPEC VERSION 2:
-               Forced real coordinates
-               background9[]: 9-slice scaling parameters
-       FORMSPEC VERSION 3:
-               Formspec elements are drawn in the order of definition
-               bgcolor[]: use 3 parameters (bgcolor, formspec (now an enum), fbgcolor)
-               box[] and image[] elements enable clipping by default
-               new element: scroll_container[]
-*/
-#define FORMSPEC_API_VERSION 3
+// See also: Formspec Version History in doc/lua_api.txt
+#define FORMSPEC_API_VERSION 5
 
 #define TEXTURENAME_ALLOWED_CHARS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.-"
 
@@ -323,6 +313,14 @@ enum ToClientCommand
                v3f added_vel
         */
 
+       TOCLIENT_MEDIA_PUSH = 0x2C,
+       /*
+               std::string raw_hash
+               std::string filename
+               u32 callback_token
+               bool should_be_cached
+       */
+
        // (oops, there is some gap here)
 
        TOCLIENT_CHAT_MESSAGE = 0x2F,
@@ -560,10 +558,10 @@ enum ToClientCommand
                u32 id
                u8 type
                v2f1000 pos
-               u32 len
+               u16 len
                u8[len] name
                v2f1000 scale
-               u32 len2
+               u16 len2
                u8[len2] text
                u32 number
                u32 item
@@ -573,6 +571,8 @@ enum ToClientCommand
                v3f1000 world_pos
                v2s32 size
                s16 z_index
+               u16 len3
+               u8[len3] text2
        */
 
        TOCLIENT_HUDRM = 0x4a,
@@ -634,9 +634,9 @@ enum ToClientCommand
                u8[4] night_sky (ARGB)
                u8[4] night_horizon (ARGB)
                u8[4] indoors (ARGB)
-               u8[4] sun_tint (ARGB)
-               u8[4] moon_tint (ARGB)
-               std::string tint_type
+               u8[4] fog_sun_tint (ARGB)
+               u8[4] fog_moon_tint (ARGB)
+               std::string fog_tint_type
        */
 
        TOCLIENT_OVERRIDE_DAY_NIGHT_RATIO = 0x50,
@@ -751,7 +751,23 @@ enum ToClientCommand
                u8[len] formspec
        */
 
-       TOCLIENT_NUM_MSG_TYPES = 0x62,
+       TOCLIENT_MINIMAP_MODES = 0x62,
+       /*
+               u16 count // modes
+               u16 mode  // wanted current mode index after change
+               for each mode
+                       u16 type
+                       std::string label
+                       u16 size
+                       std::string extra
+       */
+
+       TOCLIENT_SET_LIGHTING = 0x63,
+       /*
+               f32 shadow_intensity
+       */
+
+       TOCLIENT_NUM_MSG_TYPES = 0x64,
 };
 
 enum ToServerCommand
@@ -926,7 +942,13 @@ enum ToServerCommand
                }
        */
 
-       TOSERVER_RECEIVED_MEDIA = 0x41, // Obsolete
+       TOSERVER_HAVE_MEDIA = 0x41,
+       /*
+               u8 number of callback tokens
+               for each:
+                       u32 token
+       */
+
        TOSERVER_BREATH = 0x42, // Obsolete
 
        TOSERVER_CLIENT_READY = 0x43,
@@ -984,7 +1006,7 @@ enum AuthMechanism
        AUTH_MECHANISM_FIRST_SRP = 1 << 2,
 };
 
-enum AccessDeniedCode {
+enum AccessDeniedCode : u8 {
        SERVER_ACCESSDENIED_WRONG_PASSWORD,
        SERVER_ACCESSDENIED_UNEXPECTED_DATA,
        SERVER_ACCESSDENIED_SINGLEPLAYER,
@@ -1007,21 +1029,21 @@ enum NetProtoCompressionMode {
 
 const static std::string accessDeniedStrings[SERVER_ACCESSDENIED_MAX] = {
        "Invalid password",
-       "Your client sent something the server didn't expect.  Try reconnecting or updating your client",
+       "Your client sent something the server didn't expect.  Try reconnecting or updating your client.",
        "The server is running in simple singleplayer mode.  You cannot connect.",
-       "Your client's version is not supported.\nPlease contact server administrator.",
-       "Player name contains disallowed characters.",
-       "Player name not allowed.",
-       "Too many users.",
+       "Your client's version is not supported.\nPlease contact the server administrator.",
+       "Player name contains disallowed characters",
+       "Player name not allowed",
+       "Too many users",
        "Empty passwords are disallowed.  Set a password and try again.",
        "Another client is connected with this name.  If your client closed unexpectedly, try again in a minute.",
-       "Server authentication failed.  This is likely a server error.",
+       "Internal server error",
        "",
-       "Server shutting down.",
-       "This server has experienced an internal error. You will now be disconnected."
+       "Server shutting down",
+       "The server has experienced an internal error.  You will now be disconnected."
 };
 
-enum PlayerListModifer: u8
+enum PlayerListModifer : u8
 {
        PLAYER_LIST_INIT,
        PLAYER_LIST_ADD,