Just do it as I suggested, use a simple struct to determine the type of the struct and then cast the void pointer to the appropriate struct:

received data/ buffer?
DATA* mydata = (DATA*)buffer;
if(mydata->type == TYPE_MOVE)

{
DATA_MOVE* move = (DATA_MOVE*)buffer;
dm_player[move->player_id].input = move->input;
}
if(mydata->type == TYPE_CHAT) ...

All structs have to have the same type variable as the first member.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends