Forum

> > CS2D > Scripts > Writing bans to list manually.
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Writing bans to list manually.

2 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Writing bans to list manually.

Mami Tomoe
User Off Offline

Zitieren
Is it possible to write bans into the bans.lst file manually (through Lua) without the usage of any of the CS2D commands (I.E.: cs2d cmd banip)?

How will that affect the server?

Is the file change detection reliable enough?

Are there any risks of dataloss?

Does the order and formatting matter to CS2D?

I want to manually save my temporary bans because CS2D does not want to do that.

alt Re: Writing bans to list manually.

DC
Admin Off Offline

Zitieren
Yes, that should work. CS2D checks the modification date of bans.lst every 5 seconds and reloads it if has been changed outside of CS2D. At least that's what I see in the code. Not sure if it's really working

Zitat
How will that affect the server?

It should do what you would expect: The bans you added to the file should be loaded (if formatted correctly).

Zitat
Is the file change detection reliable enough?

There shouldn't be any problems with that. It's important that the program you use to manipulate the file also changes the modification time of the file properly (which is pretty standard).

Zitat
Are there any risks of dataloss?

Yes, there are risks. They aren't huge but they exist.
The check & reload is only done every 5 seconds. If a ban/unban is performed in CS2D shortly after you modified the file, CS2D might overwrite your changes and they will get lost.
Also if CS2D tries to write bans.lst while you are manipulating the file it will fail to save the changes. If CS2D is then quit or crashes you will lose those bans which could not be written. Note however that CS2D keeps bans in memory and will try to write all bans whenever a ban is added or removed.

Zitat
Does the order and formatting matter to CS2D?

Order doesn't really matter. Formatting does. bans.lst is basically parsed like commands in the console but only single lines starting with "banip", "banname", "banusgn" and "bansteam" are supported. Empty lines and lines starting with "//" are ignored.
Be careful! CS2D isn't really verbose at that point. So if you add something to the file like "ban whatever 123" it will probably just be ignored without any error message. So make sure to add your bans correctly without typos.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht