project_files/frontlib/net/netprotocol.c
changeset 7320 e704706008d4
parent 7314 6171f0bad318
child 7338 1ed603a54ebd
equal deleted inserted replaced
7318:a446eafcddeb 7320:e704706008d4
    60 	return 0;
    60 	return 0;
    61 }
    61 }
    62 
    62 
    63 flib_team *flib_team_from_netmsg(char **parts) {
    63 flib_team *flib_team_from_netmsg(char **parts) {
    64 	flib_team *result = NULL;
    64 	flib_team *result = NULL;
    65 	flib_team *tmpTeam = flib_team_retain(flib_calloc(1, sizeof(flib_team)));
    65 	flib_team *tmpTeam = flib_calloc(1, sizeof(flib_team));
    66 	if(tmpTeam) {
    66 	if(tmpTeam) {
    67 		if(!fillTeamFromMsg(tmpTeam, parts)) {
    67 		if(!fillTeamFromMsg(tmpTeam, parts)) {
    68 			result = tmpTeam;
    68 			result = tmpTeam;
    69 			tmpTeam = NULL;
    69 			tmpTeam = NULL;
    70 		} else {
    70 		} else {
    71 			flib_log_e("Error parsing team from net.");
    71 			flib_log_e("Error parsing team from net.");
    72 		}
    72 		}
    73 	}
    73 	}
    74 	flib_team_release(tmpTeam);
    74 	flib_team_destroy(tmpTeam);
    75 	return result;
    75 	return result;
    76 }
    76 }
    77 
    77 
    78 flib_cfg *flib_netmsg_to_cfg(flib_cfg_meta *meta, char **parts) {
    78 flib_scheme *flib_netmsg_to_cfg(flib_metascheme *meta, char **parts) {
    79 	flib_cfg *result = flib_cfg_create(meta, parts[0]);
    79 	flib_scheme *result = flib_scheme_create(meta, parts[0]);
    80 	if(result) {
    80 	if(result) {
    81 		for(int i=0; i<meta->modCount; i++) {
    81 		for(int i=0; i<meta->modCount; i++) {
    82 			result->mods[i] = !strcmp(parts[i+1], "true");
    82 			result->mods[i] = !strcmp(parts[i+1], "true");
    83 		}
    83 		}
    84 		for(int i=0; i<meta->settingCount; i++) {
    84 		for(int i=0; i<meta->settingCount; i++) {