project_files/frontlib/net/netprotocol.c
changeset 7314 6171f0bad318
parent 7275 15f722e0b96f
child 7320 e704706008d4
equal deleted inserted replaced
7312:d1db8aaa8edc 7314:6171f0bad318
       
     1 /*
       
     2  * Hedgewars, a free turn based strategy game
       
     3  * Copyright (C) 2012 Simeon Maxein <smaxein@googlemail.com>
       
     4  *
       
     5  * This program is free software; you can redistribute it and/or
       
     6  * modify it under the terms of the GNU General Public License
       
     7  * as published by the Free Software Foundation; either version 2
       
     8  * of the License, or (at your option) any later version.
       
     9  *
       
    10  * This program is distributed in the hope that it will be useful,
       
    11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    13  * GNU General Public License for more details.
       
    14  *
       
    15  * You should have received a copy of the GNU General Public License
       
    16  * along with this program; if not, write to the Free Software
       
    17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
       
    18  */
       
    19 
     1 #include "netprotocol.h"
    20 #include "netprotocol.h"
     2 
    21 
     3 #include "../util/util.h"
    22 #include "../util/util.h"
     4 #include "../util/logging.h"
    23 #include "../util/logging.h"
     5 
    24 
    77 		result->templateFilter = atoi(parts[4]);
    96 		result->templateFilter = atoi(parts[4]);
    78 	}
    97 	}
    79 	return result;
    98 	return result;
    80 }
    99 }
    81 
   100 
    82 // TODO: Test with empty map
       
    83 int flib_netmsg_to_drawnmapdata(char *netmsg, uint8_t** outbuf, size_t *outlen) {
   101 int flib_netmsg_to_drawnmapdata(char *netmsg, uint8_t** outbuf, size_t *outlen) {
    84 	int result = -1;
   102 	int result = -1;
    85 
   103 
    86 	// First step: base64 decoding
   104 	// First step: base64 decoding
    87 	char *base64decout = NULL;
   105 	char *base64decout = NULL;