Skip to content

Commit

Permalink
convert: esx_datastore > bpt_datastore
Browse files Browse the repository at this point in the history
  • Loading branch information
bitpredator committed Jun 11, 2024
1 parent 6c5eb45 commit 005e3df
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 235 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

Expand Down Expand Up @@ -631,8 +631,8 @@ to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

esx_datastore
Copyright (C) 2015-2022 Jérémie N'gadi
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 2024 bitpredator

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -645,14 +645,14 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

esx_datastore Copyright (C) 2015-2022 Jérémie N'gadi
<program> Copyright (C) 2024 bitpredator
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
Expand All @@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
<https://www.gnu.org/licenses/>.

The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
<https://www.gnu.org/licenses/why-not-lgpl.html>.
19 changes: 19 additions & 0 deletions server-data/resources/[bpt_addons]/bpt_datastore/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<h1 align='center'>bpt_datastore</a></h1>
<p align='center'><a href='https://discord.gg/ksGfNvDEfq'>Discord</a>

Copyright (C) 2024 bitpredator

This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version.

This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details.

ATTENTION:
You are not authorized to change the name of the resource and the resources within it.

If you want to contribute you can open a pull request.

You are not authorized to sell this software (this is free project).

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ CREATE TABLE `datastore_data` (
UNIQUE INDEX `index_datastore_data_name_owner` (`name`, `owner`),
INDEX `index_datastore_data_name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

16 changes: 16 additions & 0 deletions server-data/resources/[bpt_addons]/bpt_datastore/fxmanifest.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
fx_version("adamant")

game("gta5")

description("Used for storing Data, such as society inventories")

version("1.0.0")

lua54("yes")

server_scripts({
"@es_extended/imports.lua",
"@oxmysql/lib/MySQL.lua",
"server/classes/datastore.lua",
"server/main.lua",
})
6 changes: 3 additions & 3 deletions server-data/resources/[esx]/esx_society/server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ AddEventHandler("esx_society:putVehicleInGarage", function(societyName, vehicle)
print(("[^3WARNING^7] Player ^5%s^7 attempted to put vehicle in non-existing society garage - ^5%s^7!"):format(source, societyName))
return
end
TriggerEvent("esx_datastore:getSharedDataStore", society.datastore, function(store)
TriggerEvent("bpt_datastore:getSharedDataStore", society.datastore, function(store)
local garage = store.get("garage") or {}
table.insert(garage, vehicle)
store.set("garage", garage)
Expand All @@ -171,7 +171,7 @@ AddEventHandler("esx_society:removeVehicleFromGarage", function(societyName, veh
print(("[^3WARNING^7] Player ^5%s^7 attempted to remove vehicle from non-existing society garage - ^5%s^7!"):format(source, societyName))
return
end
TriggerEvent("esx_datastore:getSharedDataStore", society.datastore, function(store)
TriggerEvent("bpt_datastore:getSharedDataStore", society.datastore, function(store)
local garage = store.get("garage") or {}

for i = 1, #garage, 1 do
Expand Down Expand Up @@ -398,7 +398,7 @@ ESX.RegisterServerCallback("esx_society:getVehiclesInGarage", function(_, cb, so
print(("[^3WARNING^7] Attempting To get a non-existing society - %s!"):format(societyName))
return
end
TriggerEvent("esx_datastore:getSharedDataStore", society.datastore, function(store)
TriggerEvent("bpt_datastore:getSharedDataStore", society.datastore, function(store)
local garage = store.get("garage") or {}
cb(garage)
end)
Expand Down
43 changes: 0 additions & 43 deletions server-data/resources/[esx_addons]/esx_datastore/README.md

This file was deleted.

14 changes: 0 additions & 14 deletions server-data/resources/[esx_addons]/esx_datastore/fxmanifest.lua

This file was deleted.

This file was deleted.

80 changes: 0 additions & 80 deletions server-data/resources/[esx_addons]/esx_datastore/server/main.lua

This file was deleted.

1 change: 0 additions & 1 deletion server-data/resources/[esx_addons]/esx_policejob/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ This resource for ESX adds police armories, vehicle garages and ability for cops
* [esx_vehicleshop](https://github.com/esx-framework/esx_vehicleshop)

* Player management (boss actions and armory with buyable weapons)
* [esx_datastore](https://github.com/esx-framework/esx_datastore)
* [esx_society](https://github.com/esx-framework/esx_society)

* ESX Identity Support
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ ESX.RegisterServerCallback("esx_policejob:getVehicleInfos", function(source, cb,
end)

ESX.RegisterServerCallback("esx_policejob:getArmoryWeapons", function(source, cb)
TriggerEvent("esx_datastore:getSharedDataStore", "society_police", function(store)
TriggerEvent("bpt_datastore:getSharedDataStore", "society_police", function(store)
local weapons = store.get("weapons")

if weapons == nil then
Expand All @@ -281,7 +281,7 @@ ESX.RegisterServerCallback("esx_policejob:addArmoryWeapon", function(source, cb,
xPlayer.removeWeapon(weaponName)
end

TriggerEvent("esx_datastore:getSharedDataStore", "society_police", function(store)
TriggerEvent("bpt_datastore:getSharedDataStore", "society_police", function(store)
local weapons = store.get("weapons") or {}
local foundWeapon = false

Expand Down Expand Up @@ -309,7 +309,7 @@ ESX.RegisterServerCallback("esx_policejob:removeArmoryWeapon", function(source,
local xPlayer = ESX.GetPlayerFromId(source)
xPlayer.addWeapon(weaponName, 500)

TriggerEvent("esx_datastore:getSharedDataStore", "society_police", function(store)
TriggerEvent("bpt_datastore:getSharedDataStore", "society_police", function(store)
local weapons = store.get("weapons") or {}

local foundWeapon = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ end)
ESX.RegisterServerCallback("esx_property:getPlayerDressing", function(source, cb)
local xPlayer = ESX.GetPlayerFromId(source)

TriggerEvent("esx_datastore:getDataStore", "property", xPlayer.identifier, function(store)
TriggerEvent("bpt_datastore:getDataStore", "property", xPlayer.identifier, function(store)
local count = store.count("dressing")
local labels = {}

Expand Down Expand Up @@ -1270,7 +1270,7 @@ end)
ESX.RegisterServerCallback("esx_property:getPlayerOutfit", function(source, cb, num)
local xPlayer = ESX.GetPlayerFromId(source)

TriggerEvent("esx_datastore:getDataStore", "property", xPlayer.identifier, function(store)
TriggerEvent("bpt_datastore:getDataStore", "property", xPlayer.identifier, function(store)
local outfit = store.get("dressing", num)
cb(outfit.skin)
end)
Expand Down

0 comments on commit 005e3df

Please sign in to comment.