当前位置: 首页>>代码示例>>PHP>>正文


PHP TimeDate::secToMillisec方法代码示例

本文整理汇总了PHP中TimeDate::secToMillisec方法的典型用法代码示例。如果您正苦于以下问题:PHP TimeDate::secToMillisec方法的具体用法?PHP TimeDate::secToMillisec怎么用?PHP TimeDate::secToMillisec使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TimeDate的用法示例。


在下文中一共展示了TimeDate::secToMillisec方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getGameInfosStructFromPOST

 /**
  * Retourne la structure pour l'enregistrement des informations de jeu
  *
  * @return array
  */
 public static function getGameInfosStructFromPOST()
 {
     if ($_POST['NextFinishTimeoutValue'] < 2) {
         if ($_POST['NextFinishTimeout'] == 0) {
             $FinishTimeout = 0;
         } else {
             if ($_POST['NextFinishTimeout'] == 1) {
                 $FinishTimeout = 1;
             }
         }
     } else {
         $FinishTimeout = TimeDate::secToMillisec(intval($_POST['NextFinishTimeoutValue']));
     }
     if (array_key_exists('NextDisableRespawn', $_POST) === true) {
         $DisableRespawn = false;
     } else {
         $DisableRespawn = true;
     }
     if ($_POST['NextForceShowAllOpponentsValue'] < 2) {
         if ($_POST['NextForceShowAllOpponents'] == 0) {
             $NextForceShowAllOpponents = 0;
         } else {
             if ($_POST['NextForceShowAllOpponents'] == 1) {
                 $NextForceShowAllOpponents = 1;
             }
         }
     } else {
         $NextForceShowAllOpponents = intval($_POST['NextForceShowAllOpponentsValue']);
     }
     $out = array('GameMode' => intval($_POST['NextGameMode']), 'ChatTime' => TimeDate::secToMillisec(intval($_POST['NextChatTime'] - 8)), 'RoundsPointsLimit' => intval($_POST['NextRoundsPointsLimit']), 'RoundCustomPoints' => intval($_POST['NextRoundCustomPoints']), 'RoundsUseNewRules' => array_key_exists('NextRoundsUseNewRules', $_POST), 'RoundsForcedLaps' => intval($_POST['NextRoundsForcedLaps']), 'RoundsPointsLimitNewRules' => intval($_POST['NextRoundsPointsLimit']), 'TimeAttackLimit' => TimeDate::secToMillisec(intval($_POST['NextTimeAttackLimit'])), 'TimeAttackSynchStartPeriod' => TimeDate::secToMillisec(intval($_POST['NextTimeAttackSynchStartPeriod'])), 'TeamPointsLimit' => intval($_POST['NextTeamPointsLimit']), 'TeamMaxPoints' => intval($_POST['NextTeamMaxPoints']), 'TeamUseNewRules' => array_key_exists('NextTeamUseNewRules', $_POST), 'TeamPointsLimitNewRules' => intval($_POST['NextTeamPointsLimit']), 'LapsNbLaps' => intval($_POST['NextLapsNbLaps']), 'LapsTimeLimit' => TimeDate::secToMillisec(intval($_POST['NextLapsTimeLimit'])), 'FinishTimeout' => $FinishTimeout, 'AllWarmUpDuration' => intval($_POST['NextAllWarmUpDuration']), 'DisableRespawn' => $DisableRespawn, 'ForceShowAllOpponents' => $NextForceShowAllOpponents, 'CupPointsLimit' => intval($_POST['NextCupPointsLimit']), 'CupRoundsPerMap' => intval($_POST['NextCupRoundsPerMap']), 'CupNbWinners' => intval($_POST['NextCupNbWinners']), 'CupWarmUpDuration' => intval($_POST['NextCupWarmUpDuration']));
     if (SERVER_VERSION_NAME != 'TmForever') {
         $out += array('ScriptName' => $_POST['NextScriptName']);
     }
     return $out;
 }
开发者ID:keverage,项目名称:adminserv,代码行数:40,代码来源:adminserv.php

示例2: array

if (isset($_POST['savematchsetting']) && isset($_SESSION['adminserv']['matchset_maps_selected'])) {
    // Filename
    $matchSettingName = Str::replaceChars($_POST['matchSettingName']);
    $filename = $data['mapsDirectoryPath'] . $args['directory'] . $matchSettingName;
    if (File::getExtension($matchSettingName) != 'txt') {
        $filename .= '.txt';
    }
    $struct = array();
    // Gameinfos
    $gameinfos = AdminServ::getGameInfosStructFromPOST();
    $struct['gameinfos'] = array('game_mode' => $gameinfos['GameMode'], 'chat_time' => $gameinfos['ChatTime'], 'finishtimeout' => $gameinfos['FinishTimeout'], 'allwarmupduration' => $gameinfos['AllWarmUpDuration'], 'disablerespawn' => $gameinfos['DisableRespawn'], 'forceshowallopponents' => $gameinfos['ForceShowAllOpponents'], 'rounds_pointslimit' => $gameinfos['RoundsPointsLimit'], 'rounds_custom_points' => $gameinfos['RoundCustomPoints'], 'rounds_usenewrules' => $gameinfos['RoundsUseNewRules'], 'rounds_forcedlaps' => $gameinfos['RoundsForcedLaps'], 'rounds_pointslimitnewrules' => $gameinfos['RoundsPointsLimitNewRules'], 'team_pointslimit' => $gameinfos['TeamPointsLimit'], 'team_maxpoints' => $gameinfos['TeamMaxPoints'], 'team_usenewrules' => $gameinfos['TeamUseNewRules'], 'team_pointslimitnewrules' => $gameinfos['TeamPointsLimitNewRules'], 'timeattack_limit' => $gameinfos['TimeAttackLimit'], 'timeattack_synchstartperiod' => $gameinfos['TimeAttackSynchStartPeriod'], 'laps_nblaps' => $gameinfos['LapsNbLaps'], 'laps_timelimit' => $gameinfos['LapsTimeLimit'], 'cup_pointslimit' => $gameinfos['CupPointsLimit'], 'cup_roundsperchallenge' => $gameinfos['CupRoundsPerMap'], 'cup_nbwinners' => $gameinfos['CupNbWinners'], 'cup_warmupduration' => $gameinfos['CupWarmUpDuration']);
    if (SERVER_VERSION_NAME != 'TmForever') {
        $struct['gameinfos']['script_name'] = $gameinfos['ScriptName'];
    }
    // HotSeat
    $struct['hotseat'] = array('game_mode' => intval($_POST['hotSeatGameMode']), 'time_limit' => TimeDate::secToMillisec(intval($_POST['hotSeatTimeLimit'])), 'rounds_count' => intval($_POST['hotSeatCountRound']));
    // Filter
    $struct['filter'] = array('is_lan' => array_key_exists('filterIsLan', $_POST), 'is_internet' => array_key_exists('filterIsInternet', $_POST), 'is_solo' => array_key_exists('filterIsSolo', $_POST), 'is_hotseat' => array_key_exists('filterIsHotSeat', $_POST), 'sort_index' => intval($_POST['filterSortIndex']), 'random_map_order' => array_key_exists('filterRandomMaps', $_POST), 'force_default_gamemode' => intval($_POST['filterDefaultGameMode']));
    // ScriptSettings
    if (!$client->query('GetModeScriptInfo')) {
        AdminServ::error();
    } else {
        $scriptsettings = $client->getResponse();
        if (!empty($scriptsettings['ParamDescs'])) {
            foreach ($scriptsettings['ParamDescs'] as $param) {
                $struct['scriptsettings'][] = array('name' => $param['Name'], 'type' => $param['Type'], 'value' => $param['Default']);
            }
        }
    }
    // Maps
    $struct['startindex'] = 1;
开发者ID:keverage,项目名称:adminserv,代码行数:31,代码来源:maps-creatematchset.php


注:本文中的TimeDate::secToMillisec方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。