A go library intended for dragonfly, that lets server owners block or modify Onix Client modules or settings for players who join their server.
NOTE: Players not using Onix Client will not be affected.
This library gives you more control over what players can or can't use when they join your server with Onix Client. Whether you want to block things like Freelook or Hitboxes, or auto-enable helpful features like Double Click Prevent, this library makes it easy to do that through a simple config file.
View the official documentation here.
A proper example can be found here.
// load the controller config, the param provided can be an absolute path.
config, err := controller.LoadConfig("config.yml")
if err != nil {
panic(err)
}
// just a check to see if it can be json-marshalled, if not - panic.
if _, err = config.JSON(); err != nil {
panic(err)
}
// sending a controller config to a player
controller.SendTo(config, p)
# Onix Client Module Control Configuration
# You can find a list of modules here: https://github.com/OnixClient/translations/blob/main/client/languages/en_US.lang
# Server name that will be shown in Onix Client UI
server_name: Server Name
# Custom notification message (optional, leave empty to use default)
notification_message: Optional Notification Message
# BLOCKED MODULES
# Format:
# module_name:
# block: true
# restriction_reason: "Optional message explaining why it's blocked"
blocked_modules:
module.freelook.name:
block: true
module.hitboxes.name:
block: true
restriction_reason: Wear your glasses instead.
# FORCED MODULES
# Format:
# module_name:
# force_enable: true
# restriction_reason: "Optional message explaining why it's forced"
# settings:
# setting_name:
# value: setting_value
# min: minimum_value (optional)
# max: maximum_value (optional)
# lock_value: true/false (optional)
# removed_options: [1, 2] (optional, for enum settings)
forced_modules:
module.double_click_prevent.name:
force_enable: true
restriction_reason: High CPS is not allowed on this server.
settings:
module.double_click_prevent.setting.left_max.name:
max: 17
module.double_click_prevent.setting.limit_left_click.name:
value: true
# MODULE SETTINGS ONLY
# For modules that you don't want to block or force, but just want to change settings
# Format is the same as in the "settings" section above
module_settings:
module.environment_changer.name:
settings:
module.environment_changer.setting.gamma.name:
max: 3