- Joined
- Feb 22, 2012
- Messages
- 2,103
- Reaction score
- 1,271
This is most likely the error:I'm currentlyu sing PlusEMU. The wired settings do not save after unload, however in the database (wired_items) it refers to the right furniture (in items table). What might be the issue? No error log from PlusEMU either.
My Modtool doesn't work anymore. I don't even know where to look to fix it. :/
You must be registered to see links
<?php if(!defined('BRAIN_CMS'))
{
die('Sorry but you cannot access this file!');
}
/*
Functions list Class Game.
---------------
sso();
usersOnline();
homeRoom();
*/
class Game
{
public static function sso()
{
global $dbh;
$timeNow = strtotime("now");
$sessionKey = 'Brain-1.2.3-'.substr(str_shuffle(str_repeat("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", 5)), 0, 25).'-SSO';
$stmt = $dbh->prepare("UPDATE users SET auth_ticket = :sso , last_online = :timenow WHERE id = :id");
$stmt->bindParam(':timenow', $timeNow);
$stmt->bindParam(':id', $_SESSION['id']);
$stmt->bindParam(':sso', $sessionKey);
$stmt->execute();
}
Public static function usersOnline()
{
global $dbh;
$userCount = $dbh->prepare("SELECT * FROM users WHERE online = '1'");
$userCount->execute();
return $userCount->RowCount();
}
public static function homeRoom()
{
global $dbh, $hotel;
$stmt = $dbh->prepare("UPDATE users SET home_room = :homeroom WHERE id = :id");
$stmt->bindParam(':homeroom', $hotel['homeRoom']);
$stmt->bindParam(':id', $_SESSION['id']);
$stmt->execute();
}
}
?>
[COLOR=#666666]$ticket = time().sha1(rand(10000,99999));[/COLOR]
[COLOR=#666666]$sql = DB::query('SELECT null FROM `user_auth_ticket` WHERE `user_id` = %i LIMIT 1', (int)$user->Id);[/COLOR]
[COLOR=#666666]if(DB::count() > 0) {[/COLOR]
[COLOR=#666666]DB::query('UPDATE `user_auth_ticket` SET `auth_ticket` = %s WHERE `user_id` = %i', $ticket, (int)$user->Id);[/COLOR]
[COLOR=#666666]}else{[/COLOR]
[COLOR=#666666]DB::insert('user_auth_ticket', array ([/COLOR]
[COLOR=#666666]'user_id' => $user['id'],[/COLOR]
[COLOR=#666666]'auth_ticket' => $ticket[/COLOR]
[COLOR=#666666]));[/COLOR]
[COLOR=#666666]}[/COLOR]
Hello!
I'm trying to do Ryans nr 3). HabboHotel\Users\UserData\UserDataFactory.cs (Thanks to @Damien Jolly) Fix. (From here http://forum.ragezone.com/f353/plus-emulator-security-fixes-1103845/)
But I cant figure out how to fix my client. I'm using BrainCMS and this is the SSO statement:
I would really appreciate it if you took the time of your day to help me.. Thank you.Code:<?php if(!defined('BRAIN_CMS')) { die('Sorry but you cannot access this file!'); } /* Functions list Class Game. --------------- sso(); usersOnline(); homeRoom(); */ class Game { public static function sso() { global $dbh; $timeNow = strtotime("now"); $sessionKey = 'Brain-1.2.3-'.substr(str_shuffle(str_repeat("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", 5)), 0, 25).'-SSO'; $stmt = $dbh->prepare("UPDATE users SET auth_ticket = :sso , last_online = :timenow WHERE id = :id"); $stmt->bindParam(':timenow', $timeNow); $stmt->bindParam(':id', $_SESSION['id']); $stmt->bindParam(':sso', $sessionKey); $stmt->execute(); } Public static function usersOnline() { global $dbh; $userCount = $dbh->prepare("SELECT * FROM users WHERE online = '1'"); $userCount->execute(); return $userCount->RowCount(); } public static function homeRoom() { global $dbh, $hotel; $stmt = $dbh->prepare("UPDATE users SET home_room = :homeroom WHERE id = :id"); $stmt->bindParam(':homeroom', $hotel['homeRoom']); $stmt->bindParam(':id', $_SESSION['id']); $stmt->execute(); } } ?>
Now how would I go about changing it to this:
Code:[COLOR=#666666]$ticket = time().sha1(rand(10000,99999));[/COLOR] [COLOR=#666666]$sql = DB::query('SELECT null FROM `user_auth_ticket` WHERE `user_id` = %i LIMIT 1', (int)$user->Id);[/COLOR] [COLOR=#666666]if(DB::count() > 0) {[/COLOR] [COLOR=#666666]DB::query('UPDATE `user_auth_ticket` SET `auth_ticket` = %s WHERE `user_id` = %i', $ticket, (int)$user->Id);[/COLOR] [COLOR=#666666]}else{[/COLOR] [COLOR=#666666]DB::insert('user_auth_ticket', array ([/COLOR] [COLOR=#666666]'user_id' => $user['id'],[/COLOR] [COLOR=#666666]'auth_ticket' => $ticket[/COLOR] [COLOR=#666666]));[/COLOR] [COLOR=#666666]}[/COLOR]
public static function sso()
{
global $dbh;
//$timeNow = strtotime("now");
$ticket = 'Brain-1.2.3-'.substr(str_shuffle(str_repeat("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", 5)), 0, 25).'-SSO';
$hasTicket = $dbh->prepare('SELECT null from `user_auth_ticket` WHERE `user_id` = ? LIMIT 1');
$hasTicket->execute([ $_SESSION['id'] ]);
if($hasTicket->rowCount() > 0)
{
$update = $dbh->prepare('UPDATE `user_auth_ticket` SET `auth_ticket` = :auth_ticket WHERE `user_id` = :user_id');
$update->execute([
'auth_ticket' => $ticket,
'user_id' => $_SESSION['id']
]);
}
else
{
$insert = $dbh->prepare('INSERT INTO `user_auth_ticket` (`user_id`, `auth_ticket`) VALUES (:user_id, :auth_ticket)');
$insert->execute([
'user_id' => $_SESSION['id'],
'auth_ticket' => $ticket
]);
}
/*
// old code
$stmt = $dbh->prepare("UPDATE users SET auth_ticket = :sso , last_online = :timenow WHERE id = :id");
$stmt->bindParam(':timenow', $timeNow);
$stmt->bindParam(':id', $_SESSION['id']);
$stmt->bindParam(':sso', $sessionKey);
$stmt->execute();
*/
}
Replace your whole sso method (public static function sso) with the following:
Note that I haven't tested it yet.PHP:public static function sso() { global $dbh; //$timeNow = strtotime("now"); $ticket = 'Brain-1.2.3-'.substr(str_shuffle(str_repeat("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", 5)), 0, 25).'-SSO'; $hasTicket = $dbh->prepare('SELECT null from `user_auth_ticket` WHERE `user_id` = ? LIMIT 1'); $hasTicket->execute([ $_SESSION['id'] ]); if($hasTicket->rowCount() > 0) { $update = $dbh->prepare('UPDATE `user_auth_ticket` SET `auth_ticket` = :auth_ticket WHERE `user_id` = :user_id'); $update->execute([ 'auth_ticket' => $ticket, 'user_id' => $_SESSION['id'] ]); } else { $insert = $dbh->prepare('INSERT INTO `user_auth_ticket` (`user_id`, `auth_ticket`) VALUES (:user_id, :auth_ticket)'); $insert->execute([ 'user_id' => $_SESSION['id'], 'auth_ticket' => $ticket ]); } /* // old code $stmt = $dbh->prepare("UPDATE users SET auth_ticket = :sso , last_online = :timenow WHERE id = :id"); $stmt->bindParam(':timenow', $timeNow); $stmt->bindParam(':id', $_SESSION['id']); $stmt->bindParam(':sso', $sessionKey); $stmt->execute(); */ }
<?php staffCheck();
Game::sso();
Game::homeRoom();
?>
<html>
</body>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title><?= $config['hotelName'] ?> - Game</title>
<script src="/templates/brain/client/js/jquery-latest.js" type="text/javascript"></script>
<script src="/templates/brain/client/js/jquery-ui.js" type="text/javascript"></script>
<script src="/templates/brain/client/js/flashclient.js"></script>
<script src="/templates/brain/client/js/flash_detect_min.js"></script>
<script src="/templates/brain/client/js/client.js" type="text/javascript"></script>
</head>
<body>
<center>
<div id="client-ui">
<div id="client" style='position:absolute; left:0; right:0; top:0; bottom:0; overflow:hidden; height:100%; width:100%;'></div>
</div>
<script>
var Client = new SWFObject("<?= $hotel['swfFolderSwf'] ?>", "client", "100%", "100%", "10.0.0");
Client.addVariable("client.allow.cross.domain", "0");
Client.addVariable("client.notify.cross.domain", "1");
Client.addVariable("connection.info.host", "<?= $hotel['emuHost'] ?>");
Client.addVariable("connection.info.port", "<?= $hotel['emuPort'] ?>");
Client.addVariable("site.url", "<?= $config['hotelUrl'] ?>");
Client.addVariable("url.prefix", "<?= $config['hotelUrl'] ?>");
Client.addVariable("client.reload.url", "<?= $config['hotelUrl'] ?>/me");
Client.addVariable("client.fatal.error.url", "<?= $config['hotelUrl'] ?>/me");
Client.addVariable("client.connection.failed.url", "<?= $config['hotelUrl'] ?>/me");
Client.addVariable("external.override.texts.txt", "<?= $hotel['external_Texts_Override'] ?>");
Client.addVariable("external.override.variables.txt", "<?= $hotel['external_Variables_Override'] ?>");
Client.addVariable("external.variables.txt", "<?= $hotel['external_Variables'] ?>");
Client.addVariable("external.texts.txt", "<?= $hotel['external_Texts'] ?>");
Client.addVariable("external.figurepartlist.txt", "<?= $hotel['figuredata'] ?>");
Client.addVariable("flash.dynamic.avatar.download.configuration", "<?= $hotel['figuremap'] ?>");
Client.addVariable("productdata.load.url", "<?= $hotel['productdata'] ?>");
Client.addVariable("furnidata.load.url", "<?= $hotel['furnidata'] ?>");
Client.addVariable("use.sso.ticket", "1");
Client.addVariable("sso.ticket", "<?= User::userData('auth_ticket') ?>");
Client.addVariable("processlog.enabled", "0");
Client.addVariable("client.starting", "<?= $config['hotelName'] ?> is loading...");
Client.addVariable("flash.client.url", "<?= $hotel['swfFolder'] ?>/");
Client.addVariable("flash.client.origin", "popup");
Client.addVariable("nux.lobbies.enabled", "true");
Client.addVariable("country_code", "NL");
Client.addParam('base', '<?= $hotel['swfFolder'] ?>/');
Client.addParam('allowScriptAccess', 'always');
Client.addParam('menu', false);
Client.addParam('wmode', "opaque");
Client.write('client');
FlashExternalInterface.signoutUrl = "<?= $config['hotelUrl'] ?>/logout";
</script>
</center>
</body>
</html>
</center>
</div>
<script>
//no flash?!
if(!FlashDetect.installed){
window.location.href = "<?= $config['hotelUrl'] ?>/noflash.php";
}
</script>
</head>
Check out your database tables. Some tables might be still empty.
Which tables? Can't find 'em.
Error in packet [520] BODY: [0]:prison[0][0][0][0][0][0][0]:
System.IndexOutOfRangeException: Der Index war au?erhalb des Arraybereichs.
bei Plus.HabboHotel.Rooms.Chat.Commands.User.PrisonCommand.Execute(GameClient Session, Room Room, String[] Params) in C:\Users\User\Desktop\EMULADOR ~ ONHABBOR BASED SATIS\servidor plus estavel 2.5 - EDT NOVO CATALOGO\HabboHotel\Rooms\Chat\Commands\Administrator\PrisonCommand.cs:Zeile 30.
bei Plus.HabboHotel.Rooms.Chat.Commands.CommandManager.Parse(GameClient Session, String Message) in C:\Users\User\Desktop\EMULADOR ~ ONHABBOR BASED SATIS\servidor plus estavel 2.5 - EDT NOVO CATALOGO\HabboHotel\Rooms\Chat\Commands\CommandManager.cs:Zeile 104.
bei Plus.Communication.Packets.Incoming.Rooms.Chat.ChatEvent.Parse(GameClient Session, ClientPacket Packet) in C:\Users\User\Desktop\EMULADOR ~ ONHABBOR BASED SATIS\servidor plus estavel 2.5 - EDT NOVO CATALOGO\Communication\Packets\Incoming\Rooms\Chat\ChatEvent.cs:Zeile 41.
bei Plus.Communication.Packets.PacketManager.TryExecutePacket(GameClient Session, ClientPacket Packet) in C:\Users\User\Desktop\EMULADOR ~ ONHABBOR BASED SATIS\servidor plus estavel 2.5 - EDT NOVO CATALOGO\Communication\Packets\PacketManager.cs:Zeile 153.
bei Plus.HabboHotel.GameClients.GameClient.parser_onNewPacket(ClientPacket Message) in C:\Users\User\Desktop\EMULADOR ~ ONHABBOR BASED SATIS\servidor plus estavel 2.5 - EDT NOVO CATALOGO\HabboHotel\GameClients\GameClient.cs:Zeile 73.
Error in packet [520] BODY: [0]:prison test[0][0][0][0][0][0][0]:
System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
bei Plus.HabboHotel.Rooms.Chat.Commands.User.PrisonCommand.Execute(GameClient Session, Room Room, String[] Params) in C:\Users\User\Desktop\EMULADOR ~ ONHABBOR BASED SATIS\servidor plus estavel 2.5 - EDT NOVO CATALOGO\HabboHotel\Rooms\Chat\Commands\Administrator\PrisonCommand.cs:Zeile 38.
bei Plus.HabboHotel.Rooms.Chat.Commands.CommandManager.Parse(GameClient Session, String Message) in C:\Users\User\Desktop\EMULADOR ~ ONHABBOR BASED SATIS\servidor plus estavel 2.5 - EDT NOVO CATALOGO\HabboHotel\Rooms\Chat\Commands\CommandManager.cs:Zeile 104.
bei Plus.Communication.Packets.Incoming.Rooms.Chat.ChatEvent.Parse(GameClient Session, ClientPacket Packet) in C:\Users\User\Desktop\EMULADOR ~ ONHABBOR BASED SATIS\servidor plus estavel 2.5 - EDT NOVO CATALOGO\Communication\Packets\Incoming\Rooms\Chat\ChatEvent.cs:Zeile 41.
bei Plus.Communication.Packets.PacketManager.TryExecutePacket(GameClient Session, ClientPacket Packet) in C:\Users\User\Desktop\EMULADOR ~ ONHABBOR BASED SATIS\servidor plus estavel 2.5 - EDT NOVO CATALOGO\Communication\Packets\PacketManager.cs:Zeile 153.
bei Plus.HabboHotel.GameClients.GameClient.parser_onNewPacket(ClientPacket Message) in C:\Users\User\Desktop\EMULADOR ~ ONHABBOR BASED SATIS\servidor plus estavel 2.5 - EDT NOVO CATALOGO\HabboHotel\GameClients\GameClient.cs:Zeile 73.
Error in packet [520] BODY: [0]:prison test[0][0][0][0][0][0][0]:
System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
bei Plus.HabboHotel.Rooms.Chat.Commands.User.PrisonCommand.Execute(GameClient Session, Room Room, String[] Params) in C:\Users\User\Desktop\EMULADOR ~ ONHABBOR BASED SATIS\servidor plus estavel 2.5 - EDT NOVO CATALOGO\HabboHotel\Rooms\Chat\Commands\Administrator\PrisonCommand.cs:Zeile 102.
bei Plus.HabboHotel.Rooms.Chat.Commands.CommandManager.Parse(GameClient Session, String Message) in C:\Users\User\Desktop\EMULADOR ~ ONHABBOR BASED SATIS\servidor plus estavel 2.5 - EDT NOVO CATALOGO\HabboHotel\Rooms\Chat\Commands\CommandManager.cs:Zeile 104.
bei Plus.Communication.Packets.Incoming.Rooms.Chat.ChatEvent.Parse(GameClient Session, ClientPacket Packet) in C:\Users\User\Desktop\EMULADOR ~ ONHABBOR BASED SATIS\servidor plus estavel 2.5 - EDT NOVO CATALOGO\Communication\Packets\Incoming\Rooms\Chat\ChatEvent.cs:Zeile 41.
bei Plus.Communication.Packets.PacketManager.TryExecutePacket(GameClient Session, ClientPacket Packet) in C:\Users\User\Desktop\EMULADOR ~ ONHABBOR BASED SATIS\servidor plus estavel 2.5 - EDT NOVO CATALOGO\Communication\Packets\PacketManager.cs:Zeile 153.
bei Plus.HabboHotel.GameClients.GameClient.parser_onNewPacket(ClientPacket Message) in C:\Users\User\Desktop\EMULADOR ~ ONHABBOR BASED SATIS\servidor plus estavel 2.5 - EDT NOVO CATALOGO\HabboHotel\GameClients\GameClient.cs:Zeile 73.
Hi all,
I'm using AfterCMS with PlusEmu. When I go on the client to play it, well it charges but it stops at 76%.. I don't really know why. Maybe the .swf ? If anyone can help me I will be very happy. Thanks for watching all!
When I go on the client and load it well but it stops at 76% and still at 76% ....
The emulator is not connecting with the IP, try to open all ports what you are needed.The ports is open -> Firewall OFF -> ext_var - client configured ... I still don't know why :/