├── ArmaBE └── ArmaBE.pm ├── COPYING ├── Cfg └── empty.txt ├── Crypt └── XXTEA.pm ├── DEVELOPMENT ├── EHCP ├── addAccount.php ├── config.php ├── db_functions.php ├── delAccount.php ├── ehcp_ftp_log.txt ├── listAllUsers.php ├── showAccount.php ├── syncftp.php ├── updateInfo.php └── updatePass.php ├── FastDownload └── ForkedDaemon.pm ├── File └── Copy │ └── Recursive.pm ├── Frontier ├── Client.pm ├── Daemon.pm ├── Daemon │ └── OGP │ │ └── Forking.pm ├── RPC2.pm └── Responder.pm ├── IspConfig ├── sites_ftp_user_add.php ├── sites_ftp_user_delete.php ├── sites_ftp_user_get.php ├── sites_ftp_user_update.php └── soap_config.php ├── KKrcon ├── HL2.pm └── KKrcon.pm ├── Minecraft └── RCON.pm ├── Schedule └── Cron.pm ├── Time ├── CTime.pm ├── DaysInMonth.pm ├── JulianDay.pm ├── ParseDate.pm └── Timezone.pm ├── agent_conf.sh ├── extPatterns.txt ├── includes ├── ogp_agent.init ├── ogp_agent.init.dbn ├── ogp_agent.init.gentoo └── ogp_agent.init.rh ├── install.sh ├── ogp_agent.pl ├── ogp_agent_run ├── ogp_screenrc ├── ogp_screenrc_bk ├── php-query ├── gameq │ ├── Autoloader.php │ ├── Buffer.php │ ├── Exception │ │ ├── Protocol.php │ │ ├── Query.php │ │ └── Server.php │ ├── Filters │ │ ├── Base.php │ │ ├── Normalize.php │ │ ├── Secondstohuman.php │ │ ├── Stripcolors.php │ │ └── Test.php │ ├── GameQ.php │ ├── GameQMonitor.php │ ├── Protocol.php │ ├── Protocols │ │ ├── Aa3.php │ │ ├── Aapg.php │ │ ├── Arkse.php │ │ ├── Arma.php │ │ ├── Arma3.php │ │ ├── Armedassault2oa.php │ │ ├── Armedassault3.php │ │ ├── Ase.php │ │ ├── Atlas.php │ │ ├── Avorion.php │ │ ├── Barotrauma.php │ │ ├── Batt1944.php │ │ ├── Bf1942.php │ │ ├── Bf2.php │ │ ├── Bf3.php │ │ ├── Bf4.php │ │ ├── Bfbc2.php │ │ ├── Bfh.php │ │ ├── Blackmesa.php │ │ ├── Brink.php │ │ ├── Cfx.php │ │ ├── Cfxplayers.php │ │ ├── Citadel.php │ │ ├── Cod.php │ │ ├── Cod2.php │ │ ├── Cod4.php │ │ ├── Codmw2.php │ │ ├── Codmw3.php │ │ ├── Coduo.php │ │ ├── Codwaw.php │ │ ├── Conanexiles.php │ │ ├── Contagion.php │ │ ├── Crysis.php │ │ ├── Crysis2.php │ │ ├── Crysiswars.php │ │ ├── Cs15.php │ │ ├── Cs16.php │ │ ├── Cs2d.php │ │ ├── Cscz.php │ │ ├── Csgo.php │ │ ├── Css.php │ │ ├── Dal.php │ │ ├── Dayz.php │ │ ├── Dayzmod.php │ │ ├── Dod.php │ │ ├── Dods.php │ │ ├── Doom3.php │ │ ├── Dow.php │ │ ├── Eco.php │ │ ├── Egs.php │ │ ├── Et.php │ │ ├── Etqw.php │ │ ├── Ffe.php │ │ ├── Ffow.php │ │ ├── Fof.php │ │ ├── Gamespy.php │ │ ├── Gamespy2.php │ │ ├── Gamespy3.php │ │ ├── Gamespy4.php │ │ ├── Gmod.php │ │ ├── Grav.php │ │ ├── Gta5m.php │ │ ├── Gtan.php │ │ ├── Gtar.php │ │ ├── Had2.php │ │ ├── Halo.php │ │ ├── Hl1.php │ │ ├── Hl2dm.php │ │ ├── Hll.php │ │ ├── Homefront.php │ │ ├── Http.php │ │ ├── Hurtworld.php │ │ ├── Insurgency.php │ │ ├── Insurgencysand.php │ │ ├── Jediacademy.php │ │ ├── Jedioutcast.php │ │ ├── Justcause2.php │ │ ├── Justcause3.php │ │ ├── Killingfloor.php │ │ ├── Killingfloor2.php │ │ ├── Kingpin.php │ │ ├── L4d.php │ │ ├── L4d2.php │ │ ├── Lhmp.php │ │ ├── Lifeisfeudal.php │ │ ├── M2mp.php │ │ ├── Minecraft.php │ │ ├── Minecraftbe.php │ │ ├── Minecraftpe.php │ │ ├── Miscreated.php │ │ ├── Modiverse.php │ │ ├── Mohaa.php │ │ ├── Mordhau.php │ │ ├── Mta.php │ │ ├── Mumble.php │ │ ├── Nmrih.php │ │ ├── Ns2.php │ │ ├── Of.php │ │ ├── Openttd.php │ │ ├── Pixark.php │ │ ├── Postscriptum.php │ │ ├── Projectrealitybf2.php │ │ ├── Quake2.php │ │ ├── Quake3.php │ │ ├── Quake4.php │ │ ├── Quakelive.php │ │ ├── Raknet.php │ │ ├── Redorchestra2.php │ │ ├── Redorchestraostfront.php │ │ ├── Rf2.php │ │ ├── Rfactor.php │ │ ├── Rfactor2.php │ │ ├── Risingstorm2.php │ │ ├── Rust.php │ │ ├── Samp.php │ │ ├── Sco.php │ │ ├── Serioussam.php │ │ ├── Sevendaystodie.php │ │ ├── Ship.php │ │ ├── Sof2.php │ │ ├── Soldat.php │ │ ├── Source.php │ │ ├── Spaceengineers.php │ │ ├── Squad.php │ │ ├── Starbound.php │ │ ├── Starmade.php │ │ ├── Stormworks.php │ │ ├── Swat4.php │ │ ├── Teamspeak2.php │ │ ├── Teamspeak3.php │ │ ├── Teeworlds.php │ │ ├── Terraria.php │ │ ├── Tf2.php │ │ ├── Theforrest.php │ │ ├── Tibia.php │ │ ├── Tshock.php │ │ ├── Unreal2.php │ │ ├── Unturned.php │ │ ├── Urbanterror.php │ │ ├── Ut.php │ │ ├── Ut2004.php │ │ ├── Ut3.php │ │ ├── Valheim.php │ │ ├── Ventrilo.php │ │ ├── Vrising.php │ │ ├── Warsow.php │ │ ├── Won.php │ │ ├── Wurm.php │ │ └── Zomboid.php │ ├── Query │ │ ├── Core.php │ │ └── Native.php │ ├── Result.php │ ├── Server.php │ ├── functions.php │ └── gameq_feed.php └── lgsl │ ├── lgsl_feed.php │ └── lgsl_protocol.php └── systemd └── ogp_agent.service /Cfg/empty.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGamePanel/OGP-Agent-Linux/e4e12819caf23a6321207039c8acac5be04575be/Cfg/empty.txt -------------------------------------------------------------------------------- /DEVELOPMENT: -------------------------------------------------------------------------------- 1 | OGP Agent NOTES: 2 | 3 | Before committing code it is recommended to execute perltidy: 4 | 5 | $ perltidy -b -gnu ogp_agent.pl 6 | 7 | -------------------------------------------------------------------------------- /EHCP/config.php: -------------------------------------------------------------------------------- 1 | 84 | -------------------------------------------------------------------------------- /EHCP/db_functions.php: -------------------------------------------------------------------------------- 1 | 54 | -------------------------------------------------------------------------------- /EHCP/delAccount.php: -------------------------------------------------------------------------------- 1 | 0) { 54 | addToLog($errors); 55 | } 56 | 57 | // Return value: 58 | echo $success; 59 | ?> 60 | -------------------------------------------------------------------------------- /EHCP/ehcp_ftp_log.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenGamePanel/OGP-Agent-Linux/e4e12819caf23a6321207039c8acac5be04575be/EHCP/ehcp_ftp_log.txt -------------------------------------------------------------------------------- /EHCP/listAllUsers.php: -------------------------------------------------------------------------------- 1 | 0) { 29 | 30 | while ($row = getSQLRow($Result)) { 31 | 32 | // Only show custom entries... do not allow to modify EHCP accounts. 33 | // domainname field will be NULL for custom FTP entries 34 | 35 | if (!empty($row['homedir']) && (empty($row['domainname']) || $row['domainname'] === NULL) && (empty($row['status']) || $row['status'] === NULL)) { 36 | $countNotNull++; 37 | $username = $row['ftpusername']; 38 | $dir = $row['homedir']; 39 | $users_list.= $username . "\t" . $dir . "/./\n"; 40 | } 41 | } 42 | 43 | if ($countNotNull == 0) { 44 | $errorCount++; 45 | $errors[] = "There are no custom FTP accounts yet in the EHCP database!"; 46 | } 47 | } else { 48 | $errorCount++; 49 | $errors[] = "No FTP accounts exist from the ftpaccounts table!"; 50 | } 51 | } else { 52 | $errorCount++; 53 | $errors[] = getSQLError($connection); 54 | $success = 0; 55 | } 56 | 57 | // Log errors 58 | 59 | if ($errorCount > 0) { 60 | addToLog($errors); 61 | } 62 | } 63 | 64 | // Return the user list 65 | echo $users_list; 66 | ?> 67 | -------------------------------------------------------------------------------- /EHCP/showAccount.php: -------------------------------------------------------------------------------- 1 | 0) { 60 | addToLog($errors); 61 | } 62 | } 63 | 64 | // Return the user list 65 | echo $user_details; 66 | ?> 67 | -------------------------------------------------------------------------------- /EHCP/syncftp.php: -------------------------------------------------------------------------------- 1 | connectTodb(); # fill config.php with db user/pass for things to work.. 7 | 8 | $app->addDaemonOp('syncftp', '', '', '', 'sync ftp for nonstandard homes'); 9 | } 10 | chdir($curDir); 11 | ?> 12 | -------------------------------------------------------------------------------- /EHCP/updatePass.php: -------------------------------------------------------------------------------- 1 | 0) { 71 | addToLog($errors); 72 | } 73 | 74 | // Return value: 75 | echo $success; 76 | ?> 77 | -------------------------------------------------------------------------------- /Frontier/Daemon.pm: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 1998 Ken MacLeod 3 | # Frontier::Daemon is free software; you can redistribute it 4 | # and/or modify it under the same terms as Perl itself. 5 | # 6 | # $Id: Daemon.pm,v 1.5 2001/10/03 01:30:54 kmacleod Exp $ 7 | # 8 | 9 | # NOTE: see Net::pRPC for a Perl RPC implementation 10 | 11 | ### 12 | ### NOTE: $self is inherited from HTTP::Daemon and the weird access 13 | ### comes from there (`${*$self}'). 14 | ### 15 | 16 | use strict; 17 | 18 | package Frontier::Daemon; 19 | use vars qw{@ISA}; 20 | 21 | @ISA = qw{HTTP::Daemon}; 22 | 23 | use Frontier::RPC2; 24 | use HTTP::Daemon; 25 | use HTTP::Status; 26 | 27 | sub new { 28 | my $class = shift; my %args = @_; 29 | my $self = $class->SUPER::new(%args); 30 | return undef unless $self; 31 | 32 | ${*$self}{'methods'} = $args{'methods'}; 33 | ${*$self}{'decode'} = new Frontier::RPC2 'use_objects' => $args{'use_objects'}; 34 | ${*$self}{'response'} = new HTTP::Response 200; 35 | ${*$self}{'response'}->header('Content-Type' => 'text/xml'); 36 | 37 | my $conn; 38 | while ($conn = $self->accept) { 39 | my $rq = $conn->get_request; 40 | if ($rq) { 41 | if ($rq->method eq 'POST' && $rq->url->path eq '/RPC2') { 42 | ${*$self}{'response'}->content(${*$self}{'decode'}->serve($rq->content, ${*$self}{'methods'})); 43 | $conn->send_response(${*$self}{'response'}); 44 | } else { 45 | $conn->send_error(RC_FORBIDDEN); 46 | } 47 | } 48 | $conn->close; 49 | $conn = undef; # close connection 50 | } 51 | 52 | return $self; 53 | } 54 | 55 | =head1 NAME 56 | 57 | Frontier::Daemon - receive Frontier XML RPC requests 58 | 59 | =head1 SYNOPSIS 60 | 61 | use Frontier::Daemon; 62 | 63 | Frontier::Daemon->new(methods => { 64 | 'rpcName' => \&sub_name, 65 | ... 66 | }); 67 | 68 | =head1 DESCRIPTION 69 | 70 | I is an HTTP/1.1 server that listens on a socket for 71 | incoming requests containing Frontier XML RPC2 method calls. 72 | I is a subclass of I, which is a 73 | subclass of I. 74 | 75 | I takes a `C' parameter, a hash that maps 76 | an incoming RPC method name to reference to a subroutine. 77 | 78 | I takes a `C' parameter that if set to 79 | a non-zero value will convert incoming EintE, Ei4E, 80 | EfloatE, and EstringE values to objects instead of 81 | scalars. See int(), float(), and string() in Frontier::RPC2 for more 82 | details. 83 | 84 | =head1 SEE ALSO 85 | 86 | perl(1), HTTP::Daemon(3), IO::Socket::INET(3), Frontier::RPC2(3) 87 | 88 | 89 | 90 | =head1 AUTHOR 91 | 92 | Ken MacLeod 93 | 94 | =cut 95 | 96 | 1; 97 | -------------------------------------------------------------------------------- /Frontier/Daemon/OGP/Forking.pm: -------------------------------------------------------------------------------- 1 | package Frontier::Daemon::OGP::Forking; 2 | # $Id: Forking.pm,v 1.6 2004/01/23 19:48:33 tcaine Exp $ 3 | 4 | use strict; 5 | use vars qw{@ISA $VERSION}; 6 | 7 | $VERSION = '0.02'; 8 | 9 | use Frontier::RPC2; 10 | use HTTP::Daemon; 11 | use HTTP::Status; 12 | 13 | @ISA = qw{HTTP::Daemon}; 14 | 15 | # most of this routine comes directly from Frontier::Daemon 16 | sub new { 17 | my $class = shift; 18 | my %args = @_; 19 | my $encoding = delete $args{encoding}; 20 | my $self = $class->SUPER::new( %args ); 21 | return undef unless $self; 22 | 23 | my @options; 24 | push @options, encoding => $encoding 25 | if $encoding; 26 | 27 | ${*$self}{methods} = $args{methods}; 28 | ${*$self}{decode} = new Frontier::RPC2(@options); 29 | ${*$self}{response} = new HTTP::Response 200; 30 | ${*$self}{response}->header( 'Content-Type' => 'text/xml' ); 31 | 32 | local $SIG{CHLD} = 'IGNORE'; 33 | 34 | ACCEPT: 35 | while ( my $conn = $self->accept ) { 36 | my $pid = fork; 37 | next ACCEPT if $pid; 38 | 39 | if ( not defined $pid ) { 40 | warn "fork() failed: $!"; 41 | $conn = undef; 42 | } 43 | else { 44 | my $request = $conn->get_request; 45 | if ($request) { 46 | if ($request->method eq 'POST' && $request->url->path eq '/RPC2') { 47 | ${*$self}{'response'}->content( 48 | ${*$self}{'decode'}->serve( 49 | $request->content, 50 | ${*$self}{'methods'}, 51 | ) 52 | ); 53 | $conn->send_response(${*$self}{'response'}); 54 | } else { 55 | $conn->send_error(RC_FORBIDDEN); 56 | } 57 | } 58 | } 59 | exit; 60 | } 61 | } 62 | 63 | 1; 64 | __END__ 65 | 66 | =head1 NAME 67 | 68 | Frontier::Daemon::Forking - receive Frontier XML RPC requests 69 | 70 | =head1 SYNOPSIS 71 | 72 | use Frontier::Daemon::Forking; 73 | 74 | Frontier::Daemon::Forking->new( 75 | methods => { 76 | rpcName => \&rpcHandler, 77 | }, 78 | encoding => 'ISO-8859-1', 79 | ); 80 | 81 | sub rpcHandler { return 'OK' } 82 | 83 | =head1 DESCRIPTION 84 | 85 | L is a drop in replacement for L when a forking HTTP/1.1 server is needed that listens on a socket for incoming requests containing Frontier XML RPC2 method calls. Most of the code was borrowed from L. 86 | 87 | =head1 AUTHOR 88 | 89 | Todd Caine, tcaine@pobox.com 90 | 91 | =head1 SEE ALSO 92 | 93 | L, L, L 94 | 95 | =cut 96 | -------------------------------------------------------------------------------- /IspConfig/sites_ftp_user_add.php: -------------------------------------------------------------------------------- 1 | $soap_location, 5 | 'uri' => $soap_uri, 6 | 'trace' => 1, 7 | 'exceptions' => 1)); 8 | $session_id = $client->login($username,$password); 9 | $client_id = 0; 10 | $username = $_GET['username']; 11 | $password = $_GET['password']; 12 | $dir = $_GET['dir']; 13 | $uid = $_GET['uid']; 14 | $gid = $_GET['gid']; 15 | $params = array( 16 | 'server_id' => 1, 17 | 'parent_domain_id' => 1, 18 | 'username' => $username, 19 | 'password' => $password, 20 | 'quota_size' => -1, 21 | 'active' => 'y', 22 | 'uid' => $uid, 23 | 'gid' => $gid, 24 | 'dir' => $dir, 25 | 'quota_files' => -1, 26 | 'ul_ratio' => -1, 27 | 'dl_ratio' => -1, 28 | 'ul_bandwidth' => -1, 29 | 'dl_bandwidth' => -1 30 | ); 31 | $ftp_id = $client->sites_ftp_user_add($session_id, $client_id, $params); 32 | $client->logout($session_id); 33 | if(!file_exists('ftp_users')) mkdir('ftp_users'); 34 | chdir('ftp_users'); 35 | file_put_contents($username, $ftp_id); 36 | ?> 37 | -------------------------------------------------------------------------------- /IspConfig/sites_ftp_user_delete.php: -------------------------------------------------------------------------------- 1 | $soap_location, 5 | 'uri' => $soap_uri, 6 | 'trace' => 1, 7 | 'exceptions' => 1)); 8 | $session_id = $client->login($username,$password); 9 | chdir('ftp_users'); 10 | $username = $_GET['username']; 11 | $ftp_user_id = file_get_contents($username); 12 | $client->sites_ftp_user_delete($session_id, $ftp_user_id); 13 | unlink($username); 14 | $client->logout($session_id); 15 | ?> 16 | -------------------------------------------------------------------------------- /IspConfig/sites_ftp_user_get.php: -------------------------------------------------------------------------------- 1 | $soap_location, 5 | 'uri' => $soap_uri, 6 | 'trace' => 1, 7 | 'exceptions' => 1)); 8 | $session_id = $client->login($username,$password); 9 | chdir('ftp_users'); 10 | $username = $_GET['username']; 11 | $ftp_user_id = file_get_contents($username); 12 | $ftp_user_record = $client->sites_ftp_user_get($session_id, $ftp_user_id); 13 | if(isset($_GET['type']) AND $_GET['type'] == "detail") 14 | { 15 | foreach($ftp_user_record as $key => $value) 16 | { 17 | echo $key." : ".$value."\n"; 18 | } 19 | } 20 | else 21 | { 22 | echo $ftp_user_record['username']."\t".$ftp_user_record['dir']."/./\n"; 23 | } 24 | ?> 25 | -------------------------------------------------------------------------------- /IspConfig/sites_ftp_user_update.php: -------------------------------------------------------------------------------- 1 | $soap_location, 5 | 'uri' => $soap_uri, 6 | 'trace' => 1, 7 | 'exceptions' => 1)); 8 | $session_id = $client->login($username,$password); 9 | $client_id = 0; 10 | chdir('ftp_users'); 11 | $username = $_GET['username']; 12 | $ftp_user_id = file_get_contents($username); 13 | //* Get the ftp user record 14 | $ftp_user_record = $client->sites_ftp_user_get($session_id, $ftp_user_id); 15 | if(isset($_GET['type']) AND $_GET['type'] == "password") 16 | { 17 | $ftp_user_record['password'] = $_GET['password']; 18 | } 19 | else 20 | { 21 | $settings = explode("\n",$_GET['password']); 22 | foreach($settings as $setting) 23 | { 24 | list($key,$value) = explode("\t",$setting); 25 | $ftp_user_record[$key] = $value; 26 | } 27 | } 28 | 29 | $client->sites_ftp_user_update($session_id, $client_id, $ftp_user_id, $ftp_user_record); 30 | $client->logout($session_id); 31 | ?> 32 | -------------------------------------------------------------------------------- /IspConfig/soap_config.php: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /Time/DaysInMonth.pm: -------------------------------------------------------------------------------- 1 | package Time::DaysInMonth; 2 | 3 | use Carp; 4 | 5 | require 5.000; 6 | 7 | @ISA = qw(Exporter); 8 | @EXPORT = qw(days_in is_leap); 9 | @EXPORT_OK = qw(%mltable); 10 | 11 | use strict; 12 | 13 | use vars qw($VERSION %mltable); 14 | 15 | $VERSION = 99.1117; 16 | 17 | CONFIG: { 18 | %mltable = qw( 19 | 1 31 20 | 3 31 21 | 4 30 22 | 5 31 23 | 6 30 24 | 7 31 25 | 8 31 26 | 9 30 27 | 10 31 28 | 11 30 29 | 12 31); 30 | } 31 | 32 | sub days_in 33 | { 34 | # Month is 1..12 35 | my ($year, $month) = @_; 36 | return $mltable{$month+0} unless $month == 2; 37 | return 28 unless &is_leap($year); 38 | return 29; 39 | } 40 | 41 | sub is_leap 42 | { 43 | my ($year) = @_; 44 | return 0 unless $year % 4 == 0; 45 | return 1 unless $year % 100 == 0; 46 | return 0 unless $year % 400 == 0; 47 | return 1; 48 | } 49 | 50 | 1; 51 | 52 | __END__ 53 | 54 | =head1 NAME 55 | 56 | Time::DaysInMonth -- simply report the number of days in a month 57 | 58 | =head1 SYNOPSIS 59 | 60 | use Time::DaysInMonth; 61 | $days = days_in($year, $month_1_to_12); 62 | $leapyear = is_leap($year); 63 | 64 | =head1 DESCRIPTION 65 | 66 | DaysInMonth is simply a package to report the number of days in 67 | a month. That's all it does. Really! 68 | 69 | =head1 AUTHOR 70 | 71 | David Muir Sharnoff 72 | 73 | =head1 BUGS 74 | 75 | This only deals with the "modern" calendar. Look elsewhere for 76 | historical time and date support. 77 | 78 | =head1 LICENSE 79 | 80 | Copyright (C) 1996-1999 David Muir Sharnoff. License hereby 81 | granted for anyone to use, modify or redistribute this module at 82 | their own risk. Please feed useful changes back to muir@idiom.org. 83 | 84 | -------------------------------------------------------------------------------- /extPatterns.txt: -------------------------------------------------------------------------------- 1 | cfg 2 | conf 3 | ini 4 | gam 5 | properties 6 | txt 7 | -------------------------------------------------------------------------------- /includes/ogp_agent.init: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Generic Init script if we can't find what kind of Linux we're on 4 | 5 | agent_dir=OGP_AGENT_DIR 6 | agent_user=OGP_USER 7 | 8 | # Start function. 9 | start() { 10 | echo "Starting OGP Agent..." 11 | cd $agent_dir 12 | su -c "screen -d -m -t ogp_agent -c ogp_screenrc -S ogp_agent ./ogp_agent_run -pidfile ogp_agent_run.pid" $agent_user &> $agent_dir/ogp_agent.svc & 13 | echo 14 | } 15 | 16 | # Stop function. 17 | stop() { 18 | echo "Stopping OGP Agent..." 19 | kill `cat $agent_dir/ogp_agent_run.pid` 20 | } 21 | 22 | restart() { 23 | stop 24 | start 25 | } 26 | 27 | case $1 in 28 | start) 29 | start 30 | ;; 31 | stop) 32 | stop 33 | ;; 34 | restart) 35 | restart 36 | ;; 37 | *) 38 | echo "Usage: ogp_agent {start|stop|restart}" 39 | exit 1 40 | ;; 41 | esac 42 | 43 | exit 0; 44 | -------------------------------------------------------------------------------- /includes/ogp_agent.init.gentoo: -------------------------------------------------------------------------------- 1 | #!/sbin/runscript 2 | 3 | # Distributed under the terms of the GNU General Public License v2 4 | 5 | # GF: Config is in $agent_dir/Cfg/Config.pm 6 | 7 | agent_dir=OGP_AGENT_DIR 8 | agent_user=OGP_USER 9 | 10 | depend() { 11 | need net 12 | } 13 | 14 | start() { 15 | ebegin "Starting OGP Agent" 16 | start-stop-daemon --verbose --chdir $agent_dir --start --background --user $agent_user -e PWD="$agent_dir" --exec screen -d -m -t ogp_agent -c ogp_screenrc -S ogp_agent ./ogp_agent_run -pidfile ogp_agent_run.pid 17 | eend $? "Failed to start OGP Agent" 18 | } 19 | 20 | stop() { 21 | ebegin "Stopping OGP Agent" 22 | start-stop-daemon --stop --quiet --pidfile $agent_dir/ogp_agent_run.pid 23 | eend $? "Failed to stop OGP Agent" 24 | } 25 | 26 | -------------------------------------------------------------------------------- /ogp_screenrc: -------------------------------------------------------------------------------- 1 | startup_message off 2 | hardstatus on 3 | hardstatus alwayslastline '%{gk}[ %{G}%H %{g}][%= %{wk}%?%-Lw%?%{=b kR}[%{W}%n%f %t%?(%u)%?%{=b kR}]%{= kw}%?%+Lw%?%?%= %{g}][%{Y}%l%{g}]%{=b C}[ %D %m/%d %C%a ]%{W}' 4 | # Default scroll back 100 5 | defscrollback 100 6 | deflog on 7 | logfile $PWD/screenlogs/screenlog.%t 8 | 9 | -------------------------------------------------------------------------------- /ogp_screenrc_bk: -------------------------------------------------------------------------------- 1 | startup_message off 2 | hardstatus on 3 | hardstatus alwayslastline '%{gk}[ %{G}%H %{g}][%= %{wk}%?%-Lw%?%{=b kR}[%{W}%n%f %t%?(%u)%?%{=b kR}]%{= kw}%?%+Lw%?%?%= %{g}][%{Y}%l%{g}]%{=b C}[ %D %m/%d %C%a ]%{W}' 4 | # Default scroll back 100 5 | defscrollback 100 6 | deflog on 7 | logfile $PWD/screenlogs/screenlog.%t 8 | 9 | -------------------------------------------------------------------------------- /php-query/gameq/Autoloader.php: -------------------------------------------------------------------------------- 1 | . 17 | * 18 | * 19 | */ 20 | 21 | /** 22 | * A simple PSR-4 spec auto loader to allow GameQ to function the same as if it were loaded via Composer 23 | * 24 | * To use this just include this file in your script and the GameQ namespace will be made available 25 | * 26 | * i.e. require_once('/path/to/src/GameQ/Autoloader.php'); 27 | * 28 | * See: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader-examples.md 29 | * 30 | * @codeCoverageIgnore 31 | */ 32 | spl_autoload_register(function ($class) { 33 | 34 | // project-specific namespace prefix 35 | $prefix = 'GameQ\\'; 36 | 37 | // base directory for the namespace prefix 38 | $base_dir = __DIR__ . DIRECTORY_SEPARATOR; 39 | 40 | // does the class use the namespace prefix? 41 | $len = strlen($prefix); 42 | 43 | if (strncmp($prefix, $class, $len) !== 0) { 44 | // no, move to the next registered autoloader 45 | return; 46 | } 47 | 48 | // get the relative class name 49 | $relative_class = substr($class, $len); 50 | 51 | // replace the namespace prefix with the base directory, replace namespace 52 | // separators with directory separators in the relative class name, append 53 | // with .php 54 | $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php'; 55 | 56 | // if the file exists, require it 57 | if (file_exists($file)) { 58 | require $file; 59 | } 60 | }); 61 | -------------------------------------------------------------------------------- /php-query/gameq/Exception/Protocol.php: -------------------------------------------------------------------------------- 1 | . 17 | * 18 | * 19 | */ 20 | 21 | namespace GameQ\Exception; 22 | 23 | /** 24 | * Exception 25 | * 26 | * @author Austin Bischoff 27 | */ 28 | class Protocol extends \Exception 29 | { 30 | } 31 | -------------------------------------------------------------------------------- /php-query/gameq/Exception/Query.php: -------------------------------------------------------------------------------- 1 | . 17 | * 18 | * 19 | */ 20 | 21 | namespace GameQ\Exception; 22 | 23 | /** 24 | * Exception 25 | * 26 | * @author Austin Bischoff 27 | */ 28 | class Query extends \Exception 29 | { 30 | } 31 | -------------------------------------------------------------------------------- /php-query/gameq/Exception/Server.php: -------------------------------------------------------------------------------- 1 | . 17 | * 18 | * 19 | */ 20 | 21 | namespace GameQ\Exception; 22 | 23 | /** 24 | * Exception 25 | * 26 | * @author Austin Bischoff 27 | */ 28 | class Server extends \Exception 29 | { 30 | } 31 | -------------------------------------------------------------------------------- /php-query/gameq/Filters/Base.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Filters; 20 | 21 | use GameQ\Server; 22 | 23 | /** 24 | * Abstract base class which all filters must inherit 25 | * 26 | * @author Austin Bischoff 27 | */ 28 | abstract class Base 29 | { 30 | 31 | /** 32 | * Holds the options for this instance of the filter 33 | * 34 | * @type array 35 | */ 36 | protected $options = []; 37 | 38 | /** 39 | * Construct 40 | * 41 | * @param array $options 42 | */ 43 | public function __construct(array $options = []) 44 | { 45 | 46 | $this->options = $options; 47 | } 48 | 49 | public function getOptions() 50 | { 51 | return $this->options; 52 | } 53 | 54 | /** 55 | * Apply the filter to the data 56 | * 57 | * @param array $result 58 | * @param \GameQ\Server $server 59 | * 60 | * @return mixed 61 | */ 62 | abstract public function apply(array $result, Server $server); 63 | } 64 | -------------------------------------------------------------------------------- /php-query/gameq/Filters/Test.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Filters; 20 | 21 | use GameQ\Server; 22 | 23 | /** 24 | * Class Test 25 | * 26 | * This is a test filter to be used for testing purposes only. 27 | * 28 | * @package GameQ\Filters 29 | */ 30 | class Test extends Base 31 | { 32 | /** 33 | * Apply the filter. For this we just return whatever is sent 34 | * 35 | * @SuppressWarnings(PHPMD) 36 | * 37 | * @param array $result 38 | * @param \GameQ\Server $server 39 | * 40 | * @return array 41 | */ 42 | public function apply(array $result, Server $server) 43 | { 44 | 45 | return $result; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Aa3.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Aa3 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Aa3 extends Source 28 | { 29 | 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'aa3'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "America's Army 3"; 43 | 44 | /** 45 | * Query port = client_port + 18243 46 | * 47 | * client_port default 8777 48 | * query_port default 27020 49 | * 50 | * @type int 51 | */ 52 | protected $port_diff = 18243; 53 | } 54 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Aapg.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Aapg 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Aapg extends Aa3 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'aapg'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "America's Army: Proving Grounds"; 42 | } 43 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Arkse.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class ARK: Survival Evolved 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Arkse extends Source 28 | { 29 | 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'arkse'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "ARK: Survival Evolved"; 43 | 44 | /** 45 | * query_port = client_port + 19238 46 | * 27015 = 7777 + 19238 47 | * 48 | * @type int 49 | */ 50 | protected $port_diff = 19238; 51 | } 52 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Arma.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Arma 23 | * 24 | * @package GameQ\Protocols 25 | * 26 | * @author Wilson Jesus <> 27 | */ 28 | class Arma extends Gamespy2 29 | { 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'arma'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "ArmA Armed Assault"; 43 | } 44 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Armedassault2oa.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Armedassault2oa 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Armedassault2oa extends Source 28 | { 29 | 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = "armedassault2oa"; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "Armed Assault 2: Operation Arrowhead"; 43 | 44 | /** 45 | * Query port = client_port + 1 46 | * 47 | * @type int 48 | */ 49 | protected $port_diff = 1; 50 | } 51 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Armedassault3.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Armed assault 3 dummy Protocol Class 23 | * 24 | * Added for backward compatibility, please update to class arma3 25 | * 26 | * @deprecated v3.0.10 27 | * @package GameQ\Protocols 28 | * @author Austin Bischoff 29 | */ 30 | class Armedassault3 extends Arma3 31 | { 32 | } 33 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Atlas.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Atlas 23 | * 24 | * @package GameQ\Protocols 25 | * @author Wilson Jesus <> 26 | */ 27 | class Atlas extends Source 28 | { 29 | 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'atlas'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "Atlas"; 43 | 44 | /** 45 | * query_port = client_port + 51800 46 | * 57561 = 5761 + 51800 47 | * 48 | * this is the default value for the stock game server, both ports 49 | * can be independently changed from the stock ones, 50 | * making the port_diff logic useless. 51 | * 52 | * @type int 53 | */ 54 | protected $port_diff = 51800; 55 | } 56 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Avorion.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Avorion Protocol Class 23 | * 24 | * @package GameQ\Protocols 25 | */ 26 | class Avorion extends Source 27 | { 28 | /** 29 | * String name of this protocol class 30 | * 31 | * @type string 32 | */ 33 | protected $name = 'avorion'; 34 | 35 | /** 36 | * Longer string name of this protocol class 37 | * 38 | * @type string 39 | */ 40 | protected $name_long = "Avorion"; 41 | 42 | /** 43 | * query_port = client_port + 1 44 | * 45 | * @type int 46 | * protected $port_diff = 1; 47 | */ 48 | } 49 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Barotrauma.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Barotrauma Protocol Class 23 | * 24 | * @package GameQ\Protocols 25 | * @author Jesse Lukas 26 | */ 27 | class Barotrauma extends Source 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'barotrauma'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Barotrauma"; 42 | 43 | /** 44 | * query_port = client_port + 1 45 | * 46 | * @type int 47 | */ 48 | protected $port_diff = 1; 49 | } 50 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Batt1944.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Battalion 1944 23 | * 24 | * @package GameQ\Protocols 25 | * @author TacTicToe66 26 | */ 27 | class Batt1944 extends Source 28 | { 29 | 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'batt1944'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "Battalion 1944"; 43 | 44 | /** 45 | * query_port = client_port + 3 46 | * 47 | * @type int 48 | */ 49 | protected $port_diff = 3; 50 | 51 | /** 52 | * Normalize main fields 53 | * 54 | * @var array 55 | */ 56 | protected $normalize = [ 57 | // General 58 | 'general' => [ 59 | // target => source 60 | 'gametype' => 'bat_gamemode_s', 61 | 'hostname' => 'bat_name_s', 62 | 'mapname' => 'bat_map_s', 63 | 'maxplayers' => 'bat_max_players_i', 64 | 'numplayers' => 'bat_player_count_s', 65 | 'password' => 'bat_has_password_s', 66 | ], 67 | ]; 68 | } 69 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Bf1942.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Battlefield 1942 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Bf1942 extends Gamespy 28 | { 29 | 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'bf1942'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "Battlefield 1942"; 43 | 44 | /** 45 | * query_port = client_port + 8433 46 | * 23000 = 14567 + 8433 47 | * 48 | * @type int 49 | */ 50 | protected $port_diff = 8433; 51 | 52 | /** 53 | * The client join link 54 | * 55 | * @type string 56 | */ 57 | protected $join_link = "bf1942://%s:%d"; 58 | 59 | /** 60 | * Normalize settings for this protocol 61 | * 62 | * @type array 63 | */ 64 | protected $normalize = [ 65 | // General 66 | 'general' => [ 67 | // target => source 68 | 'dedicated' => 'dedicated', 69 | 'gametype' => 'gametype', 70 | 'hostname' => 'hostname', 71 | 'mapname' => 'mapname', 72 | 'maxplayers' => 'maxplayers', 73 | 'numplayers' => 'numplayers', 74 | 'password' => 'password', 75 | ], 76 | // Individual 77 | 'player' => [ 78 | 'name' => 'playername', 79 | 'kills' => 'kills', 80 | 'deaths' => 'deaths', 81 | 'ping' => 'ping', 82 | 'score' => 'score', 83 | ], 84 | 'team' => [ 85 | 'name' => 'teamname', 86 | ], 87 | ]; 88 | } 89 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Bf2.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Battlefield 2 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Bf2 extends Gamespy3 28 | { 29 | 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'bf2'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "Battlefield 2"; 43 | 44 | /** 45 | * query_port = client_port + 8433 46 | * 29900 = 16567 + 13333 47 | * 48 | * @type int 49 | */ 50 | protected $port_diff = 13333; 51 | 52 | /** 53 | * The client join link 54 | * 55 | * @type string 56 | */ 57 | protected $join_link = "bf2://%s:%d"; 58 | 59 | /** 60 | * BF2 has a different query packet to send than "normal" Gamespy 3 61 | * 62 | * @var array 63 | */ 64 | protected $packets = [ 65 | self::PACKET_ALL => "\xFE\xFD\x00\x10\x20\x30\x40\xFF\xFF\xFF\x01", 66 | ]; 67 | 68 | /** 69 | * Normalize settings for this protocol 70 | * 71 | * @type array 72 | */ 73 | protected $normalize = [ 74 | // General 75 | 'general' => [ 76 | // target => source 77 | 'dedicated' => 'dedicated', 78 | 'gametype' => 'gametype', 79 | 'hostname' => 'hostname', 80 | 'mapname' => 'mapname', 81 | 'maxplayers' => 'maxplayers', 82 | 'numplayers' => 'numplayers', 83 | 'password' => 'password', 84 | ], 85 | // Individual 86 | 'player' => [ 87 | 'name' => 'player', 88 | 'kills' => 'score', 89 | 'deaths' => 'deaths', 90 | 'ping' => 'ping', 91 | 'score' => 'score', 92 | ], 93 | 'team' => [ 94 | 'name' => 'team', 95 | 'score' => 'score', 96 | ], 97 | ]; 98 | } 99 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Bfh.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Battlefield Hardline Protocol class 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Bfh extends Bf4 28 | { 29 | 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'bfh'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "Battlefield Hardline"; 43 | } 44 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Blackmesa.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Blackmesa Protocol Class 23 | * 24 | * @package GameQ\Protocols 25 | * @author Jesse Lukas 26 | */ 27 | class Blackmesa extends Source 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'blackmesa'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Black Mesa"; 42 | } 43 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Brink.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Brink 23 | * 24 | * @package GameQ\Protocols 25 | * 26 | * @author Wilson Jesus <> 27 | */ 28 | class Brink extends Source 29 | { 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'brink'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "Brink"; 43 | 44 | /** 45 | * query_port = client_port + 1 46 | * 47 | * @type int 48 | */ 49 | protected $port_diff = 1; 50 | } 51 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Citadel.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Citadel Protocol Class 23 | * 24 | * @package GameQ\Protocols 25 | * @author Jesse Lukas 26 | */ 27 | class Citadel extends Source 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'citadel'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Citadel"; 42 | } 43 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Cod.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Call of Duty Protocol Class 23 | * 24 | * @package GameQ\Protocols 25 | * 26 | * @author Wilson Jesus <> 27 | */ 28 | class Cod extends Quake3 29 | { 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'cod'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "Call of Duty"; 43 | } 44 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Cod2.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Call of Duty 2 Protocol Class 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Cod2 extends Quake3 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'cod2'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Call of Duty 2"; 42 | } 43 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Cod4.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Call of Duty 4 Protocol Class 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Cod4 extends Quake3 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'cod4'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Call of Duty 4"; 42 | } 43 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Codmw2.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | use GameQ\Buffer; 22 | use GameQ\Result; 23 | 24 | /** 25 | * Call of Duty: Modern Warfare 2 Protocol Class 26 | * 27 | * @package GameQ\Protocols 28 | * @author Wilson Jesus <> 29 | */ 30 | class Codmw2 extends Quake3 31 | { 32 | /** 33 | * String name of this protocol class 34 | * 35 | * @type string 36 | */ 37 | protected $name = 'codmw2'; 38 | 39 | /** 40 | * Longer string name of this protocol class 41 | * 42 | * @type string 43 | */ 44 | protected $name_long = "Call of Duty: Modern Warfare 2"; 45 | 46 | protected function processPlayers(Buffer $buffer) 47 | { 48 | // Temporarily cache players in order to remove last 49 | $players = []; 50 | 51 | // Loop until we are out of data 52 | while ($buffer->getLength()) { 53 | // Make a new buffer with this block 54 | $playerInfo = new Buffer($buffer->readString("\x0A")); 55 | 56 | // Read player info 57 | $player = [ 58 | 'frags' => $playerInfo->readString("\x20"), 59 | 'ping' => $playerInfo->readString("\x20"), 60 | ]; 61 | 62 | // Skip first " 63 | $playerInfo->skip(1); 64 | 65 | // Add player name, encoded 66 | $player['name'] = utf8_encode(trim(($playerInfo->readString('"')))); 67 | 68 | // Add player 69 | $players[] = $player; 70 | } 71 | 72 | // Remove last, empty player 73 | array_pop($players); 74 | 75 | // Set the result to a new result instance 76 | $result = new Result(); 77 | 78 | // Add players 79 | $result->add('players', $players); 80 | 81 | // Add Playercount 82 | $result->add('clients', count($players)); 83 | 84 | // Clear 85 | unset($buffer, $players); 86 | 87 | return $result->fetch(); 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Codmw3.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Codmw3 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Codmw3 extends Source 28 | { 29 | 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'codmw3'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "Call of Duty: Modern Warfare 3"; 43 | 44 | /** 45 | * query_port = client_port + 2 46 | * 47 | * @type int 48 | */ 49 | protected $port_diff = 2; 50 | } 51 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Coduo.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Call of Duty United Offensive Class 23 | * 24 | * @package GameQ\Protocols 25 | * 26 | * @author Wilson Jesus <> 27 | */ 28 | class Coduo extends Quake3 29 | { 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'coduo'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "Call of Duty: United Offensive"; 43 | } 44 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Codwaw.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Call of Duty World at War Class 23 | * 24 | * @package GameQ\Protocols 25 | * @author naXe 26 | * @author Austin Bischoff 27 | */ 28 | class Codwaw extends Quake3 29 | { 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'codwaw'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "Call of Duty: World at War"; 43 | } 44 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Conanexiles.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Conanexiles 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Conanexiles extends Source 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'conanexiles'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Conan Exiles"; 42 | } 43 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Contagion.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Contagion 23 | * 24 | * @package GameQ\Protocols 25 | * @author Nikolay Ipanyuk 26 | * @author Austin Bischoff 27 | */ 28 | class Contagion extends Source 29 | { 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'contagion'; 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Contagion"; 42 | } 43 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Crysis.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Crysis 23 | * 24 | * @package GameQ\Protocols 25 | * 26 | * @author Wilson Jesus <> 27 | */ 28 | class Crysis extends Gamespy3 29 | { 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'crysis'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "Crysis"; 43 | } 44 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Crysis2.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Crysis2 23 | * 24 | * @package GameQ\Protocols 25 | * 26 | * @author Wilson Jesus <> 27 | */ 28 | class Crysis2 extends Gamespy3 29 | { 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'crysis2'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "Crysis 2"; 43 | } 44 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Crysiswars.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Crysiswars 23 | * 24 | * @package GameQ\Protocols 25 | * 26 | * @author Austin Bischoff 27 | */ 28 | class Crysiswars extends Gamespy3 29 | { 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'crysiswars'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "Crysis Wars"; 43 | } 44 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Cs15.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Counter-Strike 1.5 Protocol Class 23 | * 24 | * @author Nikolay Ipanyuk 25 | * @author Austin Bischoff 26 | * 27 | * @package GameQ\Protocols 28 | */ 29 | class Cs15 extends Won 30 | { 31 | 32 | /** 33 | * String name of this protocol class 34 | * 35 | * @type string 36 | */ 37 | protected $name = 'cs15'; 38 | 39 | /** 40 | * Longer string name of this protocol class 41 | * 42 | * @type string 43 | */ 44 | protected $name_long = "Counter-Strike 1.5"; 45 | } 46 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Cs16.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Cs16 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Cs16 extends Source 28 | { 29 | 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'cs16'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "Counter-Strike 1.6"; 43 | 44 | /** 45 | * In the case of cs 1.6 we offload split packets here because the split packet response for rules is in 46 | * the old gold source format 47 | * 48 | * @param $packet_id 49 | * @param array $packets 50 | * 51 | * @return string 52 | * @throws \GameQ\Exception\Protocol 53 | */ 54 | protected function processPackets($packet_id, array $packets = []) 55 | { 56 | 57 | // The response is gold source if the packets are split 58 | $this->source_engine = self::GOLDSOURCE_ENGINE; 59 | 60 | // Offload to the parent 61 | $packs = parent::processPackets($packet_id, $packets); 62 | 63 | // Reset the engine 64 | $this->source_engine = self::SOURCE_ENGINE; 65 | 66 | // Return the result 67 | return $packs; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Cscz.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Cscz 23 | * 24 | * Based off of CS 1.6 25 | * 26 | * @package GameQ\Protocols 27 | * @author Austin Bischoff 28 | */ 29 | class Cscz extends Cs16 30 | { 31 | 32 | /** 33 | * String name of this protocol class 34 | * 35 | * @type string 36 | */ 37 | protected $name = 'cscz'; 38 | 39 | /** 40 | * Longer string name of this protocol class 41 | * 42 | * @type string 43 | */ 44 | protected $name_long = "Counter-Strike: Condition Zero"; 45 | } 46 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Csgo.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Csgo 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Csgo extends Source 28 | { 29 | 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'csgo'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "Counter-Strike: Global Offensive"; 43 | } 44 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Css.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Css 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Css extends Source 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'css'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Counter-Strike: Source"; 42 | } 43 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Dal.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Dark and Light 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Dal extends Arkse 28 | { 29 | 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'dal'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "Dark and Light"; 43 | } 44 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Dayz.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Dayz 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Dayz extends Source 28 | { 29 | 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'dayz'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "DayZ Standalone"; 43 | 44 | /** 45 | * Overload the math used to guess at the Query Port 46 | * 47 | * @param int $clientPort 48 | * 49 | * @return int 50 | */ 51 | public function findQueryPort($clientPort) 52 | { 53 | 54 | /* 55 | * Port layout: 56 | * 2302 - 27016 57 | * 2402 - 27017 58 | * 2502 - 27018 59 | * 2602 - 27019 60 | * 2702 - 27020 61 | * ... 62 | */ 63 | 64 | return 27016 + (($clientPort - 2302) / 100); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Dayzmod.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Dayzmod 23 | * 24 | * @package GameQ\Protocols 25 | * @author Marcel Bößendörfer 26 | * @author Austin Bischoff 27 | */ 28 | class Dayzmod extends Armedassault2oa 29 | { 30 | 31 | /** 32 | * String name of this protocol class 33 | * 34 | * @type string 35 | */ 36 | protected $name = 'dayzmod'; 37 | 38 | /** 39 | * Longer string name of this protocol class 40 | * 41 | * @type string 42 | */ 43 | protected $name_long = "DayZ Mod"; 44 | } 45 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Dod.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Dod 23 | * 24 | * Based off of CS 1.6 25 | * 26 | * @package GameQ\Protocols 27 | * @author Austin Bischoff 28 | */ 29 | class Dod extends Cs16 30 | { 31 | 32 | /** 33 | * String name of this protocol class 34 | * 35 | * @type string 36 | */ 37 | protected $name = 'dod'; 38 | 39 | /** 40 | * Longer string name of this protocol class 41 | * 42 | * @type string 43 | */ 44 | protected $name_long = "Day of Defeat"; 45 | } 46 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Dods.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Dods 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Dods extends Source 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'dods'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Day of Defeat: Source"; 42 | } 43 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Dow.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | use GameQ\Buffer; 22 | 23 | /** 24 | * Class Dow 25 | * 26 | * Apparently the player response is incomplete as there is no information being returned for that packet 27 | * 28 | * @package GameQ\Protocols 29 | * @author Austin Bischoff 30 | */ 31 | class Dow extends Source 32 | { 33 | /** 34 | * String name of this protocol class 35 | * 36 | * @type string 37 | */ 38 | protected $name = 'dow'; 39 | 40 | /** 41 | * Longer string name of this protocol class 42 | * 43 | * @type string 44 | */ 45 | protected $name_long = "Days of War"; 46 | 47 | /** 48 | * Normalize main fields 49 | * 50 | * @var array 51 | */ 52 | protected $normalize = [ 53 | // General 54 | 'general' => [ 55 | // target => source 56 | 'gametype' => 'G_s', 57 | 'hostname' => 'ONM_s', 58 | 'mapname' => 'MPN_s', 59 | 'maxplayers' => 'P_i', 60 | 'numplayers' => 'N_i', 61 | ], 62 | // Individual 63 | 'player' => [ 64 | 'name' => 'name', 65 | 'score' => 'score', 66 | 'time' => 'time', 67 | ], 68 | ]; 69 | } 70 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Egs.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Empyrion - Galactic Survival 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | * @author TacTicToe66 27 | */ 28 | class Egs extends Source 29 | { 30 | 31 | /** 32 | * String name of this protocol class 33 | * 34 | * @type string 35 | */ 36 | protected $name = 'egs'; 37 | 38 | /** 39 | * Longer string name of this protocol class 40 | * 41 | * @type string 42 | */ 43 | protected $name_long = "Empyrion - Galactic Survival"; 44 | 45 | /** 46 | * query_port = client_port + 1 47 | * 48 | * @type int 49 | */ 50 | protected $port_diff = 1; 51 | } 52 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Et.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Wolfenstein Enemy Territory Protocol Class 23 | * 24 | * @package GameQ\Protocols 25 | * 26 | * @author Wilson Jesus <> 27 | */ 28 | class Et extends Quake3 29 | { 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'et'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "Wolfenstein Enemy Territory"; 43 | } 44 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Ffe.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Ffe - Fortress Forever 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Ffe extends Source 28 | { 29 | 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'ffe'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "Fortress Forever"; 43 | } 44 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Fof.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Fistful of Frags 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | * @author Jesse Lukas 27 | */ 28 | class Fof extends Source 29 | { 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'fof'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "Fistful of Frags"; 43 | } 44 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Gamespy4.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * GameSpy4 Protocol Class 23 | * 24 | * By all accounts GameSpy 4 seems to be GameSpy 3. 25 | * 26 | * References: 27 | * http://www.deletedscreen.com/?p=951 28 | * http://pastebin.com/2zZFDuTd 29 | * 30 | * @author Austin Bischoff 31 | */ 32 | class Gamespy4 extends Gamespy3 33 | { 34 | } 35 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Gmod.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Gmod 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Gmod extends Source 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'gmod'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Garry's Mod"; 42 | } 43 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Grav.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Grav Online Protocol Class 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Grav extends Source 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'grav'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "GRAV Online"; 42 | } 43 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Gta5m.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * GTA Five M Protocol Class 23 | * 24 | * Server base can be found at https://fivem.net/ 25 | * 26 | * Based on code found at https://github.com/LiquidObsidian/fivereborn-query 27 | * 28 | * @author Austin Bischoff 29 | * 30 | * Adding FiveM Player List by 31 | * @author Jesse Lukas 32 | * 33 | * @deprecated Use protocol CFX for querying your CitizenFX server 34 | */ 35 | class Gta5m extends Cfx 36 | { 37 | /** 38 | * The query protocol used to make the call 39 | * 40 | * @type string 41 | */ 42 | protected $protocol = 'gta5m'; 43 | 44 | /** 45 | * String name of this protocol class 46 | * 47 | * @type string 48 | */ 49 | protected $name = 'gta5m'; 50 | 51 | /** 52 | * Longer string name of this protocol class 53 | * 54 | * @type string 55 | */ 56 | protected $name_long = "GTA Five M"; 57 | } 58 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Had2.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Hidden & Dangerous 2 Protocol Class 23 | * 24 | * @author Wilson Jesus <> 25 | */ 26 | class Had2 extends Gamespy2 27 | { 28 | 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'had2'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Hidden & Dangerous 2"; 42 | 43 | /** 44 | * The difference between the client port and query port 45 | * 46 | * @type int 47 | */ 48 | protected $port_diff = 3; 49 | 50 | /** 51 | * Normalize settings for this protocol 52 | * 53 | * @type array 54 | */ 55 | protected $normalize = [ 56 | // General 57 | 'general' => [ 58 | // target => source 59 | 'dedicated' => 'isdedicated', 60 | 'gametype' => 'gametype', 61 | 'hostname' => 'hostname', 62 | 'mapname' => 'mapname', 63 | 'maxplayers' => 'maxplayers', 64 | 'numplayers' => 'numplayers', 65 | 'password' => 'password', 66 | ], 67 | // Individual 68 | 'player' => [ 69 | 'name' => 'player', 70 | 'score' => 'score', 71 | 'deaths' => 'deaths', 72 | 'ping' => 'ping', 73 | ], 74 | ]; 75 | } 76 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Halo.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Halo: Combat Evolved Protocol Class 23 | * 24 | * @author Wilson Jesus <> 25 | */ 26 | class Halo extends Gamespy2 27 | { 28 | 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'halo'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Halo: Combat Evolved"; 42 | } 43 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Hl1.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Hl1 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | * @author Jesse Lukas 27 | */ 28 | class Hl1 extends Source 29 | { 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'hl1'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "Half Life"; 43 | } 44 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Hl2dm.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Hl2dm 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Hl2dm extends Source 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'hl2dm'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Half Life 2: Deathmatch"; 42 | } 43 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Hll.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Hll 23 | * 24 | * @package GameQ\Protocols 25 | * @author Wilson Jesus <> 26 | */ 27 | class Hll extends Source 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'hll'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Hell Let Loose"; 42 | 43 | /** 44 | * query_port = client_port + 15 45 | * 64015 = 64000 + 15 46 | * 47 | * @type int 48 | */ 49 | protected $port_diff = 15; 50 | 51 | /** 52 | * Normalize settings for this protocol 53 | * 54 | * @type array 55 | */ 56 | /*protected $normalize = [ 57 | 'general' => [ 58 | // target => source 59 | 'dedicated' => 'dedicated', 60 | 'gametype' => 'gametype', 61 | 'servername' => 'hostname', 62 | 'mapname' => 'mapname', 63 | 'maxplayers' => 'maxplayers', 64 | 'numplayers' => 'numplayers', 65 | 'password' => 'password', 66 | ], 67 | ];*/ 68 | } 69 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Homefront.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class L4d2 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Homefront extends Source 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'homefront'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Homefront"; 42 | } 43 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Http.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | use GameQ\Protocol; 22 | 23 | /** 24 | * Class Http 25 | * 26 | * Generic HTTP protocol class. Useful for making http based requests 27 | * 28 | * @package GameQ\Protocols 29 | * @author Austin Bischoff 30 | */ 31 | abstract class Http extends Protocol 32 | { 33 | /** 34 | * The query protocol used to make the call 35 | * 36 | * @type string 37 | */ 38 | protected $protocol = 'http'; 39 | 40 | /** 41 | * String name of this protocol class 42 | * 43 | * @type string 44 | */ 45 | protected $name = 'http'; 46 | 47 | /** 48 | * Longer string name of this protocol class 49 | * 50 | * @type string 51 | */ 52 | protected $name_long = "Generic HTTP protocol"; 53 | 54 | /** 55 | * Http protocol is TCP 56 | * 57 | * @var string 58 | */ 59 | protected $transport = self::TRANSPORT_TCP; 60 | 61 | /** 62 | * The client join link 63 | * 64 | * @type string 65 | */ 66 | protected $join_link = null; 67 | } 68 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Hurtworld.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Hurtworld 23 | * 24 | * @package GameQ\Protocols 25 | * @author Nikolay Ipanyuk 26 | * @author Austin Bischoff 27 | */ 28 | class Hurtworld extends Source 29 | { 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'hurtworld'; 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Hurtworld"; 42 | } 43 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Insurgency.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Insurgency 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Insurgency extends Source 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'insurgency'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Insurgency"; 42 | } 43 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Insurgencysand.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Insurgency Sandstorm Class 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Insurgencysand extends Source 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'insurgencysand'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Insurgency: Sandstorm"; 42 | 43 | /** 44 | * query_port = client_port + 29 45 | * 46 | * @type int 47 | */ 48 | protected $port_diff = 29; 49 | } 50 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Jediacademy.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Jedi Academy Protocol Class 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Jediacademy extends Quake3 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'jediacademy'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Star Wars Jedi Knight: Jedi Academy"; 42 | } 43 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Jedioutcast.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Jedi Outcast Protocol Class 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Jedioutcast extends Quake3 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'jedioutcast'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Star Wars Jedi Knight II: Jedi Outcast"; 42 | } 43 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Justcause3.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Just Cause 3 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Justcause3 extends Source 28 | { 29 | 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'justcause3'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "Just Cause 3"; 43 | 44 | /** 45 | * Query port = client_port + 1 46 | * 47 | * @type int 48 | */ 49 | protected $port_diff = 1; 50 | } 51 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Killingfloor2.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Killing floor 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Killingfloor2 extends Source 28 | { 29 | 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'killing floor 2'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "Killing Floor 2"; 43 | 44 | /** 45 | * query_port = client_port + 19238 46 | * 27015 = 7777 + 19238 47 | * 48 | * @type int 49 | */ 50 | protected $port_diff = 19238; 51 | } 52 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Kingpin.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Kingpin: Life of Crime Protocol Class 23 | * 24 | * @package GameQ\Protocols 25 | * 26 | * @author Wilson Jesus <> 27 | */ 28 | class Kingpin extends Quake2 29 | { 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'kingpin'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "Kingpin: Life of Crime"; 43 | } 44 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/L4d.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class L4d 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class L4d extends Source 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'l4d'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Left 4 Dead"; 42 | } 43 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/L4d2.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class L4d2 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class L4d2 extends Source 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'l4d2'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Left 4 Dead 2"; 42 | } 43 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Lifeisfeudal.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Life is Feudal 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Lifeisfeudal extends Source 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'lifeisfeudal'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Life is Feudal"; 42 | 43 | /** 44 | * query_port = client_port + 2 45 | * 46 | * @type int 47 | */ 48 | protected $port_diff = 2; 49 | } 50 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Minecraft.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Minecraft Protocol Class 23 | * 24 | * Thanks to https://github.com/xPaw/PHP-Minecraft-Query for helping me realize this is 25 | * Gamespy 3 Protocol. Make sure you enable the items below for it to work. 26 | * 27 | * Information from original author: 28 | * Instructions 29 | * 30 | * Before using this class, you need to make sure that your server is running GS4 status listener. 31 | * 32 | * Look for those settings in server.properties: 33 | * 34 | * enable-query=true 35 | * query.port=25565 36 | * 37 | * @package GameQ\Protocols 38 | * 39 | * @author Austin Bischoff 40 | */ 41 | class Minecraft extends Gamespy3 42 | { 43 | 44 | /** 45 | * String name of this protocol class 46 | * 47 | * @type string 48 | */ 49 | protected $name = 'minecraft'; 50 | 51 | /** 52 | * Longer string name of this protocol class 53 | * 54 | * @type string 55 | */ 56 | protected $name_long = "Minecraft"; 57 | 58 | /** 59 | * The client join link 60 | * 61 | * @type string 62 | */ 63 | protected $join_link = "minecraft://%s:%d/"; 64 | 65 | /** 66 | * Normalize settings for this protocol 67 | * 68 | * @type array 69 | */ 70 | protected $normalize = [ 71 | // General 72 | 'general' => [ 73 | // target => source 74 | 'dedicated' => 'dedicated', 75 | 'gametype' => 'game_id', 76 | 'hostname' => 'hostname', 77 | 'mapname' => 'map', 78 | 'maxplayers' => 'maxplayers', 79 | 'numplayers' => 'numplayers', 80 | 'password' => 'password', 81 | ], 82 | // Individual 83 | 'player' => [ 84 | 'name' => 'player', 85 | ], 86 | ]; 87 | } 88 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Minecraftbe.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Minecraft Bedrock Edition (BE) Protocol Class 23 | * 24 | * @package GameQ\Protocols 25 | * 26 | * @author Austin Bischoff 27 | */ 28 | class Minecraftbe extends Raknet 29 | { 30 | 31 | /** 32 | * String name of this protocol class 33 | * 34 | * @type string 35 | */ 36 | protected $name = 'minecraftbe'; 37 | 38 | /** 39 | * Longer string name of this protocol class 40 | * 41 | * @type string 42 | */ 43 | protected $name_long = "Minecraft Bedrock Edition"; 44 | 45 | /** 46 | * Normalize settings for this protocol 47 | * 48 | * @type array 49 | */ 50 | protected $normalize = [ 51 | // General 52 | 'general' => [ 53 | // target => source 54 | 'dedicated' => 'dedicated', 55 | 'gametype' => 'edition', 56 | 'hostname' => 'motd_line_1', 57 | 'maxplayers' => 'max_players', 58 | 'mod' => 'gamemode', 59 | 'numplayers' => 'num_players', 60 | ], 61 | ]; 62 | } 63 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Minecraftpe.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Minecraft PE (BE) Protocol Class 23 | * 24 | * @package GameQ\Protocols 25 | * 26 | * @author Austin Bischoff 27 | */ 28 | class Minecraftpe extends Minecraft 29 | { 30 | 31 | /** 32 | * String name of this protocol class 33 | * 34 | * @type string 35 | */ 36 | protected $name = 'minecraftpe'; 37 | 38 | /** 39 | * Longer string name of this protocol class 40 | * 41 | * @type string 42 | */ 43 | protected $name_long = "MinecraftPE"; 44 | } 45 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Miscreated.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Miscreated 23 | * 24 | * @package GameQ\Protocols 25 | * @author Wilson Jesus <> 26 | */ 27 | class Miscreated extends Source 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'miscreated'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Miscreated"; 42 | 43 | /** 44 | * query_port = client_port + 2 45 | * 64092 = 64090 + 2 46 | * 47 | * @type int 48 | */ 49 | protected $port_diff = 2; 50 | 51 | /** 52 | * Normalize settings for this protocol 53 | * 54 | * @type array 55 | */ 56 | protected $normalize = [ 57 | 'general' => [ 58 | // target => source 59 | 'dedicated' => 'dedicated', 60 | 'gametype' => 'gametype', 61 | 'servername' => 'hostname', 62 | 'mapname' => 'mapname', 63 | 'maxplayers' => 'maxplayers', 64 | 'numplayers' => 'numplayers', 65 | 'password' => 'password', 66 | ], 67 | ]; 68 | } 69 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Modiverse.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Modiverse 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | * @author Jesse Lukas 27 | */ 28 | class Modiverse extends Source 29 | { 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'modiverse'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "Modiverse"; 43 | } 44 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Mohaa.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Medal of honor: Allied Assault Protocol Class 23 | * 24 | * @package GameQ\Protocols 25 | * @author Bram 26 | * @author Austin Bischoff 27 | */ 28 | class Mohaa extends Gamespy 29 | { 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'mohaa'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "Medal of honor: Allied Assault"; 43 | 44 | /** 45 | * Normalize settings for this protocol 46 | * 47 | * @type array 48 | */ 49 | protected $normalize = [ 50 | 'general' => [ 51 | // target => source 52 | 'dedicated' => 'dedicated', 53 | 'gametype' => 'gametype', 54 | 'hostname' => 'hostname', 55 | 'mapname' => 'mapname', 56 | 'maxplayers' => 'maxplayers', 57 | 'numplayers' => 'numplayers', 58 | 'password' => 'password', 59 | ], 60 | // Individual 61 | 'player' => [ 62 | 'name' => 'player', 63 | 'score' => 'frags', 64 | 'ping' => 'ping', 65 | ], 66 | ]; 67 | 68 | /** 69 | * Query port is always the client port + 97 in MOHAA 70 | * 71 | * @param int $clientPort 72 | * 73 | * @return int 74 | */ 75 | public function findQueryPort($clientPort) 76 | { 77 | return $clientPort + 97; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Mordhau.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class MORDHAU 23 | * 24 | * @package GameQ\Protocols 25 | * @author Wilson Jesus <> 26 | */ 27 | class Mordhau extends Source 28 | { 29 | 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'mordhau'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "MORDHAU"; 43 | 44 | #protected $port = 7777; 45 | 46 | /** 47 | * query_port = client_port + 19238 48 | * 27015 = 7777 + 19238 49 | * 50 | * @type int 51 | */ 52 | #protected $port_diff = 19238; 53 | } 54 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Mta.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Multi Theft Auto 23 | * 24 | * @package GameQ\Protocols 25 | * 26 | * @author Marcel Bößendörfer 27 | * @author Austin Bischoff 28 | */ 29 | class Mta extends Ase 30 | { 31 | 32 | /** 33 | * String name of this protocol class 34 | * 35 | * @type string 36 | */ 37 | protected $name = 'mta'; 38 | 39 | /** 40 | * Longer string name of this protocol class 41 | * 42 | * @type string 43 | */ 44 | protected $name_long = "Multi Theft Auto"; 45 | 46 | /** 47 | * query_port = client_port + 123 48 | * 49 | * @type int 50 | */ 51 | protected $port_diff = 123; 52 | 53 | /** 54 | * The client join link 55 | * 56 | * @type string 57 | */ 58 | protected $join_link = "mtasa://%s:%d/"; 59 | } 60 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Nmrih.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class No More Room in Hell 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | * @author Jesse Lukas 27 | */ 28 | class Nmrih extends Source 29 | { 30 | /** 31 | * No More Room in Hell protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'nmrih'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "No More Room in Hell"; 43 | } 44 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Ns2.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Ns2 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Ns2 extends Source 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'ns2'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Natural Selection 2"; 42 | 43 | /** 44 | * query_port = client_port + 1 45 | * 46 | * @type int 47 | */ 48 | protected $port_diff = 1; 49 | } 50 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Of.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Open Fortress 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | * @author Jesse Lukas 27 | */ 28 | class Of extends Source 29 | { 30 | /** 31 | * Open Fortress protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'of'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "Open Fortress"; 43 | } 44 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Pixark.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class PixARK 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Pixark extends Arkse 28 | { 29 | 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'pixark'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "PixARK"; 43 | 44 | /** 45 | * Query port = client_port + 1 46 | * 47 | * @type int 48 | */ 49 | protected $port_diff = 1; 50 | } 51 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Postscriptum.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Postscriptum 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Postscriptum extends Source 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'postscriptum'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Post Scriptum"; 42 | 43 | /** 44 | * query_port = client_port + 10 45 | * 64092 = 64090 + 10 46 | * 47 | * @type int 48 | */ 49 | protected $port_diff = 10; 50 | } 51 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Projectrealitybf2.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Projectrealitybf2 23 | * 24 | * Based off of BF2 25 | * 26 | * @package GameQ\Protocols 27 | * @author Austin Bischoff 28 | */ 29 | class Projectrealitybf2 extends Bf2 30 | { 31 | 32 | /** 33 | * String name of this protocol class 34 | * 35 | * @type string 36 | */ 37 | protected $name = 'projectrealitybf2'; 38 | 39 | /** 40 | * Longer string name of this protocol class 41 | * 42 | * @type string 43 | */ 44 | protected $name_long = "Project Reality: Battlefield 2"; 45 | } 46 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Quake4.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | use GameQ\Buffer; 22 | use GameQ\Result; 23 | 24 | /** 25 | * Quake 4 Protocol Class 26 | * 27 | * @package GameQ\Protocols 28 | * 29 | * @author Wilson Jesus <> 30 | */ 31 | class Quake4 extends Doom3 32 | { 33 | /** 34 | * String name of this protocol class 35 | * 36 | * @type string 37 | */ 38 | protected $name = 'quake4'; 39 | 40 | /** 41 | * Longer string name of this protocol class 42 | * 43 | * @type string 44 | */ 45 | protected $name_long = "Quake 4"; 46 | 47 | /** 48 | * Handle processing of player data 49 | * 50 | * @param \GameQ\Buffer $buffer 51 | * 52 | * @return array 53 | */ 54 | protected function processPlayers(Buffer $buffer) 55 | { 56 | // Some games do not have a number of current players 57 | $playerCount = 0; 58 | 59 | // Set the result to a new result instance 60 | $result = new Result(); 61 | 62 | // Parse players 63 | // Loop thru the buffer until we run out of data 64 | while (($id = $buffer->readInt8()) != 32) { 65 | // Add player info results 66 | $result->addPlayer('id', $id); 67 | $result->addPlayer('ping', $buffer->readInt16()); 68 | $result->addPlayer('rate', $buffer->readInt32()); 69 | // Add player name, encoded 70 | $result->addPlayer('name', utf8_encode(trim($buffer->readString()))); 71 | $result->addPlayer('clantag', $buffer->readString()); 72 | // Increment 73 | $playerCount++; 74 | } 75 | 76 | // Add the number of players to the result 77 | $result->add('numplayers', $playerCount); 78 | 79 | // Clear 80 | unset($buffer, $playerCount); 81 | 82 | return $result->fetch(); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Quakelive.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Quake Live 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Quakelive extends Source 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'quakelive'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Quake Live"; 42 | } 43 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Redorchestra2.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Redorchestra2 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Redorchestra2 extends Source 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'redorchestra2'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Red Orchestra 2"; 42 | 43 | /** 44 | * query_port = client_port + 19238 45 | * 27015 = 7777 + 19238 46 | * 47 | * @type int 48 | */ 49 | protected $port_diff = 19238; 50 | } 51 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Redorchestraostfront.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Red Orchestra: Ostfront 41-45 Class 23 | * 24 | * @package GameQ\Protocols 25 | * @author naXe 26 | * @author Austin Bischoff 27 | */ 28 | class Redorchestraostfront extends Source 29 | { 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'redorchestraostfront'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "Red Orchestra: Ostfront 41-45"; 43 | } 44 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Rf2.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class rFactor2 23 | * 24 | * @package GameQ\Protocols 25 | * @author Wilson Jesus <> 26 | */ 27 | class Rf2 extends Source 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'rf2'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "rFactor 2"; 42 | 43 | /** 44 | * query_port = client_port + 2 45 | * 64092 = 64090 + 2 46 | * 47 | * @type int 48 | */ 49 | protected $port_diff = 2; 50 | } 51 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Rfactor.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class rFactor 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | * @author Jesse Lukas 27 | */ 28 | class Rfactor extends Source 29 | { 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'rfactor'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "rFactor"; 43 | } 44 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Rfactor2.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class rFactor2 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | * @author Jesse Lukas 27 | */ 28 | class Rfactor2 extends Source 29 | { 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'rfactor2'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "rFactor2"; 43 | } 44 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Risingstorm2.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Rising Storm 2 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Risingstorm2 extends Source 28 | { 29 | 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'rising storm 2'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "Rising Storm 2"; 43 | 44 | /** 45 | * Query port is always 27015 46 | * 47 | * @param int $clientPort 48 | * 49 | * @return int 50 | */ 51 | public function findQueryPort($clientPort) 52 | { 53 | return 27015; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Rust.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | use GameQ\Buffer; 22 | 23 | /** 24 | * Class Rust 25 | * 26 | * @package GameQ\Protocols 27 | * @author Austin Bischoff 28 | */ 29 | class Rust extends Source 30 | { 31 | 32 | /** 33 | * String name of this protocol class 34 | * 35 | * @type string 36 | */ 37 | protected $name = 'rust'; 38 | 39 | /** 40 | * Longer string name of this protocol class 41 | * 42 | * @type string 43 | */ 44 | protected $name_long = "Rust"; 45 | 46 | /** 47 | * Overload so we can get max players from mp of keywords and num players from cp keyword 48 | * 49 | * @param Buffer $buffer 50 | */ 51 | protected function processDetails(Buffer $buffer) 52 | { 53 | $results = parent::processDetails($buffer); 54 | 55 | if ($results['keywords']) { 56 | //get max players from mp of keywords and num players from cp keyword 57 | preg_match_all('/(mp|cp)([\d]+)/', $results['keywords'], $matches); 58 | $results['max_players'] = intval($matches[2][0]); 59 | $results['num_players'] = intval($matches[2][1]); 60 | } 61 | 62 | return $results; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Sco.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Sven Co-op 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | * @author Jesse Lukas 27 | */ 28 | class Sco extends Source 29 | { 30 | /** 31 | * Sven Co-op protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'sco'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "Sven Co-op"; 43 | 44 | /** 45 | * query_port = client_port + 1 46 | * 47 | * @type int 48 | */ 49 | protected $port_diff = 1; 50 | } 51 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Serioussam.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Serious Sam Protocol Class 23 | * 24 | * @author ZCaliptium 25 | */ 26 | class Serioussam extends Gamespy 27 | { 28 | 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'serioussam'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Serious Sam"; 42 | 43 | /** 44 | * query_port = client_port + 1 45 | * 46 | * @type int 47 | */ 48 | protected $port_diff = 1; 49 | 50 | /** 51 | * Normalize settings for this protocol 52 | * 53 | * @type array 54 | */ 55 | protected $normalize = [ 56 | // General 57 | 'general' => [ 58 | // target => source 59 | 'dedicated' => 'dedicated', 60 | 'gametype' => 'gametype', 61 | 'hostname' => 'hostname', 62 | 'mapname' => 'mapname', 63 | 'maxplayers' => 'maxplayers', 64 | 'mod' => 'activemod', 65 | 'numplayers' => 'numplayers', 66 | 'password' => 'password', 67 | ], 68 | // Individual 69 | 'player' => [ 70 | 'name' => 'player', 71 | 'ping' => 'ping', 72 | 'score' => 'frags', 73 | ], 74 | ]; 75 | } 76 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Sevendaystodie.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class 7 Days to Die 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Sevendaystodie extends Source 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'sevendaystodie'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "7 Days to Die"; 42 | 43 | /** 44 | * query_port = client_port + 0 45 | * 46 | * @type int 47 | */ 48 | protected $port_diff = 0; 49 | } 50 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Ship.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | use GameQ\Buffer; 22 | use GameQ\Result; 23 | 24 | /** 25 | * Class Ship 26 | * 27 | * @package GameQ\Protocols 28 | * 29 | * @author Nikolay Ipanyuk 30 | * @author Austin Bischoff 31 | */ 32 | class Ship extends Source 33 | { 34 | 35 | /** 36 | * String name of this protocol class 37 | * 38 | * @type string 39 | */ 40 | protected $name = 'ship'; 41 | 42 | /** 43 | * Longer string name of this protocol class 44 | * 45 | * @type string 46 | */ 47 | protected $name_long = "The Ship"; 48 | 49 | /** 50 | * Specific player parse for The Ship 51 | * 52 | * Player response has unknown data after the last real player 53 | * 54 | * @param \GameQ\Buffer $buffer 55 | * 56 | * @return array 57 | */ 58 | protected function processPlayers(Buffer $buffer) 59 | { 60 | 61 | // Set the result to a new result instance 62 | $result = new Result(); 63 | 64 | // We need to read the number of players because this response has other data at the end usually 65 | $num_players = $buffer->readInt8(); 66 | 67 | // Player count 68 | $result->add('num_players', $num_players); 69 | 70 | // No players, no work 71 | if ($num_players == 0) { 72 | return $result->fetch(); 73 | } 74 | 75 | // Players list 76 | for ($player = 0; $player < $num_players; $player++) { 77 | $result->addPlayer('id', $buffer->readInt8()); 78 | $result->addPlayer('name', $buffer->readString()); 79 | $result->addPlayer('score', $buffer->readInt32Signed()); 80 | $result->addPlayer('time', $buffer->readFloat32()); 81 | } 82 | 83 | // Extra data 84 | if ($buffer->getLength() > 0) { 85 | for ($player = 0; $player < $num_players; $player++) { 86 | $result->addPlayer('deaths', $buffer->readInt32Signed()); 87 | $result->addPlayer('money', $buffer->readInt32Signed()); 88 | } 89 | } 90 | 91 | unset($buffer); 92 | 93 | return $result->fetch(); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Sof2.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Soldier of Fortune 2 Class 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Sof2 extends Quake3 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'sof2'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Solder of Fortune II"; 42 | 43 | /** 44 | * The client join link 45 | * 46 | * @type string 47 | */ 48 | protected $join_link = "sof2mp://%s:%d/"; 49 | } 50 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Soldat.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Soldat 23 | * 24 | * @package GameQ\Protocols 25 | * 26 | * @author Marcel Bößendörfer 27 | * @author Austin Bischoff 28 | */ 29 | class Soldat extends Ase 30 | { 31 | 32 | /** 33 | * String name of this protocol class 34 | * 35 | * @type string 36 | */ 37 | protected $name = 'soldat'; 38 | 39 | /** 40 | * Longer string name of this protocol class 41 | * 42 | * @type string 43 | */ 44 | protected $name_long = "Soldat"; 45 | 46 | /** 47 | * query_port = client_port + 123 48 | * 49 | * @type int 50 | */ 51 | protected $port_diff = 123; 52 | 53 | /** 54 | * The client join link 55 | * 56 | * @type string 57 | */ 58 | protected $join_link = "soldat://%s:%d/"; 59 | } 60 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Spaceengineers.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Space Engineers Protocol Class 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Spaceengineers extends Source 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'spaceengineers'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Space Engineers"; 42 | } 43 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Squad.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Squad 23 | * 24 | * Port reference: http://forums.joinsquad.com/topic/9559-query-ports/ 25 | * 26 | * @package GameQ\Protocols 27 | * @author Austin Bischoff 28 | */ 29 | class Squad extends Source 30 | { 31 | 32 | /** 33 | * String name of this protocol class 34 | * 35 | * @type string 36 | */ 37 | protected $name = 'squad'; 38 | 39 | /** 40 | * Longer string name of this protocol class 41 | * 42 | * @type string 43 | */ 44 | protected $name_long = "Squad"; 45 | 46 | /** 47 | * query_port = client_port + 19378 48 | * 27165 = 7787 + 19378 49 | * 50 | * @type int 51 | */ 52 | protected $port_diff = 19378; 53 | } 54 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Starbound.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class L4d2 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Starbound extends Source 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'starbound'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Starbound"; 42 | } 43 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Stormworks.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Stormworks 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | * @author Jesse Lukas 27 | */ 28 | class Stormworks extends Source 29 | { 30 | /** 31 | * Stormworks protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'stormworks'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "Stormworks"; 43 | 44 | /** 45 | * query_port = client_port + 1 46 | * 47 | * @type int 48 | */ 49 | protected $port_diff = 1; 50 | } 51 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Swat4.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Swat4 23 | * 24 | * @package GameQ\Protocols 25 | * 26 | * @author Wilson Jesus <> 27 | */ 28 | class Swat4 extends Gamespy2 29 | { 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'swat4'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "SWAT 4"; 43 | 44 | /** 45 | * query_port = client_port + 1 46 | * 47 | * @type int 48 | */ 49 | protected $port_diff = 1; 50 | } 51 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Terraria.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Terraria 23 | * 24 | * @package GameQ\Protocols 25 | * 26 | * @author Austin Bischoff 27 | */ 28 | class Terraria extends Tshock 29 | { 30 | 31 | /** 32 | * String name of this protocol class 33 | * 34 | * @type string 35 | */ 36 | protected $name = 'terraria'; 37 | 38 | /** 39 | * Longer string name of this protocol class 40 | * 41 | * @type string 42 | */ 43 | protected $name_long = "Terraria"; 44 | 45 | /** 46 | * query_port = client_port + 101 47 | * 7878 = 7777 + 101 48 | * 49 | * @type int 50 | */ 51 | protected $port_diff = 101; 52 | 53 | /** 54 | * The client join link 55 | * 56 | * @type string 57 | */ 58 | protected $join_link = "steam://connect/%s:%d/"; 59 | } 60 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Tf2.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Tf2 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Tf2 extends Source 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'tf2'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Team Fortress 2"; 42 | } 43 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Theforrest.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Class Theforrest 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Theforrest extends Source 28 | { 29 | 30 | /** 31 | * String name of this protocol class 32 | * 33 | * @type string 34 | */ 35 | protected $name = 'theforrest'; 36 | 37 | /** 38 | * Longer string name of this protocol class 39 | * 40 | * @type string 41 | */ 42 | protected $name_long = "The Forrest"; 43 | 44 | /** 45 | * query_port = client_port + 1 46 | * 47 | * @type int 48 | */ 49 | protected $port_diff = 1; 50 | } 51 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Unturned.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Unturned Protocol Class 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Unturned extends Source 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'unturned'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Unturned"; 42 | 43 | /** 44 | * query_port = client_port + 1 45 | * 46 | * @type int 47 | */ 48 | protected $port_diff = 1; 49 | } 50 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Urbanterror.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Urban Terror Class 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Urbanterror extends Quake3 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'urbanterror'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Urban Terror"; 42 | 43 | /** 44 | * The client join link 45 | * 46 | * @type string 47 | */ 48 | protected $join_link = "urt://%s:%d/"; 49 | } 50 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Ut.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Unreal Tournament Protocol Class 23 | * 24 | * @author Austin Bischoff 25 | */ 26 | class Ut extends Gamespy 27 | { 28 | 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'ut'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Unreal Tournament"; 42 | 43 | /** 44 | * query_port = client_port + 1 45 | * 46 | * @type int 47 | */ 48 | protected $port_diff = 1; 49 | 50 | /** 51 | * Normalize settings for this protocol 52 | * 53 | * @type array 54 | */ 55 | protected $normalize = [ 56 | // General 57 | 'general' => [ 58 | // target => source 59 | 'dedicated' => 'dedicated', 60 | 'gametype' => 'gametype', 61 | 'hostname' => 'hostname', 62 | 'mapname' => 'mapname', 63 | 'maxplayers' => 'maxplayers', 64 | 'numplayers' => 'numplayers', 65 | 'password' => 'password', 66 | ], 67 | // Individual 68 | 'player' => [ 69 | 'name' => 'name', 70 | 'score' => 'frags', 71 | ], 72 | ]; 73 | } 74 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Ut2004.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Unreal Tournament 2004 Protocol Class 23 | * 24 | * @author Austin Bischoff 25 | */ 26 | class Ut2004 extends Unreal2 27 | { 28 | 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'ut2004'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Unreal Tournament 2004"; 42 | } 43 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Valheim.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Valheim Protocol Class 23 | * 24 | * @package GameQ\Protocols 25 | */ 26 | class Valheim extends Source 27 | { 28 | /** 29 | * String name of this protocol class 30 | * 31 | * @type string 32 | */ 33 | protected $name = 'valheim'; 34 | 35 | /** 36 | * Longer string name of this protocol class 37 | * 38 | * @type string 39 | */ 40 | protected $name_long = "Valheim"; 41 | 42 | /** 43 | * query_port = client_port + 1 44 | * 45 | * @type int 46 | */ 47 | protected $port_diff = 1; 48 | } 49 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Vrising.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * V Rining Protocol Class 23 | * 24 | * @package GameQ\Protocols 25 | */ 26 | class Vrising extends Source 27 | { 28 | /** 29 | * String name of this protocol class 30 | * 31 | * @type string 32 | */ 33 | protected $name = 'vrising'; 34 | 35 | /** 36 | * Longer string name of this protocol class 37 | * 38 | * @type string 39 | */ 40 | protected $name_long = "V Rising"; 41 | 42 | /** 43 | * query_port = client_port + 1 44 | * 45 | * @type int 46 | */ 47 | protected $port_diff = 1; 48 | } 49 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Warsow.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | use GameQ\Buffer; 22 | use GameQ\Result; 23 | 24 | /** 25 | * Warsow Protocol Class 26 | * 27 | * @package GameQ\Protocols 28 | * @author Austin Bischoff 29 | */ 30 | class Warsow extends Quake3 31 | { 32 | /** 33 | * String name of this protocol class 34 | * 35 | * @type string 36 | */ 37 | protected $name = 'warsow'; 38 | 39 | /** 40 | * Longer string name of this protocol class 41 | * 42 | * @type string 43 | */ 44 | protected $name_long = "Warsow"; 45 | 46 | /** 47 | * The client join link 48 | * 49 | * @type string 50 | */ 51 | protected $join_link = "warsow://%s:%d/"; 52 | 53 | /** 54 | * Handle player info, different than quake3 base 55 | * 56 | * @param Buffer $buffer 57 | * 58 | * @return array 59 | * @throws \GameQ\Exception\Protocol 60 | */ 61 | protected function processPlayers(Buffer $buffer) 62 | { 63 | // Set the result to a new result instance 64 | $result = new Result(); 65 | 66 | // Loop until we are out of data 67 | while ($buffer->getLength()) { 68 | // Make a new buffer with this block 69 | $playerInfo = new Buffer($buffer->readString("\x0A")); 70 | 71 | // Add player info 72 | $result->addPlayer('frags', $playerInfo->readString("\x20")); 73 | $result->addPlayer('ping', $playerInfo->readString("\x20")); 74 | 75 | // Skip first " 76 | $playerInfo->skip(1); 77 | 78 | // Add player name, encoded 79 | $result->addPlayer('name', utf8_encode(trim(($playerInfo->readString('"'))))); 80 | 81 | // Skip space 82 | $playerInfo->skip(1); 83 | 84 | // Add team 85 | $result->addPlayer('team', $playerInfo->read()); 86 | 87 | // Clear 88 | unset($playerInfo); 89 | } 90 | 91 | // Clear 92 | unset($buffer); 93 | 94 | return $result->fetch(); 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Won.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * World Opponent Network (WON) class 23 | * 24 | * Pre-cursor to the A2S (source) protocol system 25 | * 26 | * @author Nikolay Ipanyuk 27 | * @author Austin Bischoff 28 | * 29 | * @package GameQ\Protocols 30 | */ 31 | class Won extends Source 32 | { 33 | 34 | /** 35 | * Array of packets we want to look up. 36 | * Each key should correspond to a defined method in this or a parent class 37 | * 38 | * @type array 39 | */ 40 | protected $packets = [ 41 | self::PACKET_DETAILS => "\xFF\xFF\xFF\xFFdetails\x00", 42 | self::PACKET_PLAYERS => "\xFF\xFF\xFF\xFFplayers", 43 | self::PACKET_RULES => "\xFF\xFF\xFF\xFFrules", 44 | ]; 45 | 46 | /** 47 | * The query protocol used to make the call 48 | * 49 | * @type string 50 | */ 51 | protected $protocol = 'won'; 52 | 53 | /** 54 | * String name of this protocol class 55 | * 56 | * @type string 57 | */ 58 | protected $name = 'won'; 59 | 60 | /** 61 | * Longer string name of this protocol class 62 | * 63 | * @type string 64 | */ 65 | protected $name_long = "World Opponent Network"; 66 | } 67 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Wurm.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Wurm Unlimited Protocol Class 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Wurm extends Source 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'wurm'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Wurm Unlimited"; 42 | } 43 | -------------------------------------------------------------------------------- /php-query/gameq/Protocols/Zomboid.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | namespace GameQ\Protocols; 20 | 21 | /** 22 | * Project Zomboid Protocol Class 23 | * 24 | * @package GameQ\Protocols 25 | * @author Austin Bischoff 26 | */ 27 | class Zomboid extends Source 28 | { 29 | /** 30 | * String name of this protocol class 31 | * 32 | * @type string 33 | */ 34 | protected $name = 'zomboid'; 35 | 36 | /** 37 | * Longer string name of this protocol class 38 | * 39 | * @type string 40 | */ 41 | protected $name_long = "Project Zomboid"; 42 | } 43 | -------------------------------------------------------------------------------- /php-query/gameq/functions.php: -------------------------------------------------------------------------------- 1 | "; 10 | $data .= ""; 11 | foreach($player_list as $id => $player) 12 | { 13 | $maxcount = 0; 14 | foreach($player as $td => $column) 15 | { 16 | if($column != null) 17 | { 18 | $sub = substr($td,0,3); 19 | if($td == 'time' || $td == 'gq_time'){ 20 | $time = $player['time']; 21 | $hours = ((int)($time/3600)); 22 | $mins = ((int)($time/60))-($hours*60); 23 | $secs = ((int)($time)) - ($mins*60) - ($hours*3600); 24 | if ($hours <= 9) $hours= "0".$hours; 25 | if ($mins <= 9) $mins= "0".$mins; 26 | if ($secs <= 9) $secs= "0".$secs; 27 | $player_list[$id][$td] = @$hours.":".@$mins.":".@$secs; 28 | } 29 | if($sub == "gq_"){ 30 | $player_list[$id][substr($td,3)] = $column; 31 | unset($player_list[$id][$td]); 32 | } 33 | } 34 | else 35 | unset($player_list[$id][$td]); 36 | if(isset($player_list[$id][$td])) 37 | $maxcount++; 38 | } 39 | if($max < $maxcount) 40 | { 41 | $max = $maxcount; 42 | $maxid = $id; 43 | } 44 | } 45 | 46 | foreach($player_list[$maxid] as $td => $column) 47 | { 48 | if($column != "" ) 49 | { 50 | if($td == "name") $td = "player_name"; 51 | $data .= "".get_lang($td).""; 52 | $tdcount++; 53 | } 54 | } 55 | $data .= ""; 56 | $data .= ""; 57 | foreach ( $player_list as $player ){ 58 | $data .= ""; 59 | foreach($player_list[$maxid] as $maxtd => $maxcolumn) 60 | { 61 | if(isset($player[$maxtd])) 62 | $data .= "".htmlentities($player[$maxtd]).""; 63 | else 64 | $data .= " "; 65 | } 66 | $data .= ""; 67 | } 68 | $data .= "".get_lang('players').": " . $numplayers."/".$numplayersmax . ""; 69 | $data .= ""; 70 | return $data; 71 | } 72 | ?> 73 | -------------------------------------------------------------------------------- /php-query/gameq/gameq_feed.php: -------------------------------------------------------------------------------- 1 | 99999 || $q_port < 1024) 20 | { 21 | echo "FAILURE"; return; 22 | } 23 | 24 | if (preg_match("/[^0-9a-z\.\-\[\]\:]/i", $ip)) 25 | { 26 | echo "FAILURE"; return; 27 | } 28 | 29 | /* $lgsl_protocol_list = lgsl_protocol_list(); 30 | 31 | if (!isset($lgsl_protocol_list[$type])) 32 | { 33 | echo "FAILURE"; return; 34 | } */ 35 | 36 | //------------------------------------------------------------------------------------------------------------+ 37 | // FILTER HOSTNAME AND IP FORMATS THAT PHP ACCEPTS BUT ARE NOT WANTED 38 | if (preg_match("/(\[[0-9a-z\:]+\])/iU", $ip, $match)) { $ip = $match[1]; } 39 | elseif (preg_match("/([0-9a-z\.\-]+)/i", $ip, $match)) { $ip = $match[1]; } 40 | 41 | //------------------------------------------------------------------------------------------------------------+ 42 | // QUERY SERVER 43 | $gq = new \GameQ\GameQ(); 44 | $server = array( 45 | 'id' => 'server', 46 | 'type' => $type, 47 | 'host' => $ip . ":" . $q_port, 48 | ); 49 | $gq->addServer($server); 50 | $gq->setOption('timeout', 1); 51 | $gq->setOption('debug', FALSE); 52 | $gq->addFilter('normalise'); 53 | $results = $gq->process(); 54 | 55 | //------------------------------------------------------------------------------------------------------------+ 56 | // SERIALIZED OUTPUT 57 | echo "_SGAMEQF_".serialize($results['server'])."_SGAMEQF_"; 58 | return; 59 | -------------------------------------------------------------------------------- /systemd/ogp_agent.service: -------------------------------------------------------------------------------- 1 | # ogp_agent systemd Service Script 2 | # By Open Game Panel 3 | # OGP 4 | [Unit] 5 | Description=Open Game Panel (OGP) Daemon www.opengamepanel.org 6 | After=network.target 7 | 8 | [Service] 9 | Type=oneshot 10 | ExecStart=/bin/sh -c "{OGP_AGENT_PATH}/ogp_agent_init start" 11 | ExecStop=/bin/sh -c "{OGP_AGENT_PATH}/ogp_agent_init stop" 12 | RemainAfterExit=yes 13 | PIDFile="{OGP_AGENT_PATH}/ogp_agent_run.pid" 14 | 15 | [Install] 16 | WantedBy=multi-user.target 17 | --------------------------------------------------------------------------------