Commit Graph

185 Commits

Author SHA1 Message Date
DuckieTM 773694460f 🆙 Small fix Wired Highscore 2026-04-04 16:26:20 +02:00
DuckieTM e6f824aedd 🆙 Wired Core updates
Thanks to Migueg
2026-04-04 16:19:46 +02:00
DuckieTM 0916ff1e0b 🆙 Redone the userwalk flood detection 2026-04-04 08:49:19 +02:00
duckietm 2246d82dc7 🆙 Fix Youtube TV's 2026-03-31 11:41:08 +02:00
DuckieTM 3bc82ee147 Merge pull request #59 from Lorenzune/feature/pr-20260327
Extend wired runtime metadata and placeholder support
2026-03-31 09:01:11 +02:00
DuckieTM 88536e4e88 Merge pull request #53 from simoleo89/furnieditor
feat: FurniEditor WebSocket (packets 10040-10045)
2026-03-30 11:12:13 +02:00
DuckieTM 0ebb303e0c 🆙 Small security fix Forum Groups & better cache
GuildChangeSettingsEvent 2000ms - Write
GuildForumPostThreadEvent 2000ms - Write
ModerateMessage/Thread 2000ms - Write
ThreadUpdate 2000ms -Write
UpdateSettings 2000ms- Write
MarkAsRead 2000ms - Write
Data/List/Threads/Messages - 500ms Read-only
2026-03-29 16:04:52 +02:00
DuckieTM c34bf49e64 🆕 Groups Forums
- Please run the 002_forum_groups.sql !
2026-03-29 14:46:53 +02:00
DuckieTM bf0f246b84 🆙 stage 1 2026-03-28 19:35:00 +01:00
Life 7e736900a3 feat: FurniEditor WebSocket handlers (10040-10045) — search, detail, update, delete, interactions 2026-03-27 20:10:03 +01:00
duckietm 9cbfc6c1db 🆙 Fix Groups Forum SQL code 2026-03-27 17:11:21 +01:00
Lorenzune dfd9cd1357 Extend wired runtime metadata and placeholder support
- add wf_xtra_text_output_furni_name and expand text placeholders for furni, users, bots and pets

- include room, entry, teleport and item metadata needed by the new :wired tools flow

- animate furniture position updates through the wired movement path

- fix teleport pair persistence/lookups for items_teleports with explicit column inserts
2026-03-27 09:37:14 +01:00
DuckieTM f7a75d8614 Merge pull request #51 from Lorenzune/feature/pr-20260326
Add wired evaluation and text placeholder extras
2026-03-26 15:19:59 +01:00
duckietm 95aea934bd 🆙 Fix rooms loading
- Layout Cache (eliminates 1 DB query per room load)

Standard room models (model_a, model_b, etc.) are loaded once at startup and cached in memory
RoomLayout gets a new constructor from cached data instead of ResultSet
~99% of rooms use standard models, so this saves a DB round-trip on nearly every room load

- Better Parallel Pipeline (reduced critical path)

Before: layout → [items|rights|wordfilter] → heightmap → [bots|pets|wired]
After:  layout → [items|rights|wordfilter|bots|pets] → [heightmap|wired]

Bots and pets only need layout for positioning, not items - so they now start immediately
Wired only needs items loaded (not heightmap) - so it now runs parallel with heightmap

-  Deferred Promotion Query (faster Room instantiation)

Moved room_promotions DB query from constructor to loadDataInternal() as an async task
Room constructor now only runs bans query (needed for entry check)
Saves ~20ms per Room instantiation for promoted rooms

-  Smart Heightmap (reduced tile iterations by 80-95%)

Instead of updating ALL tiles (1024 for 32x32 room), only updates tiles with items on them
Uses getTilesAt() for correct rotation-aware multi-tile coverage
For a room with 100 items on a 32x32 grid: ~200 tile updates instead of 1024
2026-03-26 12:44:12 +01:00
duckietm b755828d85 🆙 Small fix UserCreditsComposer
se this instead of this.client.getHabbo() since giveCredits() is already called on the Habbo instance itself. No need for the round-trip through the client.
2026-03-26 10:43:26 +01:00
duckietm 31ebb96a9c 🆙 Speeds up the badge loading 2026-03-26 10:15:40 +01:00
duckietm f2d8f109ff 🆙 Optimization for the gameserver
- Room Cleanup Optimization (RoomManager.java)

Added roomsByOwner ConcurrentHashMap that tracks which rooms belong to which owner
clearInactiveRooms() now iterates unique owners instead of ALL rooms
Went from O(rooms × clients) to O(unique_owners × clients) every 120s

 - Volatile Fields (Room.java)

Removed volatile from 27 room config fields (score, category, chatMode, allowPets, etc.)
Kept volatile only on 8 fields that genuinely need cross-thread visibility (loaded, preLoaded, needsUpdate, muted, etc.)
Reduces CPU cache line invalidation on every room cycle tick

- Search Cache TTL (SearchUserEvent.java + CleanerThread.java)

SearchUserEvent now has 30-second TTL per entry instead of full wipe every 10s
SearchRoomsEvent already had LRU eviction (max 200) — removed redundant .clear() call
Frequently searched users stay cached, only stale entries get cleaned

- scheduledComposers/scheduledTasks — After reading the code, these are actually already handled correctly: processScheduledTasks() swaps the set with a fresh one before processing, and processScheduledComposers() calls .clear() after sending. No leak risk.
2026-03-26 09:59:02 +01:00
duckietm 5319e5e5c3 🆙 Database performance fixes
1. HabboManager - O(1) username lookup
Before: getHabbo(String) held a synchronized lock and iterated ALL online users every call
After: Secondary ConcurrentHashMap<String, Habbo> keyed by lowercase username → instant get() lookup, no lock contention

2. ItemsComponent - Batch DB saves
Before: dispose() spawned a separate thread per dirty item, each opening its own DB connection
After: Single connection, JDBC addBatch()/executeBatch() for both UPDATE and DELETE, flushed every 100 items. A user with 500 dirty items now does 5 batch executions instead of 500 thread spawns + 500 connections.

3. AcceptFriendRequestEvent - N+1 elimination
Before: For each offline user: query 1 (getOfflineHabboInfo by ID) → query 2 (load full Habbo by username) = 2 queries × up to 100 users = 200 queries
After: Single query by user ID directly = 1 query × up to 100 users = 100 queries (50% reduction)

4. RoomManager - Direct HashMap lookup
Before: getCategory(int id) iterated all categories checking getId() == id even though the map is already keyed by ID
After: Direct roomCategories.get(id) → O(1) instead of O(n)
2026-03-26 09:41:31 +01:00
duckietm 954d0d9703 Stop tracking .idea directory 2026-03-26 09:18:24 +01:00
Lorenzune 32d2915b78 Add wired evaluation and text placeholder extras 2026-03-26 05:24:53 +01:00
duckietm d4c0ddf09c 🆙 Bump to Version 4.1.0 2026-03-25 12:46:07 +01:00
DuckieTM f57eefed0f Merge pull request #44 from simoleo89/dev
Fix CatalogPagesListComposer parsing error in Nitro client
2026-03-25 07:49:45 +01:00
Lorenzune e5fbf6f8f4 Refine wired movement, extras, and source handling 2026-03-25 03:26:27 +01:00
Life 0a56f46d28 Fix CatalogPagesListComposer parsing error in Nitro client
The Nitro client's NodeData parser enforces safety limits (max 1000 offers,
500 children, 20 depth) using Math.min() on the count but the server was
sending all data beyond those limits. The unread bytes left in the buffer
corrupted parsing of subsequent nodes, causing RangeError.

Cap server-side output to match client limits and snapshot offerIds array
to prevent potential race conditions between size() and iteration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 21:52:55 +01:00
DuckieTM 0dc0c45096 Merge pull request #42 from Lorenzune/feature/wired-followups-20260324
Refine wired movement and extra behavior
2026-03-24 07:15:13 +01:00
Lorenzune 3a8c9985fb Refine wired movement and extra behavior 2026-03-24 02:11:54 +01:00
DuckieTM 64283d9242 ㊙️ Security update
- SQL injection fix: Replaced string concatenation of minPrice/maxPrice with proper parameterized ? placeholders using a paramIndex counter

- IDOR fix: Added user_id ownership check in MarketPlace.takeBackItem() — now verifies the DB user_id matches the requesting player before allowing item retrieval, with warning log on mismatch
2026-03-23 21:50:08 +01:00
duckietm f6588c378a 🆙 Added the latest Compiled version and cleanup 2026-03-23 16:25:22 +01:00
DuckieTM e08387e5c8 Merge pull request #34 from simoleo89/catalog-redesign
feat: CatalogAdmin server handlers (10050-10059)
2026-03-23 15:22:38 +01:00
Lorenzune 0b12c7d856 feat: improve wired movement and selector behavior 2026-03-22 16:48:51 +01:00
Life 4a20f26685 feat: CatalogAdmin server handlers (10050-10059) with acc_catalogfurni
Add 9 incoming packet handlers + 1 outgoing composer for catalog
admin management via websocket. All operations require acc_catalogfurni
permission.

Handlers:
- CatalogAdminSavePageEvent (10050) - UPDATE catalog_pages
- CatalogAdminCreatePageEvent (10051) - INSERT catalog_pages
- CatalogAdminDeletePageEvent (10052) - DELETE catalog_pages
- CatalogAdminSaveOfferEvent (10053) - UPDATE catalog_items
- CatalogAdminCreateOfferEvent (10054) - INSERT catalog_items
- CatalogAdminDeleteOfferEvent (10055) - DELETE catalog_items
- CatalogAdminMoveOfferEvent (10056) - reorder offers
- CatalogAdminMovePageEvent (10057) - move/toggle enabled/visible
- CatalogAdminPublishEvent (10058) - reload catalog + broadcast
- CatalogAdminResultComposer (10059) - response (success + message)

Includes:
- New permission constant ACC_CATALOGFURNI in Permission.java
- SQL migration to add acc_catalogfurni column to permissions table
- Enabled by default for Administrator rank (id=7)
2026-03-22 16:47:31 +01:00
DuckieTM dc930c086e 🆙 Small fix 2026-03-21 15:28:03 +01:00
Lorenzune b82820c67b Merge remote-tracking branch 'upstream/main'
# Conflicts:
#	Emulator/src/main/java/com/eu/habbo/habbohotel/commands/CommandHandler.java
#	Emulator/src/main/java/com/eu/habbo/habbohotel/items/ItemManager.java
#	Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboHasHandItem.java
#	Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectFurniToFurni.java
#	Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectFurniToUser.java
#	Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectUserToFurni.java
#	Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerFurniStateToggled.java
#	Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboClicksFurni.java
#	Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboClicksTile.java
#	Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboClicksUser.java
#	Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomUnitManager.java
#	Emulator/src/main/java/com/eu/habbo/habbohotel/wired/WiredConditionType.java
#	Emulator/src/main/java/com/eu/habbo/habbohotel/wired/WiredEffectType.java
#	Emulator/src/main/java/com/eu/habbo/habbohotel/wired/WiredTriggerType.java
#	Emulator/src/main/java/com/eu/habbo/habbohotel/wired/core/WiredManager.java
#	Emulator/src/main/java/com/eu/habbo/habbohotel/wired/migrate/WiredEvents.java
#	Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/ClickFurniEvent.java
#	Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/users/ClickUserEvent.java
2026-03-21 14:46:11 +01:00
Lorenzune 3a5d1e21e3 feat(wired): expand advanced wired gameplay tools 2026-03-21 14:27:57 +01:00
DuckieTM d184808218 🆙 Added AvailableCommands 2026-03-21 12:27:43 +01:00
DuckieTM ca25740cdb Merge branch 'main' into dev 2026-03-21 09:06:27 +01:00
simoleo89 6b4e6a8759 feat: custom prefix system with effects and admin commands
Backend implementation:
- UserPrefix model with effect field, DB CRUD operations
- PrefixesComponent inventory management
- PurchasePrefixEvent with settings, blacklist and currency validation
- Composers: UserPrefixes, PrefixReceived, ActivePrefixUpdated
- RoomChatMessage serializes active prefix (text, color, icon, effect)
- Admin commands: giveprefix, listprefixes, removeprefix, prefixblacklist
- CustomPrefixLayout catalog page
- SQL setup: user_prefixes, custom_prefix_settings, custom_prefix_blacklist tables
2026-03-20 17:14:15 +01:00
duckietm aefc1e787b 🆙 Stage 2 reconnect 2026-03-20 17:11:09 +01:00
duckietm 5807303807 🆙 Stage 1 reconnect 2026-03-20 16:08:51 +01:00
DuckieTM 349b2c4dcd Merge pull request #26 from Lorenzune/pr/wired-tools-command-20260319
feat(commands): add wired tools launcher
2026-03-19 21:05:50 +01:00
duckietm c2f3311344 🆙 Duplicate packet fix 2026-03-19 16:17:47 +01:00
duckietm 85ade76142 🆙 Latest comopiled version 2026-03-19 15:48:02 +01:00
Lorenzune 2a9f1c1c32 feat(commands): add wired tools launcher 2026-03-19 15:24:17 +01:00
Lorenzune 12079a43f8 feat(commands): add wired tools launcher 2026-03-19 15:22:49 +01:00
Lorenzune 00782cbde9 feat(wired): add advanced match conditions and hotel timezone 2026-03-19 14:30:32 +01:00
Lorenzune e234debfbd feat(wired): add advanced match conditions and hotel timezone 2026-03-19 14:27:26 +01:00
duckietm 5743341220 🆙 Fix conflict import 2026-03-19 10:20:35 +01:00
DuckieTM 727f0a9242 Merge pull request #23 from Lorenzune/pr/wired-altitude-relative-move-clean-20260318
feat(wired): add altitude and relative move effects
2026-03-19 10:05:39 +01:00
DuckieTM db5f09f81a Merge branch 'main' into pr/wired-triggers-clean-20260318 2026-03-19 10:05:04 +01:00
DuckieTM 67d0639bee Merge branch 'main' into pr/wired-altitude-relative-move-clean-20260318 2026-03-19 10:04:39 +01:00