# Security and Webhoks

<mark style="color:blue;">Whenever a player rents a vehicle, all financial actions such as the deposit fee, rental charges, refund upon return, and payments made for completed jobs are automatically logged to Discord via webhook.</mark>

<mark style="color:blue;">Additionally, a system designed for server managers (bosses) provides detailed Discord Webhook logs for the following actions:</mark>\ <mark style="color:blue;">player payments, deposit collection, cash withdrawals from the company account, and grain or bale sales.</mark>

## <mark style="color:orange;">🧾 Rental Validation System</mark>

<mark style="color:blue;">To ensure security during vehicle rental and return operations, various validation checks are performed.</mark>

<mark style="color:blue;">When renting a vehicle, the server verifies:</mark>

* <mark style="color:blue;">Whether the vehicle is available for rental</mark>
* <mark style="color:blue;">Whether the player is close enough to the rental point</mark>

<mark style="color:blue;">Similarly, when returning a vehicle, the server checks:</mark>

* <mark style="color:blue;">If the player has actually rented that specific vehicle before</mark>
* <mark style="color:blue;">If the player is near the designated return coordinates</mark>

<mark style="color:blue;">If any of the following conditions are detected:</mark>

* <mark style="color:blue;">The player is too far from the required location</mark>
* <mark style="color:blue;">The client sends incorrect or manipulated data</mark>
* <mark style="color:blue;">The vehicle is not eligible for rental</mark>
* <mark style="color:blue;">The player attempts to return a vehicle they never rented</mark>

<mark style="color:blue;">The action is blocked, and a detailed alert is sent to server admins via Discord Webhook.</mark>

<mark style="color:blue;">This system helps prevent abuse of the rental system and ensures maximum server security.</mark>

***

## ✅ <mark style="color:orange;">Task Validation System</mark>

<mark style="color:blue;">During the planting, harvesting, and baling stages, several validation checks are performed both when players begin a row and when they complete it.</mark>

<mark style="color:blue;">Before a player begins working on a row, the server performs the following validations:</mark>

* <mark style="color:blue;">Checks whether the player is close enough to the first parcel of the selected row</mark>
* <mark style="color:blue;">Verifies the accuracy of the client-side arguments sent by the player</mark>
* <mark style="color:blue;">Confirms that the selected row is suitable for the intended farming stage (planting, harvesting, or baling)</mark>

<mark style="color:blue;">Before completing a row, the server performs the following checks:</mark>

* <mark style="color:blue;">Verifies that the player is at the correct coordinates</mark>
* <mark style="color:blue;">Confirms the accuracy of the client-side arguments</mark>
* <mark style="color:blue;">Checks whether the player has previously started that specific row</mark>

<mark style="color:blue;">During the bale collection stage (with a trailer), the following additional checks are performed:</mark>

* <mark style="color:blue;">Verifies that the player is close to the correct parcel of the selected row</mark>
* <mark style="color:blue;">Checks whether a bale actually exists on that parcel</mark>

<mark style="color:blue;">During the forklift transport phase to the storage area, the following checks are performed:</mark>

* <mark style="color:blue;">Verifies that there is actually a bale at the trailer spot the player is trying to pick from</mark>
* <mark style="color:blue;">Checks whether the player is in the correct position to pick up the bale with the forklift</mark>
* <mark style="color:blue;">During delivery, confirms whether the player has previously picked up a bale using the forklift</mark>

<mark style="color:blue;">If any inconsistency is detected during these validations, the action is canceled and the event is reported in detail to server admins via Discord Webhook.</mark>\ <mark style="color:blue;">This system ensures that row entry and completion processes are securely managed and helps prevent potential abuse.</mark>
