コード例 #1
0
ファイル: C4Network.php プロジェクト: frankstein-1/openclonk
 /**
  * Returns a Clonk 4 conform error string.
  *
  * @param string message
  * @return string
  */
 public static function createError($message)
 {
     return C4Network::createAnswer(array("Status" => "Failure", "Message" => $message));
 }
コード例 #2
0
ファイル: index.php プロジェクト: frankstein-1/openclonk
                     C4Network::sendAnswer(C4Network::createError('Round signup failed. (To many tries?)'));
                 }
             }
             break;
         case 'Update':
             //update an existing round
             if ($server->updateReference($csid, $reference)) {
                 C4Network::sendAnswer(C4Network::createAnswer(array('Status' => 'Success')));
             } else {
                 C4Network::sendAnswer(C4Network::createError('Round update failed.'));
             }
             break;
         case 'End':
             //remove a round
             if ($server->removeReference($csid)) {
                 C4Network::sendAnswer(C4Network::createAnswer(array('Status' => 'Success')));
             } else {
                 C4Network::sendAnswer(C4Network::createError('Round end failed.'));
             }
             break;
         default:
             if (!empty($action)) {
                 C4Network::sendAnswer(C4Network::createError('Unknown action.'));
             } else {
                 C4Network::sendAnswer(C4Network::createError('No action defined.'));
             }
             break;
     }
 } else {
     C4Network::sendAnswer(C4Network::createError('Wrong engine, "' . ParseINI::parseValue('Game', $input) . '" expected.'));
 }