Exemplo n.º 1
0
 private function _cmd_insertMap($player, $command_string)
 {
     $public = true;
     if (!($commandset = parseBotCommands($command_string))) {
         return;
     }
     if (!isset($commandset[1])) {
         parent::sendText('/w ' . $player . ' Usage: /insertmap <version> <filename> <filesize> <signature> <crc32>');
     } else {
         if (!parent::insertMap($commandset[1], $commandset[2], $commandset[3], $commandset[4], $commandset[5])) {
             parent::sendText('/w ' . $player . ' Failed to insert map.');
         } else {
             parent::sendText('/w ' . $player . ' Successfully insert a new map, please use -commit to save changes');
         }
     }
 }
Exemplo n.º 2
0
 public function _cmd_set(player $player, $message)
 {
     $command = parseBotCommands($message);
     if (!isset($command[1])) {
         return;
     }
     switch ($command[1]) {
         /*
         case 'read':
         	$player->setReadBufferSize($command[2]);
         	$summary = 'Read buffer set to ' . $player->getReadBufferSize();
         break;
         
         case 'write':
         	$player->setWriteBufferSize($command[2]);
         	$summary = 'Write buffer set to ' . $player->getWriteBufferSize();
         break;
         */
         case 'dynamic':
             $this->dynamic_timeslot = true;
             $summary = 'Dynamic Transfer Mode Selected.';
             break;
         case 'static':
             $this->dynamic_timeslot = false;
             $summary = 'Static Transfer Mode Selected.';
             break;
             /*
             case 'error':
             	//purposely calling an non existing method to demostrate the error handling
             	call_method('throwError', $this);
             break;
             */
         /*
         case 'error':
         	//purposely calling an non existing method to demostrate the error handling
         	call_method('throwError', $this);
         break;
         */
         default:
             $summary = 'Invalid sub command.';
     }
     call_method('sendChatMessage', $this, $summary);
 }