Running WHIP
What happens behind the Quick Start: the database, oxmysql, a player's first download, Legacy versus Enhanced, and update checks. When something goes wrong, the WHIP setup report in the server console says what to fix (whipsetup prints it again).
The database
WHIP needs MariaDB 10.2.3+ or MySQL 8.0.16+: older versions ignore the rules that stop a bank balance going below zero. The setup report says when yours is too old.
- Waiting for the database. whip_core waits for oxmysql to connect. Meanwhile the console says what to check every 30 seconds, and joining players are told the server is still starting.
- No connection string. With no
mysql_connection_string, whip_core stops and prints the line to add. - No SQL to run. whip_core creates its tables on the first start and updates them on the next start after an update. whip_phone does the same for its own tables.
- A broken table stops the start. If a table can't be created or read, whip_core stops and says why in the console. Players are told the server didn't start.
WHIPFX's oxmysql#
The recipe installs WHIPFX's oxmysql: oxmysql 2.14.3 with one fix. A query made while the database is down returns an error at once, instead of waiting for ever (whip_core gives up after 65 seconds). Stock oxmysql works too; the setup report says which one you run.
To get the fix, replace the oxmysql folder with the latest release, or apply whip_core/dev/oxmysql-p001.diff by hand.
A player's first download#
WHIP's pictures and videos come from WHIP's CDN, each the first time a screen shows it. A server that installs the media packs instead sends them all on the first join, about 510 MB in 5 packs of up to 145 MB each; a pack downloads again only when it changes.
sv_resourceFileDownloadTimeout 600000 raises it to ten minutes. Legacy has no limit.Legacy and Enhanced
FiveM runs on Legacy (the FXServer server) and Enhanced (the cfx-server server). One WHIP runs on both, and almost everything works the same.
A script can't reliably tell which one it's on, so an Enhanced server declares it:
setr whip_platform enhancedThe setup report warns when the server looks like the other platform. To see what your game was told, turn developer mode on in /w and type whipplatform in F8. Developers: Writing for both platforms.
Update checks#
Every 12 hours, whip_core asks GitHub whether WHIP's resources have a newer release, and any other resource that names its repository. A newer one shows in the server console, in the setup report, and to an admin turning developer mode on. whipupdates in the server console lists every resource it checks; whipupdates check asks again now.
It sends one request per repository to api.github.com. GitHub sees your server's address and which repositories it asked about, and nothing else. To turn it off:
set whip_update_check falseYour own resource takes part with one line in its fxmanifest.lua, next to its version:
version '1.0.0'
whip_updates 'you/mycafe' -- the GitHub repository whose latest release is compared with versionA resource's update status, from the last check: your own when resource is left out, or nil when it names no repository. GetUpdates returns every resource that names one. Neither asks GitHub, so call them as often as you like.
{ resource, repository, current, latest, url, newer, checkedAt, problem }|nil · table[]local update = exports.whip_core:GetUpdate()
if update and update.newer then
print(('mycafe %s is out: %s'):format(update.latest, update.url))
end