Files
2006Scape/2006Scape Server/plugins/plugin/integration/website/WebsiteConfig.kt
T
Dark98 e1efbb0fdf Website Integration Rewrite, Upgrades & Plugin Migration
- 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
2026-11-13 01:12:15 +00:00

27 lines
1022 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.ServerConfigEvent
import com.rs2.game.players.Player
@SubscribesTo(ServerConfigEvent::class)
class WebsiteConfig : EventSubscriber<ServerConfigEvent> {
companion object {
var password: String = ""
var playersOnline: Boolean = false
var registeredAccounts: Boolean = false
}
override fun subscribe(context: EventContext, player: Player?, event: ServerConfigEvent) {
val legacyMaster = event.getBoolean("website_integration", false)
event.group("website") { g ->
g.registerString("password", password, "websitepass") { password = it }
g.registerBoolean("players_online", legacyMaster, "website_players_online") { playersOnline = it }
g.registerBoolean("registered_accounts", legacyMaster, "website_registered_accounts") { registeredAccounts = it }
}
}
}