DATABASE_HOST
DATABASE_HOST
Perfect World v1.2.6 php API
Extra credits to das7002, tbnanubis, renan7899, twiggy3452, Drakaer, Ronny
$Instance : \PerfectWorldAPI
Singleton instance of PerfectWorldAPI
$_database : \MonkeyDatabase
Instance of MonkeyDatabase
Instance() : \PerfectWorldAPI
Returns singleton instance of class
AddUser(string $username, string $password, string $email, string $question = '', string $answer = '', string $realName = '', integer $gender, string $number = '0', string $country = '0', string $city = '0', string $address = '0', string $postalcode = '0', integer $birthday)
Add user to Perfect World database
string | $username | |
string | $password | |
string | ||
string | $question | |
string | $answer | |
string | $realName | |
integer | $gender | |
string | $number | |
string | $country | |
string | $city | |
string | $address | |
string | $postalcode | |
integer | $birthday |
SetPassword(string $username = '', string $password, string $oldPassword = '') : boolean
Sets a password for an account. This can be useful for password resets. If you have them input an old password, be sure to check that the old password length isn't 0. Otherwise they'll be able to overwrite the password without inputting an old password. This isn't a bug in the API, it's by design.
string | $username | |
string | $password | |
string | $oldPassword |
GetUserData(integer $userID, $forceUpdate = false) : mixed
Get user's data based on ID or currently logged in account. If the data has already been accessed, it will return that unless forceUpdate is set to true. If empty userID and user is not logged in, function returns false.
integer | $userID | |
$forceUpdate |
Login(string $username, string $password, string $email = '')
Login to an account. E-Mail parameter is optional. If you plan to use the e-mail parameter, make sure to check if the e-mail length is greater than 0, otherwise it will bypass the e-mail check and allow the user in with just username and password.
string | $username | |
string | $password | |
string |
GetOnlineCharacterList() : mixed
Returns an array of online user's names and IDs
array
None found |
GetCharList(integer $limit, integer $page) : mixed
Get an array of all character's names and IDs (This can return a massive amount of data)
integer | $limit | |
integer | $page |
array
version |
2/16/2012, Added $page and $limit parameters |
---|
GetCharacterName( $charID) : string
Returns currently selected character's name. If no character is selected, empty string is returned.
$charID |
** File not found : **
None found |
GetCharData(integer $charID, $forceUpdate = false) : mixed
Get character's data based on ID or currently logged in account character. If the data has already been accessed, it will return that unless forceUpdate is set to true. If empty userID and user is not logged in, function returns false.
integer | $charID | |
$forceUpdate |
None found |
GetCharID() : integer
Get character ID if character is set. 0 means that no character is set.
None found |
startSession() : void
Attempt to start user session (cookie blocks will prevent this from starting)
bug |
A bug regarding the session not being properly destroyed has been fixed |
---|
verifyFingerprint() : boolean
Verify session fingerprint against user fingerprint. Returns true if fingerprint is the same. Returns false if fingerprint mismatch.
None found |
setSessionVariable(string $variable, mixed $value) : void
Set a session variable.
NOTE: There is mild session data hiding for shared hosts. Beware using this on anything but a dedicated host. As the data could be unhidden fairly easy by another user.
string | $variable | |
mixed | $value |
None found |
getUserFingerprint() : string
Returns current user fingerprint (Not session fingerprint)
None found |
None found |
getSessionVariable(string $variable) : mixed
Get a session variable.
NOTE: There is mild session data hiding for shared hosts. Beware using this on anything but a dedicated host. As the data could be unhidden fairly easy by another user.
string | $variable |
None found |