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


PHP Module::authenticateGameEditor方法代码示例

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


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

示例1: createSpawnableForObject

 public static function createSpawnableForObject($gameId, $type, $typeId, $editorId, $editorToken)
 {
     if (!Module::authenticateGameEditor($gameId, $editorId, $editorToken, "read_write")) {
         return new returnData(6, NULL, "Failed Authentication");
     }
     switch ($type) {
         case 'Item':
             $query = "SELECT name as title FROM items WHERE game_id = {$gameId} AND item_id = {$typeId} LIMIT 1";
             break;
         case 'Node':
             $query = "SELECT title FROM nodes WHERE game_id = {$gameId} AND node_id = {$typeId} LIMIT 1";
             break;
         case 'Npc':
             $query = "SELECT name as title FROM npcs WHERE game_id = {$gameId} AND npc_id = {$typeId} LIMIT 1";
             break;
         case 'WebPage':
             $query = "SELECT name as title FROM web_pages WHERE web_page_id = {$typeId} LIMIT 1";
             break;
         case 'AugBubble':
             $query = "SELECT name as title FROM aug_bubbles WHERE aug_bubble_id = {$typeId} LIMIT 1";
             break;
     }
     $result = Module::query($query);
     $obj = mysql_fetch_object($result);
     $title = $obj->title;
     Spawnables::createSpawnable($gameId, $type, $typeId, $title, 5, 35, 50, 'PER_PLAYER', 'PLAYER', 0, 0, 50, 10, 0, 100, 15, 0, 0, 0, 1, 0);
     return Spawnables::getSpawnableForObject($gameId, $type, $typeId);
 }
开发者ID:spoymenov,项目名称:arisgames,代码行数:28,代码来源:spawnables.php

示例2: deleteWebHook

 public function deleteWebHook($gameId, $intWebHookID, $editorId, $editorToken)
 {
     if (!Module::authenticateGameEditor($gameId, $editorId, $editorToken, "read_write")) {
         return new returnData(6, NULL, "Failed Authentication");
     }
     $query = "DELETE FROM web_hooks WHERE web_hook_id = {$intWebHookID}";
     $rsResult = Module::query($query);
     if (mysql_error()) {
         return new returnData(3, NULL, "SQL Error");
     }
     if (!mysql_affected_rows()) {
         return new returnData(2, NULL, 'invalid event id');
     }
     $query = "DELETE FROM requirements WHERE game_id = {$gameId} AND content_type = 'OutgoingWebHook' AND content_id = '{$intWebHookID}'";
     $rsResult = Module::query($query);
     if (mysql_error()) {
         return new returnData(3, NULL, "{$query} SQL Error");
     }
     $query = "DELETE FROM requirements WHERE game_id = {$gameId} AND requirement = 'PLAYER_HAS_RECEIVED_INCOMING_WEB_HOOK' AND requirement_detail_1 = '{$intWebHookID}'";
     $rsResult = Module::query($query);
     if (mysql_error()) {
         return new returnData(3, NULL, "{$query} SQL Error");
     }
     return new returnData(0, TRUE);
 }
开发者ID:spoymenov,项目名称:arisgames,代码行数:25,代码来源:webhooks.php

示例3: updateOverlay

 public function updateOverlay($overlayId, $gameId, $name, $mediaId, $topLeftLat, $topLeftLong, $topRightLat, $topRightLong, $bottomLeftLat, $bottomLeftLong, $editorId, $editorToken)
 {
     if (!Module::authenticateGameEditor($gameId, $editorId, $editorToken, "read_write")) {
         return new returnData(6, NULL, "Failed Authentication");
     }
     $newName = addslashes($newName);
     Module::query("UPDATE overlays SET game_id = {$gameId}, name = '{$name}', media_id = {$mediaId}, top_left_latitude = {$topLeftLat}, top_left_longitude = {$topLeftLong}, top_right_latitude = {$topRightLat}, top_right_longitude = {$topRightLong}, bottom_left_latitude = {$bottomLeftLat}, bottom_left_longitude = {$bottomLeftLong} WHERE overlay_id = {$overlayId};");
     return new returnData(0);
 }
开发者ID:kimblemj,项目名称:server,代码行数:9,代码来源:overlays.php

示例4: deleteFountain

 public static function deleteFountain($fountainId, $editorId, $editorToken)
 {
     if (!Module::authenticateGameEditor($gameId, $editorId, $editorToken, "read_write")) {
         return new returnData(6, NULL, "Failed Authentication");
     }
     $query = "UPDATE fountains SET active = 0 WHERE fountain_id = {$fountainId}";
     Module::query($query);
     /*
             //This does a hard delete
             $query = "DELETE FROM fountains WHERE fountain_id = $fountainId";
             Module::query($query);
     */
     return new returnData(0);
 }
开发者ID:spoymenov,项目名称:arisgames,代码行数:14,代码来源:fountains.php

示例5: swapSortIndex

 public function swapSortIndex($gameId, $a, $b, $editorId, $editorToken)
 {
     if (!Module::authenticateGameEditor($gameId, $editorId, $editorToken, "read_write")) {
         return new returnData(6, NULL, "Failed Authentication");
     }
     $result = Module::query("SELECT * FROM quests WHERE game_id = {$gameId} AND (quest_id = '{$a}' OR quest_id = '{$b}')");
     $quests = array();
     while ($quest = mysql_fetch_object($result)) {
         $quests[$quest->quest_id] = $quest;
     }
     Module::query("UPDATE quests SET sort_index = '{$quests[$a]->sort_index}' WHERE game_id = {$gameId} AND quest_id = '{$b}'");
     Module::query("UPDATE quests SET sort_index = '{$quests[$b]->sort_index}' WHERE game_id = {$gameId} AND quest_id = '{$a}'");
     return new returnData(0);
 }
开发者ID:kimblemj,项目名称:server,代码行数:14,代码来源:quests.php

示例6: deleteRequirement

 public function deleteRequirement($gameId, $requirementId, $editorId, $editorToken)
 {
     if (!Module::authenticateGameEditor($gameId, $editorId, $editorToken, "read_write")) {
         return new returnData(6, NULL, "Failed Authentication");
     }
     $query = "DELETE FROM requirements WHERE game_id = {$gameId} AND requirement_id = {$requirementId}";
     $rsResult = Module::query($query);
     if (mysql_error()) {
         return new returnData(3, NULL, "SQL Error");
     }
     if (mysql_affected_rows()) {
         return new returnData(0);
     } else {
         return new returnData(2, NULL, 'invalid requirement id');
     }
 }
开发者ID:spoymenov,项目名称:arisgames,代码行数:16,代码来源:requirements.php

示例7: deletePlayerStateChange

 public function deletePlayerStateChange($gameId, $intPlayerStateChangeId, $editorId, $editorToken)
 {
     if (!Module::authenticateGameEditor($gameId, $editorId, $editorToken, "read_write")) {
         return new returnData(6, NULL, "Failed Authentication");
     }
     $query = "DELETE FROM player_state_changes WHERE game_id = {$gameId} AND id = {$intPlayerStateChangeId}";
     $rsResult = Module::query($query);
     if (mysql_error()) {
         return new returnData(3, NULL, "SQL Error");
     }
     if (mysql_affected_rows()) {
         return new returnData(0);
     } else {
         return new returnData(2, NULL, 'invalid player state change id');
     }
 }
开发者ID:kimblemj,项目名称:server,代码行数:16,代码来源:playerStateChanges.php

示例8: updateWebPage

 public static function updateWebPage($gameId, $webPageId, $name, $url, $iconMediaId, $editorId, $editorToken)
 {
     if (!Module::authenticateGameEditor($gameId, $editorId, $editorToken, "read_write")) {
         return new returnData(6, NULL, "Failed Authentication");
     }
     $name = addslashes($name);
     $query = "UPDATE web_pages \n            SET name = '{$name}', \n                url = '{$url}', \n                icon_media_id = '{$iconMediaId}' \n                    WHERE web_page_id = '{$webPageId}'";
     Module::query($query);
     if (mysql_error()) {
         return new returnData(3, NULL, "SQL Error:" . mysql_error() . "while running query:" . $query);
     }
     if (mysql_affected_rows()) {
         return new returnData(0, TRUE, "Success Running:" . $query);
     } else {
         return new returnData(0, FALSE, "Success Running:" . $query);
     }
 }
开发者ID:spoymenov,项目名称:arisgames,代码行数:17,代码来源:webpages.php

示例9: updateNode

 public function updateNode($gameId, $intNodeID, $strTitle, $strText, $intMediaID, $intIconMediaID, $strOpt1Text, $intOpt1NodeID, $strOpt2Text, $intOpt2NodeID, $strOpt3Text, $intOpt3NodeID, $strQACorrectAnswer, $intQAIncorrectNodeID, $intQACorrectNodeID, $editorId, $editorToken)
 {
     if (!Module::authenticateGameEditor($gameId, $editorId, $editorToken, "read_write")) {
         return new returnData(6, NULL, "Failed Authentication");
     }
     $strTitle = addslashes($strTitle);
     $strText = addslashes($strText);
     $strOpt1Text = addslashes($strOpt1Text);
     $strOpt2Text = addslashes($strOpt2Text);
     $strOpt3Text = addslashes($strOpt3Text);
     $strQACorrectAnswer = addslashes($strQACorrectAnswer);
     $query = "UPDATE nodes \n            SET title = '{$strTitle}', text = '{$strText}',\n                media_id = '{$intMediaID}', icon_media_id = '{$intIconMediaID}',\n                opt1_text = '{$strOpt1Text}', opt1_node_id = '{$intOpt1NodeID}',\n                opt2_text = '{$strOpt2Text}', opt2_node_id = '{$intOpt2NodeID}',\n                opt3_text = '{$strOpt3Text}', opt3_node_id = '{$intOpt3NodeID}',\n                require_answer_string = '{$strQACorrectAnswer}', \n                require_answer_incorrect_node_id = '{$intQAIncorrectNodeID}', \n                require_answer_correct_node_id = '{$intQACorrectNodeID}'\n                    WHERE game_id = {$gameId} AND node_id = '{$intNodeID}'";
     Module::query($query);
     if (mysql_error()) {
         return new returnData(3, NULL, "SQL Error:" . mysql_error() . "while running query:" . $query);
     }
     if (mysql_affected_rows()) {
         return new returnData(0, TRUE, "Success Running:" . $query);
     } else {
         return new returnData(0, FALSE, "Success Running:" . $query);
     }
 }
开发者ID:spoymenov,项目名称:arisgames,代码行数:22,代码来源:nodes.php

示例10: updateNpc

 public function updateNpc($gameId, $npcId, $name, $description, $greeting, $closing, $mediaId, $iconMediaId, $editorId, $editorToken)
 {
     if (!Module::authenticateGameEditor($gameId, $editorId, $editorToken, "read_write")) {
         return new returnData(6, NULL, "Failed Authentication");
     }
     $greeting = str_replace("“", "\"", $greeting);
     $greeting = str_replace("”", "\"", $greeting);
     $closing = str_replace("“", "\"", $closing);
     $closing = str_replace("”", "\"", $closing);
     $name = addslashes($name);
     $description = addslashes($description);
     $greeting = addslashes($greeting);
     $closing = addslashes($closing);
     $query = "UPDATE npcs \n            SET name = '{$name}', description = '{$description}',\n                text = '{$greeting}', closing = '{$closing}', \n                media_id = '{$mediaId}', icon_media_id = '{$iconMediaId}'\n                    WHERE npc_id = '{$npcId}' AND game_id = {$gameId}";
     Module::query($query);
     if (mysql_error()) {
         return new returnData(3, NULL, "SQL Error:" . mysql_error());
     }
     if (mysql_affected_rows()) {
         return new returnData(0, TRUE, "");
     } else {
         return new returnData(0, FALSE, "");
     }
 }
开发者ID:kimblemj,项目名称:server,代码行数:24,代码来源:npcs.php

示例11: pruneNoteContentFromGame

 public function pruneNoteContentFromGame($gameId, $surrogate, $editorId, $editorToken)
 {
     if (!Module::authenticateGameEditor($gameId, $editorId, $editorToken, "read_write")) {
         return new returnData(6, NULL, "Failed Authentication");
     }
     $unused_content = array();
     $noteContent = Module::queryArray("SELECT * FROM note_content WHERE game_id = '{$gameId}'");
     for ($i = 0; $i < count($noteContent); $i++) {
         if (!Module::queryObject("SELECT * FROM notes WHERE game_id = '{$gameId}' AND note_id = '{$noteContent[$i]->note_id}'")) {
             $unused_content[] = $noteContent[$i]->content_id;
         }
     }
     if ($surrogate) {
         for ($i = 0; $i < count($unused_content); $i++) {
             Module::query("UPDATE note_content SET game_id = '{$surrogate}' WHERE game_id = '{$gameId}' AND content_id = '{$unused_content[$i]}'");
         }
     } else {
         for ($i = 0; $i < count($unused_content); $i++) {
             Module::query("DELETE FROM note_content WHERE game_id = '{$gameId}' AND content_id = '{$unused_content[$i]}'");
         }
     }
     return $unused_content;
 }
开发者ID:kimblemj,项目名称:server,代码行数:23,代码来源:prune.php

示例12: getPlayerLogs

 public function getPlayerLogs($glob)
 {
     ini_set('display_errors', 1);
     error_reporting(E_ALL);
     //Grrr amfphp should take care of this...
     $data = file_get_contents("php://input");
     $glob = json_decode($data);
     $reqOutputFormat = $glob->output_format;
     $reqOutputToFile = $glob->output_to_file;
     $reqOutputFilename = $glob->output_filename;
     $reqGameId = $glob->game_id;
     $reqEditorId = $glob->editor_id;
     $reqEditorToken = $glob->editor_token;
     $reqGroup = $glob->groupname;
     $reqPlayers = $glob->players;
     $reqPlayer = $glob->player;
     $reqStartDate = $glob->start_date;
     $reqEndDate = $glob->end_date;
     $reqGetExpired = $glob->get_expired;
     $reqVerbose = $glob->verbose;
     $iknowwhatimdoing = $glob->i_know_what_im_doing == "yes";
     //minimal level of "security" to prevent massive data requests
     if ($iknowwhatimdoing) {
         set_time_limit(0);
         ignore_user_abort(1);
     }
     //validation
     $expectsNotice = 'Expects JSON argument of minimal form: {"output_format":"json","game_id":1,"editor_id":1,"editor_token":"abc123"}';
     if (!is_string($reqOutputFormat)) {
         $reqOutputFormat = "json";
     } else {
         $reqOutputFormat = strToLower($reqOutputFormat);
     }
     if ($reqOutputFormat != "json" && $reqOutputFormat != "csv" && $reqOutputFormat != "xml") {
         return new returnData(1, NULL, "Error- Invalid output format (" . $reqOutputFormat . ")\n" . $expectsNotice);
     }
     if (is_numeric($reqOutputToFile)) {
         $reqOutputToFile = intval($reqOutputToFile);
     } else {
         $reqOutputToFile = 0;
     }
     if (!is_string($reqOutputFilename)) {
         $reqOutputFilename = $reqOutputToFile ? "mostrecentlogrequest" : "tmpmostrecentlogrequest";
     }
     if (is_numeric($reqGameId)) {
         $reqGameId = intval($reqGameId);
     } else {
         return new returnData(1, NULL, "Error- Empty Game (" . $reqGameId . ")\n" . $expectsNotice);
     }
     if (is_numeric($reqEditorId)) {
         $reqEditorId = intval($reqEditorId);
     } else {
         return new returnData(1, NULL, "Error- Empty Editor (" . $reqEditorId . ")\n" . $expectsNotice);
     }
     if (!is_string($reqEditorToken)) {
         return new returnData(1, NULL, "Error- Invalid EditorToken (" . $reqEditorToken . ")\n" . $expectsNotice);
     }
     if (!Module::authenticateGameEditor($reqGameId, $reqEditorId, $reqEditorToken, "read_write")) {
         return new returnData(6, NULL, "Failed Authentication");
     }
     $filterMode = "none";
     if (is_string($reqGroup)) {
         $filterMode = "group";
     }
     if (is_array($reqPlayers)) {
         $filterMode = "players";
     }
     if (is_numeric($reqPlayer)) {
         $filterMode = "player";
     }
     if (!preg_match("/\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}/", $reqStartDate)) {
         $reqStartDate = "0000-00-00 00:00:00";
     }
     if (!preg_match("/\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}/", $reqEndDate)) {
         $reqEndDate = "9999-00-00 00:00:00";
     }
     if (!$iknowwhatimdoing && floor(abs(strtotime($reqEndDate) - strtotime($reqStartDate)) / (60 * 60 * 24 * 31)) > 0) {
         return new returnData(1, NULL, "Please don't ask for more than a month of data at a time!");
     }
     if (!is_numeric($reqGetExpired)) {
         $reqGetExpired = 0;
     } else {
         if (intval($reqGetExpired) > 0) {
             $reqGetExpired = 1;
         }
     }
     if (!is_numeric($reqVerbose)) {
         $reqVerbose = 0;
     } else {
         if (intval($reqVerbose) > 0) {
             $reqVerbose = 1;
         }
     }
     $playerLogs = array();
     if ($filterMode == "group") {
         $p = Module::queryArray("SELECT player_id, display_name, media_id, group_name from players WHERE group_name = '{$reqGroup}'");
         for ($i = 0; $i < count($p); $i++) {
             $log = new stdClass();
             $log->player = $p[$i];
             if ($log->player->display_name == "") {
//.........这里部分代码省略.........
开发者ID:kimblemj,项目名称:server,代码行数:101,代码来源:playerlog.php

示例13: deleteContent

 public static function deleteContent($gameId, $intContentID, $editorId, $editorToken)
 {
     if (!Module::authenticateGameEditor($gameId, $editorId, $editorToken, "read_write")) {
         return new returnData(6, NULL, "Failed Authentication");
     }
     //Lookup the object
     $query = "SELECT content_type,content_id FROM folder_contents WHERE object_content_id = {$intContentID} AND game_id = '{$gameId}' LIMIT 1";
     $contentQueryResult = Module::query($query);
     $content = @mysql_fetch_object($contentQueryResult);
     if (mysql_error()) {
         return new returnData(3, NULL, "SQL Error");
     }
     Spawnables::deleteSpawnablesOfObject($gameId, $content->content_type, $content->content_id, $editorId, $editorToken);
     //Delete the content record
     $query = "DELETE FROM folder_contents WHERE object_content_id = {$intContentID} AND game_id = '{$gameId}'";
     Module::query($query);
     if (mysql_error()) {
         return new returnData(3, NULL, "SQL Error");
     }
     //Delete the object
     if ($content->content_type == "Node") {
         Nodes::deleteNode($gameId, $content->content_id, $editorId, $editorToken);
     } else {
         if ($content->content_type == "Item") {
             Items::deleteItem($gameId, $content->content_id, $editorId, $editorToken);
         } else {
             if ($content->content_type == "Npc") {
                 Npcs::deleteNpc($gameId, $content->content_id, $editorId, $editorToken);
             } else {
                 if ($content->content_type == "WebPage") {
                     WebPages::deleteWebPage($gameId, $content->content_id, $editorId, $editorToken);
                 } else {
                     if ($content->content_type == "AugBubble") {
                         AugBubbles::deleteAugBubble($gameId, $content->content_id, $editorId, $editorToken);
                     } else {
                         if ($content->content_type == "PlayerNote") {
                             Notes::deleteNote($content->content_id, $editorId, $editorToken);
                         }
                     }
                 }
             }
         }
     }
     if (mysql_affected_rows()) {
         return new returnData(0);
     } else {
         return new returnData(2, 'invalid folder id');
     }
 }
开发者ID:spoymenov,项目名称:arisgames,代码行数:49,代码来源:editorFoldersAndContent.php

示例14: deleteTagFromGame

 public function deleteTagFromGame($gameId, $tagId, $editorId, $editorToken)
 {
     if (!Module::authenticateGameEditor($gameId, $editorId, $editorToken, "read_write")) {
         return new returnData(6, NULL, "Failed Authentication");
     }
     $tag = Module::queryObject("SELECT * FROM game_tags WHERE tag_id = '{$tagId}'");
     if ($tag->player_created == 1) {
         Module::query("DELETE FROM game_tags WHERE tag_id = '{$tagId}'");
         Module::query("DELETE FROM note_tags WHERE tag_id = '{$tagId}'");
     } else {
         $notesTagged = Module::queryObject("SELECT note_id FROM note_tags WHERE tag_id = '{$tagId}'");
         if ($notesTagged) {
             Module::query("UPDATE game_tags SET player_created = 1 WHERE tag_id = '{$tagId}'");
         } else {
             Module::query("DELETE FROM game_tags WHERE tag_id = '{$tagId}'");
             Module::query("DELETE FROM note_tags WHERE tag_id = '{$tagId}'");
         }
     }
     return new returnData(0);
 }
开发者ID:kimblemj,项目名称:server,代码行数:20,代码来源:notebook.php

示例15: untagItem

 public static function untagItem($gameId, $itemId, $tagId, $editorId, $editorToken)
 {
     if (!Module::authenticateGameEditor($gameId, $editorId, $editorToken, "read_write")) {
         return new returnData(6, NULL, "Failed Authentication");
     }
     $query = "DELETE FROM object_tags WHERE object_type = 'ITEM' AND object_id = '{$itemId}' AND tag_id = '{$tagId}';";
     Module::query($query);
     return new returnData(0);
 }
开发者ID:kimblemj,项目名称:server,代码行数:9,代码来源:items.php


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