ZH-CN/logIn: Difference between revisions
Jump to navigation
Jump to search
Qwe7769611 (talk | contribs) No edit summary |
m (Добавление языков) |
||
(One intermediate revision by one other user not shown) | |||
Line 14: | Line 14: | ||
*'''thePassword:''' 登录此帐户所需的密码 | *'''thePassword:''' 登录此帐户所需的密码 | ||
=== | ===返回值=== | ||
如果玩家成功登录到给定帐户,则返回“true”。如果由于某种原因登录失败,即玩家已经登录到某个帐户(首先使用[[logOut]]),如果该帐户已经在使用中或由于其他原因失败,则返回“false”或“nil” | 如果玩家成功登录到给定帐户,则返回“true”。如果由于某种原因登录失败,即玩家已经登录到某个帐户(首先使用[[logOut]]),如果该帐户已经在使用中或由于其他原因失败,则返回“false”或“nil” | ||
Line 33: | Line 33: | ||
{{Account_functions}} | {{Account_functions}} | ||
[[en:logIn]] | |||
[[ru:logIn]] | [[ru:logIn]] | ||
[[ar:logIn]] | [[ar:logIn]] | ||
[[zh-cn:logIn]] | [[zh-cn:logIn]] |
Latest revision as of 14:09, 12 April 2021
此函数用于将给定的玩家登录到给定的帐户.您需要提供登录该帐户所需的密码.
语法
bool logIn ( player thePlayer, account theAccount, string thePassword )
OOP 语法 什么是OOP?
必填参数
- thePlayer: 登录账户的玩家
- theAccount: 要登录的账户
- thePassword: 登录此帐户所需的密码
返回值
如果玩家成功登录到给定帐户,则返回“true”。如果由于某种原因登录失败,即玩家已经登录到某个帐户(首先使用logOut),如果该帐户已经在使用中或由于其他原因失败,则返回“false”或“nil”
示例
function loginPlayer ( thePlayer, command, username, password ) local account = getAccount ( username, password ) -- 返回账户 if ( account ~= false ) then -- If the account exists. logIn ( thePlayer, account, password ) -- 让他们登录. else outputChatBox ( "用户名或密码错误!", thePlayer, 255, 255, 0 ) -- 告诉他们参数错误了. end end addCommandHandler ( "log-in", loginPlayer ) -- 使其触发“/log-in”, 注意: /login is hardcored and cannot be used.
See Also
- addAccount
- copyAccountData
- getAccount
- getAccountData
- getAccountName
- getAccountPlayer
- getAccountSerial
- getAccounts
- getAccountsBySerial
- getAllAccountData
- getPlayerAccount
- isGuestAccount
- logIn
- logOut
- removeAccount
- setAccountData
- setAccountPassword
- getAccountByID
- getAccountID
- getAccountIP
- getAccountsByData
- getAccountsByIP
- setAccountName