- Pre-requirements:
- The project needs to be a Docker container
- AWS ECR Repository
- Coolify Resource set up
- Bun needs to be installed on host machine
- Need to set up the coolify server to be able to pull your ECR images (detailed below).
- On your project's folder, create a
.env
with your config (template below).
const roundToNextDivisible = (num: number, interval: number) => { | |
return Math.ceil(num / interval) * interval; | |
}; | |
/** | |
* Similar to setInterval, but aligned to the minute or a multiple of it, while also accounting for drift. | |
*/ | |
export default class MinuteScheduler { | |
public tsLast = Date.now(); |
If you need to spawn a vehicle on the server side, you can use CreateVehicleServerSetter()
, but the issue is that you need the vehicle type, but on the server there is no native to get it from a vehicle model.
In txAdmin this was initially "solved" by getting the vehicle class on the client and sending that to the server use it as a type when creating the vehicle. The logic used on the client is to check for the class on the vehClassNamesEnum
table and assuming automobile
for classes not on that table.
Later it was noticed that the server needs "type" instead of "class", and there is also no GetVehicleTypeFromName()
on the client.
To solve this issue, it was created a lookup table to fix mismatched types.
This gist shows how to generate that table.
This must be run every now and then since new vehicles are added to the game on new DLC releases.
[ | |
{ | |
"name": "txmaster", | |
"master": true, | |
"password_temporary": true, | |
"password_hash": "$2a$12$JterWfFQx1abyi.OBKTIW.mOiHl7wrlyaTnz21SmygI20qO2xIdu2", | |
"providers": {}, | |
"permissions": [] | |
} | |
] |