當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DBUtils::get_uuid方法代碼示例

本文整理匯總了PHP中DBUtils::get_uuid方法的典型用法代碼示例。如果您正苦於以下問題:PHP DBUtils::get_uuid方法的具體用法?PHP DBUtils::get_uuid怎麽用?PHP DBUtils::get_uuid使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DBUtils的用法示例。


在下文中一共展示了DBUtils::get_uuid方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: date

         if (!empty($tmp)) {
             $errorHTML .= "<p/>User Name already in use";
         }
     }
 }
 if (empty($user->userMail)) {
     $errorHTML .= "<p/>Enter User Mail";
 }
 if (empty($user->userFirstname)) {
     $errorHTML .= "<p/>Enter User First Name";
 }
 if (empty($user->userLastname)) {
     $errorHTML .= "<p/>Enter User Last Name";
 }
 if (empty($user->password)) {
     $user->setPassword(DBUtils::get_uuid());
 }
 if (empty($errorHTML)) {
     if (empty($user->registerDate)) {
         $user->setRegisterDate(time());
     }
     $user->updateInsertToDatabase(DBUtils::getConnection());
     $bot->setUserId($user->userId);
     $bot->updateInsertToDatabase(DBUtils::getConnection());
     try {
         $const = "v1.3_" . date("Ymd");
         GameConstantUtil::setConstant("constant.bot.version", $const);
     } catch (Exception $exc) {
         error_log($exc->getMessage());
         error_log($exc->getTraceAsString());
     }
開發者ID:bsormagec,項目名稱:tavlamania-php,代碼行數:31,代碼來源:newbot.php

示例2: createGameUser

 public static function createGameUser($fbUser, $accessToken)
 {
     $result = new FunctionResult();
     $errors = array();
     if (empty($fbUser) || empty($fbUser['id'])) {
         array_push($errors, LanguageUtils::getText("LANG_FACEBOOK_USER_CREATE_ERROR_USER_EMPTY"));
         $result->success = false;
         $result->result = $errors;
         unset($errors);
         return $result;
     }
     if (empty($accessToken)) {
         array_push($errors, LanguageUtils::getText("LANG_FACEBOOK_USER_CREATE_ERROR_TOKEN_EMPTY"));
         $result->success = false;
         $result->result = $errors;
         unset($errors);
         return $result;
     }
     $user = GameUsers::create();
     $user->setActive(1);
     $user->setFacebookId($fbUser['id']);
     $user->setOauthToken($accessToken);
     $user->setCoins(GameConstantUtil::getConstant(GameUsers::$CONSTANT_USER_FIRST_COIN));
     if (isset($fbUser['username'])) {
         $user->setUserName($fbUser['username']);
     } else {
         $user->setUserName($fbUser['id']);
     }
     if (isset($fbUser['first_name'])) {
         $user->setUserFirstname($fbUser['first_name']);
     }
     if (isset($fbUser['last_name'])) {
         $user->setUserLastname($fbUser['last_name']);
     }
     if (isset($fbUser['email'])) {
         $user->setUserMail($fbUser['email']);
     }
     $time = time();
     $user->setRegisterDate($time);
     $user->setLastLoginDate($time);
     $user->setLoginCount(1);
     if (isset($fbUser['gender'])) {
         if ($fbUser['gender'] == "male") {
             $user->setGender(1);
         } else {
             if ($fbUser['gender'] == "female") {
                 $user->setGender(0);
             }
         }
     }
     if (isset($fbUser['birthday'])) {
         $user->setBirtday($fbUser['birthday']);
         $user->setBirthdayDate(DBUtils::facebookBirthDayConverter($fbUser['birthday']));
     }
     $user->setPassword(DBUtils::get_uuid());
     $user->setUserXP(0);
     $level = GameUserLevel::getUserLevel(0);
     if (!empty($level)) {
         $user->setUserLevelNumber($level->levelNumber);
     }
     $user->setWinGameCount(0);
     $user->setLostGameCount(0);
     $user->setWinCountQuitGame(0);
     $user->setWinCountConnectionLostGame(0);
     $user->setWinCountDoubleGame(0);
     $user->setLostCountQuitGame(0);
     $user->setLostCountConnectionLostGame(0);
     $user->setLostCountDoubleGame(0);
     $user->insertIntoDatabase(DBUtils::getConnection());
     $result->success = true;
     $result->result = $user;
     Queue::updateUserImage($user->userId);
     unset($user);
     return $result;
 }
開發者ID:bsormagec,項目名稱:tavlamania-php,代碼行數:75,代碼來源:GameUsers.class.php


注:本文中的DBUtils::get_uuid方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。