Installation

Setting up Glitch on top of Oxide Phone — requirements, start order, database tables, getting the app on phones, live stream limits, money, photo storage, checking it works and updating.

Glitch comes with Oxide Phone. Buying the phone gives you four resources, each its own download in your Cfx Portal assets: oxide-phone (the phone) and its three apps, oxide-hookr, oxide-leakd and oxide-glitch. Set up the phone first with its Installation guide. This page covers what Glitch adds.

Requirements

  • ox_lib, oxmysql and o-link. Glitch needs o-link 1.11.0 or newer: it reaches the phone through o-link's app services, which older versions do not have. Your version is on the version line of o-link/fxmanifest.lua.
  • Oxide Phone (oxide-phone), which hosts the app and carries the live video. Without it Glitch does nothing.
  • QBCore, QBX or ESX (through o-link)
  • OneSync turned on (it is on by default on most servers). The server reads where streamers are and what they drive.
  • The phone's live streams turned on (they are by default). See Live streams.

Steps

Copy the oxide-glitch folder into your server's resources folder, next to oxide-phone. Keep the folder name oxide-glitch.

Open your server.cfg (the text file that lists the resources your server starts).

Add ensure oxide-glitch on its own line, below ensure oxide-phone:

server.cfg
ensure ox_lib
ensure oxmysql
# your framework and your other scripts
ensure o-link
ensure oxide-phone
ensure oxide-glitch

If you keep your Oxide resources in a folder named [oxide] and start them all with ensure [oxide], you can skip this line. Glitch does not have to start after the phone: it joins the phone whenever the phone starts, and again after the phone restarts.

Save server.cfg.

Start Glitch:

  • If the server is off, start it.
  • If the server is running and oxide-phone was already installed when it last started, type refresh in the server console (so the server notices the new folder), then type ensure oxide-glitch. No restart is needed.
  • If you are installing the phone at the same time, restart the whole server instead. Glitch reaches the phone through o-link, and o-link only finds the phone at the moment o-link itself starts.

Glitch creates its database tables (all named oxide_glitch_...) by itself the first time it starts. You do not need to import anything.

The same tables are in sql/migrations (0001_init.sql and 0002_characters.sql) if you would rather create them yourself with your database tool (HeidiSQL, phpMyAdmin and the like). Import them in number order, each file as a whole. Importing them is safe, also more than once: they only create the tables and add the columns that are missing. Glitch still checks its tables at every start, so the database user in your oxmysql connection must be allowed to create and change tables either way.

Getting the app on phones

Players install Glitch themselves from the phone's Store app. You don't need to do anything.

To put Glitch on every phone instead (players can't remove it):

In game, as an admin, type /phone settings.

Open Home & Apps → Store.

Add glitch to Preinstalled apps.

Press Save Changes.

You can also add 'glitch' to Config.Store.preinstalled in oxide-phone/shared/config.lua, but that file only counts before the phone's first start. After that, the list saved in /phone settings is the one used (see the phone's Configuration).

If you turn the Store off (the Store switch in the same place), every app, Glitch included, is on every phone.

Leave Config.App.id as 'glitch'. The phone only serves the app id declared in Glitch's fxmanifest.lua (phone_app 'glitch'), so a different id cuts Glitch off from accounts, streams and photos.

Live streams

The video goes from the streamer's phone through your game server to each real viewer. The phone sets the limits, in /phone settings → Media → Live streams. Its defaults:

  • 25 real viewers per stream
  • 4 streams at once, in every app together (Leakd's lives count too)
  • 60 minutes for the longest stream; the phone ends a stream at that point
  • 40 Mbps of upload for all viewers together

Each real viewer costs the server about 0.73 Mbps of upload at the default quality (500 kbps of video plus overhead), so the default upload budget covers about 54 real viewers across all streams. When a stream or the server is full, viewers are told so and can still chat. Simulated viewers cost nothing.

With live streams turned off, Glitch tells players that streaming is turned off on this server.

Money

Subs and cheers are paid from the viewer's bank, and cash-outs go to the streamer's bank, through o-link (Config.Money.account, bank by default). Nothing else touches player money.

Photos

Avatars and banners come from the phone's Photos and Camera, and are kept in the photo storage you set up for the phone (Fivemanage, or S3 or R2 compatible storage). Glitch needs nothing extra. To set storage up, follow the Photos section of the phone's Installation guide. Live streams do not use this storage. Without storage, channels keep their initials and colours.

Check That It Works

Start the server and watch the console. There should be no red errors from oxide-glitch.

Join the server and open your phone.

Open the Store, find Glitch and install it (skip this if you made it preinstalled).

Open Glitch. You should see the Browse screen (or a sign-in screen if the phone has no SIM).

If Glitch shows Something went wrong and it doesn't go away:

  • Check that o-link is 1.11.0 or newer (see Requirements).
  • Look in the server console for an oxide-glitch error that mentions migrations failed. That means Glitch could not create or update its tables; check that your database user may create and change tables.

Updating

Copy your shared/config.lua, the files in shared/config/ and any locale files you changed somewhere safe.

Replace the oxide-glitch folder with the new one.

Put your changes back into the new files.

Restart oxide-glitch.

New tables or columns are added at start; your data stays. A stream that was live when Glitch stopped is paid from its last save (every minute) the next time Glitch starts, if it ran long enough.