ItsMods

Full Version: More then 256 whitelisted dvars
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This method will allow modders to give admins more than 256 dvars and admins a way to set all the dvars from a config file.

Put in a config: dvartrick.cfg

Code:
if ( dvarfloat( ui_animSpeedScale ) == 0 ) setmoddvar set
    exec server.cfg
    setmoddvar set -remove

Add dvartrick.cfg to the mod fastfile:
rawfile,dvartrick.cfg

When the dedicated server starts, execute the config:
/exec dvartrick.cfg

This will:
- Whitelist 'set' if it's a dedicated server
- Execute server.cg
- Blacklist 'set'

In server.cfg admins can set any number of dvars using 'set dvarname [value]'

Notes:
- The if keyword is followed by a space and the predicate is between brackets. The whole statement is in one line.
- The dvar ui_animspeedscale does not exist in dedicated servers, so the predicate is true. The dvar is client side and can not be set to zero. This prevents clients from using this method to whitelist their own dvars.

Tutorial originally written by ignomo
Source: codhq
(08-04-2011, 18:15)Pozzuh Wrote: [ -> ]This method will allow modders to give admins more than 256 dvars and admins a way to set all the dvars from a config file.

Put in a config: dvartrick.cfg

Code:
if ( dvarfloat( ui_animSpeedScale ) == 0 ) setmoddvar set
    exec server.cfg
    setmoddvar set -remove

Add dvartrick.cfg to the mod fastfile:
rawfile,dvartrick.cfg

When the dedicated server starts, execute the config:
/exec dvartrick.cfg

This will:
- Whitelist 'set' if it's a dedicated server
- Execute server.cg
- Blacklist 'set'

In server.cfg admins can set any number of dvars using 'set dvarname [value]'

Notes:
- The if keyword is followed by a space and the predicate is between brackets. The whole statement is in one line.
- The dvar ui_animspeedscale does not exist in dedicated servers, so the predicate is true. The dvar is client side and can not be set to zero. This prevents clients from using this method to whitelist their own dvars.

Source: codhq

When re-posting someone else's findings/work, always mention their name explicitly. Otherwise, people will unwittingly give you credit for it. It isn't good enough in my view to simply mention the source in the small print at the foot of a post.

As it is this finding was made by ignomo.
I found this posted on the openwarfare mod site. There was no name included, so I didn't know who made it.
( http://openwarfaremod.com/owforum/viewto...=96&t=5432 )

Normally I'd have included the makers name, as I did in the menu file reference I posted.
(08-15-2011, 15:35)Pozzuh Wrote: [ -> ]I found this posted on the openwarfare mod site. There was no name included, so I didn't know who made it.
( http://openwarfaremod.com/owforum/viewto...=96&t=5432 )

Normally I'd have included the makers name, as I did in the menu file reference I posted.

Pozzuh Wrote:There was no name included

Actually, there was. If you look again, I quoted ignomo verbatim, and I also finished my post by saying:

Tally Wrote:Well done ignomo!

http://openwarfaremod.com/owforum/viewto...=96&t=5432

My point was it avoids all sorts of misunderstandings and hurt feelings if you are clear about your sources.
I didn't see that. And as you can see I already edited my post.

Stop hating please.