예제 #1
0
 function toggleGui($login)
 {
     $this->hidingGui[$login] = !$this->hidingGui[$login];
     if ($this->hidingGui[$login]) {
         $this->connection->chatSendServerMessage('ManiaLive interface has been deactivated, press F8 to enable...', $login, true);
         $this->connection->sendHideManialinkPage($login, true);
         Manialinks::load();
         $this->drawWindow(Shortkey::Create($login));
         CustomUI::Create($login)->saveToDefault();
         $this->connection->sendDisplayManialinkPage($login, Manialinks::getXml(), 0, false, true);
         $this->connection->executeMulticall();
     } else {
         Manialinks::load();
         foreach ($this->currentWindows as $visibilityByLogin) {
             if (isset($visibilityByLogin[$login])) {
                 $this->drawWindow($visibilityByLogin[$login]);
             }
         }
         if ($this->modalShown[$login]) {
             $this->drawModal($this->modalShown[$login]);
         }
         $this->drawWindow(Shortkey::Create($login));
         CustomUI::Create($login)->save();
         $this->connection->sendDisplayManialinkPage($login, Manialinks::getXml(), 0, false);
     }
 }
예제 #2
0
 function man($login, $commandName, $parametersCount = -2)
 {
     $commandName = strtolower($commandName);
     if ($parametersCount == -2 && isset($this->registeredCommands[$commandName])) {
         $help = array();
         $help[] = 'Available $<$o$FC4' . $commandName . '$> commands:';
         foreach ($this->registeredCommands[$commandName] as $command) {
             if (!count($command->authorizedLogin) || in_array($login, $command->authorizedLogin)) {
                 $help[] = '$<$o$FC4' . $command->name . ' (' . $command->parametersCount . ')$>' . ($command->help ? ':' . $command->help : '');
             }
         }
         $text = implode("\n", $help);
     } else {
         if (isset($this->registeredCommands[$commandName][$parametersCount])) {
             $command = $this->registeredCommands[$commandName][$parametersCount];
             if (!count($command->authorizedLogin) || in_array($login, $command->authorizedLogin)) {
                 $text = '$<$o$FC4' . $command->name . ' (' . $command->parametersCount . ')$>' . ($command->help ? ':' . $command->help : '');
             } else {
                 $text = 'This command does not exists use help to see available commands';
             }
         } else {
             $text = 'This command does not exists use help to see available commands';
         }
     }
     $this->connection->chatSendServerMessage($text, $login, true);
 }