Beispiel #1
0
 * @description invite_game.php
 */
$subjectIds = array();
$inviteSubject = new \Ss\Market\InviteSubject();
for ($i = 0; sizeof($subjectIds) < 5; $i++) {
    $id = rand(1, 15);
    if (in_array($id, $subjectIds)) {
        continue;
    } else {
        array_push($subjectIds, $id);
    }
}
$subjectContents = $inviteSubject->GetInviteSubjectArray($subjectIds);
$inviteParticipant = new \Ss\Market\InviteParticipant();
// 设置活动上限数为50个用户
if ($inviteParticipant->GetInviteParticipantArrayCount() >= 50) {
    $curStep = -1;
}
// 初始化流量
$gameResultGPRS = rand(0, 2048);
if ($curStep == 2 && !empty($_COOKIE['PUE'])) {
    $inviteParticipantData = $inviteParticipant->GetInviteParticipantArray(strval(base64_decode($_COOKIE['PUE'])));
    if ($inviteParticipantData['init_gprs'] == 0) {
        $inviteParticipant->UpdateInviteParticipantInitGPRS($gameResultGPRS, strval(base64_decode($_COOKIE['PUE'])));
    } else {
        $gameResultGPRS = $inviteParticipantData['init_gprs'];
    }
}
?>

    <?php