Ulysses

Ulysses Stuff => General Chat & Help and Support => Topic started by: Skrillex on May 17, 2011, 05:38:15 PM

Title: Server shutdown via client console
Post by: Skrillex on May 17, 2011, 05:38:15 PM
I am running a dedicated server on my desktop and I want my admins to be able to shut the server down. I have the server running on a auto-restart program so when it closes then it auto restarts. How can I allow my admins to shut the server down? This closest I have come to solving this problem is "ulx rcon quit" but the console blocks the command. Help would be nice, thanks.
Title: Re: Server shutdown via client console
Post by: Aaron113 on May 17, 2011, 06:12:22 PM
I coded this awhile ago.  This crashes your server and it should start back up.
Code: [Select]
function ulx.crasher( ply )
timer.Create("Crasher", 1, 1, function()
for _,plys in pairs( player.GetAll() ) do
plys:SendLua()
end
end )
ulx.fancyLogAdmin( ply, "#A restarted the server" )
end
local crasher = ulx.command( "Utility", "ulx restartserver", ulx.crasher, "!restartserver" )
crasher:defaultAccess( ULib.ACCESS_SUPERADMIN )
crasher:help( "Crashes the server." )

There may be another way, but this is all I got.
Title: Re: Server shutdown via client console
Post by: Skrillex on May 17, 2011, 06:59:37 PM
need help with that code
Title: Re: Server shutdown via client console
Post by: Aaron113 on May 17, 2011, 07:15:59 PM
It can go in your ulx/lua/ulx/modules/sh/ folder.  Name it whatever you'd like.  If you want I could whip it up in a zip file for you.

If you need help with something else, let me know what.
Title: Re: Server shutdown via client console
Post by: Skrillex on May 18, 2011, 03:53:26 PM
I can't get that working x.x Maybe more descriptive? Sorry
Title: Re: Server shutdown via client console
Post by: krooks on May 18, 2011, 06:05:29 PM
Do you not understand where to put it, or how to use it?
By the looks of the code your admins would type !restartserver in chat, and it will restart, if that's where your issue is.
Title: Re: Server shutdown via client console
Post by: DiscoBiscuit on May 19, 2011, 03:51:02 PM
I always tell my admins to use _restart or killserver with rcon.
Title: Re: Server shutdown via client console
Post by: krooks on May 20, 2011, 12:19:40 AM
This is sorta off topic, but what's the point of restarting the server when you can just change the map?
Is this to free memory or something? I always do a full system restart when it starts to get bogged down (typically each morning or afternoon when no ones on, making sure it's ready for the peak hours.)