Raised This Month: $12 Target: $400
 3% 

Completely restart server via amxx?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 05-16-2015 , 17:30   Completely restart server via amxx?
Reply With Quote #1

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.
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever is offline
OnePL
BANNED
Join Date: May 2012
Location: GB
Old 05-16-2015 , 17:32   Re: Completely restart server via amxx?
Reply With Quote #2

server_cmd("restart");
OnePL is offline
Send a message via ICQ to OnePL Send a message via AIM to OnePL Send a message via Yahoo to OnePL Send a message via Skype™ to OnePL
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 05-16-2015 , 20:45   Re: Completely restart server via amxx?
Reply With Quote #3

I don't think you can restart the server any other way, short of intentionally crashing it.
__________________
In Flames we trust!
Nextra is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 05-16-2015 , 21:14   Re: Completely restart server via amxx?
Reply With Quote #4

_restart maybe, i not have sure.

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

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-16-2015 , 23:05   Re: Completely restart server via amxx?
Reply With Quote #5

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).
__________________
fysiks is offline
Shooting King
RAAASENGAN
Join Date: Mar 2012
Location: India
Old 05-17-2015 , 03:02   Re: Completely restart server via amxx?
Reply With Quote #6

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.
__________________
As every time said, don't ever UNDERESTIMATE me.

Donate - Here
Shooting King is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 05-17-2015 , 08:47   Re: Completely restart server via amxx?
Reply With Quote #7

Quote:
Originally Posted by Shooting King View Post
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.
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Shooting King
RAAASENGAN
Join Date: Mar 2012
Location: India
Old 05-17-2015 , 09:06   Re: Completely restart server via amxx?
Reply With Quote #8

Quote:
Originally Posted by ^SmileY View Post
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
__________________
As every time said, don't ever UNDERESTIMATE me.

Donate - Here
Shooting King is offline
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 05-17-2015 , 09:17   Re: Completely restart server via amxx?
Reply With Quote #9

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?
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.

Last edited by aron9forever; 05-17-2015 at 09:28.
aron9forever is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-17-2015 , 13:20   Re: Completely restart server via amxx?
Reply With Quote #10

Quote:
Originally Posted by aron9forever View Post
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).
__________________
fysiks is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:19.


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