Work in progress
This page is incomplete and work in progress. This will be expanded in the future.
Reason: Internal events aren't too important to explain since they aren't supposed to be called by a thrid party. To spend our time more usefull we focus on other pages people need more.
Internal events
Note
Internal events are not meant to called by external parties. But we can't control what you do with it so instead of you guessing we explain what these internal events do.
However we don't provide examples since, again, they aren't supposed to be called by third parties.
If you do need more information on internal events, please contact us on Discord we don't mind helping you out.
Info
Receiver means this event only receives triggers and a sender triggers the given event (name).
Example:
-- Usage of a receiver
TriggerEvent("ReceiverEventName", "SomeArgument")
-- Usage of a sender
AddEventHandler("SenderEventName" function(arg1)
-- Custom code here
end)
// Usage of a receiver
emit("ReceiverEventName", "SomeArgument")
// Usage of a sender
on("SenderEventName", (arg1) => {
// Custom code here
})
// Usage of a receiver
emit("ReceiverEventName", "SomeArgument")
// Usage of a sender
on("SenderEventName", (arg1: any) => {
// Custom code here
})
Server sided
Receivers
These events only receive triggers.
db:_onModelX
Accessible by client: No
We've got 3 different events for this:
db:_onModelCreateddb:_onModelUpdateddb:_onModelDeleted
When a database model gets created, updated to deleted these events are called. They all take the following arguments:
Arguments
| Argument | Type | Description |
|---|---|---|
| modelName | String | The database model name. |
| model | GarageModel | OutdoorGarageModel | IndoorGarageModel | GarageInteriorModel | ScrapyardModel | ParkingSpotModel | PlayerVehicleModel | GarageAccessModel | ParkingRentModel | The data of this database model. |
_enterIndoorGarage
Accessible by client: No
Event name: rn-garages:server:_enterIndoorGarage
This internal event is used by OnPlayerLoadedTrigger by rn-bridge to put players in a garage if they were in one when they left the server.
Calling this even will make the player immediatly enter the garage (only if they have access).
Arguments
| Argument | Type | Description |
|---|---|---|
| source | Number | The server id of the user who needs to enter a garage. |
| garageId | Number | The database id of the garage the user needs to enter. |
isFullyLoaded
Accessible by client: Yes
Event name: rn-garages:server:isFullyLoaded (First part is based on resource name)
Checks if the kernel is fully loaded or not. Used by client kernels to check if they can send request to the server's endpoints or not.
Arguments
| Argument | Type | Description |
|---|---|---|
| event | String | An client event name to get the result delivered to. |
shouldBoot
Accessible by client: Yes
Event name: rn-garages:server:shouldBoot (First part is based on resource name)
Used by client kernels to check if they should boot or not.
For example: If an error occured while initializing the database this event will return false so the client doesn't continue booting and start requesting stuff from the server side endpoints.
Arguments
| Argument | Type | Description |
|---|---|---|
| event | String | An client event name to get the result delivered to. |
_sendBootProcessStatus
Accessible by client: Yes
Event name: rn-garages:server:_sendBootProcessStatus (First part is based on resource name)
Used by client kernels to check if the server kernel is done checking the user config.
Sends the result to rn-garages:_bootProcessStatus on the client side.
FiveMQ events
For a description on what FiveMQ is see FiveMQ in Bridge documentation.
Critical
These events should NOT be called AT ALL BY A THRID PARTY!
FiveMQ:_handleExpiredParking
Accessible by client: No
Event name: rn-garages:FiveMQ:_handleExpiredParking
When parking has expired on a vehicle this event gets trigged by our FiveMQ module.
Arguments
| Argument | Type | Description |
|---|---|---|
| cb | FiveMQCallback | A callback that takes an acknowledgement argument and returns nothing. |
| playerVehicle | PlayerVehicle | The Sequelize model of PlayerVehicle. |
| garage | ExportedGarageModel | An exported database model version of the garage this event is about. |
FiveMQ:_handleExpiredImpoundParking
Accessible by client: No
Event name: rn-garages:FiveMQ:_handleExpiredImpoundParking
When impound parking has expired on a vehicle this event gets trigged by our FiveMQ module.
Arguments
| Argument | Type | Description |
|---|---|---|
| cb | FiveMQCallback | A callback that takes an acknowledgement argument and returns nothing. |
| playerVehicle | PlayerVehicle | The Sequelize model of PlayerVehicle. |
| garage | ValidGarageModel | The Sequelize model of the garage this event is about. |
FiveMQ:_handleParkingRentPayment
Accessible by client: No
Event name: rn-garages:FiveMQ:_handleParkingRentPayment
When parking rent is due this event gets trigged by our FiveMQ module.
Arguments
| Argument | Type | Description |
|---|---|---|
| cb | FiveMQCallback | A callback that takes an acknowledgement argument and returns nothing. |
| parkingRentId | Number | The database id of the ParkingRent this event is about. |
Client sided
Senders
Data is send to these events and you can listen in on them.
_bootProcessStatus
Accessible by server: Yes
Event name: rn-garages:_bootProcessStatus (First part is based on resource name)
Used by client kernels to receive the result of _sendBootProcessStatus.
Arguments
| Argument | Type | Description |
|---|---|---|
| shouldBoot | Boolean | null | If the client kernel should boot or not. Null means server isn't sure yet. |