Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google Log In with Steam Sign In
  • Create Account
Photo

lua and max gs chars and queryclientcvar

lua

  • Please log in to reply
11 replies to this topic

#1
OFFLINE   Zelly

Zelly

    Regular Member

  • Coders
  • PipPipPip
  • 141 posts
73
Getting Better
So first time I have used this. Don't know really the side effects of using this.

I am using et.G_QueryClientCvar() r_mode and r_customwidth and r_customheight to get an estimation on how many characters can fit in a client's console.

The reason I am coming here is I am trying to figure out if my lua is taking up of the MAX_GAMESTATE_CHARS because Tweek reported many of his players are getting kicked after latest update. He does have a lot of maps, but hasn't added any for a while, and only started getting kicked after the update.

So my question is can et.G_QueryClientCvar cause a spike in maxgamestatechars or something else in lua perhaps, I don't think I made any other major changes that could have caused this spike.

Also it goes to cheat.log when it does a query, is there some way to disable this so it doesn't fill up that log.

#2
OFFLINE   gaoesa

gaoesa

    Advanced Member

  • Management
  • PipPipPipPip
  • 4391 posts
341
Will become famous
  • LocationFinland

There is no relation between the et.G_QueryClientCvar and config strings. MAX_GAMESTATE_CHARS means that there is too much text in the config strings.



#3
OFFLINE   Zelly

Zelly

    Regular Member

  • Coders
  • PipPipPip
  • 141 posts
73
Getting Better
Ok thank you, the only reason I thought there was a link is because of the forcecvar and sv_cvars take up csinfo if I remembered correctly.

Am not sure what else it could be, besides the pk3s.

#4
OFFLINE   hellreturn

hellreturn

    Management

  • Management
  • PipPipPipPip
  • 2693 posts
158
On the road to fame

Ok thank you, the only reason I thought there was a link is because of the forcecvar and sv_cvars take up csinfo if I remembered correctly.

Am not sure what else it could be, besides the pk3s.

 

Not complete list but from top of my mind:

 

server motd,

player names,

omni bot names,

extra mod pk3 names,

.admin .url - cvars in config (one of the reason i tell admins not to add those .admin ,url etc etc) No players reads it.

settings in mapconfigs aka forcecvar and sv_cvars



#5
OFFLINE   Zelly

Zelly

    Regular Member

  • Coders
  • PipPipPip
  • 141 posts
73
Getting Better
I do have a sets LuaESMod to the version number so I can see it on gametracker. But that has been in there since the beginning.
Is there a way to see the full output of the gamestate? Maybe I could look for something that would be a little off.
I know of csinfo but that just tells me the length.

Edited by Zelly, 31 March 2015 - 10:46 PM.


#6
OFFLINE   gaoesa

gaoesa

    Advanced Member

  • Management
  • PipPipPipPip
  • 4391 posts
341
Will become famous
  • LocationFinland

Maybe you could print the config strings with Lua http://mygamingtalk....etConfigstring?The first two strings are set by the engine and those can have larger size than the rest. The rest can have maximum length of 1024 bytes each. The total MAX is something like half of the total space (all strings combined), for some weird and unknown reason, if I remember correctly.



#7
OFFLINE   Zelly

Zelly

    Regular Member

  • Coders
  • PipPipPip
  • 141 posts
73
Getting Better
I will give it a shot, thanks.

#8
OFFLINE   Zelly

Zelly

    Regular Member

  • Coders
  • PipPipPip
  • 141 posts
73
Getting Better
What I have so far...
But my total is much higher than csinfo which is what you mean by "The total MAX is something like half of the total space (all strings combined), for some weird and unknown reason, if I remember correctly."
My total was 7081 while csinfo said 4089
local _writetofile = function(line) -- append to csinfo.log
    if not line then return et.G_LogPrint("Line empty\n") end
    local status,f,err = pcall(io.open,"csinfo.log","a")
    if not f then return et.G_LogPrint(err .."\n") end
    if not status then return et.G_LogPrint(f .."\n") end
    f:write(line)
    f:close()
end

local _ljust = function(s,l,sep) --- Justify to left
    if not s then s = "" end
    if type(s) ~= "string" then s = tostring(s) end
    if not l then return s end
    if not sep then sep = " " end
    if s:len() == l then return s end
    l = l - 1
    for k=s:len() , l do s = s .. sep end
    return s
end

function et_ConsoleCommand( cmd )
    local Arg0 = string.lower( et.trap_Argv(0) )
    if Arg0 == "getcsinfo" then
        local LOG_WITH_ZERO_LENGTH = false
        local cs = { }
        local MAX_CONFIGSTRINGS = 1024
        local total_length = 0
        local Arg1 = string.lower( et.trap_Argv(1) )

        if Arg1 == "true" then LOG_WITH_ZERO_LENGTH = true end

        for cs_index=1, MAX_CONFIGSTRINGS do
            local cs_str = et.trap_GetConfigstring( cs_index-1 ) -- index is -1 since it starts at 0
            local cs_len = cs_str:len()
            total_length = total_length + cs_len
            if cs_len > 0 or LOG_WITH_ZERO_LENGTH then
                cs[#cs+1] = _ljust(cs_index-1,4) .. " | " .. _ljust(cs_len,4) .. " | " .. cs_str
            end
        end

        _writetofile("\n\n" .. os.date("%c") .. " " .. et.trap_Cvar_Get('fs_game') .. " " .. et.trap_Cvar_Get('mapname') .. "\nTotal length: " .. total_length .. "\n")
        _writetofile(table.concat(cs,"\n"))

        et.G_LogPrint("Total length: " .. total_length .. "\n")
    end
end
Anything you notice that is off?

#9
OFFLINE   gaoesa

gaoesa

    Advanced Member

  • Management
  • PipPipPipPip
  • 4391 posts
341
Will become famous
  • LocationFinland

I meant that MAX_GAMESTATE_CHARS, the value when the error is triggered, would not be close to the actual available space. I don't know why csinfo gives different results. The value 7081 is not much. Does the content look ok?



#10
OFFLINE   Zelly

Zelly

    Regular Member

  • Coders
  • PipPipPip
  • 141 posts
73
Getting Better
It appears so. I couldn't notice anything strange.
Spoiler


#11
OFFLINE   gaoesa

gaoesa

    Advanced Member

  • Management
  • PipPipPipPip
  • 4391 posts
341
Will become famous
  • LocationFinland

Looks fine.

 

Some notes:

893  | 28   | \id\0\l\0\c\0000000000000001
894  | 6    | \id\-1
895  | 6    | \id\-1
896  | 6    | \id\-1
897  | 6    | \id\-1
898  | 6    | \id\-1
899  | 6    | \id\-1
900  | 6    | \id\-1
901  | 6    | \id\-1
902  | 6    | \id\-1
903  | 6    | \id\-1
904  | 6    | \id\-1

Those are fireteams.

 

About the forced cvars, cg_damagekick doesn't exists, there is no need to force it enabled. Upper limit of 36000 for rate is low. It should be allowed to rise all the way up to 50000 if needed. There is no savings regarding bandwidth. All the same data must be transmitted by the server. Too low value causes the packets the server sends to fragment,  if there are bigger packets. I'm saying 36000 is too low because I've made rate autostepping based on fragmentation for the next version and it always stepped to 36000 pretty fast. There should be some room for even bigger data.



#12
OFFLINE   Zelly

Zelly

    Regular Member

  • Coders
  • PipPipPip
  • 141 posts
73
Getting Better
Ok thank you. Going to send the script over to tweek to see if he has anything wrong.





Also tagged with one or more of these keywords: lua

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users