Skip to content

Update GameMEAPI-php #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
gameME SDK
Webpage: http://www.gameme.com
Docs: http://www.gameme.com/docs/api/sdk
Copyright (C) 2011-2015 TTS Oetzel & Goerz GmbH
Webpage: https://www.gameme.com
Docs: https://www.gameme.com/docs/api/sdk
Copyright (C) 2011-2018 TTS Oetzel & Goerz GmbH

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
Expand Down
20 changes: 20 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "gamemedev/gamemeapi",
"version": "0.2",
"description": "",
"license": "GPL-2.0",
"authors": [
{
"name": "TTS Oetzel & Goerz GmbH",
"email": "info@gameme.com"
}
],
"require":{
"php": ">=5.5"
},
"autoload": {
"psr-4": {
"GameMEAPI\\": "src/"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
<?php
/**
* gameME SDK
* Webpage: http://www.gameme.com
* Docs: http://www.gameme.com/docs/api/sdk
* Copyright (C) 2011-2015 TTS Oetzel & Goerz GmbH
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*
* All API results are limited to personal, non-commercial use only
* Copyright(C) gameME 2011-2013 TTS Oetzel & Goerz GmbH. All rights reserved.
*/
require("gameme_api_sdk.php");
$gameME_sdk_object = new gameMEAPI(YOUR_URL_HERE);
$current_slots = 0;
$maximum_slots = 0;
$current_bots = 0;
$total_servers = 0;
try {
$server_list = $gameME_sdk_object->client_api_serverlist(GAMEME_FILTER_NONE);
foreach($server_list['serverlist'] as $server) {
$current_slots += $server['act'];
$current_bots += $server['bots'];
$maximum_slots += $server['max'];
$total_servers++;
}
} catch (Exception $e) {
die ("Client API Serverlist Error: ".$e->getMessage()."\n");
}
print "Currently ".$current_slots."/".$maximum_slots." players (".$current_bots." bots) on ".$total_servers." gameservers\n";
<?php

/**
* gameME SDK
* Webpage: http://www.gameme.com
* Docs: http://www.gameme.com/docs/api/sdk
* Copyright (C) 2011-2015 TTS Oetzel & Goerz GmbH
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*
* All API results are limited to personal, non-commercial use only
* Copyright(C) gameME 2011-2013 TTS Oetzel & Goerz GmbH. All rights reserved.
*/

require __DIR__ .'vendor/autoload.php';
$gameME_sdk_object = new \GameMEAPI\gameMEAPI(YOUR_URL_HERE);

$current_slots = 0;
$maximum_slots = 0;
$current_bots = 0;
$total_servers = 0;
try {

$server_list = $gameME_sdk_object->client_api_serverlist(GAMEME_FILTER_NONE);
foreach($server_list['serverlist'] as $server) {
$current_slots += $server['act'];
$current_bots += $server['bots'];
$maximum_slots += $server['max'];
$total_servers++;
}

} catch (Exception $e) {
die ("Client API Serverlist Error: ".$e->getMessage()."\n");
}

print "Currently ".$current_slots."/".$maximum_slots." players (".$current_bots." bots) on ".$total_servers." gameservers\n";


?>
Original file line number Diff line number Diff line change
@@ -1,42 +1,40 @@
<?php

/**
* gameME SDK
* Webpage: http://www.gameme.com
* Docs: http://www.gameme.com/docs/api/sdk
* Copyright (C) 2011-2015 TTS Oetzel & Goerz GmbH
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*
* All API results are limited to personal, non-commercial use only
* Copyright(C) gameME 2011-2013 TTS Oetzel & Goerz GmbH. All rights reserved.
*/

require("gameme_api_sdk.php");
$gameME_sdk_object = new gameMEAPI(YOUR_URL_HERE);

try {

$server_list = $gameME_sdk_object->client_api_serverlist(GAMEME_FILTER_NONE);
foreach($server_list['serverlist'] as $server) {
echo $server['name']." ".$server['act']."/".$server['max']." - ".$server['map']."\n";
}

} catch (Exception $e) {
die ("Client API Serverlist Error: ".$e->getMessage()."\n");
}

<?php

/**
* gameME SDK
* Webpage: http://www.gameme.com
* Docs: http://www.gameme.com/docs/api/sdk
* Copyright (C) 2011-2015 TTS Oetzel & Goerz GmbH
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*
* All API results are limited to personal, non-commercial use only
* Copyright(C) gameME 2011-2013 TTS Oetzel & Goerz GmbH. All rights reserved.
*/

require __DIR__ .'vendor/autoload.php';
$gameME_sdk_object = new \GameMEAPI\gameMEAPI(YOUR_URL_HERE);

try {
$server_list = $gameME_sdk_object->client_api_serverlist(GAMEME_FILTER_NONE);
foreach($server_list['serverlist'] as $server) {
echo $server['name']." ".$server['act']."/".$server['max']." - ".$server['map']."\n";
}
} catch (Exception $e) {
die ("Client API Serverlist Error: ".$e->getMessage()."\n");
}

?>
Loading