diff -r f821f7d727b7 -r 1ed603a54ebd project_files/frontlib/net/netprotocol.c --- a/project_files/frontlib/net/netprotocol.c Wed Jul 18 21:34:49 2012 +0200 +++ b/project_files/frontlib/net/netprotocol.c Thu Jul 19 17:56:38 2012 +0200 @@ -140,3 +140,48 @@ free(base64decout); return result; } + +flib_room *flib_room_from_netmsg(char **params) { + flib_room *result = NULL; + flib_room *tmpRoom = flib_calloc(1, sizeof(flib_room)); + if(tmpRoom) { + tmpRoom->inProgress = !strcmp(params[0], "True"); + tmpRoom->name = flib_strdupnull(params[1]); + tmpRoom->playerCount = atoi(params[2]); + tmpRoom->teamCount = atoi(params[3]); + tmpRoom->owner = flib_strdupnull(params[4]); + tmpRoom->map = flib_strdupnull(params[5]); + tmpRoom->scheme = flib_strdupnull(params[6]); + tmpRoom->weapons = flib_strdupnull(params[7]); + if(tmpRoom->name && tmpRoom->owner && tmpRoom->map && tmpRoom->scheme && tmpRoom->weapons) { + result = tmpRoom; + tmpRoom = NULL; + } + } + flib_room_destroy(tmpRoom); + return result; +} + +int fillRoomArray(flib_room **array, char **params, int count) { + for(int i=0; i