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


PHP client::logPlayerCreatedNote方法代码示例

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


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

示例1: createNote

 public static function createNote($pack)
 {
     $pack->auth->permission = "read_write";
     if (!users::authenticateUser($pack->auth)) {
         return new return_package(6, NULL, "Failed Authentication");
     }
     if ($pack->media) {
         $pack->media->auth = $pack->auth;
         $pack->media->game_id = $pack->game_id;
         $pack->media_id = media::createMedia($pack->media)->data->media_id;
     }
     $game = games::getGame($pack);
     $pack->note_id = dbconnection::queryInsert("INSERT INTO notes (" . "game_id," . "user_id," . (isset($pack->name) ? "name," : "") . (isset($pack->description) ? "description," : "") . (isset($pack->media_id) ? "media_id," : "") . "published," . "created" . ") VALUES (" . "'" . $pack->game_id . "'," . "'" . $pack->auth->user_id . "'," . (isset($pack->name) ? "'" . addslashes($pack->name) . "'," : "") . (isset($pack->description) ? "'" . addslashes($pack->description) . "'," : "") . (isset($pack->media_id) ? "'" . addslashes($pack->media_id) . "'," : "") . ($game->data->moderated ? "'PENDING'" : "'AUTO'") . "," . "CURRENT_TIMESTAMP" . ")");
     if ($pack->trigger) {
         $scene_id = dbconnection::queryObject("SELECT * FROM user_game_scenes WHERE user_id = '{$pack->auth->user_id}' AND game_id = '{$pack->game_id}'")->scene_id;
         if (!$scene_id) {
             $scene_id = $game->data->intro_scene_id;
         }
         $instance_id = dbconnection::queryInsert("INSERT INTO instances (game_id, object_id, object_type, created) VALUES ('{$pack->game_id}', '{$pack->note_id}', 'NOTE', CURRENT_TIMESTAMP)");
         $trigger_id = dbconnection::queryInsert("INSERT INTO triggers (game_id, instance_id, scene_id, type, latitude, longitude, infinite_distance, created) VALUES ( '{$pack->game_id}', '{$instance_id}', '{$scene_id}', 'LOCATION', '{$pack->trigger->latitude}', '{$pack->trigger->longitude}', '1', CURRENT_TIMESTAMP);");
     }
     //allow for 'tag_id' in API, but really just use object_tags
     if ($pack->tag_id) {
         dbconnection::queryInsert("INSERT INTO object_tags (game_id, object_type, object_id, tag_id, created) VALUES ('{$pack->game_id}', 'NOTE', '{$pack->note_id}', '{$pack->tag_id}', CURRENT_TIMESTAMP)");
     }
     client::logPlayerCreatedNote($pack);
     games::bumpGameVersion($pack);
     return notes::getNote($pack);
 }
开发者ID:kimblemj,项目名称:server,代码行数:29,代码来源:notes.php


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