ovflowd / chocolatey

:chocolate_bar: The open source Habbo.com Engine & CMS
GNU General Public License v3.0
50 stars 19 forks source link

Disable "client-new-user" after choose Room Nux #147

Closed Ducksane closed 7 years ago

Ducksane commented 7 years ago

New users can force "client-new-user" page if they refresh CMS without disconnecting, page must be disabled once users choose a room nux.

ovflowd commented 7 years ago

That shouldn't happen. Since the CMS disables it after choosing the room.

I will give a look.

ovflowd commented 7 years ago

@s150217754 can you confirm this?

s150217754 commented 7 years ago

Will try it out in a couple of days. Been a really busy week.

Ducksane commented 7 years ago

Players exploit this bug to create multiple room. I hope a fix will take place quickly

s150217754 commented 7 years ago

@BobyTS does this apply to Registering a New Account or New Avatar or both?

How would I be able to replicate this glitch? By refreshing during Loading page or..?

Ducksane commented 7 years ago

@s150217754 After passing the stage of selection of the room nux, reloaded the page

s150217754 commented 7 years ago

So it's after selecting the room and before the client loads completely?

Ok sure, will try to replicate this later.

Ducksane commented 7 years ago

Well it happens anytime from the moment you refresh page without logout from the CMS.

I have misconfigured my CORS, so maybe my problem is wrong I will do another test a little later

s150217754 commented 7 years ago

Sure, keep us updated! Nevertheless I will try it on my end in the evening.

Ducksane commented 7 years ago

Here is how to create multiple room nux:

new-user-client_bug

s150217754 commented 7 years ago

Yes I have just verified this on my end and multiple rooms were created.

multinuxroom

@BobyTS Also, can you verify whether the Furnis are actually inserted in the room? I realised (on my end) that there is no Furnis in the room.

Chrome Log

Failed to load resource: the server responded with a status of 500 (Internal Server Error)
Choosing room failed!

Lumen Log

Next Illuminate\Database\QueryException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'baba' for key 'username' (SQL: insert into `users` (`username`, `mail`, `motto`, `look`, `auth_ticket`, `password`, `account_created`, `ip_current`) values (baba, test@mail.net, I'm new to this game!!, hr-100.hd-180-1.ch-210-66.lg-270-82.sh-290-80, , d946912ed9506e88f7e8336e3bd28abefc0b4245f6a2c20b2aa8914a4f2afa74, 1492013892, 127.0.0.1)) in C:\xampp\htdocs\vendor\illuminate\database\Connection.php:647
Stack trace:
#0 C:\xampp\htdocs\vendor\illuminate\database\Connection.php(607): Illuminate\Database\Connection->runQueryCallback('insert into `us...', Array, Object(Closure))
#1 C:\xampp\htdocs\vendor\illuminate\database\Connection.php(450): Illuminate\Database\Connection->run('insert into `us...', Array, Object(Closure))
#2 C:\xampp\htdocs\vendor\illuminate\database\Connection.php(404): Illuminate\Database\Connection->statement('insert into `us...', Array)
#3 C:\xampp\htdocs\vendor\illuminate\database\Query\Processors\Processor.php(32): Illuminate\Database\Connection->insert('insert into `us...', Array)
#4 C:\xampp\htdocs\vendor\illuminate\database\Query\Builder.php(2131): Illuminate\Database\Query\Processors\Processor->processInsertGetId(Object(Sofa\Eloquence\Query\Builder), 'insert into `us...', Array, 'id')
#5 C:\xampp\htdocs\vendor\illuminate\database\Eloquent\Builder.php(1242): Illuminate\Database\Query\Builder->insertGetId(Array, 'id')
#6 C:\xampp\htdocs\vendor\illuminate\database\Eloquent\Model.php(674): Illuminate\Database\Eloquent\Builder->__call('insertGetId', Array)
#7 C:\xampp\htdocs\vendor\illuminate\database\Eloquent\Model.php(639): Illuminate\Database\Eloquent\Model->insertAndSetId(Object(Sofa\Eloquence\Builder), Array)
#8 C:\xampp\htdocs\vendor\illuminate\database\Eloquent\Model.php(508): Illuminate\Database\Eloquent\Model->performInsert(Object(Sofa\Eloquence\Builder))
#9 C:\xampp\htdocs\vendor\sofa\hookable\src\Hookable.php(125): Illuminate\Database\Eloquent\Model->save(Array)
#10 C:\xampp\htdocs\app\Models\User.php(187): App\Models\User->save()
#11 C:\xampp\htdocs\app\Http\Controllers\AccountController.php(223): App\Models\User->store('baba', '3e51e377ff29103...', 'test@mail.net', '127.0.0.1')
#12 C:\xampp\htdocs\app\Http\Controllers\AccountController.php(198): App\Http\Controllers\AccountController->createUser(Object(Illuminate\Http\Request), Array)
#13 [internal function]: App\Http\Controllers\AccountController->createAvatar(Object(Illuminate\Http\Request))
#14 C:\xampp\htdocs\vendor\illuminate\container\BoundMethod.php(29): call_user_func_array(Array, Array)
#15 C:\xampp\htdocs\vendor\illuminate\container\BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#16 C:\xampp\htdocs\vendor\illuminate\container\BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Laravel\Lumen\Application), Array, Object(Closure))
#17 C:\xampp\htdocs\vendor\illuminate\container\Container.php(531): Illuminate\Container\BoundMethod::call(Object(Laravel\Lumen\Application), Array, Array, NULL)
#18 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(741): Illuminate\Container\Container->call(Array, Array)
#19 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(707): Laravel\Lumen\Application->callControllerCallable(Array, Array)
#20 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(681): Laravel\Lumen\Application->callLumenController(Object(App\Http\Controllers\AccountController), 'createAvatar', Array)
#21 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(643): Laravel\Lumen\Application->callControllerAction(Array)
#22 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(623): Laravel\Lumen\Application->callActionOnArrayBasedRoute(Array)
#23 [internal function]: Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}(Object(Illuminate\Http\Request))
#24 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Routing\Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#25 C:\xampp\htdocs\app\Http\Middleware\Maintenance.php(25): Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(Object(Illuminate\Http\Request))
#26 C:\xampp\htdocs\vendor\illuminate\pipeline\Pipeline.php(148): App\Http\Middleware\Maintenance->handle(Object(Illuminate\Http\Request), Object(Closure))
#27 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#28 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Routing\Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#29 C:\xampp\htdocs\vendor\illuminate\pipeline\Pipeline.php(102): Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(Object(Illuminate\Http\Request))
#30 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(778): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#31 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(624): Laravel\Lumen\Application->sendThroughPipeline(Array, Object(Closure))
#32 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(528): Laravel\Lumen\Application->handleFoundRoute(Array)
#33 [internal function]: Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}(Object(Illuminate\Http\Request))
#34 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Routing\Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#35 C:\xampp\htdocs\vendor\rdehnhardt\lumen-maintenance-mode\src\Http\Middleware\MaintenanceModeMiddleware.php(49): Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(Object(Illuminate\Http\Request))
#36 C:\xampp\htdocs\vendor\illuminate\pipeline\Pipeline.php(148): Rdehnhardt\MaintenanceMode\Http\Middleware\MaintenanceModeMiddleware->handle(Object(Illuminate\Http\Request), Object(Closure))
#37 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#38 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Routing\Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#39 C:\xampp\htdocs\vendor\illuminate\pipeline\Pipeline.php(102): Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(Object(Illuminate\Http\Request))
#40 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(778): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#41 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(534): Laravel\Lumen\Application->sendThroughPipeline(Array, Object(Closure))
#42 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(475): Laravel\Lumen\Application->dispatch(NULL)
#43 C:\xampp\htdocs\index.php(26): Laravel\Lumen\Application->run()
#44 {main}  
Ducksane commented 7 years ago

Well indeed, still a new bug since I updated the CMS. Furni no longer register in the table and it no longer automatically goes into it room (home_room) after registration.

s150217754 commented 7 years ago

@BobyTS Believe its because of StyleCI changes. Will be creating a new issue ticket on your behalf.

ovflowd commented 7 years ago

@s150217754 the log that you presented it's about creatingAvatar. Not related to client-new-user could you provide the logs from the client thing? I will also by myself test it.

s150217754 commented 7 years ago

@sant0ro Chocolatey tries to create a new avatar everytime the client refresh back on client-new-user but failed. However, the rooms will still get created.

The log should be correct. I can try it again later.

ovflowd commented 7 years ago

As Far I can see

    // Create a New User Avatar
    $app->post('api/user/avatars', 'AccountController@createAvatar');

createAvatar is only used when you create a new Avatar on UserPreferences.

s150217754 commented 7 years ago

Maybe I mixed up the logs. Will try again and post the right logs.

ovflowd commented 7 years ago

Fixed it. And disabled new-client-user on new user.

Ducksane commented 7 years ago

@sant0ro Nice but this technique still works to create several room nux :

new-user-client_bug

ovflowd commented 7 years ago

Weird. Does the Rooms being created and with furniture?

Does any error happens on lumen.log?

Ducksane commented 7 years ago

Yes, rooms and furnis are inserted into the database. No error on lumen.log

ovflowd commented 7 years ago

I think I fixed it now.

Ducksane commented 7 years ago

@sant0ro Perfect, it is no longer possible to create several rooms, but what bothers me is that " client-new-user" page always appears if we refresh the page. Problem is that if a player crashes a few minutes after signing up, client-new-user reappears. It will automatically lose its look. Can you make sure that the page no longer appears once the nux room has been created ? It's like Habbo.

Ducksane commented 7 years ago

@sant0ro Unresolved problem, after a crash , new players can no longer login for name already used because client-new-user always appears

ovflowd commented 7 years ago

What you mean after a crash? It's client-new-user still appearing?

ovflowd commented 7 years ago

@BobyTS does after creating a room appears an error in lumen.log?

Ducksane commented 7 years ago

New users who have never logged out of the CMS have alway "client-new-user". I have not seen any room error, only SQL errors for duplicate name

ovflowd commented 7 years ago

@BobyTS download a ZIP of last "binaries" branch. (Not in Releases) just download the branch as ZIP and try it again.

Ducksane commented 7 years ago

We should no longer use the master branch? To update our CMS this is the most convenient way

ovflowd commented 7 years ago

master branch are stable source codes. development branch are unstable source codes under development binaries branch are build source coded ready to use with just extracting the code.

Pull Requests need to be sent to development branch.

Ducksane commented 7 years ago

I see but to update my CMS without having to download the .zip, which branch should I use? Binaries too ? :) I work with PhpStorm and I get the changes from the master branch

ovflowd commented 7 years ago

Yes, binaries.

You can easily switch using:

git pull
git checkout binaries

And to switch again to master

git checkout master

If you want to contribute

git checkout development

Do your changes and after saving the files

git add --all
git commit -m "Commit Message"
git push