English ¥Weeds¥ Simple Server Shutdown v1.0 icon

13 comments
08.01.13 09:21:50 pm
like 1 likes it!
3 kb, 74 Downloads
RichNagel
User
Offline Off
Simple Server Shutdown v1.0

Description:

This Lua script for Counter-Strike 2D allows a server administrator to restart (or completely shut down) a dedicated server, along with countdown notification messages (and audible sound effects) displayed to the current players on the server announcing the server restart or shutdown.

Restarting or shutting down the dedicated server is performed by issuing two simple console commands via RCon, and the players are tactfully kicked from the server (with a kick message to the players explaining that the server has been restarted or shut down) after the countdown notification messages are displayed to them (and before the server is actually restarted or shut down).

Click Spoiler for complete readme and usage instructions, also included in the ZIP:

Spoiler >


Disclaimer:

The few things that I've uploaded and shared here in the CS2D file archives are simply for my own enjoyment

If someone finds them useful or fun, great. If not, oh well, so be it... they are ONLY for *MY* enjoyment in the first place :wink:


X
imageimage
edited 5×, last 09.01.13 09:01:22 am
x This file has been reviewed and declined by Sparty (08.07.16 03:33:36 pm)
The quality of the file is too low! Please invest more time and only upload stuff which is actually good. Do not upload your first "5 minute"-attempts. Sorry, but nobody wants to see and download stuff like that!

Comments

13 comments
Goto Page
To the start Previous 1 Next To the start

Log in!

You need to log in to be able to write comments!Log in
09.01.13 10:47:35 am
Up
Usful
09.01.13 08:54:28 am
Up
AlbertCirrus
User
Offline Off
_____
09.01.13 01:26:41 am
Up
RatedX
User
Offline Off
Dem screenshots gave me cancer.
08.01.13 11:54:17 pm
Up
RichNagel
User
Offline Off
Yates has written:
The actual way to code is in a long line until you come to the end of a function or statement, from what I know. So you could do this in ~15 lines (I do agree 5 was OTT) most likely due to the fact that you used a shitload of timers when you didn't even need to do so.


Thanks for the info I used the timers simply because of one of the example code snippets that I saw over at the CS2D help site. Anything else (or method) which accomplishes the exact same task would probably be WAY over my head though, I'm sure <grin>.

Anyhow, I ran into another snaglet with the "luareset" command, when I actually added it to my code. Most of the time the dedicated server would crash with the Windows error message:

Code:
1
2
Windows exception
EXCEPTION_ACCESS_VIOLATION


...and the times that it didn't crash, the bots were not added to the server again, after the map changed.

I also tried completely removing the map change, but then (of course) all loaded scripts that a dedicated server may be running are flushed (and no longer function) after the "luareset" command is issued.

That being said, after reading a few more (older) message posts from DC over in the forums, it does appear that a map change essentially restarts the server (unloads everything, shuts down the server 'softly' so to speak, restarts the server, and then does the map change).

Gloke has written:
it's easier to use rcon.


Actually, this is intended for use via RCon (albeit, with a little longer and different console commands).
08.01.13 11:27:20 pm
Up
Horazont
User
Offline Off
It's easier to use rcon.
08.01.13 11:05:38 pm
Up
Yates
Reviewer
Offline Off
@user RichNagel: The actual way to code is in a long line until you come to the end of a function or statement, from what I know. So you could do this in ~15 lines (I do agree 5 was OTT) most likely due to the fact that you used a shitload of timers when you didn't even need to do so.
08.01.13 11:02:57 pm
like I like it!
Up
J_Lucas
User
Offline Off
good ...
08.01.13 10:03:16 pm
Up
RichNagel
User
Offline Off
Yates has written:
http://cs2d.com/help.php?cat=all&cmd=luareset#cmd use this instead of mapchange. It's faster plus mapchange does not reset the server settings, so there is no point using that.


That's a really good idea, thanks for the helpful suggestion But, after just testing it I ran into a snag when bots are in the server:

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
>luareset

LUA ERROR (ai_update_living): attempt to call a nil value
Freezing bots to stop Lua error msg flood! Use 'bot_freeze 0' to unfreeze bots!

>bot_freeze 0

LUA ERROR (ai_update_living): bots/includes/general.lua:74: attempt to perform arithmetic on field '?' (a nil value)
Freezing bots to stop Lua error msg flood! Use 'bot_freeze 0' to unfreeze bots!

>bot_freeze 0

LUA ERROR (ai_update_living): bots/includes/general.lua:74: attempt to perform arithmetic on field '?' (a nil value)
Freezing bots to stop Lua error msg flood! Use 'bot_freeze 0' to unfreeze bots!


etc..., and so on. The only way that I can see to correct the above problem was to do a map change (kicking all of the bots and then re-adding them didn't stop the error messages).

That being said, I'm going to add a "luareset" before the map change... as you said, a "luareset" will reset the server settings and flush the Lua engine (whereas a mapchange will not).


Yates has written:
Also, why kick people on mapchange? They can also wait, you know.


I just figured it was 'more thorough', so to speak.


Yates has written:
while like 5 are needed


How could the script be condensed (to allow for the timed announcements/sounds and such)? That was the whole point of it... to announce to the players that the server will be shut down after a timed countdown (verses a simple "Server will shutdown", and then disconnect, as sheeL replied).
08.01.13 09:49:16 pm
Up
Chingy
User
Offline Off
@user Yates: That's what I expected already. Bad script.
08.01.13 09:39:58 pm
Up
Yates
Reviewer
Offline Off
@user Chingy: Shitload while like 5 are needed.
08.01.13 09:36:17 pm
Up
Chingy
User
Offline Off
How many lines does it have?

@user sheeL: Server is dead.
08.01.13 09:33:21 pm
Up
sheeL
User
Offline Off
1° - /rcon msg i go shotdown my server@C
2° - /rcon disconnect
08.01.13 09:32:31 pm
Up
Yates
Reviewer
Offline Off
http://cs2d.com/help.php?cat=all&cmd=luareset#cmd use this instead of mapchange. It's faster plus mapchange does not reset the server settings, so there is no point using that.

Also, why kick people on mapchange? They can also wait, you know.
To the start Previous 1 Next To the start