Ejemplo n.º 1
0
            break;
        }
        $players = getPlayersOnPage($response, $players, $limit, $online);
        // __VIEWSTATE and __EVENTVALIDATION are not updated as inputs, rather some weird format I don't recognize
        preg_match('#\\|__VIEWSTATE\\|(.*?)\\|.*\\|__EVENTVALIDATION\\|(.*?)\\|#', $response, $inputs);
        $nextPost = array('__VIEWSTATE' => $inputs[1], '__EVENTVALIDATION' => $inputs[2], '__ASYNCPOST' => 'true', 'ctl00$cphRoblox$rbxGroupRoleSetMembersPane$currentRoleSetID' => $role, 'ctl00$cphRoblox$rbxGroupRoleSetMembersPane$dlUsers_Footer$ctl01$HiddenInputButton' => '', 'ctl00$cphRoblox$rbxGroupRoleSetMembersPane$dlUsers_Footer$ctl01$PageTextBox' => $i + 1);
        curl_setopt_array($curl, array(CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_POSTFIELDS => $nextPost));
        $response = curl_exec($curl);
    }
    if (!$raw) {
        echo 'Get time: ' . (time() - $start) . ' seconds<br>Players: ' . count($players) . '<br><br>';
    }
    return $players;
}
if (array_key_exists('group', $_GET)) {
    $group = $_GET['group'];
    list($ranks, $roles) = getRoleSets($group);
}
if (array_key_exists('getAll', $_GET)) {
    $group = $_GET['getAll'];
    list($ranks, $roles) = getRoleSets($_GET['getAll']);
    $all = array();
    foreach ($ranks as $rank => $id) {
        $all = array_merge($all, getPlayers($ranks, $raw, $group, $rank, $limit, $online));
    }
    echo json_encode($all);
} else {
    if (array_key_exists('rank', $_GET)) {
        echo json_encode(getPlayers($ranks, $raw, $group, $_GET['rank'], $limit, $online));
    }
}
         </td>
         </tr></table>
 		<span class="clear"><!-- --></span>
 		<br />
 				
 		<center>
 			<?php 
 $bar_width = "273px";
 $bar_height = "20px";
 $ally_img = "wow/static/images/services/status/ally.png";
 $horde_img = "wow/static/images/services/status/horde.png";
 //Show percent online (true = yes, false = no)
 $show_percent = true;
 $alliance = array("1", "3", "4", "7", "11", "22");
 $horde = array("2", "5", "6", "8", "9", "10");
 $p = @getPlayers($server_cdb);
 $a = @doFaction($server_cdb, $alliance);
 $h = @doFaction($server_cdb, $horde);
 $ap = @percent($a, $p);
 $hp = @percent($h, $p);
 $b = @barWidth($a, $p, 273);
 $c = @barWidth($h, $p, 273);
 echo "<a data-tooltip='" . doFaction($server_cdb, $alliance) . " <font style=\"color:#3399ff;font-weight:bold;\">" . $Status['Ali'] . "</font> <small>" . $Status['PlOnLine'] . "</small>'\\><div style=\"width:" . $bar_width . ";height:" . $bar_height . ";\">\n    \t\t\t<div style=\"float:left;text-align:right;background:url(./" . $ally_img . ");width:" . $b . "px;height:20px;\">";
 if ($show_percent) {
     echo "<font style=\"color:#FFFFFF;font-weight:bold;\"><center>{$ap}%</center></font></a>";
 }
 echo "<a data-tooltip='" . doFaction($server_cdb, $horde) . " <font style=\"color:#ff3333;font-weight:bold;\">" . $Status['Horde'] . "</font> <small>" . $Status['PlOnLine'] . "</small>'\\></div>\n    \t\t\t<div style=\"float:right;text-align:left;background:url(./" . $horde_img . ");background-position:right;width:" . $c . "px;height:20px;\">";
 if ($show_percent) {
     echo "<font style=\"color:#FFFFFF;font-weight:bold;\"><center>{$hp}%</center></font></a>";
 }
 echo "</div>\n    \t\t\t</div>";
		    <div class="row">
		     	<?php 
require_once 'admin_nav.php';
?>
		        <div class="col-md-5">
		            <div class="container-fluid" id ="games_container" style="display:show">
						<table class="table table-condensed table-hover" id="games_head">
							<thead>
								<tr class = "table_headers">
									<th>Last</th>
									<th>First</th>												
								</tr>
							</thead>
							<tbody id="games_body">
								<?php 
getPlayers();
?>
						  	</tbody>						
			  			</table>
					</div>
		        </div>
		    </div>
		</div>
			
		<!--js-->
		<script src="https://code.jquery.com/jquery.js"></script>
	    <script src="assets/js/bootstrap.min.js"></script>

	</body>
</html>
Ejemplo n.º 4
0
<?php

require "../php/header.php";
ob_start();
$name = $HTTP_GET_VARS['name'];
if ($name == null) {
    header("Location: index.php");
    exit;
}
openDatabase(false);
$players = getPlayers($name, 50);
if (count($players) == 1) {
    if (getPid($name) != 0) {
        header("Location: playerinfo.php?name=" . urlencode($name));
        closeDatabase();
        exit;
    }
}
ob_end_flush();
$html_title = "WinBolo.net: Search Results for {$name}";
include "{$BASE_FILES}/inc_top.php";
$error_heading = "Search Results";
if (count($players) == 0) {
    $error_body = "Sorry, no matches to your query.";
} else {
    $error_body = "Search Results (Limit 50 matches)<P>";
    $count = 0;
    while ($count < count($players)) {
        $error_body .= "<a href=\"playerinfo.php?name=" . urlencode($players[$count]) . "\">" . $players[$count] . "</A><BR>";
        $count++;
    }
Ejemplo n.º 5
0
     }
 } else {
     if ($playerA != "") {
         if (getPid($playerA) != 0) {
             $listA = array();
             $listA[0] = $playerA;
         } else {
             $listA = getPlayers($playerA, 50);
         }
     }
     if ($playerB != "") {
         if (getPid($playerB) != 0) {
             $listB = array();
             $listB[0] = $playerB;
         } else {
             $listB = getPlayers($playerB, 50);
         }
     }
 }
 if (sizeof($listA) == 1 && sizeof($listB) == 1) {
     if ($listA[0] == $playerA && $listB[0] == $playerB) {
         #We have found a match
         $found = true;
         if ($isTeam == true) {
             $idA = getTid($listA[0]);
             $idB = getTid($listB[0]);
         } else {
             $idA = getPid($listA[0]);
             $idB = getPid($listB[0]);
         }
         $scoreA = getScore($idA, $gt, $isTeam);
Ejemplo n.º 6
0
$gameId = $_POST['gameId'];
/*get game id*/
$message = array();
/*message to be returned*/
/*validate ip is associated with a user*/
$message['AllPlayersInfo'] = null;
$message['AllPlayerMarkers'] = null;
$message['AllItems'] = null;
/*Verify the game exists*/
if (IsGameInDb($gameId) == true) {
    $activeItems = GetActiveItems($gameId);
    /*get the items in game*/
    while ($r = $activeItems->fetch_assoc()) {
        $message['AllItems'][] = $r;
    }
    $Players = getPlayers($gameId);
    /*get all players in the game*/
    while ($r = $Players->fetch_assoc()) {
        $message['AllPlayerMarkers'][] = $r;
        $items = GetPlayersItems($gameId, $r["PlayerId"]);
        /*get the Players picked up items*/
        $itemArray = array();
        $itemArray["items"] = null;
        while ($row = $items->fetch_assoc()) {
            $itemArray["items"][] = $row;
        }
        $itemArray["gold"] = GetPlayersGold($gameId, $r["PlayerId"]);
        $message['AllPlayersInfo'][] = $itemArray;
    }
}
echo json_encode($message);
Ejemplo n.º 7
0
    $fetch = getPlayers();
    while ($array2 = $fetch->fetch(PDO::FETCH_NUM)) {
        $html .= '<tr><td><div align="center"><small>' . $array2[0] . '</small></div></td>';
        if ($array2[1] == 0) {
            $html .= '<td><div align="center"><small>0</small></div></td>';
        } else {
            $html .= '<td><div align="center"><small>' . $array2[1] . '</small></div></td>';
        }
    }
    $html .= '</tr>';
    $html .= '</table>';
    $cache->create_cache('top_vote', $html);
} elseif (!$cache->verifTime('top_vote')) {
    $cache->destroy_cache('top_vote');
    $html = '<table width="100%"><tr><th>Nom</th><th>Points</th></tr>';
    $fetch = getPlayers();
    while ($array2 = $fetch->fetch(PDO::FETCH_NUM)) {
        $html .= '<tr><td><div align="center"><small>' . $array2[0] . '</small></div></td>';
        if ($array2[1] == 0) {
            $html .= '<td><div align="center"><small>0</small></div></td>';
        } else {
            $html .= '<td><div align="center"><small>' . $array2[1] . '</small></div></td>';
        }
    }
    $html .= '</tr>';
    $html .= '</table>';
    $cache->create_cache('top_vote', $html);
} else {
    $html = $cache->get_cache('top_vote');
}
include './modules/interactif/html/top_vote.php';
Ejemplo n.º 8
0
        foreach ($seasoning as $season) {
            $response = file_get_contents("https://api.fantasydata.net/{$league}/v2/JSON/Games/{$season}", false, $context);
            $data = json_decode($response);
            foreach ($data as $game) {
                $badDate = str_replace("T", " ", $game->DateTime);
                if (empty($badDate) === false) {
                    $teamChavez = Team::getTeamByTeamApiId($pdo, $game->AwayTeamID);
                    $teamPaul = Team::getTeamByTeamApiId($pdo, $game->HomeTeamID);
                    if ($teamChavez !== null && $teamPaul !== null) {
                        $gameToInsert = new Game(null, $teamChavez->getTeamId(), $teamPaul->getTeamId(), $badDate);
                        $gameToInsert->insert($pdo);
                    } else {
                        echo "<p>* * * SIX OF THIRTEEN SKIPPED THIS GAME * * *</p>" . PHP_EOL;
                    }
                }
            }
        }
    } catch (Exception $exception) {
        echo "Something went wrong: " . $exception->getMessage() . PHP_EOL;
    } catch (TypeError $typeError) {
        echo "Something went wrong: " . $typeError->getMessage() . PHP_EOL;
    }
}
$sportLeagues = ["NHL", "NBA", "MLB"];
$pdo = connectToEncryptedMySQL("/etc/apache2/capstone-mysql/sprots.ini");
foreach ($sportLeagues as $sportLeague) {
    $sport = Sport::getSportBySportLeague($pdo, $sportLeague);
    getTeams($sportLeague, $sport->getSportId());
    getGames($sportLeague);
    getPlayers($sportLeague);
}
Ejemplo n.º 9
0
<?php

if ($_SERVER["REQUEST_METHOD"] == "GET") {
    $gameid = $_GET["gameid"];
    $uuid = $_GET["uuid"];
    getPlayers($gameid, $uuid);
}
function getPlayers($gameid, $uuid)
{
    $servername = "localhost";
    $username = "******";
    $password = "";
    $dbname = "mafia";
    $conn = new PDO("mysql:host={$servername};dbname={$dbname}", $username, $password);
    $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    $sql = "SELECT name, status FROM mafia WHERE gameid = '{$gameid}'";
    $i = 1;
    foreach ($conn->query($sql) as $row) {
        $status = "";
        if ($row['status'] == 0) {
            $status = "Waiting";
        } else {
            $status = "Game Starting";
        }
        echo $i . ": " . $row['name'] . " | Status: " . $status . "<br />";
        $i++;
    }
    $conn = null;
    if ($status == "Game Starting") {
        echo "<a href='game.php?uuid=" . $uuid . "&gameid={$gameid}'><button>Start Game</button></a>";
    }
Ejemplo n.º 10
0
function requstGameList($Hash, $timestamp, $Lad, $Type = 0)
{
    $once = false;
    $uno = false;
    $up = 0;
    include "conf.php";
    $conn = new mysqli($serverip, $username, $password, $dbname, $Port);
    if ($conn->connect_error) {
        die("Connection failed: " . $conn->connect_error);
    }
    $hash = mysqli_escape_string($conn, $Hash);
    $lad = mysqli_escape_string($conn, $Lad);
    $type = mysqli_escape_string($conn, $Type);
    $UserQuerry = "SELECT * from user where hash = '{$hash}'";
    $UserResult = $conn->query($UserQuerry);
    if ($UserResult->num_rows > 0) {
        while ($UserRow = $UserResult->fetch_assoc()) {
            if ($once == false) {
                $BanCheckQuerrt = "SELECT * from hwid where id = '" . $UserRow['id'] . "'";
                $BanCheckResult = $conn->query($BanCheckQuerrt);
                while ($BanCheckRow = $BanCheckResult->fetch_assoc()) {
                    if ((int) $BanCheckRow['banned'] == 0) {
                        //Ping($hash, $timestamp, 0);
                        $gameResult = $conn->query("SELECT * from games where BotGame = '{$type}' AND ladder = '{$lad}'");
                        if ($gameResult->num_rows > 0) {
                            while ($GameRow = $gameResult->fetch_assoc()) {
                                $PlayerResult = $conn->query("SELECT * from players where GameID = '" . $GameRow['id'] . "'");
                                if ($PlayerResult->num_rows < 8) {
                                    $up = (int) $GameRow['created'] - $timestamp;
                                    echo encrypt($GameRow['id'] . "■" . $GameRow['Game'] . "■" . $GameRow['Password'] . "■" . $GameRow['Description'] . "■" . $GameRow['Difficulty'] . "■" . $GameRow['Realm'] . "■" . $up . "■" . getPlayers($GameRow['id'], $conn, 2) . "|");
                                }
                            }
                        } else {
                            printf(encrypt(",,,,,,,,"));
                        }
                    } else {
                        printf(encrypt("Banned"));
                    }
                }
            }
        }
    } else {
        echo encrypt("No hash");
        return;
    }
    $conn->close();
}
Ejemplo n.º 11
0
    }
    $sql = "SELECT * FROM `fixtures` WHERE gameweek > " . $currentGW . "";
    $result = $conn->query($sql);
    $jsonData = array();
    while ($array = $result->fetch_row()) {
        $obj = new Fixture($array[0], getManagerForId($array[1]), getManagerForId($array[2]), $array[3]);
        $jsonData[] = $obj;
    }
    return $jsonData;
}
// get player info http://fantasy.premierleague.com/web/api/elements/217  with the last being an id
//routing
if (isset($_GET["q"])) {
    switch ($_GET["q"]) {
        case 'getPlayers':
            echo json_encode(getPlayers());
            break;
        case 'getGWTeam':
            getCurrentGameWeek(78479);
            echo json_encode(getGWTeam($_GET["tid"]));
            break;
        case 'getAllGWTeams':
            getCurrentGameWeek(78479);
            echo json_encode(getAllGWTeams($_GET["uid"]));
            break;
        case 'getTournamentTable':
            echo json_encode(getLeagueStandings(78479));
            break;
        case 'getSessionId':
            echo session_id();
            break;