Пример #1
0
<?php

// ENREGISTREMENT
if (isset($_POST['savegameinfos'])) {
    // Variables
    $struct = AdminServ::getGameInfosStructFromPOST();
    // Requêtes
    if (!$client->query('SetGameInfos', $struct) && $client->getErrorMessage() != 'Script not allowed for this title.') {
        AdminServ::error();
    } else {
        // Team info
        if (SERVER_VERSION_NAME == 'ManiaPlanet' && isset($_POST['teamInfo1Name'])) {
            $team1 = array('name' => $_POST['teamInfo1Name'], 'color' => $_POST['teamInfo1Color'], 'colorhex' => $_POST['teamInfo1ColorHex'], 'country' => $_POST['teamInfo1Country']);
            $team2 = array('name' => $_POST['teamInfo2Name'], 'color' => $_POST['teamInfo2Color'], 'colorhex' => $_POST['teamInfo2ColorHex'], 'country' => $_POST['teamInfo2Country']);
            AdminServ::setTeamInfo($team1, $team2);
        }
        // RoundCustomPoints
        if (isset($_POST['NextRoundCustomPoints']) && $_POST['NextRoundCustomPoints'] != null) {
            $NextRoundCustomPoints = explode(',', $_POST['NextRoundCustomPoints']);
            $NextRoundCustomPointsArray = array();
            if (count($NextRoundCustomPoints) > 0) {
                foreach ($NextRoundCustomPoints as $point) {
                    $NextRoundCustomPointsArray[] = intval(trim($point));
                }
            }
            if (!$client->query('SetRoundCustomPoints', $NextRoundCustomPointsArray)) {
                AdminServ::error();
            }
        }
        // MatchSettings
        if (SERVER_MATCHSET) {