Austinb / GameQ

A PHP Gameserver Status Query Library
https://austinb.github.io/GameQ/
GNU Lesser General Public License v3.0
404 stars 134 forks source link

GameQ not getting correct data. #44

Closed jurgenmeijer closed 11 years ago

jurgenmeijer commented 11 years ago

Im trying to use the gameQ library to get my gameserver status, however, it does not work properly. Before i downloaded V2 it pretty much worked (i didnt notice v2 at first) but now it will only give me TF2 server status. It doesnt matter which game i try, it always returns TF2.

<?php

// Servers = array('109.201.136.66' ,'109.201.136.67','109.201.136.68'); public function construct(){ parent::construct();

    $this->servers = $this->config->item('gameservers');
    $this->games = array('l4d2', 'css', 'csgo');

    $this->instance = new GameQ();
}

public function getServers($online = true){ $servers = array(); $count = 0;

    foreach($this->servers AS $gameserver){

        foreach($this->games AS $key => $game){
            $servers[] = array('id' => $count, 'type' => $game, 'host' => $gameserver);
            $count++;
        }
    }

    $this->instance->addServers($servers);

    $this->instance->setOption('timeout', 4); // Seconds
    $this->instance->setFilter('normalise');
    $this->instance->setOption('debug', TRUE);

    $data = $this->instance->requestData();

    return $data;
}

?>

The result from the $servers array looks like this: <?php array(9) { [0]=> array(3) { ["id"]=> int(0) ["type"]=> string(4) "l4d2" ["host"]=> string(14) "109.201.136.66" } [1]=> array(3) { ["id"]=> int(1) ["type"]=> string(3) "css" ["host"]=> string(14) "109.201.136.66" } [2]=> array(3) { ["id"]=> int(2) ["type"]=> string(4) "csgo" ["host"]=> string(14) "109.201.136.66" } [3]=> array(3) { ["id"]=> int(3) ["type"]=> string(4) "l4d2" ["host"]=> string(14) "109.201.136.67" } [4]=> array(3) { ["id"]=> int(4) ["type"]=> string(3) "css" ["host"]=> string(14) "109.201.136.67" } [5]=> array(3) { ["id"]=> int(5) ["type"]=> string(4) "csgo" ["host"]=> string(14) "109.201.136.67" } [6]=> array(3) { ["id"]=> int(6) ["type"]=> string(4) "l4d2" ["host"]=> string(14) "109.201.136.68" } [7]=> array(3) { ["id"]=> int(7) ["type"]=> string(3) "css" ["host"]=> string(14) "109.201.136.68" } [8]=> array(3) { ["id"]=> int(8) ["type"]=> string(4) "csgo" ["host"]=> string(14) "109.201.136.68" } } ?>

This is my output array of gameserver data: <?php array(9) { ["109.201.136.66"]=> array(139) { ["coop"]=> string(1) "0" ["deathmatch"]=> string(1) "1" ["decalfrequency"]=> string(2) "10" ["dedicated"]=> string(1) "d" ["game_descr"]=> string(13) "Team Fortress" ["game_dir"]=> string(2) "tf" ["gq_address"]=> string(14) "109.201.136.66" ["gq_dedicated"]=> string(1) "d" ["gq_gametype"]=> bool(false) ["gq_hostname"]=> string(36) "[Nforce.com]NFOrce Gaming TF2 Server" ["gq_mapname"]=> string(11) "cp_dustbowl" ["gq_maxplayers"]=> int(20) ["gq_mod"]=> string(2) "tf" ["gq_numplayers"]=> int(0) ["gq_online"]=> bool(true) ["gq_password"]=> int(0) ["gq_port"]=> int(27015) ["gq_protocol"]=> string(6) "source" ["gq_transport"]=> string(3) "udp" ["gq_type"]=> string(4) "l4d2" ["hostname"]=> string(36) "[Nforce.com]NFOrce Gaming TF2 Server" ["map"]=> string(11) "cp_dustbowl" ["max_players"]=> int(20) ["mp_allowNPCs"]=> string(1) "1" ["mp_autocrosshair"]=> string(1) "1" ["mp_autoteambalance"]=> string(1) "1" ["mp_disable_respawn_times"]=> string(1) "0" ["mp_fadetoblack"]=> string(1) "0" ["mp_falldamage"]=> string(1) "0" ["mp_flashlight"]=> string(1) "0" ["mp_footsteps"]=> string(1) "1" ["mp_forceautoteam"]=> string(1) "0" ["mp_forcerespawn"]=> string(1) "1" ["mp_fraglimit"]=> string(1) "0" ["mp_friendlyfire"]=> string(1) "0" ["mp_highlander"]=> string(1) "0" ["mp_holiday_nogifts"]=> string(1) "0" ["mp_match_end_at_timelimit"]=> string(1) "0" ["mp_maxrounds"]=> string(1) "0" ["mp_respawnwavetime"]=> string(4) "10.0" ["mp_scrambleteams_auto"]=> string(1) "1" ["mp_scrambleteams_auto_windifference"]=> string(1) "2" ["mp_stalemate_enable"]=> string(1) "0" ["mp_stalemate_meleeonly"]=> string(1) "0" ["mp_teamlist"]=> string(16) "hgrunt;scientist" ["mp_teamplay"]=> string(1) "0" ["mp_teams_unbalance_limit"]=> string(1) "1" ["mp_timelimit"]=> string(1) "0" ["mp_tournament"]=> string(1) "0" ["mp_tournament_stopwatch"]=> string(1) "1" ["mp_weaponstay"]=> string(1) "0" ["mp_windifference"]=> string(1) "0" ["mp_windifference_min"]=> string(1) "0" ["mp_winlimit"]=> string(1) "0" ["nextlevel"]=> string(0) "" ["num_bots"]=> int(0) ["num_players"]=> int(0) ["num_rules"]=> int(108) ["os"]=> string(1) "l" ["password"]=> int(0) ["players"]=> array(0) { } ["protocol"]=> int(17) ["r_AirboatViewDampenDamp"]=> string(3) "1.0" ["r_AirboatViewDampenFreq"]=> string(3) "7.0" ["r_AirboatViewZHeight"]=> string(3) "0.0" ["r_JeepViewDampenDamp"]=> string(3) "1.0" ["r_JeepViewDampenFreq"]=> string(3) "7.0" ["r_JeepViewZHeight"]=> string(4) "10.0" ["r_VehicleViewDampen"]=> string(1) "1" ["secure"]=> int(1) ["steamappid"]=> int(440) ["sv_accelerate"]=> string(2) "10" ["sv_airaccelerate"]=> string(2) "10" ["sv_alltalk"]=> string(1) "0" ["sv_bounce"]=> string(1) "0" ["sv_cheats"]=> string(1) "0" ["sv_contact"]=> string(0) "" ["sv_footsteps"]=> string(1) "1" ["sv_friction"]=> string(1) "4" ["sv_gravity"]=> string(3) "800" ["sv_maxspeed"]=> string(3) "320" ["sv_noclipaccelerate"]=> string(1) "5" ["sv_noclipspeed"]=> string(1) "5" ["sv_password"]=> string(1) "0" ["sv_pausable"]=> string(1) "0" ["sv_registration_message"]=> string(20) "No account specified" ["sv_registration_successful"]=> string(1) "0" ["sv_rollangle"]=> string(1) "0" ["sv_rollspeed"]=> string(3) "200" ["sv_specaccelerate"]=> string(1) "5" ["sv_specnoclip"]=> string(1) "1" ["sv_specspeed"]=> string(1) "3" ["sv_steamgroup"]=> string(0) "" ["sv_stepsize"]=> string(2) "18" ["sv_stopspeed"]=> string(3) "100" ["sv_tags"]=> string(2) "cp" ["sv_voiceenable"]=> string(1) "1" ["sv_wateraccelerate"]=> string(2) "10" ["sv_waterfriction"]=> string(1) "1" ["teams"]=> array(0) { } ["tf_allow_player_use"]=> string(1) "0" ["tf_arena_change_limit"]=> string(1) "1" ["tf_arena_first_blood"]=> string(1) "1" ["tf_arena_force_class"]=> string(1) "0" ["tf_arena_max_streak"]=> string(1) "3" ["tf_arena_override_cap_enable_time"]=> string(2) "-1" ["tf_arena_preround_time"]=> string(2) "10" ["tf_arena_round_time"]=> string(1) "0" ["tf_arena_use_queue"]=> string(1) "1" ["tf_birthday"]=> string(1) "0" ["tf_bot_count"]=> string(1) "0" ["tf_ctf_bonus_time"]=> string(2) "10" ["tf_damage_disablespread"]=> string(1) "0" ["tf_force_holidays_off"]=> string(1) "0" ["tf_gamemode_arena"]=> string(1) "0" ["tf_gamemode_cp"]=> string(1) "1" ["tf_gamemode_ctf"]=> string(1) "0" ["tf_gamemode_mvm"]=> string(1) "0" ["tf_gamemode_payload"]=> string(1) "0" ["tf_gamemode_sd"]=> string(1) "0" ["tf_max_charge_speed"]=> string(3) "750" ["tf_maxspeed"]=> string(3) "400" ["tf_medieval"]=> string(1) "0" ["tf_medieval_autorp"]=> string(1) "1" ["tf_mm_servermode"]=> string(1) "0" ["tf_mm_strict"]=> string(1) "0" ["tf_mm_trusted"]=> string(1) "0" ["tf_mvm_death_penalty"]=> string(1) "0" ["tf_mvm_min_players_to_start"]=> string(1) "3" ["tf_overtime_nag"]=> string(1) "0" ["tf_playergib"]=> string(1) "1" ["tf_server_identity_disable_quickplay"]=> string(1) "0" ["tf_teamtalk"]=> string(1) "0" ["tf_use_fixed_weaponspreads"]=> string(1) "0" ["tf_weapon_criticals"]=> string(1) "1" ["tv_enable"]=> string(1) "0" ["tv_password"]=> string(1) "0" ["tv_relaypassword"]=> string(1) "0" ["version"]=> int(49) } [1]=> array(139) { ["coop"]=> string(1) "0" ["deathmatch"]=> string(1) "1" ["decalfrequency"]=> string(2) "10" ["dedicated"]=> string(1) "d" ["game_descr"]=> string(13) "Team Fortress" ["game_dir"]=> string(2) "tf" ["gq_address"]=> string(14) "109.201.136.66" ["gq_dedicated"]=> string(1) "d" ["gq_gametype"]=> bool(false) ["gq_hostname"]=> string(36) "[Nforce.com]NFOrce Gaming TF2 Server" ["gq_mapname"]=> string(11) "cp_dustbowl" ["gq_maxplayers"]=> int(20) ["gq_mod"]=> string(2) "tf" ["gq_numplayers"]=> int(0) ["gq_online"]=> bool(true) ["gq_password"]=> int(0) ["gq_port"]=> int(27015) ["gq_protocol"]=> string(6) "source" ["gq_transport"]=> string(3) "udp" ["gq_type"]=> string(3) "css" ["hostname"]=> string(36) "[Nforce.com]NFOrce Gaming TF2 Server" ["map"]=> string(11) "cp_dustbowl" ["max_players"]=> int(20) ["mp_allowNPCs"]=> string(1) "1" ["mp_autocrosshair"]=> string(1) "1" ["mp_autoteambalance"]=> string(1) "1" ["mp_disable_respawn_times"]=> string(1) "0" ["mp_fadetoblack"]=> string(1) "0" ["mp_falldamage"]=> string(1) "0" ["mp_flashlight"]=> string(1) "0" ["mp_footsteps"]=> string(1) "1" ["mp_forceautoteam"]=> string(1) "0" ["mp_forcerespawn"]=> string(1) "1" ["mp_fraglimit"]=> string(1) "0" ["mp_friendlyfire"]=> string(1) "0" ["mp_highlander"]=> string(1) "0" ["mp_holiday_nogifts"]=> string(1) "0" ["mp_match_end_at_timelimit"]=> string(1) "0" ["mp_maxrounds"]=> string(1) "0" ["mp_respawnwavetime"]=> string(4) "10.0" ["mp_scrambleteams_auto"]=> string(1) "1" ["mp_scrambleteams_auto_windifference"]=> string(1) "2" ["mp_stalemate_enable"]=> string(1) "0" ["mp_stalemate_meleeonly"]=> string(1) "0" ["mp_teamlist"]=> string(16) "hgrunt;scientist" ["mp_teamplay"]=> string(1) "0" ["mp_teams_unbalance_limit"]=> string(1) "1" ["mp_timelimit"]=> string(1) "0" ["mp_tournament"]=> string(1) "0" ["mp_tournament_stopwatch"]=> string(1) "1" ["mp_weaponstay"]=> string(1) "0" ["mp_windifference"]=> string(1) "0" ["mp_windifference_min"]=> string(1) "0" ["mp_winlimit"]=> string(1) "0" ["nextlevel"]=> string(0) "" ["num_bots"]=> int(0) ["num_players"]=> int(0) ["num_rules"]=> int(108) ["os"]=> string(1) "l" ["password"]=> int(0) ["players"]=> array(0) { } ["protocol"]=> int(17) ["r_AirboatViewDampenDamp"]=> string(3) "1.0" ["r_AirboatViewDampenFreq"]=> string(3) "7.0" ["r_AirboatViewZHeight"]=> string(3) "0.0" ["r_JeepViewDampenDamp"]=> string(3) "1.0" ["r_JeepViewDampenFreq"]=> string(3) "7.0" ["r_JeepViewZHeight"]=> string(4) "10.0" ["r_VehicleViewDampen"]=> string(1) "1" ["secure"]=> int(1) ["steamappid"]=> int(440) ["sv_accelerate"]=> string(2) "10" ["sv_airaccelerate"]=> string(2) "10" ["sv_alltalk"]=> string(1) "0" ["sv_bounce"]=> string(1) "0" ["sv_cheats"]=> string(1) "0" ["sv_contact"]=> string(0) "" ["sv_footsteps"]=> string(1) "1" ["sv_friction"]=> string(1) "4" ["sv_gravity"]=> string(3) "800" ["sv_maxspeed"]=> string(3) "320" ["sv_noclipaccelerate"]=> string(1) "5" ["sv_noclipspeed"]=> string(1) "5" ["sv_password"]=> string(1) "0" ["sv_pausable"]=> string(1) "0" ["sv_registration_message"]=> string(20) "No account specified" ["sv_registration_successful"]=> string(1) "0" ["sv_rollangle"]=> string(1) "0" ["sv_rollspeed"]=> string(3) "200" ["sv_specaccelerate"]=> string(1) "5" ["sv_specnoclip"]=> string(1) "1" ["sv_specspeed"]=> string(1) "3" ["sv_steamgroup"]=> string(0) "" ["sv_stepsize"]=> string(2) "18" ["sv_stopspeed"]=> string(3) "100" ["sv_tags"]=> string(2) "cp" ["sv_voiceenable"]=> string(1) "1" ["sv_wateraccelerate"]=> string(2) "10" ["sv_waterfriction"]=> string(1) "1" ["teams"]=> array(0) { } ["tf_allow_player_use"]=> string(1) "0" ["tf_arena_change_limit"]=> string(1) "1" ["tf_arena_first_blood"]=> string(1) "1" ["tf_arena_force_class"]=> string(1) "0" ["tf_arena_max_streak"]=> string(1) "3" ["tf_arena_override_cap_enable_time"]=> string(2) "-1" ["tf_arena_preround_time"]=> string(2) "10" ["tf_arena_round_time"]=> string(1) "0" ["tf_arena_use_queue"]=> string(1) "1" ["tf_birthday"]=> string(1) "0" ["tf_bot_count"]=> string(1) "0" ["tf_ctf_bonus_time"]=> string(2) "10" ["tf_damage_disablespread"]=> string(1) "0" ["tf_force_holidays_off"]=> string(1) "0" ["tf_gamemode_arena"]=> string(1) "0" ["tf_gamemode_cp"]=> string(1) "1" ["tf_gamemode_ctf"]=> string(1) "0" ["tf_gamemode_mvm"]=> string(1) "0" ["tf_gamemode_payload"]=> string(1) "0" ["tf_gamemode_sd"]=> string(1) "0" ["tf_max_charge_speed"]=> string(3) "750" ["tf_maxspeed"]=> string(3) "400" ["tf_medieval"]=> string(1) "0" ["tf_medieval_autorp"]=> string(1) "1" ["tf_mm_servermode"]=> string(1) "0" ["tf_mm_strict"]=> string(1) "0" ["tf_mm_trusted"]=> string(1) "0" ["tf_mvm_death_penalty"]=> string(1) "0" ["tf_mvm_min_players_to_start"]=> string(1) "3" ["tf_overtime_nag"]=> string(1) "0" ["tf_playergib"]=> string(1) "1" ["tf_server_identity_disable_quickplay"]=> string(1) "0" ["tf_teamtalk"]=> string(1) "0" ["tf_use_fixed_weaponspreads"]=> string(1) "0" ["tf_weapon_criticals"]=> string(1) "1" ["tv_enable"]=> string(1) "0" ["tv_password"]=> string(1) "0" ["tv_relaypassword"]=> string(1) "0" ["version"]=> int(49) } [2]=> array(139) { ["coop"]=> string(1) "0" ["deathmatch"]=> string(1) "1" ["decalfrequency"]=> string(2) "10" ["dedicated"]=> string(1) "d" ["game_descr"]=> string(13) "Team Fortress" ["game_dir"]=> string(2) "tf" ["gq_address"]=> string(14) "109.201.136.66" ["gq_dedicated"]=> string(1) "d" ["gq_gametype"]=> bool(false) ["gq_hostname"]=> string(36) "[Nforce.com]NFOrce Gaming TF2 Server" ["gq_mapname"]=> string(11) "cp_dustbowl" ["gq_maxplayers"]=> int(20) ["gq_mod"]=> string(2) "tf" ["gq_numplayers"]=> int(0) ["gq_online"]=> bool(true) ["gq_password"]=> int(0) ["gq_port"]=> int(27015) ["gq_protocol"]=> string(6) "source" ["gq_transport"]=> string(3) "udp" ["gq_type"]=> string(4) "csgo" ["hostname"]=> string(36) "[Nforce.com]NFOrce Gaming TF2 Server" ["map"]=> string(11) "cp_dustbowl" ["max_players"]=> int(20) ["mp_allowNPCs"]=> string(1) "1" ["mp_autocrosshair"]=> string(1) "1" ["mp_autoteambalance"]=> string(1) "1" ["mp_disable_respawn_times"]=> string(1) "0" ["mp_fadetoblack"]=> string(1) "0" ["mp_falldamage"]=> string(1) "0" ["mp_flashlight"]=> string(1) "0" ["mp_footsteps"]=> string(1) "1" ["mp_forceautoteam"]=> string(1) "0" ["mp_forcerespawn"]=> string(1) "1" ["mp_fraglimit"]=> string(1) "0" ["mp_friendlyfire"]=> string(1) "0" ["mp_highlander"]=> string(1) "0" ["mp_holiday_nogifts"]=> string(1) "0" ["mp_match_end_at_timelimit"]=> string(1) "0" ["mp_maxrounds"]=> string(1) "0" ["mp_respawnwavetime"]=> string(4) "10.0" ["mp_scrambleteams_auto"]=> string(1) "1" ["mp_scrambleteams_auto_windifference"]=> string(1) "2" ["mp_stalemate_enable"]=> string(1) "0" ["mp_stalemate_meleeonly"]=> string(1) "0" ["mp_teamlist"]=> string(16) "hgrunt;scientist" ["mp_teamplay"]=> string(1) "0" ["mp_teams_unbalance_limit"]=> string(1) "1" ["mp_timelimit"]=> string(1) "0" ["mp_tournament"]=> string(1) "0" ["mp_tournament_stopwatch"]=> string(1) "1" ["mp_weaponstay"]=> string(1) "0" ["mp_windifference"]=> string(1) "0" ["mp_windifference_min"]=> string(1) "0" ["mp_winlimit"]=> string(1) "0" ["nextlevel"]=> string(0) "" ["num_bots"]=> int(0) ["num_players"]=> int(0) ["num_rules"]=> int(108) ["os"]=> string(1) "l" ["password"]=> int(0) ["players"]=> array(0) { } ["protocol"]=> int(17) ["r_AirboatViewDampenDamp"]=> string(3) "1.0" ["r_AirboatViewDampenFreq"]=> string(3) "7.0" ["r_AirboatViewZHeight"]=> string(3) "0.0" ["r_JeepViewDampenDamp"]=> string(3) "1.0" ["r_JeepViewDampenFreq"]=> string(3) "7.0" ["r_JeepViewZHeight"]=> string(4) "10.0" ["r_VehicleViewDampen"]=> string(1) "1" ["secure"]=> int(1) ["steamappid"]=> int(440) ["sv_accelerate"]=> string(2) "10" ["sv_airaccelerate"]=> string(2) "10" ["sv_alltalk"]=> string(1) "0" ["sv_bounce"]=> string(1) "0" ["sv_cheats"]=> string(1) "0" ["sv_contact"]=> string(0) "" ["sv_footsteps"]=> string(1) "1" ["sv_friction"]=> string(1) "4" ["sv_gravity"]=> string(3) "800" ["sv_maxspeed"]=> string(3) "320" ["sv_noclipaccelerate"]=> string(1) "5" ["sv_noclipspeed"]=> string(1) "5" ["sv_password"]=> string(1) "0" ["sv_pausable"]=> string(1) "0" ["sv_registration_message"]=> string(20) "No account specified" ["sv_registration_successful"]=> string(1) "0" ["sv_rollangle"]=> string(1) "0" ["sv_rollspeed"]=> string(3) "200" ["sv_specaccelerate"]=> string(1) "5" ["sv_specnoclip"]=> string(1) "1" ["sv_specspeed"]=> string(1) "3" ["sv_steamgroup"]=> string(0) "" ["sv_stepsize"]=> string(2) "18" ["sv_stopspeed"]=> string(3) "100" ["sv_tags"]=> string(2) "cp" ["sv_voiceenable"]=> string(1) "1" ["sv_wateraccelerate"]=> string(2) "10" ["sv_waterfriction"]=> string(1) "1" ["teams"]=> array(0) { } ["tf_allow_player_use"]=> string(1) "0" ["tf_arena_change_limit"]=> string(1) "1" ["tf_arena_first_blood"]=> string(1) "1" ["tf_arena_force_class"]=> string(1) "0" ["tf_arena_max_streak"]=> string(1) "3" ["tf_arena_override_cap_enable_time"]=> string(2) "-1" ["tf_arena_preround_time"]=> string(2) "10" ["tf_arena_round_time"]=> string(1) "0" ["tf_arena_use_queue"]=> string(1) "1" ["tf_birthday"]=> string(1) "0" ["tf_bot_count"]=> string(1) "0" ["tf_ctf_bonus_time"]=> string(2) "10" ["tf_damage_disablespread"]=> string(1) "0" ["tf_force_holidays_off"]=> string(1) "0" ["tf_gamemode_arena"]=> string(1) "0" ["tf_gamemode_cp"]=> string(1) "1" ["tf_gamemode_ctf"]=> string(1) "0" ["tf_gamemode_mvm"]=> string(1) "0" ["tf_gamemode_payload"]=> string(1) "0" ["tf_gamemode_sd"]=> string(1) "0" ["tf_max_charge_speed"]=> string(3) "750" ["tf_maxspeed"]=> string(3) "400" ["tf_medieval"]=> string(1) "0" ["tf_medieval_autorp"]=> string(1) "1" ["tf_mm_servermode"]=> string(1) "0" ["tf_mm_strict"]=> string(1) "0" ["tf_mm_trusted"]=> string(1) "0" ["tf_mvm_death_penalty"]=> string(1) "0" ["tf_mvm_min_players_to_start"]=> string(1) "3" ["tf_overtime_nag"]=> string(1) "0" ["tf_playergib"]=> string(1) "1" ["tf_server_identity_disable_quickplay"]=> string(1) "0" ["tf_teamtalk"]=> string(1) "0" ["tf_use_fixed_weaponspreads"]=> string(1) "0" ["tf_weapon_criticals"]=> string(1) "1" ["tv_enable"]=> string(1) "0" ["tv_password"]=> string(1) "0" ["tv_relaypassword"]=> string(1) "0" ["version"]=> int(49) } [3]=> array(119) { ["bot_quota"]=> string(1) "0" ["coop"]=> string(1) "0" ["deathmatch"]=> string(1) "1" ["decalfrequency"]=> string(2) "10" ["dedicated"]=> string(1) "d" ["game_descr"]=> string(22) "Counter-Strike: Source" ["game_dir"]=> string(7) "cstrike" ["gq_address"]=> string(14) "109.201.136.67" ["gq_dedicated"]=> string(1) "d" ["gq_gametype"]=> bool(false) ["gq_hostname"]=> string(50) "[NFOrce.com] Public 1 - SODStatsme/Dust+Dust2 only" ["gq_mapname"]=> string(7) "de_dust" ["gq_maxplayers"]=> int(20) ["gq_mod"]=> string(7) "cstrike" ["gq_numplayers"]=> int(0) ["gq_online"]=> bool(true) ["gq_password"]=> int(0) ["gq_port"]=> int(27015) ["gq_protocol"]=> string(6) "source" ["gq_transport"]=> string(3) "udp" ["gq_type"]=> string(4) "l4d2" ["hostname"]=> string(50) "[NFOrce.com] Public 1 - SODStatsme/Dust+Dust2 only" ["map"]=> string(7) "de_dust" ["max_players"]=> int(20) ["metamod_version"]=> string(6) "1.8.7V" ["mp_allowNPCs"]=> string(1) "1" ["mp_autocrosshair"]=> string(1) "1" ["mp_autoteambalance"]=> string(1) "1" ["mp_c4timer"]=> string(2) "45" ["mp_disable_respawn_times"]=> string(1) "0" ["mp_fadetoblack"]=> string(1) "0" ["mp_falldamage"]=> string(1) "0" ["mp_flashlight"]=> string(1) "0" ["mp_footsteps"]=> string(1) "1" ["mp_forceautoteam"]=> string(1) "0" ["mp_forcerespawn"]=> string(1) "1" ["mp_fraglimit"]=> string(1) "0" ["mp_freezetime"]=> string(1) "6" ["mp_friendlyfire"]=> string(1) "0" ["mp_holiday_nogifts"]=> string(1) "0" ["mp_hostagepenalty"]=> string(1) "5" ["mp_limitteams"]=> string(1) "2" ["mp_match_end_at_timelimit"]=> string(1) "0" ["mp_maxrounds"]=> string(1) "0" ["mp_respawnwavetime"]=> string(4) "10.0" ["mp_roundtime"]=> string(1) "5" ["mp_scrambleteams_auto"]=> string(1) "1" ["mp_scrambleteams_auto_windifference"]=> string(1) "2" ["mp_stalemate_enable"]=> string(1) "0" ["mp_stalemate_meleeonly"]=> string(1) "0" ["mp_startmoney"]=> string(3) "800" ["mp_teamlist"]=> string(16) "hgrunt;scientist" ["mp_teamplay"]=> string(1) "0" ["mp_teams_unbalance_limit"]=> string(1) "1" ["mp_timelimit"]=> string(1) "0" ["mp_tournament"]=> string(1) "0" ["mp_weaponstay"]=> string(1) "0" ["mp_winlimit"]=> string(1) "0" ["nextlevel"]=> string(0) "" ["num_bots"]=> int(0) ["num_players"]=> int(0) ["num_rules"]=> int(88) ["os"]=> string(1) "l" ["password"]=> int(0) ["players"]=> array(0) { } ["protocol"]=> int(17) ["r_AirboatViewDampenDamp"]=> string(3) "1.0" ["r_AirboatViewDampenFreq"]=> string(3) "7.0" ["r_AirboatViewZHeight"]=> string(3) "0.0" ["r_JeepViewDampenDamp"]=> string(3) "1.0" ["r_JeepViewDampenFreq"]=> string(3) "7.0" ["r_JeepViewZHeight"]=> string(4) "10.0" ["r_VehicleViewDampen"]=> string(1) "1" ["secure"]=> int(1) ["sm_advertisements_version"]=> string(5) "0.5.5" ["sm_nextmap"]=> string(8) "de_dust2" ["sm_quakesounds_version"]=> string(3) "1.8" ["sourcemod_version"]=> string(5) "1.4.4" ["steamappid"]=> int(240) ["sv_accelerate"]=> string(1) "5" ["sv_airaccelerate"]=> string(2) "10" ["sv_allowminmodels"]=> string(1) "1" ["sv_alltalk"]=> string(1) "0" ["sv_bounce"]=> string(1) "0" ["sv_cheats"]=> string(1) "0" ["sv_competitive_minspec"]=> string(1) "0" ["sv_contact"]=> string(0) "" ["sv_enableboost"]=> string(1) "0" ["sv_enablebunnyhopping"]=> string(1) "0" ["sv_footsteps"]=> string(1) "1" ["sv_friction"]=> string(1) "4" ["sv_gravity"]=> string(3) "800" ["sv_maxspeed"]=> string(3) "320" ["sv_noclipaccelerate"]=> string(1) "5" ["sv_noclipspeed"]=> string(1) "5" ["sv_nostats"]=> string(1) "0" ["sv_password"]=> string(1) "0" ["sv_pausable"]=> string(1) "0" ["sv_rollangle"]=> string(1) "0" ["sv_rollspeed"]=> string(3) "200" ["sv_specaccelerate"]=> string(1) "5" ["sv_specnoclip"]=> string(1) "1" ["sv_specspeed"]=> string(1) "3" ["sv_steamgroup"]=> string(0) "" ["sv_stepsize"]=> string(2) "18" ["sv_stopspeed"]=> string(2) "75" ["sv_tags"]=> string(0) "" ["sv_voiceenable"]=> string(1) "1" ["sv_wateraccelerate"]=> string(2) "10" ["sv_waterfriction"]=> string(1) "1" ["teams"]=> array(0) { } ["tf_arena_max_streak"]=> string(1) "3" ["tf_arena_preround_time"]=> string(2) "10" ["tf_arena_round_time"]=> string(1) "0" ["tf_arena_use_queue"]=> string(1) "1" ["tv_enable"]=> string(1) "0" ["tv_password"]=> string(1) "0" ["tv_relaypassword"]=> string(1) "0" ["version"]=> int(49) } [4]=> array(119) { ["bot_quota"]=> string(1) "0" ["coop"]=> string(1) "0" ["deathmatch"]=> string(1) "1" ["decalfrequency"]=> string(2) "10" ["dedicated"]=> string(1) "d" ["game_descr"]=> string(22) "Counter-Strike: Source" ["game_dir"]=> string(7) "cstrike" ["gq_address"]=> string(14) "109.201.136.67" ["gq_dedicated"]=> string(1) "d" ["gq_gametype"]=> bool(false) ["gq_hostname"]=> string(50) "[NFOrce.com] Public 1 - SODStatsme/Dust+Dust2 only" ["gq_mapname"]=> string(7) "de_dust" ["gq_maxplayers"]=> int(20) ["gq_mod"]=> string(7) "cstrike" ["gq_numplayers"]=> int(0) ["gq_online"]=> bool(true) ["gq_password"]=> int(0) ["gq_port"]=> int(27015) ["gq_protocol"]=> string(6) "source" ["gq_transport"]=> string(3) "udp" ["gq_type"]=> string(3) "css" ["hostname"]=> string(50) "[NFOrce.com] Public 1 - SODStatsme/Dust+Dust2 only" ["map"]=> string(7) "de_dust" ["max_players"]=> int(20) ["metamod_version"]=> string(6) "1.8.7V" ["mp_allowNPCs"]=> string(1) "1" ["mp_autocrosshair"]=> string(1) "1" ["mp_autoteambalance"]=> string(1) "1" ["mp_c4timer"]=> string(2) "45" ["mp_disable_respawn_times"]=> string(1) "0" ["mp_fadetoblack"]=> string(1) "0" ["mp_falldamage"]=> string(1) "0" ["mp_flashlight"]=> string(1) "0" ["mp_footsteps"]=> string(1) "1" ["mp_forceautoteam"]=> string(1) "0" ["mp_forcerespawn"]=> string(1) "1" ["mp_fraglimit"]=> string(1) "0" ["mp_freezetime"]=> string(1) "6" ["mp_friendlyfire"]=> string(1) "0" ["mp_holiday_nogifts"]=> string(1) "0" ["mp_hostagepenalty"]=> string(1) "5" ["mp_limitteams"]=> string(1) "2" ["mp_match_end_at_timelimit"]=> string(1) "0" ["mp_maxrounds"]=> string(1) "0" ["mp_respawnwavetime"]=> string(4) "10.0" ["mp_roundtime"]=> string(1) "5" ["mp_scrambleteams_auto"]=> string(1) "1" ["mp_scrambleteams_auto_windifference"]=> string(1) "2" ["mp_stalemate_enable"]=> string(1) "0" ["mp_stalemate_meleeonly"]=> string(1) "0" ["mp_startmoney"]=> string(3) "800" ["mp_teamlist"]=> string(16) "hgrunt;scientist" ["mp_teamplay"]=> string(1) "0" ["mp_teams_unbalance_limit"]=> string(1) "1" ["mp_timelimit"]=> string(1) "0" ["mp_tournament"]=> string(1) "0" ["mp_weaponstay"]=> string(1) "0" ["mp_winlimit"]=> string(1) "0" ["nextlevel"]=> string(0) "" ["num_bots"]=> int(0) ["num_players"]=> int(0) ["num_rules"]=> int(88) ["os"]=> string(1) "l" ["password"]=> int(0) ["players"]=> array(0) { } ["protocol"]=> int(17) ["r_AirboatViewDampenDamp"]=> string(3) "1.0" ["r_AirboatViewDampenFreq"]=> string(3) "7.0" ["r_AirboatViewZHeight"]=> string(3) "0.0" ["r_JeepViewDampenDamp"]=> string(3) "1.0" ["r_JeepViewDampenFreq"]=> string(3) "7.0" ["r_JeepViewZHeight"]=> string(4) "10.0" ["r_VehicleViewDampen"]=> string(1) "1" ["secure"]=> int(1) ["sm_advertisements_version"]=> string(5) "0.5.5" ["sm_nextmap"]=> string(8) "de_dust2" ["sm_quakesounds_version"]=> string(3) "1.8" ["sourcemod_version"]=> string(5) "1.4.4" ["steamappid"]=> int(240) ["sv_accelerate"]=> string(1) "5" ["sv_airaccelerate"]=> string(2) "10" ["sv_allowminmodels"]=> string(1) "1" ["sv_alltalk"]=> string(1) "0" ["sv_bounce"]=> string(1) "0" ["sv_cheats"]=> string(1) "0" ["sv_competitive_minspec"]=> string(1) "0" ["sv_contact"]=> string(0) "" ["sv_enableboost"]=> string(1) "0" ["sv_enablebunnyhopping"]=> string(1) "0" ["sv_footsteps"]=> string(1) "1" ["sv_friction"]=> string(1) "4" ["sv_gravity"]=> string(3) "800" ["sv_maxspeed"]=> string(3) "320" ["sv_noclipaccelerate"]=> string(1) "5" ["sv_noclipspeed"]=> string(1) "5" ["sv_nostats"]=> string(1) "0" ["sv_password"]=> string(1) "0" ["sv_pausable"]=> string(1) "0" ["sv_rollangle"]=> string(1) "0" ["sv_rollspeed"]=> string(3) "200" ["sv_specaccelerate"]=> string(1) "5" ["sv_specnoclip"]=> string(1) "1" ["sv_specspeed"]=> string(1) "3" ["sv_steamgroup"]=> string(0) "" ["sv_stepsize"]=> string(2) "18" ["sv_stopspeed"]=> string(2) "75" ["sv_tags"]=> string(0) "" ["sv_voiceenable"]=> string(1) "1" ["sv_wateraccelerate"]=> string(2) "10" ["sv_waterfriction"]=> string(1) "1" ["teams"]=> array(0) { } ["tf_arena_max_streak"]=> string(1) "3" ["tf_arena_preround_time"]=> string(2) "10" ["tf_arena_round_time"]=> string(1) "0" ["tf_arena_use_queue"]=> string(1) "1" ["tv_enable"]=> string(1) "0" ["tv_password"]=> string(1) "0" ["tv_relaypassword"]=> string(1) "0" ["version"]=> int(49) } [5]=> array(119) { ["bot_quota"]=> string(1) "0" ["coop"]=> string(1) "0" ["deathmatch"]=> string(1) "1" ["decalfrequency"]=> string(2) "10" ["dedicated"]=> string(1) "d" ["game_descr"]=> string(22) "Counter-Strike: Source" ["game_dir"]=> string(7) "cstrike" ["gq_address"]=> string(14) "109.201.136.67" ["gq_dedicated"]=> string(1) "d" ["gq_gametype"]=> bool(false) ["gq_hostname"]=> string(50) "[NFOrce.com] Public 1 - SODStatsme/Dust+Dust2 only" ["gq_mapname"]=> string(7) "de_dust" ["gq_maxplayers"]=> int(20) ["gq_mod"]=> string(7) "cstrike" ["gq_numplayers"]=> int(0) ["gq_online"]=> bool(true) ["gq_password"]=> int(0) ["gq_port"]=> int(27015) ["gq_protocol"]=> string(6) "source" ["gq_transport"]=> string(3) "udp" ["gq_type"]=> string(4) "csgo" ["hostname"]=> string(50) "[NFOrce.com] Public 1 - SODStatsme/Dust+Dust2 only" ["map"]=> string(7) "de_dust" ["max_players"]=> int(20) ["metamod_version"]=> string(6) "1.8.7V" ["mp_allowNPCs"]=> string(1) "1" ["mp_autocrosshair"]=> string(1) "1" ["mp_autoteambalance"]=> string(1) "1" ["mp_c4timer"]=> string(2) "45" ["mp_disable_respawn_times"]=> string(1) "0" ["mp_fadetoblack"]=> string(1) "0" ["mp_falldamage"]=> string(1) "0" ["mp_flashlight"]=> string(1) "0" ["mp_footsteps"]=> string(1) "1" ["mp_forceautoteam"]=> string(1) "0" ["mp_forcerespawn"]=> string(1) "1" ["mp_fraglimit"]=> string(1) "0" ["mp_freezetime"]=> string(1) "6" ["mp_friendlyfire"]=> string(1) "0" ["mp_holiday_nogifts"]=> string(1) "0" ["mp_hostagepenalty"]=> string(1) "5" ["mp_limitteams"]=> string(1) "2" ["mp_match_end_at_timelimit"]=> string(1) "0" ["mp_maxrounds"]=> string(1) "0" ["mp_respawnwavetime"]=> string(4) "10.0" ["mp_roundtime"]=> string(1) "5" ["mp_scrambleteams_auto"]=> string(1) "1" ["mp_scrambleteams_auto_windifference"]=> string(1) "2" ["mp_stalemate_enable"]=> string(1) "0" ["mp_stalemate_meleeonly"]=> string(1) "0" ["mp_startmoney"]=> string(3) "800" ["mp_teamlist"]=> string(16) "hgrunt;scientist" ["mp_teamplay"]=> string(1) "0" ["mp_teams_unbalance_limit"]=> string(1) "1" ["mp_timelimit"]=> string(1) "0" ["mp_tournament"]=> string(1) "0" ["mp_weaponstay"]=> string(1) "0" ["mp_winlimit"]=> string(1) "0" ["nextlevel"]=> string(0) "" ["num_bots"]=> int(0) ["num_players"]=> int(0) ["num_rules"]=> int(88) ["os"]=> string(1) "l" ["password"]=> int(0) ["players"]=> array(0) { } ["protocol"]=> int(17) ["r_AirboatViewDampenDamp"]=> string(3) "1.0" ["r_AirboatViewDampenFreq"]=> string(3) "7.0" ["r_AirboatViewZHeight"]=> string(3) "0.0" ["r_JeepViewDampenDamp"]=> string(3) "1.0" ["r_JeepViewDampenFreq"]=> string(3) "7.0" ["r_JeepViewZHeight"]=> string(4) "10.0" ["r_VehicleViewDampen"]=> string(1) "1" ["secure"]=> int(1) ["sm_advertisements_version"]=> string(5) "0.5.5" ["sm_nextmap"]=> string(8) "de_dust2" ["sm_quakesounds_version"]=> string(3) "1.8" ["sourcemod_version"]=> string(5) "1.4.4" ["steamappid"]=> int(240) ["sv_accelerate"]=> string(1) "5" ["sv_airaccelerate"]=> string(2) "10" ["sv_allowminmodels"]=> string(1) "1" ["sv_alltalk"]=> string(1) "0" ["sv_bounce"]=> string(1) "0" ["sv_cheats"]=> string(1) "0" ["sv_competitive_minspec"]=> string(1) "0" ["sv_contact"]=> string(0) "" ["sv_enableboost"]=> string(1) "0" ["sv_enablebunnyhopping"]=> string(1) "0" ["sv_footsteps"]=> string(1) "1" ["sv_friction"]=> string(1) "4" ["sv_gravity"]=> string(3) "800" ["sv_maxspeed"]=> string(3) "320" ["sv_noclipaccelerate"]=> string(1) "5" ["sv_noclipspeed"]=> string(1) "5" ["sv_nostats"]=> string(1) "0" ["sv_password"]=> string(1) "0" ["sv_pausable"]=> string(1) "0" ["sv_rollangle"]=> string(1) "0" ["sv_rollspeed"]=> string(3) "200" ["sv_specaccelerate"]=> string(1) "5" ["sv_specnoclip"]=> string(1) "1" ["sv_specspeed"]=> string(1) "3" ["sv_steamgroup"]=> string(0) "" ["sv_stepsize"]=> string(2) "18" ["sv_stopspeed"]=> string(2) "75" ["sv_tags"]=> string(0) "" ["sv_voiceenable"]=> string(1) "1" ["sv_wateraccelerate"]=> string(2) "10" ["sv_waterfriction"]=> string(1) "1" ["teams"]=> array(0) { } ["tf_arena_max_streak"]=> string(1) "3" ["tf_arena_preround_time"]=> string(2) "10" ["tf_arena_round_time"]=> string(1) "0" ["tf_arena_use_queue"]=> string(1) "1" ["tv_enable"]=> string(1) "0" ["tv_password"]=> string(1) "0" ["tv_relaypassword"]=> string(1) "0" ["version"]=> int(49) } [6]=> array(16) { ["gq_address"]=> string(14) "109.201.136.68" ["gq_dedicated"]=> bool(false) ["gq_gametype"]=> bool(false) ["gq_hostname"]=> bool(false) ["gq_mapname"]=> bool(false) ["gq_maxplayers"]=> bool(false) ["gq_mod"]=> bool(false) ["gq_numplayers"]=> bool(false) ["gq_online"]=> bool(false) ["gq_password"]=> bool(false) ["gq_port"]=> int(27015) ["gq_protocol"]=> string(6) "source" ["gq_transport"]=> string(3) "udp" ["gq_type"]=> string(4) "l4d2" ["players"]=> array(0) { } ["teams"]=> array(0) { } } [7]=> array(16) { ["gq_address"]=> string(14) "109.201.136.68" ["gq_dedicated"]=> bool(false) ["gq_gametype"]=> bool(false) ["gq_hostname"]=> bool(false) ["gq_mapname"]=> bool(false) ["gq_maxplayers"]=> bool(false) ["gq_mod"]=> bool(false) ["gq_numplayers"]=> bool(false) ["gq_online"]=> bool(false) ["gq_password"]=> bool(false) ["gq_port"]=> int(27015) ["gq_protocol"]=> string(6) "source" ["gq_transport"]=> string(3) "udp" ["gq_type"]=> string(3) "css" ["players"]=> array(0) { } ["teams"]=> array(0) { } } [8]=> array(16) { ["gq_address"]=> string(14) "109.201.136.68" ["gq_dedicated"]=> bool(false) ["gq_gametype"]=> bool(false) ["gq_hostname"]=> bool(false) ["gq_mapname"]=> bool(false) ["gq_maxplayers"]=> bool(false) ["gq_mod"]=> bool(false) ["gq_numplayers"]=> bool(false) ["gq_online"]=> bool(false) ["gq_password"]=> bool(false) ["gq_port"]=> int(27015) ["gq_protocol"]=> string(6) "source" ["gq_transport"]=> string(3) "udp" ["gq_type"]=> string(4) "csgo" ["players"]=> array(0) { } ["teams"]=> array(0) { } } } ?>

As you can see, the incorrect data is being shown.

Austinb commented 11 years ago

Hello,

Just a quick glance at the output of the $servers array you are using the same ip for multiple different types of servers without specifying ports. If you have multiple servers running on the same ip address they have to have different ports so you must specify the ports for each server when adding them to GameQ. The default for Source based games is 27015 so if you do not provide a port GameQ will assume the server port is the default.

So for example the first 3 servers listed at 109.201.136.66 will all be queried at 109.201.136.66:27015 so they will all return the information from that one server. Same goes for the other 2 sets with the same ip addresses.

jurgenmeijer commented 11 years ago

Hello Austin,

Thank you for your input. I guess i need to find a way to include the ports, because for example, :27015 can be used for CS:S, but for example 27016 can be TF2, thats the thing i dont know. I was under the impression the library would query the entire server and list the games running on which port. Maybe if you host one game, it wouldnt matter because you know the entire data. But the thing is; I dont know which games run on which ports for this to properly work i need to get a list of the gameserver first, that way i would know which game is running on which port. The system we are using is scalable so we could be adding 10 to 20 server per day, so i have to make the list dynamic.

Austinb commented 11 years ago

For speed and resource usage reasons GameQ only operates with defined ip:port calls. Doing scans on servers would be very resource intensive. Also GameQ has no way to tell what kind of game you are querying. It assumes you are providing the proper game type (tf2, bf3, etc...) so it knows how to process the data it receives from the queries.

The syntax for ports is just host => ip:port but from what you have stated it is something on your end preventing you from being able to provide the port.

Good luck.