Don't handle server-side sphere for now

This commit is contained in:
Vortrex
2022-08-01 02:14:12 -05:00
parent e94da0eb95
commit 521b0a406c

View File

@@ -245,10 +245,9 @@ function onResourceStop(event, resource) {
if (resource == thisResource) { if (resource == thisResource) {
kickAllClients(); kickAllClients();
saveServerDataToDatabase(); saveServerDataToDatabase();
disconnectFromDatabase(persistentDatabaseConnection, true);
collectAllGarbage(); collectAllGarbage();
} }
disconnectFromDatabase(persistentDatabaseConnection, true);
} }
// =========================================================================== // ===========================================================================
@@ -257,18 +256,21 @@ function onPedEnteredSphere(event, ped, sphere) {
if (ped.isType(ELEMENT_PLAYER)) { if (ped.isType(ELEMENT_PLAYER)) {
let client = getClientFromPlayerElement(ped); let client = getClientFromPlayerElement(ped);
if (isPlayerOnJobRoute(client)) { // Handled client-side since server spheres aren't showing on GTAC atm (bug)
if (sphere == getJobRouteLocationData(getPlayerJob(client), getPlayerJobRoute(client), getPlayerJobRouteLocation(client)).marker) { //if (isPlayerOnJobRoute(client)) {
playerArrivedAtJobRouteLocation(client); // if (sphere == getJobRouteLocationData(getPlayerJob(client), getPlayerJobRoute(client), getPlayerJobRouteLocation(client)).marker) {
} // playerArrivedAtJobRouteLocation(client);
} // }
//}
} }
} }
// =========================================================================== // ===========================================================================
function onPedExitedSphere(event, ped, sphere) { function onPedExitedSphere(event, ped, sphere) {
//if (ped.isType(ELEMENT_PLAYER)) {
// let client = getClientFromPlayerElement(ped);
//}
} }
// =========================================================================== // ===========================================================================
@@ -277,11 +279,11 @@ function onPedPickupPickedUp(event, ped, pickup) {
if (ped.isType(ELEMENT_PLAYER)) { if (ped.isType(ELEMENT_PLAYER)) {
let client = getClientFromPlayerElement(ped); let client = getClientFromPlayerElement(ped);
if (isPlayerOnJobRoute(client)) { //if (isPlayerOnJobRoute(client)) {
if (pickup == getJobRouteLocationData(getPlayerJob(client), getPlayerJobRoute(client), getPlayerJobRouteLocation(client)).marker) { // if (pickup == getJobRouteLocationData(getPlayerJob(client), getPlayerJobRoute(client), getPlayerJobRouteLocation(client)).marker) {
playerArrivedAtJobRouteLocation(client); // playerArrivedAtJobRouteLocation(client);
} // }
} //}
} }
} }
@@ -512,12 +514,12 @@ async function onPlayerSpawn(client) {
updatePlayerSnowState(client); updatePlayerSnowState(client);
} }
if (areServerElementsSupported() && isGameFeatureSupported("walkingStyle")) { if (areServerElementsSupported() && isGameFeatureSupported("walkStyle")) {
logToConsole(LOG_DEBUG, `[VRR.Event] Setting player walking style for ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[VRR.Event] Setting player walking style for ${getPlayerDisplayForConsole(client)}`);
setEntityData(getPlayerPed(client), "agrp.walkStyle", getPlayerCurrentSubAccount(client).walkStyle, true); setEntityData(getPlayerPed(client), "agrp.walkStyle", getPlayerCurrentSubAccount(client).walkStyle, true);
} }
if (isGameFeatureSupported("fightingStyle")) { if (isGameFeatureSupported("fightStyle")) {
logToConsole(LOG_DEBUG, `[VRR.Event] Setting player fighting style for ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[VRR.Event] Setting player fighting style for ${getPlayerDisplayForConsole(client)}`);
setPlayerFightStyle(client, getPlayerCurrentSubAccount(client).fightStyle); setPlayerFightStyle(client, getPlayerCurrentSubAccount(client).fightStyle);
} }