/**
  * voteMap()
  * Votemap
  * 
  * @param $cmdInfo - Command info
  * @return array - Status
  */
 public function voteMap($cmdInfo)
 {
     $return = array('code' => 'ERROR', 'message' => '');
     if (!$this->checkPollActive()) {
         if (!empty($cmdInfo['vars']) || $cmdInfo['vars'] != null) {
             $varsSplit = explode(' ', $cmdInfo['vars'], 2);
             if (!empty($varsSplit[0])) {
                 $result = searchMapKey($varsSplit[0]);
                 $mode = isset($varsSplit[1]) ? searchGameModeKey($varsSplit[1]) : 'gpm_sa';
                 if ($result != false) {
                     $mc = new GameMaps();
                     $mapName = $mc->getMapName($result);
                     $modeName = $mc->getGameMode(searchGameModeKey($mode));
                     $this->createPoll('cmdVotemapExec', $cmdInfo['origin']['nucleusId'], $cmdInfo['origin']['cdKeyHash'], array('map' => $result, 'map_name' => $mapName, 'gamemode' => searchGameModeKey($mode), 'gamemode_name' => $modeName));
                     $return['code'] = 'OK';
                     $this->ct->send('|ccc| Votemap poll created for map ' . $mapName . ' ' . $modeName . '. ' . $this->settings['tool_igcmds_votes'] . ' more votes needed. Type !yes to approve.');
                 } else {
                     $return['message'] = '|ccc| Map \'' . $varsSplit[0] . '\' was not found!';
                 }
             } else {
                 $return['message'] = '|ccc| Please specify a map, parameters: {map} {gamemode}';
             }
         } else {
             $return['message'] = '|ccc| Please specify a map';
         }
     } else {
         $return['message'] = '|ccc| There\'s already a poll going on. Please wait until that poll ends...';
     }
     return $return;
 }
Beispiel #2
0
							
							<div class="alert alert-info"><i class="fa fa-lightbulb-o"></i> <?php 
echo $lang['tool_mrot_help1'];
?>
</div>
							
							<select class="form-control" size="20">
							
<?php 
foreach ($cmg->combos as $key => $value) {
    ?>
								<optgroup label="<?php 
    echo $lang['tool_mrot_gamemode'];
    ?>
: <?php 
    echo $cmg->getGameMode($key);
    ?>
">
<?php 
    foreach ($value as $map) {
        ?>
									<option onclick="appendRotation('<?php 
        echo $cmg->getMapName($map);
        ?>
','<?php 
        echo $cmg->getGameMode($key);
        ?>
','<?php 
        echo $map;
        ?>
','<?php 
Beispiel #3
0
// Default response template
$response = array('status' => 'ERROR', 'msg' => '', 'request_date' => date($settings['cp_date_format_full']), 'last_stream' => date($settings['cp_date_format_full'], $settings['server_last_stream']), 'info' => array(), 'players' => array(), 'chat' => array(), 'igaAdmins' => array());
if ($user->checkLogin()) {
    // Connect to server
    if (!$rc->connect($cn, $cs) || !$rc->init()) {
        $response['msg'] = $lang['msg_serverdown'] . ' ' . date($settings['cp_date_format_full'], $settings['server_last_stream']);
    } else {
        $cmg = new GameMaps();
        $sv = new rcon\Server();
        $pl = new rcon\Players();
        $ct = new rcon\Chat();
        if ($userInfo['rights_server'] == 'yes') {
            $response['status'] = 'OK';
            $response['info'] = (array) $sv->fetch();
            $response['info']['mapName'] = $cmg->getMapName($response['info']['map']);
            $response['info']['gameModeName'] = $cmg->getGameMode($response['info']['gameMode']);
            if (isset($_GET['players'])) {
                $response['players'] = $pl->fetch();
            }
            if (isset($_GET['chat'])) {
                $response['chat'] = $ct->fetch();
            }
            if (isset($_GET['igaAdmins'])) {
                $response['igaAdmins'] = $sv->fetchIgaAdmins();
            }
        } else {
            $response['msg'] = $lang['msg_cmd_noaccess'];
        }
    }
} else {
    $response['msg'] = $lang['msg_nologin'];