sub chgame { my ($player_id, $command, $hostip, $hostport, $hostversion, $map, $players, $maxplayers, $techlvl) = @_; foreach(@gameDB) { my $host_id = parsexml($_, 'player_id'); if ($host_id eq $player_id) { print "allowed\n"; shift; addgame($player_id, $command, $hostip, $hostport, $hostversion, $map, $players, $maxplayers, $techlvl); } else { print "host doesent match\n"; } } broadcast($player_id, "chgame: $hostip"); }