-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 1f61ee9
Showing
379 changed files
with
7,323 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
db.php | ||
killteamjson/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
$root = $_SERVER['DOCUMENT_ROOT']; | ||
require_once $root . '/include.php'; | ||
global $dbcon; | ||
|
||
header('Content-Type: application/json'); | ||
switch ($_SERVER['REQUEST_METHOD']) { | ||
case "GET": | ||
//Get the requested faction | ||
GETFaction(); | ||
break; | ||
default: | ||
//Invalid verb | ||
header('HTTP/1.0 500 Server Error - Invalid verb "' . $_SERVER['REQUEST_METHOD'] . '"'); | ||
die(); | ||
break; | ||
} | ||
|
||
function GETFaction() { | ||
// Get the requested faction id | ||
$factionid = $_REQUEST['factionid']; | ||
|
||
if ($factionid == null || $factionid == '') { | ||
// No faction id passed in, return all factions | ||
$factions = Faction::GetFactions(); | ||
echo json_encode($factions); | ||
} else { | ||
// Return the requested faction | ||
$faction = Faction::GetFaction($factionid); | ||
echo json_encode($faction); | ||
} | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
$root = $_SERVER['DOCUMENT_ROOT']; | ||
require_once $root . '/include.php'; | ||
global $dbcon; | ||
|
||
header('Content-Type: application/json'); | ||
switch ($_SERVER['REQUEST_METHOD']) { | ||
case "GET": | ||
//Get the requested thing | ||
GETID(); | ||
break; | ||
default: | ||
//Invalid verb | ||
header('HTTP/1.0 500 Server Error - Invalid verb "' . $_SERVER['REQUEST_METHOD'] . '"'); | ||
die(); | ||
break; | ||
} | ||
|
||
function GETID() { | ||
// Return a shortid | ||
$chars = ['B', 'C', 'D', 'F', 'G', 'H', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; | ||
|
||
$out = ''; | ||
$len = 10; | ||
$blocksize = 1000; | ||
|
||
for ($i = 0; $i < $len; $i++) { | ||
if ($i % $blocksize == 0 && $i > 0) { | ||
$out .= "-"; | ||
} | ||
$out .= $chars[rand(0, sizeof($chars) - 1)]; | ||
} | ||
|
||
echo $out; | ||
} | ||
|
||
?> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
$root = $_SERVER['DOCUMENT_ROOT']; | ||
require_once $root . '/include.php'; | ||
global $dbcon; | ||
|
||
header('Content-Type: application/json'); | ||
switch ($_SERVER['REQUEST_METHOD']) { | ||
case "GET": | ||
//Get the requested killteam | ||
GETKillteam(); | ||
break; | ||
default: | ||
//Invalid verb | ||
header('HTTP/1.0 500 Server Error - Invalid verb "' . $_SERVER['REQUEST_METHOD'] . '"'); | ||
die(); | ||
break; | ||
} | ||
|
||
function GETKillteam() { | ||
// Get the requested killteam id | ||
$killteamid = $_REQUEST['killteamid']; | ||
|
||
if ($killteamid == null || $killteamid == '') { | ||
// No killteam id passed in, return all killteams | ||
$killteams = Killteam::GetKillteams(); | ||
echo json_encode($killteams); | ||
} else { | ||
// Return the requested killteam | ||
$killteam = Killteam::GetKillteam($killteamid); | ||
echo json_encode($killteam); | ||
} | ||
} | ||
?> |
Oops, something went wrong.