Ejemplo n.º 1
0
function GetInfoForHigestPlayer($gameId)
{
    $message = array();
    /*message to be returned*/
    $r = GetHighScoreInGame($gameId, 1);
    $message["Gold"] = $r["Gold"];
    $message["name"] = GetPlayersName($r["PlayerId"]);
    /*get name stuff here */
    return $message;
}
Ejemplo n.º 2
0
<?php

include 'functions.php';
$message = array();
/*message to be returned*/
$gameId = $_POST['gameId'];
/*the game being played */
$results = GetGameResults($gameId);
while ($r = $results->fetch_assoc()) {
    $row = array();
    $row["Name"] = GetPlayersName($r["PlayerId"]);
    $row["Gold"] = $r["Gold"];
    $message['Results'][] = $row;
}
echo json_encode($message);
/*return the message as ajson encoded object*/