Skip to content

Commit

Permalink
Config.Linux returns nil when set to true on linux hosts. TweetData.t…
Browse files Browse the repository at this point in the history
…ime works for me in the on linux so I think this is a proper fix.
  • Loading branch information
mbiddle committed Dec 1, 2024
1 parent 61d5bdc commit 81d8d89
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 26 deletions.
1 change: 0 additions & 1 deletion config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ Config = Config or {}
Config.BillingCommissions = { -- This is a percentage (0.10) == 10%
mechanic = 0.10
}
Config.Linux = false -- True if linux
Config.TweetDuration = 12 -- How many hours to load tweets (12 will load the past 12 hours of tweets)
Config.RepeatTimeout = 2000
Config.CallRepeats = 10
Expand Down
37 changes: 12 additions & 25 deletions server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -833,31 +833,18 @@ end)

RegisterNetEvent('qb-phone:server:UpdateTweets', function(NewTweets, TweetData)
local src = source
if Config.Linux then
MySQL.insert('INSERT INTO phone_tweets (citizenid, firstName, lastName, message, date, url, picture, tweetid) VALUES (?, ?, ?, ?, ?, ?, ?, ?)', {
TweetData.citizenid,
TweetData.firstName,
TweetData.lastName,
TweetData.message,
TweetData.date,
TweetData.url:gsub('[%<>\"()\' $]', ''),
TweetData.picture:gsub('[%<>\"()\' $]', ''),
TweetData.tweetId
})
TriggerClientEvent('qb-phone:client:UpdateTweets', -1, src, NewTweets, TweetData, false)
else
MySQL.insert('INSERT INTO phone_tweets (citizenid, firstName, lastName, message, date, url, picture, tweetid) VALUES (?, ?, ?, ?, ?, ?, ?, ?)', {
TweetData.citizenid,
TweetData.firstName,
TweetData.lastName,
TweetData.message,
TweetData.time,
TweetData.url:gsub('[%<>\"()\' $]', ''),
TweetData.picture:gsub('[%<>\"()\' $]', ''),
TweetData.tweetId
})
TriggerClientEvent('qb-phone:client:UpdateTweets', -1, src, NewTweets, TweetData, false)
end

MySQL.insert('INSERT INTO phone_tweets (citizenid, firstName, lastName, message, date, url, picture, tweetid) VALUES (?, ?, ?, ?, ?, ?, ?, ?)', {
TweetData.citizenid,
TweetData.firstName,
TweetData.lastName,
TweetData.message,
TweetData.time,
TweetData.url:gsub('[%<>\"()\' $]', ''),
TweetData.picture:gsub('[%<>\"()\' $]', ''),
TweetData.tweetId
})
TriggerClientEvent('qb-phone:client:UpdateTweets', -1, src, NewTweets, TweetData, false)
end)

RegisterNetEvent('qb-phone:server:TransferMoney', function(iban, amount)
Expand Down

0 comments on commit 81d8d89

Please sign in to comment.