AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Completely restart server via amxx? (https://forums.alliedmods.net/showthread.php?t=262990)

aron9forever 05-16-2015 17:30

Completely restart server via amxx?
 
Is it possible to completely restart a server via amxx?
What I'm looking for is reloading metamod, so mapchange won't work.

I guess having auto-restart on and just server_cmd("quit") would work but there must be some other better way.

OnePL 05-16-2015 17:32

Re: Completely restart server via amxx?
 
server_cmd("restart");

Nextra 05-16-2015 20:45

Re: Completely restart server via amxx?
 
I don't think you can restart the server any other way, short of intentionally crashing it.

^SmileY 05-16-2015 21:14

Re: Completely restart server via amxx?
 
_restart maybe, i not have sure.

Oh, and have a -autorestar parameter for HLDS i guess.

fysiks 05-16-2015 23:05

Re: Completely restart server via amxx?
 
AMX Mod X is not running when the server is not running. I.e. you cannot do something with a plugin when it's not running. An external script is required which is why the server is restarted when there is a fatal error (with the exception of a few like seg faults) and when you use the quit command (if there is a script running to start the server which is typical of servers hosted by a GSP).

Shooting King 05-17-2015 03:02

Re: Completely restart server via amxx?
 
I guess we can do that with Amxmodx Module using OS Threads and Process API. When you are going to "quit" an HLDS, start another individual process (store its handle in secondary storage). This process should give some delay after it has detected that hlds process has been ended and execute a start cmd to start HLDS again.

^SmileY 05-17-2015 08:47

Re: Completely restart server via amxx?
 
Quote:

Originally Posted by Shooting King (Post 2297714)
I guess we can do that with Amxmodx Module using OS Threads and Process API. When you are going to "quit" an HLDS, start another individual process (store its handle in secondary storage). This process should give some delay after it has detected that hlds process has been ended and execute a start cmd to start HLDS again.

Yeah, that is called _restart command native from HLDS, shoud be used with -autorestart at windows only i guess.

Ps.
Crate a simple .bat file or use screen in linux to restart process using quit command.
Is impossible to do a full restart without do it.

Shooting King 05-17-2015 09:06

Re: Completely restart server via amxx?
 
Quote:

Originally Posted by ^SmileY (Post 2297782)
Ps.
Crate a simple .bat file or use screen in linux to restart process using quit command.
Is impossible to do a full restart without do it.

Thats not Amxmodx xD

aron9forever 05-17-2015 09:17

Re: Completely restart server via amxx?
 
I would need this to work for every server that runs my plugin, not only my own
I will look at module loading / unloading then, I sort of knew this wasn't possible since the whole autorestart on crash thing relies on child processes



edit:: server_cmd("restart") does the job
are there any problems with using this, problems I haven't found yet?

fysiks 05-17-2015 13:20

Re: Completely restart server via amxx?
 
Quote:

Originally Posted by aron9forever (Post 2297793)
edit:: server_cmd("restart") does the job
are there any problems with using this, problems I haven't found yet?

The server command "restart" is essentially the same as changing the map. It's is not the same as stopping the server and then starting the server (which is sometimes required, as I found out recently).


All times are GMT -4. The time now is 18:42.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.