project_files/frontlib/net/netprotocol.h
changeset 7482 d70a5b0d1190
parent 7338 1ed603a54ebd
child 7497 7e1d72fc03c7
equal deleted inserted replaced
7479:c8c552ee3acb 7482:d70a5b0d1190
    25 #include "../model/map.h"
    25 #include "../model/map.h"
    26 #include "../model/room.h"
    26 #include "../model/room.h"
    27 
    27 
    28 #include <stddef.h>
    28 #include <stddef.h>
    29 
    29 
    30 // TODO unify naming
       
    31 
       
    32 /**
    30 /**
    33  * Create a new team from this 23-part net message
    31  * Create a new team from this 23-part net message
    34  */
    32  */
    35 flib_team *flib_team_from_netmsg(char **parts);
    33 flib_team *flib_team_from_netmsg(char **parts);
    36 
    34 
    37 /**
    35 /**
    38  * Create a new scheme from this net message, which must have
    36  * Create a new scheme from this net message, which must have
    39  * meta->modCount+meta->settingCount+1 parts.
    37  * meta->modCount+meta->settingCount+1 parts.
    40  */
    38  */
    41 flib_scheme *flib_netmsg_to_cfg(flib_metascheme *meta, char **parts);
    39 flib_scheme *flib_scheme_from_netmsg(flib_metascheme *meta, char **parts);
    42 
    40 
    43 /**
    41 /**
    44  * Create a new map from this five-part netmsg
    42  * Create a new map from this five-part netmsg
    45  */
    43  */
    46 flib_map *flib_netmsg_to_map(char **parts);
    44 flib_map *flib_map_from_netmsg(char **parts);
    47 
    45 
    48 /**
    46 /**
    49  * Decode the drawn map data from this netmessage line.
    47  * Decode the drawn map data from this netmessage line.
    50  *
    48  *
    51  * The data is first base64 decoded and then quncompress()ed.
    49  * The data is first base64 decoded and then quncompress()ed.
    52  * The return value is a newly allocated byte buffer, the length
    50  * The return value is a newly allocated byte buffer, the length
    53  * is written to the variable pointed to by outlen.
    51  * is written to the variable pointed to by outlen.
    54  * Returns NULL on error.
    52  * Returns NULL on error.
    55  */
    53  */
    56 int flib_netmsg_to_drawnmapdata(char *netmsg, uint8_t **outbuf, size_t *outlen);
    54 int flib_drawnmapdata_from_netmsg(char *netmsg, uint8_t **outbuf, size_t *outlen);
    57 
    55 
    58 /**
    56 /**
    59  * Create a new room from this 8-part net message
    57  * Create a new room from this 8-part net message
    60  */
    58  */
    61 flib_room *flib_room_from_netmsg(char **params);
    59 flib_room *flib_room_from_netmsg(char **params);