#some bugs and fixes

1 messages ยท Page 1 of 1 (latest)

sour lion
#

Hi, I love the racing app a lot, but I find it quite buggy, which is quite a pitty.
I have fixed them already and I am wanting that these fixes can be available for everyone using the app.

  1. So, Im using esx, and I found that the bridge of the client side lacks the functions getPlayerJobName and getPlayerJobLevel. The following should be added.
function getPlayerJobName()
    local playerData = ESX.PlayerData
    if playerData and playerData.job then
        return playerData.job.name
    end
end

function getPlayerJobLevel()
    local playerData = ESX.PlayerData
    if playerData and playerData.job and playerData.job.grade then
        return playerData.job.grade
    end
end
  1. Secondly, with the latest update, it shows No auth in the racing app and basically I have no permissions for every actions. It is caused by the following:
    In client/main.lua:2420, the key should be auth instead of type
    In server/main.lua:1524, the key for auth, again, should be auth instead of type

  2. Crew disband does not work.
    This is caused by the wrong callback being triggered.
    In client/main.lua:2974, the callback should be 'cw-racingapp:server:disbandCrew' instead of 'cw-racingapp:server:leaveCrew'
    (basically the disbandCrew callback is not triggered anywhere in the current scriptPaimonNomming )
    BTW, the callback 'cw-racingapp:server:disbandCrew' is duplicated in server/crews.lua, it would be great if that can be removed ๐Ÿ™‚

Thats so far what I found. Thanks again for the amazing app!!001

idle lava
#

Super thanks for actually finding and fixing the issues ๐Ÿ™ wish more people helped out like this

sour lion
#

ur welcome, I'll ask my friends to test it out further, and will let you know if more issues are found๐Ÿ˜‰

sour lion
idle lava
#

Thank you, fixed this also

sour lion
# idle lava Thank you, fixed this also

Hi, my friends have found another bug, that is the crew page does not update upon swapping users.
I have never written in vue so it is hard for me to come up with a fix for that, can you please have a look? thank youKittyHappy

idle lava
#

Will do

idle lava
sour lion
#

then Im stuck with all the vue codes

idle lava
#

Might not be any print in the nui fetch hmmHD
Anyway, it's fixed. No release yet in case I find anything else while playing today. But you can grab the source code

sour lion
# idle lava Might not be any print in the nui fetch <:hmmHD:1236662449839804437> Anyway, it...

Hi, some issues and fixes found today ๐Ÿ™‚

  1. Ranked race cannot be finished. Error shows in server console.
    This is caused by ranking being set to nil on client side when swapping user

modifying the NUICallback UiChangeRacerName as follow would fix the issue(client/main.lua:2513-2536)
(I am not sure why the original code sets CurrentRanking to nil here. Im sorry if this fix breaks anything else but so far it worked fine for me.)

RegisterNUICallback('UiChangeRacerName', function(racername, cb)
    local result = cwCallback.await('cw-racingapp:server:changeRacerName', racername)

    if result and result.name then
        debugLog('New name and type', result.name, result.type)
        CurrentName = result.name
        CurrentAuth = result.auth
        CurrentRanking = result.ranking
        local myCrew = cwCallback.await('cw-racingapp:server:getMyCrew', CurrentName)

        if myCrew then
            debugLog('Is in a crew', myCrew)
            CurrentCrew = myCrew
            TriggerServerEvent('cw-racingapp:server:changeCrew', CurrentCrew)
        else
            CurrentCrew = nil
            TriggerServerEvent('cw-racingapp:server:changeCrew', nil)
        end
        cb(true)
    else
        cb(false)
    end
end)
  1. In certain race, if a racer leaves the race after someone finished the game, that race will get stuck in current race.
    This is because the racers that already finished the race are not excluded when calculating remaining racers.

In server/main.lua:781-783, modify as follow would fix the issue

for _, v in pairs(Tracks[raceId].Racers) do
    if not v.Finished then
        amountOfRacers = amountOfRacers + 1
    end
end

It's midnight here I gotta take some rest for now :), if I found smth more tmr I will let you know again.