Ulysses Stuff > Releases

[TTT] Scoreboard Ranks for ULX - Version 1.2.0

<< < (5/12) > >>

GG142:
So, I'm having the same problem, but might be able to give a little extra info;
So it all starts after server restart/map change. First of all, the 'rank' column width resets to 60, even if I set it to something else in the sv_tttsbranks.lua file, or with the column width command. And even weirder; the actual tags stay in the same position.
So say I've set the column width to 200, after a map change the rank column will reset to 60, but the tags will stay in the 200 position.
And then of course the entire I can't see CD or MIA people problem. All these problems seem to go away for everyone after I either update the column width with the ULX command, or refresh the ranks.

I'm currently trying to fix this in the code aswell, but without progress so far.
Good luck! :P

Decicus:

--- Quote from: GG142 on February 14, 2016, 11:33:26 PM ---So, I'm having the same problem, but might be able to give a little extra info;
So it all starts after server restart/map change. First of all, the 'rank' column width resets to 60, even if I set it to something else in the sv_tttsbranks.lua file, or with the column width command. And even weirder; the actual tags stay in the same position.
So say I've set the column width to 200, after a map change the rank column will reset to 60, but the tags will stay in the 200 position.
And then of course the entire I can't see CD or MIA people problem. All these problems seem to go away for everyone after I either update the column width with the ULX command, or refresh the ranks.

I'm currently trying to fix this in the code aswell, but without progress so far.
Good luck! :P

--- End quote ---

I never really checked if the issue happened over a mapchange, but I'll do that when I have time later today. Thanks for letting me know.

GG142:
So uh, holy shite; I found the start of a fix.

Basicly, in the ttt_sb_ranks.lua file, in a new line under the hook.add statement underneath the END of the refresh function, just call the refresh function.
It fixes the problem after server restart, but after map change things will go baad again.
I know that this is a very edgy way of doing things, but it works :P

Anyone not knowing lua, in the file called ttt_sb_ranks.lua there should be this, somewhere around line 18.

--- Code: ---local function TTTSBRanksRefresh( ply )

    if not ULib.fileExists( dir ) then ULib.fileCreateDir( dir ) end
    if ULib.fileRead( dir .. ranks ) then TTTSBRanks = util.JSONToTable( ULib.fileRead( dir .. ranks ) ) end
    if ULib.fileRead( dir .. settings ) then TTTSBSettings = util.JSONToTable( ULib.fileRead( dir .. settings ) ) end
    if ULib.fileRead( dir .. groups ) then TTTSBGroups = util.JSONToTable( ULib.fileRead( dir .. groups ) ) end

    if SERVER then

        net.Start( "ULX_TTTSBRanks" )
        net.WriteTable( TTTSBRanks )
        net.WriteTable( TTTSBSettings )
        net.WriteTable( TTTSBGroups )
        if ply then

            net.Send( ply )

        else

            net.Broadcast()

        end

    end

end
hook.Add( "PlayerInitialSpawn", "ULXTTTRefresh_PlayerJoin", TTTSBRanksRefresh )
--- End code ---
Simply add
--- Code: ---TTTSBRanksRefresh()
--- End code ---
underneath that.

GG142:
Found a complete fix;

--- Code: ---local TTTSBGroups = {}

local function TTTSBRanksRefresh( ply )

    if not ULib.fileExists( dir ) then ULib.fileCreateDir( dir ) end
    if ULib.fileRead( dir .. ranks ) then TTTSBRanks = util.JSONToTable( ULib.fileRead( dir .. ranks ) ) end
    if ULib.fileRead( dir .. settings ) then TTTSBSettings = util.JSONToTable( ULib.fileRead( dir .. settings ) ) end
    if ULib.fileRead( dir .. groups ) then TTTSBGroups = util.JSONToTable( ULib.fileRead( dir .. groups ) ) end

    if SERVER then

        net.Start( "ULX_TTTSBRanks" )
        net.WriteTable( TTTSBRanks )
        net.WriteTable( TTTSBSettings )
        net.WriteTable( TTTSBGroups )
        if ply then

            net.Send( ply )

        else

            net.Broadcast()

        end

    end

end

function dirtyhack(ply)
MsgN( ply:Nick() .. " has spawned!" )
TTTSBRanksRefresh()
end
hook.Add( "PlayerInitialSpawn", "ULXTTTRefresh_PlayerJoin", TTTSBRanksRefresh )
hook.Add( "PlayerSpawn", "ulxttt_dirtyhack", dirtyhack )

--- End code ---
Simply create another function, calling TTTSBRanksRefresh() but then with the hook "PlayerSpawn". :D ('Dirtyhack' is just a placeholder. Also, Decicus; consider adding this in the actual release ;) )

Decicus:

--- Quote from: GG142 on February 15, 2016, 04:22:25 AM ---Found a complete fix;
-snip-
Simply create another function, calling TTTSBRanksRefresh() but then with the hook "PlayerSpawn". :D ('Dirtyhack' is just a placeholder. Also, Decicus; consider adding this in the actual release ;) )

--- End quote ---

Yeah... I already had the idea of doing it for each PlayerSpawn, but then it could potentially be called too often and in worst cases someone might notice lag (even for a split second for each spawn, but still somewhat annoying).
Although, I think implementing a similar hook for the first round after a mapchange using TTTBeginRound might be a possible fix.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version