English Writing bans to list manually.

2 replies
Goto Page
To the start Previous 1 Next To the start
Up
Mami Tomoe
User
Offline Off
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.
Look at me standing, here on my own again
16.05.22 09:01:08 pm
Up
DC
Admin
Offline Off
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

Quote:
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).

Quote:
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).

Quote:
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.

Quote:
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.
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
16.05.22 09:45:50 pm
Up
Mami Tomoe
User
Offline Off
Okay, thank you!
Look at me standing, here on my own again
To the start Previous 1 Next To the start