FiveRP: the server from the hosting account, not the earlier one
Wrong server was published before. This is the one that runs on the hosting account the video was made on: FiveRP - two-step registration (account, then an identity printed onto a passport), login that returns you to your resident, and a loading screen driven by the game's own streaming events. resources/[local]/fiverp-auth NUI + scrypt hashes + oxmysql resources/[local]/fiverp-characters identity, character load, spawn resources/[local]/fiverp-loadscreen loading screen sql/schema.sql accounts, characters docs/DESIGN.md the design system every screen follows docs/screens/ shot from the live server Only our own code is in here. cfx-server-data and oxmysql are fetched by install.sh instead of being vendored, which keeps the repo at 3.7 MB. install.sh does the whole box in one command: recommended FXServer build, cfx-server-data, oxmysql, MariaDB with the schema, resources, server.cfg (mode 600 - it carries the key and the database password), boot entry, then it waits for the Cfx registration. Tested end to end on a spare install root: 29 resources scanned, database and schema created, and it stopped exactly where a wrong licence key should stop it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
71856b15e9
commit
c857979a55
@@ -1,36 +1,28 @@
|
||||
# redl-fivem-rp
|
||||
# FiveRP
|
||||
|
||||
An open-source **FiveM roleplay base written completely from scratch** — no ESX, no QBCore, no scripts downloaded from a forum. Every line here was written by an AI agent on a live server, on camera, and it is free for anyone to take and build on.
|
||||
An open **FiveM roleplay base** — account registration, login and character identity, written by an AI agent on a live server, on camera, and free for anyone to take and build on.
|
||||
|
||||
> 🇷🇺 Русская версия — ниже / Russian version below.
|
||||
|
||||
This repository is the server itself, exactly as it runs: the resources, the schema, the supervisor, the config. `sh install.sh` puts it on a clean Ubuntu box.
|
||||
Not a framework fork: `fiverp-auth`, `fiverp-characters` and `fiverp-loadscreen` are written for this server. No ESX, no QBCore. The only things that come from outside are the stock Cfx resources (`mapmanager`, `chat`, `spawnmanager`, `sessionmanager`, `hardcap`) and `oxmysql` — the installer fetches both, so this repository stays small and readable.
|
||||
|
||||
## Why another base?
|
||||
## What it does today
|
||||
|
||||
Most FiveM projects start by dropping in a 200 MB framework, of which you use maybe 5%. You inherit somebody else's bugs, somebody else's dependencies, and you end up with the same server as a thousand other people — and you're afraid to touch any of it, because you don't know what breaks.
|
||||
- **Two-step registration** — account first (email, username, password), identity second (first and last name, issued once, printed onto a passport).
|
||||
- **Login** that returns you to your resident, with the character loaded from the database.
|
||||
- **Loading screen** with real progress from the game's own streaming events.
|
||||
- **Passwords hashed with scrypt**, per-password salt, stored as `scrypt$salt$hash`. The client never decides anything: registration, login and spawning are all server side.
|
||||
- **`basic-gamemode` is deliberately off** — it force-respawns on map start, which would drop a player into the world behind the auth screen. `fiverp-auth` owns spawning instead.
|
||||
|
||||
This is the opposite. It's small, it's readable, and it only contains what was actually asked for. If you don't understand a file, you can ask for it to be rewritten.
|
||||
| Loading | Sign in | Register | Identity |
|
||||
|---|---|---|---|
|
||||
|  |  |  |  |
|
||||
|
||||
## What's in it
|
||||
|
||||
- Own MySQL driver (`rp_db`) — the wire protocol spoken directly over a TCP socket: handshake, `mysql_native_password`, text result sets, a connection pool, transactions. No npm packages, no third-party database resource.
|
||||
- Accounts and characters (`rp_core`, `rp_session`): registration, login, scrypt password hashing, the connection gate (bans, capacity), character creation and spawn. Every decision is made server-side; the client can only ask.
|
||||
- NUI screens with real design work (`rp_ui`, `rp_loading`), not a template: a loading screen with a procedural night-city flyover and synthesised ambience, sign-in / register with live validation, character creation with an orbiting camera and a live ped, and a spawn picker.
|
||||
- A self-test (`rp_selftest`) that proves the account/character data path survived the last restart, and a driver test suite (`rp_dbtest`).
|
||||
- `cfx-server-data` is not used at all — the player cap, chat, spawning and session handling are ours.
|
||||
|
||||
## Screens
|
||||
|
||||
The whole UI follows one theme the agent picked itself — **Los Santos County records**: your login is a residency file, character creation is an identity-record intake, spawn selection is a county survey map.
|
||||
|
||||
| Auth — RESIDENT INTAKE | Character — identity record | Spawn — county survey grid |
|
||||
|---|---|---|
|
||||
|  |  |  |
|
||||
The whole interface follows one design system — a light, glassy theme on **Unbounded**, with the city visible behind the panels. Every colour, radius and font is a token; the rules are in [`docs/DESIGN.md`](docs/DESIGN.md), and the fonts ship with the resources (a NUI page has no guaranteed internet).
|
||||
|
||||
## Install
|
||||
|
||||
Ubuntu 22.04 / 24.04 (or Debian 12), 4 vCPU / 8 GB RAM recommended, and a free server key from [keymaster.fivem.net](https://keymaster.fivem.net).
|
||||
Ubuntu 22.04 / 24.04 or Debian 12, and a free server key from [keymaster.fivem.net](https://keymaster.fivem.net).
|
||||
|
||||
```sh
|
||||
git clone https://github.com/RedlHosting/redl-fivem-rp.git
|
||||
@@ -38,79 +30,63 @@ cd redl-fivem-rp
|
||||
sudo sh install.sh --licence cfxk_your_key_here
|
||||
```
|
||||
|
||||
The installer fetches the recommended FXServer build, installs MariaDB and applies the schema, copies the resources into `/opt/fivem`, writes `server.cfg` and a `secrets.cfg` with a generated database password, sets the server to start on boot, and waits until it has registered with Cfx. Then connect to `<your ip>:30120`.
|
||||
The installer fetches the recommended FXServer build, clones `cfx-server-data`, installs `oxmysql`, sets up MariaDB with the schema and a generated password, copies the FiveRP resources in, writes `server.cfg`, adds a boot entry and waits until the server has registered with Cfx. Then connect to `<your ip>:30120`.
|
||||
|
||||
Useful options: `--dir`, `--hostname`, `--port`, `--name` (run several servers on one box), `--db-name`, `--db-user`, `--no-start`. Run `sh install.sh --help` for the list.
|
||||
Options: `--dir`, `--hostname`, `--port`, `--name` (a second server on the same box), `--db-name`, `--db-user`, `--db-pass`, `--build`, `--no-start`. Run `sh install.sh --help`.
|
||||
|
||||
Day to day:
|
||||
|
||||
```sh
|
||||
service fivem start|stop|restart|status # systemd boxes: systemctl ...
|
||||
rcon status # send a command to the live console
|
||||
service fiverp start|stop|restart|status # systemd boxes: systemctl ...
|
||||
rcon status # command into the live console
|
||||
tail -f /opt/fivem/logs/server.log
|
||||
```
|
||||
|
||||
## Layout
|
||||
|
||||
resources/[rp]/ the server: rp_db, rp_core, rp_session, rp_loading, rp_ui, rp_selftest, rp_dbtest
|
||||
etc/schema.sql database schema (accounts, characters, transactions, inventory, vehicles)
|
||||
bin/ supervise.sh (keep-alive + console FIFO), rcon, the init script
|
||||
assets/fonts/ the bundled font subsets — a NUI page has no guaranteed internet
|
||||
server.cfg.example main config
|
||||
etc/secrets.cfg.example
|
||||
docs/SERVER.md how it is put together, resource by resource
|
||||
|
||||
`docs/SERVER.md` is the design document: what each resource does, why the interface looks the way it does, how the database is protected.
|
||||
resources/[local]/fiverp-auth registration and login (NUI + scrypt + oxmysql)
|
||||
resources/[local]/fiverp-characters identity, character load and spawn
|
||||
resources/[local]/fiverp-loadscreen loading screen
|
||||
sql/schema.sql accounts, characters
|
||||
server.cfg.example main config
|
||||
bin/ keep-alive supervisor, rcon, init script
|
||||
docs/DESIGN.md the design system every screen follows
|
||||
|
||||
## What's not built yet
|
||||
|
||||
The pre-spawn experience and the framework underneath it are done. Gameplay on top of it — chat, HUD, inventory, jobs, vehicles, policing, medical — is not. `characters`, `transactions`, `inventory` and `vehicles` already have their tables, and the money API in `rp_core/server/player.lua` is journalled and ready.
|
||||
Everything after the spawn: chat, HUD, inventory, money, jobs, vehicles. The `characters` table already carries model, appearance, position and heading, so gameplay has somewhere to write.
|
||||
|
||||
- **Part 1** — the foundation: database, registration, login, character creation ← *we are here*
|
||||
- **Part 2** — money, jobs, the bank
|
||||
- **Part 3** — inventory and phone
|
||||
- **Part 4** — garages and vehicles
|
||||
- **Part 5** — an admin panel and the project website on the same machine
|
||||
|
||||
Issues and pull requests are welcome — this is meant to be used, not admired.
|
||||
Issues and pull requests welcome — this is meant to be used, not admired.
|
||||
|
||||
## How it was made
|
||||
|
||||
Everything is built on a [REDL](https://redl.io) VDS, where an AI agent lives on the server itself with root access. The task is given in plain words, the agent writes the code, fixes its own mistakes and restarts the service. The whole process is recorded — including the parts where it broke.
|
||||
Built on a [REDL](https://redl.io) VDS, where an AI agent lives on the server itself with root access. The task is given in plain words, the agent writes the code, fixes its own mistakes and restarts the service. The whole process is recorded — including the parts where it broke.
|
||||
|
||||
## Licence
|
||||
|
||||
MIT — take it, change it, ship it. Credit is nice but not required.
|
||||
MIT for the FiveRP code. `cfx-server-data` and `oxmysql` keep their own licences; Unbounded is under the SIL Open Font License.
|
||||
|
||||
---
|
||||
|
||||
# redl-fivem-rp (RU)
|
||||
# FiveRP (RU)
|
||||
|
||||
Открытая **ролевая база для FiveM, написанная полностью с нуля** — без ESX, без QBCore, без скачанных с форума скриптов. Каждая строчка здесь написана ИИ-агентом на живом сервере, в кадре, и выложена бесплатно для всех.
|
||||
Открытая **ролевая база для FiveM** — регистрация аккаунта, вход и личность персонажа, написанные ИИ-агентом на живом сервере, в кадре, и выложенные бесплатно для всех.
|
||||
|
||||
В репозитории лежит сам сервер, ровно в том виде, в каком он работает: ресурсы, схема базы, супервизор, конфиг. `sh install.sh` ставит его на чистую Ubuntu.
|
||||
Это не форк фреймворка: `fiverp-auth`, `fiverp-characters` и `fiverp-loadscreen` написаны под этот сервер. Никакого ESX и QBCore. Извне берутся только штатные ресурсы Cfx (`mapmanager`, `chat`, `spawnmanager`, `sessionmanager`, `hardcap`) и `oxmysql` — установщик скачивает их сам, поэтому репозиторий остаётся маленьким и читаемым.
|
||||
|
||||
## Зачем ещё одна база?
|
||||
## Что уже работает
|
||||
|
||||
Обычно проект начинается с того, что ставится сборка на 200 мегабайт, из которой реально используется процентов пять. Вместе с ней приезжают чужие баги, чужие зависимости, и в итоге у тебя такой же сервер, как ещё у тысячи человек, — и трогать его страшно, потому что непонятно, что отвалится.
|
||||
- **Регистрация в два шага** — сначала аккаунт (почта, логин, пароль), потом личность (имя и фамилия, выдаются один раз и печатаются на паспорте).
|
||||
- **Вход**, который возвращает к своему персонажу — данные поднимаются из базы.
|
||||
- **Загрузочный экран** с настоящим прогрессом из событий стриминга игры.
|
||||
- **Пароли на scrypt**, соль на каждый пароль, хранение в виде `scrypt$соль$хеш`. Клиент ничего не решает: регистрация, вход и спавн — на сервере.
|
||||
- **`basic-gamemode` намеренно выключен** — он делает принудительный респавн при старте карты и выбрасывал бы игрока в мир за экраном авторизации. Спавном занимается `fiverp-auth`.
|
||||
|
||||
Здесь наоборот. Мало кода, он читаемый, и в нём есть только то, что мы попросили. Не понял файл — попросил переписать.
|
||||
|
||||
## Что внутри
|
||||
|
||||
- Свой драйвер MySQL (`rp_db`) — протокол реализован прямо поверх TCP-сокета: рукопожатие, `mysql_native_password`, разбор результатов, пул соединений, транзакции. Ни одного npm-пакета и ни одного чужого ресурса для базы.
|
||||
- Аккаунты и персонажи (`rp_core`, `rp_session`): регистрация, вход, хеширование паролей scrypt, шлюз подключения (баны, вместимость), создание персонажа и спавн. Все решения принимает сервер, клиент может только попросить.
|
||||
- Экраны NUI с настоящей дизайн-проработкой (`rp_ui`, `rp_loading`), а не шаблон: загрузочный экран с процедурным облётом ночного города и синтезированной атмосферой, вход/регистрация с живой валидацией, создание персонажа с облётом камеры и живой моделью, выбор точки спавна.
|
||||
- Самотест (`rp_selftest`), который на каждом запуске доказывает, что данные аккаунтов и персонажей пережили перезапуск, и набор тестов драйвера (`rp_dbtest`).
|
||||
- `cfx-server-data` не используется вообще — лимит игроков, чат, спавн и сессии свои.
|
||||
|
||||
## Экраны
|
||||
|
||||
Весь интерфейс сделан в одной теме, которую агент выбрал сам, — **архив округа Лос-Сантос**: вход это дело о проживании, создание персонажа — анкета учёта личности, выбор спавна — топографическая карта округа.
|
||||
Весь интерфейс живёт по одной дизайн-системе — светлая «стеклянная» тема на шрифте **Unbounded**, город виден за панелями. Каждый цвет, радиус и шрифт — токен; правила в [`docs/DESIGN.md`](docs/DESIGN.md), шрифты лежат внутри ресурсов (у страницы NUI нет гарантированного интернета).
|
||||
|
||||
## Установка
|
||||
|
||||
Ubuntu 22.04 / 24.04 (или Debian 12), рекомендую 4 vCPU / 8 ГБ RAM, и бесплатный ключ сервера с [keymaster.fivem.net](https://keymaster.fivem.net).
|
||||
Ubuntu 22.04 / 24.04 или Debian 12 и бесплатный ключ сервера с [keymaster.fivem.net](https://keymaster.fivem.net).
|
||||
|
||||
```sh
|
||||
git clone https://github.com/RedlHosting/redl-fivem-rp.git
|
||||
@@ -118,44 +94,38 @@ cd redl-fivem-rp
|
||||
sudo sh install.sh --licence cfxk_ваш_ключ
|
||||
```
|
||||
|
||||
Установщик сам скачает рекомендованную сборку FXServer, поставит MariaDB и накатит схему, разложит ресурсы в `/opt/fivem`, напишет `server.cfg` и `secrets.cfg` со сгенерированным паролем базы, поставит сервер в автозапуск и дождётся регистрации в Cfx. Дальше — `connect <ваш ip>:30120`.
|
||||
Установщик скачает рекомендованную сборку FXServer, склонирует `cfx-server-data`, поставит `oxmysql`, поднимет MariaDB со схемой и сгенерированным паролем, положит ресурсы FiveRP, напишет `server.cfg`, пропишет автозапуск и дождётся регистрации сервера в Cfx. Дальше — `connect <ваш ip>:30120`.
|
||||
|
||||
Полезные параметры: `--dir`, `--hostname`, `--port`, `--name` (несколько серверов на одной машине), `--db-name`, `--db-user`, `--no-start`. Список — `sh install.sh --help`.
|
||||
Параметры: `--dir`, `--hostname`, `--port`, `--name` (второй сервер на той же машине), `--db-name`, `--db-user`, `--db-pass`, `--build`, `--no-start`. Список — `sh install.sh --help`.
|
||||
|
||||
Повседневное:
|
||||
|
||||
```sh
|
||||
service fivem start|stop|restart|status # на машинах с systemd — systemctl ...
|
||||
rcon status # команда в живую консоль сервера
|
||||
service fiverp start|stop|restart|status # на машинах с systemd — systemctl ...
|
||||
rcon status # команда в живую консоль
|
||||
tail -f /opt/fivem/logs/server.log
|
||||
```
|
||||
|
||||
## Что где лежит
|
||||
|
||||
resources/[rp]/ сам сервер: rp_db, rp_core, rp_session, rp_loading, rp_ui, rp_selftest, rp_dbtest
|
||||
etc/schema.sql схема базы (accounts, characters, transactions, inventory, vehicles)
|
||||
bin/ supervise.sh (перезапуск + FIFO консоли), rcon, init-скрипт
|
||||
assets/fonts/ вшитые подмножества шрифтов — у страницы NUI нет гарантированного интернета
|
||||
server.cfg.example основной конфиг
|
||||
etc/secrets.cfg.example
|
||||
docs/SERVER.md как всё устроено, ресурс за ресурсом
|
||||
resources/[local]/fiverp-auth регистрация и вход (NUI + scrypt + oxmysql)
|
||||
resources/[local]/fiverp-characters личность, загрузка персонажа и спавн
|
||||
resources/[local]/fiverp-loadscreen загрузочный экран
|
||||
sql/schema.sql accounts, characters
|
||||
server.cfg.example основной конфиг
|
||||
bin/ супервизор, rcon, init-скрипт
|
||||
docs/DESIGN.md дизайн-система, по которой сделаны все экраны
|
||||
|
||||
## Чего ещё нет
|
||||
|
||||
Всё до спавна и фундамент под этим — готово. Геймплей сверху — чат, HUD, инвентарь, работы, транспорт, полиция, медицина — нет. Таблицы `characters`, `transactions`, `inventory`, `vehicles` уже заведены, денежный API в `rp_core/server/player.lua` журналируемый и готов.
|
||||
|
||||
- **Часть 1** — фундамент: база, регистрация, авторизация, создание персонажа ← *мы здесь*
|
||||
- **Часть 2** — деньги, работы, банк
|
||||
- **Часть 3** — инвентарь и телефон
|
||||
- **Часть 4** — гаражи и транспорт
|
||||
- **Часть 5** — админка + сайт проекта на этой же машине
|
||||
Всего, что после спавна: чат, HUD, инвентарь, деньги, работы, транспорт. В таблице `characters` уже есть модель, внешность, позиция и поворот — геймплею есть куда писать.
|
||||
|
||||
Issues и pull request'ы приветствуются — это сделано, чтобы этим пользовались.
|
||||
|
||||
## Как это сделано
|
||||
|
||||
Всё собирается на VDS [REDL](https://redl.io), где ИИ-агент живёт прямо на сервере с root-доступом. Задача ставится обычными словами, агент пишет код, чинит свои же ошибки и перезапускает сервис. Весь процесс записан — включая те моменты, где всё ломалось.
|
||||
Собрано на VDS [REDL](https://redl.io), где ИИ-агент живёт прямо на сервере с root-доступом. Задача ставится обычными словами, агент пишет код, чинит свои же ошибки и перезапускает сервис. Весь процесс записан — включая моменты, где всё ломалось.
|
||||
|
||||
## Лицензия
|
||||
|
||||
MIT — берите, меняйте, используйте. Упоминание приятно, но не обязательно.
|
||||
MIT на код FiveRP. У `cfx-server-data` и `oxmysql` свои лицензии; Unbounded — под SIL Open Font License.
|
||||
|
||||
Reference in New Issue
Block a user