Lia Core Library
This page documents general utilities used throughout Lilia.
Overview
The core library exposes shared helper functions used across multiple modules. Its main jobs include realm-aware file inclusion and small convenience utilities for coloured console output, deprecation warnings, and standardised punishments.
lia.include
Purpose
Includes a Lua file on the appropriate realm, sending it to clients when required.
Parameters
path
(string): Path to the Lua file.realm
(string): Realm state ("server"
,"client"
,"shared"
, etc.).
Realm
Depends on the file realm.
Returns
- nil: This function does not return a value.
Example
lia.includeDir
Purpose
Includes every Lua file in a directory, with optional recursion and realm override.
Parameters
dir
(string): Directory path.raw
(boolean): Treatdir
as a raw Lua path.deep
(boolean): Include sub-folders whentrue
.realm
(string): Realm state override.
Realm
Depends on included files.
Returns
- nil: This function does not return a value.
Example
lia.includeGroupedDir
Purpose
Recursively includes Lua files while preserving alphabetical order.
Parameters
dir
(string): Directory path.raw
(boolean): Treatdir
as a raw filesystem path.recursive
(boolean): Traverse sub-directories.forceRealm
(string): Realm override for all files.
Realm
Shared
Returns
- nil: This function does not return a value.
Example
lia.error
Purpose
Prints a coloured error message prefixed with “$Lilia$”.
Parameters
msg
(string): Error text.
Realm
Shared
Returns
- nil: This function does not return a value.
Example
lia.deprecated
Purpose
Displays a deprecation warning and optionally runs a fallback callback.
Parameters
methodName
(string): Name of the deprecated method.callback
(function): Fallback function. Optional.
Realm
Shared
Returns
- nil: This function does not return a value.
Example
lia.updater
Purpose
Prints an updater message in cyan with the Lilia prefix.
Parameters
msg
(string): Message text.
Realm
Shared
Returns
- nil: This function does not return a value.
Example
lia.information
Purpose
Prints an informational message with the Lilia prefix.
Parameters
msg
(string): Console text.
Realm
Shared
Returns
- nil: This function does not return a value.
Example
lia.bootstrap
Purpose
Logs a bootstrap message with a coloured section tag.
Parameters
section
(string): Bootstrap stage.msg
(string): Descriptive message.
Realm
Shared
Returns
- nil: This function does not return a value.
Example
lia.notifyAdmin
Purpose
Broadcasts a chat message to all staff members permitted to view alt-account notifications.
Parameters
notification
(string): Text to broadcast.
Realm
Shared
Returns
- nil: This function does not return a value.
Example
lia.printLog
Purpose
Prints a colour-coded log entry to the console.
Parameters
category
(string): Log category name.logString
(string): Text to log.
Realm
Shared
Returns
- nil: This function does not return a value.
Example
lia.applyPunishment
Purpose
Applies standardised kick/ban commands for a player infraction.
Parameters
client
(Player): Player to punish.infraction
(string): Reason.kick
(boolean): Kick the player.ban
(boolean): Ban the player.time
(number): Ban duration (minutes).kickKey
(string): Localisation key for kick reason.banKey
(string): Localisation key for ban reason.
Realm
Shared
Returns
- nil: This function does not return a value.
Example
lia.includeEntities
Purpose
Recursively loads entity-related files from a directory.
Parameters
path
(string): Directory path containing entity files.
Realm
Shared
Returns
- nil: This function does not return a value.
Example