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


Python UserEntityManager.addUser方法代碼示例

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


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

示例1: onResponse

# 需要導入模塊: from user.userentitymanager import UserEntityManager [as 別名]
# 或者: from user.userentitymanager.UserEntityManager import addUser [as 別名]
    def onResponse(self, dataView):
        """
        :type dataView: message.db.dataview.SUserDataView
        """

        userEntity = UserEntity(dataView.basicInfo)
        userEntity.updateUserData(dataView)

        UserEntityManager.addUser(userEntity)

        userEntity.updateDeviceCodeAndSessionKey(self.deviceCode, MyUuid.getUuid())
        UserEntityManager.onUserLogin(userEntity, self.request.connId, self.deviceCode)

        self.request.response(userEntity.getLoginReturn())

        # save changes
        DbCacheHelper.getITableSaverProxy().updateTUserSettings(None, userEntity.getTUserSettings())
        # logging
        DbLogHepler.logSignup(userEntity.getLogUserInfo())
開發者ID:bropony,項目名稱:gamit,代碼行數:21,代碼來源:userdbcallback.py

示例2: signup

# 需要導入模塊: from user.userentitymanager import UserEntityManager [as 別名]
# 或者: from user.userentitymanager.UserEntityManager import addUser [as 別名]
    def signup(self, signupInfo, _request):
        """
        :type signupInfo: message.gate.gatemsg.SSignup
        :type _request: message.gate.ilogin.ILogin_Signup_Request
        """

        if not signupInfo.account:
            ErrorCodeManager.raiseError("ErrorSignup_invalidAccount")

        if not signupInfo.password:
            ErrorCodeManager.raiseError("ErrorSignup_invalidPassword")

        if not ELoginType.isValueValid(signupInfo.loginType):
            ErrorCodeManager.raiseError("ErrorSignup_invalidLoginType")

        userEntity = UserEntityManager.findUserEntityByAccount(signupInfo.account)
        if userEntity:
            ErrorCodeManager.raiseError("ErrorLogin_AccountExists")

        if signupInfo.loginType == ELoginType.MobilePhoneNum:
            if ServerConfigManager.isValidationCodeEnabled:
                if not PhoneValidationManager.isValidationCodeValid(signupInfo.validationCode, signupInfo.account):
                    ErrorCodeManager.raiseError("ErrorLogin_InvalidValidationCode")
                else:
                    PhoneValidationManager.removeValidationCode(signupInfo.account)

        dataView = UserDbHelper.createAccount(signupInfo)
        userEntity = UserEntity(dataView.basicInfo)
        userEntity.updateUserData(dataView)
        UserEntityManager.addUser(userEntity)

        userEntity.updateDeviceCodeAndSessionKey(signupInfo.deviceCode, MyUuid.getUuid())
        UserEntityManager.onUserLogin(userEntity, _request.connId, signupInfo.deviceCode)

        _request.response(userEntity.getLoginReturn())

        # save changes
        DbSaver.saveTable(userEntity.getTUserSettings())

        # logging
        DbLogHepler.logSignup(userEntity.getLogUserInfo())
開發者ID:bropony,項目名稱:gamit,代碼行數:43,代碼來源:iloginimpl.py


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