Forum

> > CS2D > Servers > Server blocks connection
Forums overviewCS2D overview Servers overviewLog in to reply

English Server blocks connection

15 replies
To the start Previous 1 Next To the start

old Server blocks connection

Quattro
GAME BANNED Off Offline

Quote
I am using rcon and changing maps a lot on dedicated server and after some time it blocks me from connecting.

What command does it and how do I disable it?

I must wait for an hour or so to be able to see server again on serverlist and then if I map change or something it blocks me again...

old Re: Server blocks connection

DC
Admin Off Offline

Quote
What exactly means "a lot"? Senders who send abnormal amounts of network messages might get a "ignored"-status by the flood protection system. It leads to the scenario you described.

You can try if changing cs2d cmd mp_floodprot and/ore cs2d cmd mp_floodprotignoretime helps.

If you think you're sending a sane amount of messages it might be a bug or a bad threshold value for a particular network message which needs to be adjusted.

old Re: Server blocks connection

Quattro
GAME BANNED Off Offline

Quote
There is no way I sent too many commands... Yesterday I removed floodprot command altogether to use the default setting and it blocked me after using !map command once - now whole night has passed and it still is unreachable through CS2D client

Spoiler >

old Re: Server blocks connection

Yates
Reviewer Off Offline

Quote
@user Quattro: You should stop parsing the text each time and instead just save each word separately as an entry in a table.

For example:
1
text = {"!map", "de_dust2"}
String to table >

There's also the issue of your if statement to check whether someone is an admin or not is inside the other one. It will never be reached. Best practice would be to put all failing statements before the actual functionality to save code processing time.

Example:
1
2
3
4
5
6
7
8
9
10
11
12
function myFunction(id)
	if not id then
		return false
	end

	if not player(id, "exists") then
		return false
	end

	-- now I can simply execute my code and return true because best practice
	return true
end

Your check admin function also opens the file each time, why not open it once on server start and save all admin U.S.G.N. ID's into an
admin
table?

Right now your code does too much for too little. This may not solve your issue, I don't count on it, but these are issues you should address asap.

Minor note: CS2D hooks use
return [number]
to ensure that come an update all code remains stable. If your code (
check_admin
) does not need to return a specific value to represent a specific state or specify an action to another function (when something doesn't just fail or succeed), use true or false instead
edited 3×, last 18.06.18 05:16:19 pm

old Re: Server blocks connection

DC
Admin Off Offline

Quote
@user Quattro: No idea why it happens then. Are you sure that the server is still up and running normally? Can other people still join and play on it?

old Re: Server blocks connection

Quattro
GAME BANNED Off Offline

Quote
@user DC: This image explained everything:

IMG:https://image.prntscr.com/image/Dk24PPncTICq_zf1Ejp1rw.png




@Yates, thank you, good tips. I wanted to remake maps and adminlist already but thought it's not worth the effort.
I already learned by now: reduce read files as much as possible

As for admin function itself: don't think I'm such a noob steam(id) function checks everything you mentioned and more (I use it instead of player(id,'steam') it is not in this code)

old Re: Server blocks connection

DC
Admin Off Offline

Quote
Does this happen to all people on the server? Can nobody play on it?

1) Please restart the server and see how it behaves.
2) If it keeps showing the flood warnings I recommend to disable the Lua scripts and see how it behaves after that
3) If it still shows the flood warnings after reboot and without any Lua scripts please share your server config so we can check if there's anything suspicious.

old Re: Server blocks connection

Quattro
GAME BANNED Off Offline

Quote
It just happened again during gameplay!

I'll post logs when host restarts the sv

Spoiler >

old Re: Server blocks connection

Yates
Reviewer Off Offline

Quote
@user DC: Could it be line endings? I highly doubt it as it would have popped up before. But maybe a mix between the two if they are not converted to a specific type?

old Re: Server blocks connection

Quattro
GAME BANNED Off Offline

Quote
Sv is back today and I found an interesting detail. Hoster said he didn't restart the sv - he just clicked "ok" on error message. So...

Whenever CS2D detects flooding attempt, error message pops up and server freezes until someone turns that message off. Which makes it super easy to "crash" servers

And my script triggers floodprot for some reason.

Spoiler >


Spoiler >

old Re: Server blocks connection

Quattro
GAME BANNED Off Offline

Quote
Idk if you will understand what exactly it does since it is written not in lua... Basically it gets info from text files, updates the info then removes old text files and creates updated ones.
After it's done it quits.

Btw same thing happened again after 1 guy left the server even though I disabled floodprot... Server is unreachable again


Spoiler >

Admin/mod comment

.ahk for the win

old Re: Server blocks connection

Yates
Reviewer Off Offline

Quote
You don't really need to know the language to tell that this script has too many loops and looks like it can easily break

What is this script exactly meant to do? Seems like you're just more capable of writing in this language than Lua so you'd rather handle it that way when it could otherwise be faster in Lua and less prone to break.

How are you triggering this? A quick search leads me to the AutoHotKey. This definitely looks like something better off done with Lua.

old Re: Server blocks connection

Quattro
GAME BANNED Off Offline

Quote
This is how lua executes it:
os.execute('ranks.exe')

Yeah I can write it in lua but I made that script and really wanted to use it instead of rewriting...

That script is really stable on my system and it is on dedi, but for some reason it triggers that protection. I don't understand, it only reads/writes text files

old Re: Server blocks connection

DC
Admin Off Offline

Quote
Oh it's a Windows server!? Maybe that's the problem...
Your server provider shouldn't get error messages he needs to click away. This is not normal or at least I never heard about it. On the other hand I have ZERO experience with Windows server so maybe weird stuff is going on there...
What do the error messages say by the way? (the ones which pop up and need to be closed manually)

If you haven't done it yet I still recommend to do what I suggested a few posts earlier:
ACTUALLY restart the CS2D server process and try if the problem also occurs without any Lua scripts (and without any additional programs of course).

This way we can see if this problem is caused by CS2D itself or by any additional stuff which is done.

If the program you invoke only does file operations and doesn't open a UDP connection to the server it shouldn't cause the problems you have. And the code looks like it's not doing any socket/UDP stuff so it should be fine.

One possible explanation: The CS2D server process is paused entirely when that error message pops up or when your exe is executed (or for whatever reason). In that time it can't process incoming UDP packets because it's not running. So the system layer caches the packets and waits until the CS2D process becomes active again and asks for them. When the CS2D process becomes active again a big number of messages accumulated which are then all processed at once (because CS2D is an action game and needs to process everything ASAP). For the CS2D process it looks like people were flooding the server because so many messages are received. The flood protection kicks in.

CS2D has multiple layers of built-in protections. So either this is one internal protection which can't be turned off at all or the setting doesn't work properly.

All this would still be weird because normally CS2D should never be paused entirely. Maybe it needs to be started differently on Windows server (process priority too low or something like that).

old Re: Server blocks connection

Quattro
GAME BANNED Off Offline

Quote
@user DC:

It is safe to assume by now it is caused by calculator because server hangs up right after "Updating ranks..." message; that's when lua runs calculator and it never happened before I started using os.execute

My script probably interrupts the server for several milliseconds like you explained and it causes that error... I will try adding sleep times to slow down the calculator but one thing is clear, it is better to rewrite it in lua


Edit: Solved it by digging into ranks script. It wasn't os.execute or windows fault, there was a leftover line in ranks script which activated that error whenever someone got penalty.
edited 2×, last 20.06.18 09:50:36 am
To the start Previous 1 Next To the start
Log in to reply Servers overviewCS2D overviewForums overview