Server Settings
This page covers server-side configuration options including database management, crafting recovery, and shared table functionality.
π§ Configuration Options
All server settings are located in shared/config.lua under the SERVER SETTINGS section.
-- ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
-- SERVER SETTINGS
-- ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Config.CreateAutoTable = true
Config.CraftingItemsRecovery = true
Config.SharedTables = falseπ Setting Descriptions
Automatic Database Creation
Config.CreateAutoTable = truePurpose: Automatically create required database tables when the resource starts for the first time.
Options:
true- Database tables are created automatically (recommended for easy setup)false- Tables must be created manually usingkoja-crafting.sql
How it works: When enabled, the script will execute SQL queries on first startup to create three tables:
koja-crafting-queue
Stores crafting queue data
Fields:
id- Unique queue item IDidentifier- Player identifiercraftingTableId- Which table is being useditemName- Item being crafteditemImage- Item image pathamount- Quantity being craftedcraftingAmount- Items per craftexp- Experience gained on completionstartTime,endTime- Crafting timestampscraftingTime- Duration in secondscompleted- Whether crafting is finished
When to use each option:
β
Use true (Auto-Create) when:
First time installing the script
Want quick and easy setup
Don't have direct database access
Prefer automated setup
β
Use false (Manual Import) when:
You have custom database naming conventions
Want more control over table structure
Already have tables from previous version
Prefer manual database management
Auto-creation only runs if tables don't exist. It is safe to keep enabled β it won't overwrite existing tables. If manual import fails, enable auto-create and restart the resource. Requires oxmysql to be running before koja-crafting starts.
Crafting Items Recovery
Config.CraftingItemsRecovery = truePurpose: Save crafting progress to database, allowing players to recover items after disconnect, server crash, or restart.
Options:
true- Crafting progress is saved to database (recommended)false- Crafting progress is lost on disconnect/restart
How it works:
Example Scenarios:
Player crafts item, logs out normally
β Can claim when back
β Lost forever
Server crashes during crafting
β Items recoverable
β All progress lost
Player crashes/timeout
β Progress saved
β Must restart craft
Server restart for update
β Queue preserved
β Queue wiped
Recommendation:
β Keep enabled for player satisfaction β prevents frustration from lost items. Adds minimal performance impact (one INSERT per craft start and updates on completion).
Performance Considerations:
Minimal database writes
Negligible impact on modern MySQL servers
Benefits outweigh the small overhead
Shared Crafting Tables
Config.SharedTables = falsePurpose: Control whether crafting queues are shared between all players or personal to each player.
Options:
false- Each player has their own private queue (default)true- All players share the same queue per crafting station
How it works:
Personal Queues (false - Default):
Each player sees only their own crafting items
Other players can't interact with your queue
Items are bound to your character
Prevents griefing
Shared Queues (true):
All players see the same queue at each station
Anyone can claim completed items (first come, first served)
Promotes teamwork and collaboration
Risk of item theft if not managed
Use Cases:
Public Server
false (Personal)
Prevents griefing
Roleplay Server
true (Personal)
More realistic
Gang/Faction Server
true (Shared)
Team collaboration
Whitelisted Community
true (Shared)
Trust between players
π Troubleshooting
π Monitoring Database Health (FOR EMERGENCY)
Check active crafting entries:
SELECT COUNT(*) FROM `koja-crafting-queue` WHERE completed = 0;Check player progression:
SELECT identifier, level, exp FROM `koja-crafting` ORDER BY level DESC LIMIT 10;Find stuck/old crafting items:
SELECT * FROM `koja-crafting-queue`
WHERE completed = 0
AND endTime < UNIX_TIMESTAMP(NOW()) * 1000;π Related Settings
For player data configuration, see Player Progression
For queue behavior, see Crafting Queue Settings
For installation guide, see Installation
Last updated