AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [ANY] Anti server empty after restart (https://forums.alliedmods.net/showthread.php?t=202625)

Franc1sco 12-08-2012 12:49

[ANY] Anti server empty after restart
 
Description:

Force retry for all clients on server restart, useful to not lose all players when it restarts.

Quote:

Originally Posted by ddhoward (Post 1950393)
Tested only on TF2, should work on other mods that support ClientCommand sending "retry".

Running the command sm_retryandrestart will force all clients to retry, then after a 0.1 second pause, will run the _restart command. The action will be logged to the standard sourcemod log file with the admin's information.

Running the command sm_retryandrestart 0 will cause a restart WITHOUT attempting to auto-reconnect clients. This action will be logged to the standard sourcemod log file with the admin's information.

If the cvar sm_retryonrestart_enabled = 1, the plugin will still listen for the commands _restart or quit, and make an attempt to reconnect clients before shutting down. Setting the cvar to 0 will disable this functionality.

Please note that it is IMPOSSIBLE to trigger a forced retry on clients upon server CRASH. The plugin only works if a restart was triggered intentionally through the server commands quit, _restart, or sm_retryonrestart.


Credits:

Advcommands ( https://forums.alliedmods.net/showthread.php?p=889397 ) for the code idea of sm_shutdown command
I posted this plugin by a request



Suggestions are welcome :wink:


Donations (optional):

If you apreciate my work, you can donate me via paypal or with a trade offer


Download:

Main repository
Direct download
Code changes

ericwilder 12-08-2012 15:05

Re: [ANY] Anti server empty after restart
 
not works in l4d2.

Commencing connection retry to public(192.168.0.11:27015)
FCVAR_SERVER_CAN_EXECUTE prevented server running command: connect

doze 12-09-2012 01:51

Re: [ANY] Anti server empty after restart
 
Not working in hl2dm.

Franc1sco 12-09-2012 05:35

Re: [ANY] Anti server empty after restart
 
Quote:

Originally Posted by ericwilder (Post 1850324)
not works in l4d2.

Commencing connection retry to public(192.168.0.11:27015)
FCVAR_SERVER_CAN_EXECUTE prevented server running command: connect

Quote:

Originally Posted by doze (Post 1850731)
Not working in hl2dm.


Working in CS:S and any game that can force executed "retry" on client.

Despirator 12-09-2012 10:42

Re: [ANY] Anti server empty after restart
 
PHP Code:

ReconnectClient

Syntax
:
native ReconnectClient(client);

Usage:
 
client        The client index
Notes
:
Reconnect a client without dropping the netchannel

Return:
No return.

Version Added:
1.4.0 


Franc1sco 12-09-2012 10:59

Re: [ANY] Anti server empty after restart
 
Quote:

Originally Posted by Despirator (Post 1850928)
PHP Code:

ReconnectClient

Syntax
:
native ReconnectClient(client);

Usage:
 
client        The client index
Notes
:
Reconnect a client without dropping the netchannel

Return:
No return.

Version Added:
1.4.0 


ok thanks but I just try it but always appear "Disconnect: Server shutting down." and no force to reconnect the client, however with "retry" on client he can reconnect

Dino Penis 12-09-2012 21:46

Re: [ANY] Anti server empty after restart
 
I tried it on my Test server, and I don't quite get how it works. Does this go and make the clients type retry when the server is down? I'm trying this on CSS, and I don't think it works.

Franc1sco 01-02-2013 01:26

Re: [ANY] Anti server empty after restart
 
Quote:

Originally Posted by Dino Penis (Post 1851239)
I tried it on my Test server, and I don't quite get how it works. Does this go and make the clients type retry when the server is down? I'm trying this on CSS, and I don't think it works.

The server must execute first "quit" or "_restart" command for this plugin works, if you restart the server killing the process ("quit" or "_restart" command not used) then the plugin will not work.


The plugin is tested and works.

Mitchell 01-02-2013 12:19

Re: [ANY] Anti server empty after restart
 
This probably wont work if you have any timers open, or anything that will delay the _restart command from shutting down.

C0nw0nk 01-02-2013 12:31

Re: [ANY] Anti server empty after restart
 
Be useful if something like this could be implemented for crashes too.


All times are GMT -4. The time now is 04:10.

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