garrysmod-requests icon indicating copy to clipboard operation
garrysmod-requests copied to clipboard

Function for checking that server is under password

Open klen-list opened this issue 2 years ago • 3 comments

Details

Once sv_password has been added to the list of convars that Lua cannot read, there is no normal way to know that the server is under password. Yes, you can file.Read server.cfg or wait for the first run of CheckPassword (but in my case it is needed at server startup, before any connection), but these are all unnecessary workarounds. It would be nice to have a simple function like

bool game.IsPasswordSet()

klen-list avatar Mar 23 '23 06:03 klen-list

What are you needing this for? good addition but there could be a solution

garryspins avatar Mar 23 '23 19:03 garryspins

bool game.HasPassword()

sounds better

unknown-gd avatar Apr 17 '23 22:04 unknown-gd

i personally prefer game.IsPasswordProtected()

also imo this should be a shared function (at least if it doesn't need to be networked)

mgetJane avatar Apr 01 '24 06:04 mgetJane