I'm working on the PHP wrapper for the global login.
Simple implementation:
But first, you need to define the THPMError struct:PHP Code:$err = 0;
HPMLogin($username, $password, $err);
if($err->eHPMError == -1)
{
// Login Successful, let's check if the user exists in our database.
if($core->GetUserData($username))
{
// User Exists, log in
$session->SetUser($username);
}
else
{
// First login, create user in our database
$core->CreateUser($username, $password);
$session->SetUser($username);
}
}
else
{
// Login failed.
echo $err->errDescription;
}
It don't implements just the login, but all HabboRails API unctions:PHP Code:class THPMError
{
var $eHPMError = 0;
var $eDetailedErrorType = 0;
var $ErrCode = 0;
var $errDescription = "";
};
With these functions, you can, for example, check if an user has permission to access your hotel, useful during long maintenances or a closed beta:int HPMLogin(char* user, char* password, THPMError* error);
int HPMGetAppStats(THPMAppStats* stats, THPMError* error);
int HPMEnumerateApp(int appID, THPMApp* info, THPMError* error);
int HPMIsAppSubscribed(int appID, int* subscribed, THPMError* error);
int HPMMountAppFilesystem(THPMError* error);
HPMHandle_t HPMOpenFileEx(const char *cszFileName, const char *cszMode, unsigned int *puSize, THPMError* error);
int HPMReadFile(void *pBuf, unsigned int uSize, unsigned int uCount, HPMHandle_t hFile, THPMError *error);
int HPMCloseFile(HPMHandle_t hFile, THPMError *error);
By the way, like our facebook page: http://www.facebook.com/pages/Projec...45103918937538PHP Code:$hotelAppId = 1337;
$subscribed = 0;
HPMIsAppSubscribed($hotelAppId, $subscribed, $err);
if($subscribed == 1)
{
// ...
}
else
{
echo "You don't have permission to access the Hotel.";
}
@cecer1
Like a bro





