sub unify_information { my ($sid, $rx) = @_; my %uei; # unified extended info my @upi; # unified player info # FIXME unify with {player playername name, other keys/columns} # first process all available player entries for (my $i = 0; exists $rx->{"player_$i"}; $i++) { # add player info to UPI and remove from hash my @player; push @player, $sid; push @player, delete $rx->{"player_$i"} || "Derp"; push @player, delete $rx->{"team_$i"}; push @player, int (delete $rx->{"frags_$i"} || 0); push @player, delete $rx->{"mesh_$i"}; push @player, delete $rx->{"skin_$i"}; push @player, delete $rx->{"face_$i"}; push @player, int (delete $rx->{"ping_$i"} || 0); {"ngsecret_$i"}; push @upi, \@player; } # return remaining values, player array return ($rx, \@upi); } 1;