project_files/frontlib/net/netprotocol.h
changeset 7271 5608ac657362
parent 7269 5b0aeef8ba2a
child 7275 15f722e0b96f
equal deleted inserted replaced
7269:5b0aeef8ba2a 7271:5608ac657362
     1 #ifndef NETPROTOCOL_H_
     1 #ifndef NETPROTOCOL_H_
     2 #define NETPROTOCOL_H_
     2 #define NETPROTOCOL_H_
     3 
     3 
     4 #include "../model/team.h"
     4 #include "../model/team.h"
       
     5 #include "../model/cfg.h"
       
     6 #include "../model/map.h"
       
     7 
       
     8 #include <stddef.h>
     5 
     9 
     6 /**
    10 /**
     7  * Create a new team from this 23-part net message
    11  * Create a new team from this 23-part net message
     8  */
    12  */
     9 flib_team *flib_team_from_netmsg(char **parts);
    13 flib_team *flib_team_from_netmsg(char **parts);
    10 
    14 
       
    15 /**
       
    16  * Create a new scheme from this net message, which must have
       
    17  * meta->modCount+meta->settingCount+1 parts.
       
    18  */
       
    19 flib_cfg *flib_netmsg_to_cfg(flib_cfg_meta *meta, char **parts);
       
    20 
       
    21 /**
       
    22  * Create a new map from this five-part netmsg
       
    23  */
       
    24 flib_map *flib_netmsg_to_map(char **parts);
       
    25 
       
    26 /**
       
    27  * Decode the drawn map data from this netmessage line.
       
    28  *
       
    29  * The data is first base64 decoded and then quncompress()ed.
       
    30  * The return value is a newly allocated byte buffer, the length
       
    31  * is written to the variable pointed to by outlen.
       
    32  * Returns NULL on error.
       
    33  */
       
    34 uint8_t *flib_netmsg_to_drawnmapdata(size_t *outlen, char *netmsg);
    11 
    35 
    12 #endif /* NETPROTOCOL_H_ */
    36 #endif /* NETPROTOCOL_H_ */