mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-12-06 11:17:17 +00:00
- Remove synchronous website integration execution from the GameEngine 600ms tick loop - Decouple website credentials and toggles from ConfigLoader, secrets.json, and Constants.WEBSITE_INTEGRATION - Introduce modular "website" configuration group with independent toggles for players_online and registered_accounts - Consolidate background tasks onto a single daemon ScheduledExecutorService with graceful lifecycle management via ServerStartupEvent and ServerShutdownEvent - Optimize character directory counting with Java NIO streaming to prevent heap allocations - Add UTF-8 URL encoding, User-Agent headers, safe stream handling, and network exception throttling
18 lines
547 B
Kotlin
18 lines
547 B
Kotlin
package plugin.integration.website
|
|
|
|
import com.rs2.event.EventContext
|
|
import com.rs2.event.EventSubscriber
|
|
import com.rs2.event.SubscribesTo
|
|
import com.rs2.event.impl.ServerShutdownEvent
|
|
import com.rs2.game.players.Player
|
|
|
|
@SubscribesTo(ServerShutdownEvent::class)
|
|
class WebsiteShutdownSubscriber : EventSubscriber<ServerShutdownEvent> {
|
|
|
|
override fun subscribe(context: EventContext, player: Player?, event: ServerShutdownEvent) {
|
|
PlayersOnlineWebsite.stop()
|
|
RegisteredAccsWebsite.stop()
|
|
WebsiteService.stop()
|
|
}
|
|
}
|