Forum

> > CS2D > General > Bans.lst related stuff
Forums overviewCS2D overviewGeneral overviewLog in to reply

English Bans.lst related stuff

6 replies
To the start Previous 1 Next To the start

old Bans.lst related stuff

Nekomata
User Off Offline

Quote
Ai, I have a few bans.lst related questions I was hoping to gather answers from DC himself and anyone else who knows the answers.
I am writing from phone so mind mistakes and the idea of why i didn't test most of these for myself. Plus a faster and direct answer wouls be great

I have a parsing question as to how the bans.lst is parsed (reading AND writing)

1.      if i were write bans like this
1
2
3
banip x.x.x.x
banusgn xxxxxx
banip x.x.x.x
It wouldn't create an issue, would it?

2.      the delimiter used in bans, is usually 4 spaces(a tab /t), if i were to just use one space, it would it still be a valid read?

3.      When a server is started, at what intervals is the bans list updated and read at? If i were to update it using a text editor and save it will it be directly read and used or shall i have to restart the server

4.      If I were to write a lua based custom bans.lst parser JUST for WRITING (not reading, mind) it wouldn't cause some kind of a clash if I don't use cs2d stock ban commands (banusgn,banip etc), righto?

5.      What are the extents to using bans.lst, are there any hidden parameters?

old Re: Bans.lst related stuff

Yates
Reviewer Off Offline

Quote
I've written in the bans.lst myself and this has nearly always caused it to suddenly delete all it's content - this also answers question 4 (and partially 2), just use the standard commands. Don't write in it yourself or use Lua to, it leads (I speak for myself) to problems.

user Nekomata has written
If i were to update it using a text editor and save it will it be directly read and used or shall i have to restart the server

You would have to restart the server.

user Nekomata has written
What are the extents to using bans.lst, are there any hidden parameters?

I hope you mean things like duration, reason etc with the parse command. If not, no. Nothing special about the .lst file.

@user Mr_Magnifice: Please refrain from posting things like "wat r u on abuut?" - This post clearly states all questions pretty good. Stop wasting your and our time.

old Re: Bans.lst related stuff

Nekomata
User Off Offline

Quote
Thanks for the reply. I manage a few servers and the last thing I'd want is deleting a huge ban list that has been working for years. Sadly I don't have access to in-game methods otherwise I would have used that. I was hoping the cs2d's ban.lst parser would be more flexible, since I have to add reported bans and usually using my phone. And I wouldn't want thewhole thing to implode because of a single forgotten extra whitespace. I can make a parser inlua which would accustom to the ban.lst anf work fluently however cs2d's lua, in my opinion, is a tad unstable and I wouldn't want to completely bet on the success of it so that's why I was wondering if it was a good idea and also asking as to how the ban.lst parser works so I wouldn't end up clashing it with my own parser.




Bump: Captain!
edited 1×, last 14.05.15 04:45:59 pm

old Re: Bans.lst related stuff

DC
Admin Off Offline

Quote
bans.lst is not designed for external (write-)access and yes it is a bit dirty. It's updated only when you use the in-game commands to change it so no, you can't use it the way you want to use it.

I could work on that though...

Edit:
No wait. I was wrong. I thought it was that way but actually CS2D checks that file every 5 seconds and reloads it if it has been changed outside. Whitespaces shouldn't matter. It should work with any number of spaces/tabs.

Edit²:
So to answer everything:

1. Shouldn't be a problem. Order does not matter and parameters can be left out. the command and one parameter (ip/name/usgn) is minimum

2. Should still work and be valid

3. The file change time is checked every five seconds. The file is reloaded and parsed when it has been changed.

4. May lead to problems. Especially when internal bans happen and you changed the ban file inbetween. I'm not too sure about this though.

5. No, there is no secret stuff. Just a list with an arbitrary number of cs2d cmd banip / cs2d cmd banname / cs2d cmd banusgn. duration and reason is always optional. All other commands are ignored, lines starting with // and empty lines are ignored as well.
edited 5×, last 08.06.15 06:57:45 pm

old Re: Bans.lst related stuff

Nekomata
User Off Offline

Quote
Thank you for the reply!
The client doesn't do the 5 second re-check tho? It's pretty much until you restart the client and If you don't then the bans.lst in memory overwrites the file, which means if you made any edits to bans.lst, it would get overwritten. o.o

old Re: Bans.lst related stuff

DC
Admin Off Offline

Quote
The client (when hosting using "New Game") and the dedicated server both do it.
They even print this message when it happens:
Quote
'sys\bans.lst' has been modified outside CS2D. Reloading bans.
To the start Previous 1 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview