brenoepics / morningstar

An open-source Arcturus Community Fork.
GNU General Public License v3.0
3 stars 2 forks source link

fix(CatalogManager): disallow loading more than 26598 catalog items - [closed] #1085

Closed brenoepics closed 1 year ago

brenoepics commented 4 years ago

In GitLab by @zgrav on Dec 23, 2019, 20:54

_Merges 264-max-catalogue-itemsv2 -> dev

Closes #264

brenoepics commented 4 years ago

In GitLab by @ghost on Dec 24, 2019, 06:37

Commented on src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java line 270

Yes, you should add this to emulator_settings. Also, I'd consider moving this into a separate query that uses COUNT(*) and only warns the user that the limit has been exceeded.

brenoepics commented 4 years ago

In GitLab by @ghost on Dec 24, 2019, 06:38

Commented on src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java line 49

Make the default something rounded, like 20 000 (unless there is a specific reason for 26598).

brenoepics commented 4 years ago

In GitLab by @zgrav on Dec 24, 2019, 08:13

Commented on src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java line 49

I believe 26598 was/is a hardcoded limit into the client and kicks you out if you exceed this threshold. Can dip down to 20k if you prefer.

brenoepics commented 4 years ago

In GitLab by @zgrav on Dec 24, 2019, 08:30

Commented on src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java line 270

Due to the change (it's items and not pages), I opted to skip the iteration for that specific page with a warning to the user.

brenoepics commented 4 years ago

In GitLab by @zgrav on Dec 24, 2019, 08:52

Just realized I misunderstood this, and it's not pages but catalogitems. will patch

brenoepics commented 4 years ago

In GitLab by @zgrav on Dec 24, 2019, 09:32

Commented on src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java line 49

Confirmed:

Specific catalog section with over 26598 items will crash it. However I think this value can be probably be modded in the .swf, so I made it an option.

Error in update receiver "com.sulake.bootstrap::CoreCommunicationManagerBootstrap": Invalid message length 2142070

brenoepics commented 4 years ago

In GitLab by @zgrav on Dec 24, 2019, 09:41

Commented on src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java line 270

changed this line in version 2 of the diff

brenoepics commented 4 years ago

In GitLab by @zgrav on Dec 24, 2019, 09:41

Commented on src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java line 49

changed this line in version 2 of the diff

brenoepics commented 4 years ago

In GitLab by @zgrav on Dec 24, 2019, 09:41

added 2 commits

Compare with previous version

brenoepics commented 4 years ago

In GitLab by @zgrav on Dec 24, 2019, 09:41

@alejandro I have pushed latest changes. I have one question, if/when this gets merged, where can I add the new setting to a 'common' SQL? Do we build one?

brenoepics commented 4 years ago

In GitLab by @zgrav on Dec 24, 2019, 13:21

resolved all threads

brenoepics commented 4 years ago

In GitLab by @zgrav on Dec 24, 2019, 13:40

added 1 commit

Compare with previous version

brenoepics commented 4 years ago

In GitLab by @ghost on Dec 24, 2019, 15:37

Commented on src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java line 353

It's not a "setting", it's a constraint posed by the EvaWire format. Remove this log line.

brenoepics commented 4 years ago

In GitLab by @ghost on Dec 24, 2019, 15:40

Commented on src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java line 333

Make this a public static integer and make it have a default value of 20 000. Load the actual value set in the config in PluginManager like in https://git.krews.org/morningstar/Arcturus-Community/commit/12b1b7c2ba30a7be48723d3aadc96f7bbb5d95a2#ebe3b3cabd01fddb95e25a9c0bfc2b6d98a98181. Also append a line to the SQL updates that adds the configuration option like in https://git.krews.org/morningstar/Arcturus-Community/commit/906a0c880cd690f35c788aba99e713b562b35e45#161d5a4bc5aeaba61d238615fec566e2631f9338.

brenoepics commented 4 years ago

In GitLab by @zgrav on Dec 24, 2019, 18:07

Commented on src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java line 353

Will do, thank you!

brenoepics commented 4 years ago

In GitLab by @zgrav on Dec 24, 2019, 18:11

Commented on src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java line 353

changed this line in version 4 of the diff

brenoepics commented 4 years ago

In GitLab by @zgrav on Dec 24, 2019, 18:11

Commented on src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java line 333

changed this line in version 4 of the diff

brenoepics commented 4 years ago

In GitLab by @zgrav on Dec 24, 2019, 18:11

added 1 commit

Compare with previous version

brenoepics commented 4 years ago

In GitLab by @zgrav on Dec 24, 2019, 18:11

Commented on src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java line 333

@alejandro please check if it's as intended! :)

brenoepics commented 4 years ago

In GitLab by @zgrav on Dec 24, 2019, 18:12

added 1 commit

Compare with previous version

brenoepics commented 4 years ago

In GitLab by @zgrav on Dec 24, 2019, 18:13

added 1 commit

Compare with previous version

brenoepics commented 4 years ago

In GitLab by @ghost on Dec 27, 2019, 15:37

Closed as per #264

brenoepics commented 4 years ago

In GitLab by @ghost on Dec 27, 2019, 15:37

closed