TM-FORUM

The TrackMania universal forum ^_^
It is currently 21 Feb 2017 13:17

All times are UTC + 1 hour




Post new topic Reply to topic  [ 24 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: [XAseco] XAseco crash rebooter
PostPosted: 24 Mar 2009 13:05 
Offline
happy cruiser
happy cruiser
User avatar

Joined: 18 Dec 2007 07:32
Posts: 142
Location: BC Canada, FTW!
Owned TM-games: TMU & TMO
These modified Aseco.sh & Aseco.bat files will start aseco.php back up if it crashes. Saving time when trying to code and test other plugin's on a server. Instead of having to restart aseco.php in SSH every time, you can just type /admin shutdown in game to reload aseco.php. It's generally just a nice option to have. Also allowing you to let people without SSH access to restart the server. (i.e: Other teammates)

Instructions:
* Replace your old "Aseco.sh" or "Aseco.bat" file with the one I have provided.
* Launch your server using the new "Aseco.sh" or "Aseco.bat" file.
* When in game, type /admin shutdown to restart aseco.php.

Aseco.sh
Code:
#!/bin/bash
while true
do
#  php aseco.php TMN </dev/null >aseco.log 2>&1 &
  php aseco.php TMN
  rm aseco.txt

  rm nohup.out
  sleep 5
done



Aseco.bat
Code:
@echo off

rem ****** Set here your php path *******

set INSTPHP=C:\Programme\Apache2\Php5

rem *************************************

PATH=%PATH%;%INSTPHP%;%INSTPHP%\extensions

REM change to directory this batch file was called from, to make sure it finds aseco.php
cd %~dp0

:restart
php.exe aseco.php
echo %errorlevel%

echo Program exit at %date% %time% - errorlevel %errorlevel% >> restart.txt

goto restart

REM if you want aseco to NOT restart itself automatically, add "pause" above the "goto restart" line

_________________
Come visit our server
Tet19 Music Tower


Last edited by Kakkoii on 06 Apr 2009 10:17, edited 17 times in total.

Top
 Profile  
 
 Post subject: Re: [XAseco] XAseco Instant Restarter
PostPosted: 24 Mar 2009 13:33 
Offline
road tourist
road tourist

Joined: 26 Dec 2008 11:28
Posts: 81
Location: Slovenia, Maribor
Owned TM-games: TMUF
hey is this only for aseco or can i use also use it on xaseco O.o :roflol:

edit: im using xaseco v1.06 and when i try to restart my xaseco it says: [Aseco] You have to be MasterAdmin to restart Aseco (or something like this =x )


Top
 Profile  
 
 Post subject: Re: [XAseco] XAseco Instant Restarter
PostPosted: 24 Mar 2009 13:44 
Offline
happy cruiser
happy cruiser
User avatar

Joined: 18 Dec 2007 07:32
Posts: 142
Location: BC Canada, FTW!
Owned TM-games: TMU & TMO
Amisxp wrote:
hey is this only for aseco or can i use also use it on xaseco O.o :roflol:

edit: im using xaseco v1.06 and when i try to restart my xaseco it says: [Aseco] You have to be MasterAdmin to restart Aseco (or something like this =x )

It's for XAseco :). Do you have your login in the Master Admin list that's in your config.xml file?

edit: I updated the code. Xaseco 1.06 uses a slightly different admin arguement than 1.02. Should work for both versions now.

_________________
Come visit our server
Tet19 Music Tower


Top
 Profile  
 
 Post subject: Re: [XAseco] XAseco Instant Restarter
PostPosted: 24 Mar 2009 15:22 
Offline
road tourist
road tourist

Joined: 26 Dec 2008 11:28
Posts: 81
Location: Slovenia, Maribor
Owned TM-games: TMUF
ok works now...but
is this plugin meant to crash xaseco and then reload it?
cuz my xaseco only crashes but it doesnt reload =/


Top
 Profile  
 
 Post subject: Re: [XAseco] XAseco Instant Restarter
PostPosted: 24 Mar 2009 17:22 
Offline
sunday driver
sunday driver

Joined: 22 Mar 2009 06:42
Posts: 67
Owned TM-games: faadfad
Intresting plugin i will check it to my test server. :3


Top
 Profile  
 
 Post subject: Re: [XAseco] XAseco Instant Restarter
PostPosted: 25 Mar 2009 00:25 
Offline
happy cruiser
happy cruiser
User avatar

Joined: 18 Dec 2007 07:32
Posts: 142
Location: BC Canada, FTW!
Owned TM-games: TMU & TMO
Amisxp wrote:
ok works now...but
is this plugin meant to crash xaseco and then reload it?
cuz my xaseco only crashes but it doesnt reload =/


Sorry, I forgot that our server uses a custom Aseco.sh which checks to see if aseco.php is down at a set interval and starts it back up if it is. I have included the customized Aseco.sh in my post. :)

_________________
Come visit our server
Tet19 Music Tower


Top
 Profile  
 
 Post subject: Re: [XAseco] Instant XAseco Restarter
PostPosted: 04 Apr 2009 20:00 
Offline
happy cruiser
happy cruiser
User avatar

Joined: 18 Dec 2007 07:32
Posts: 142
Location: BC Canada, FTW!
Owned TM-games: TMU & TMO
Anyone tested the windows .bat file? Need to know if it works.

_________________
Come visit our server
Tet19 Music Tower


Top
 Profile  
 
 Post subject: Re: [XAseco] Instant XAseco Restarter
PostPosted: 04 Apr 2009 20:10 
Offline
TM-Patrol
TM-Patrol
User avatar

Joined: 23 May 2007 08:20
Posts: 1466
Location: Venray
Owned TM-games: TMU, TMN, TMF
Manialink(s): intr
tested on windows and works correct only forgot one thing to add.

Code:
<?php
/**
* XAseco Restarter
* Restarts XAseco instantly.
* Created by Kakkoii of Tet19
*
* Dependencies: none
*
* Intructions:
* When in game, type /reaseco  to restart aseco.
**/

Aseco::addChatCommand('reaseco', 'restarts aseco');

function chat_reaseco($aseco, $command) {
   $admin = $command['author'];
   $login = $admin->login;
   $player = $aseco->server->players->getPlayer($login);
   $playernick = ($player->nickname);

if ($aseco->isMasterAdmin($login)) {
   showReaseco($command['author'], $aseco->chat_commands, 'chat', false, false);
} else {
if ($aseco->isMasterAdmin($admin)) {
   showReaseco($command['author'], $aseco->chat_commands, 'chat', false, false);
} else {   
   $message = '$000[$fffAseco$000]$FC0 Sorry '.$playernick.'$z$s$FC0, you need to be a MasterAdmin to restart Aseco!';           
   $aseco->addCall('ChatSendServerMessage', array($message));
}
}
}
?>

_________________
Code:
tmnforever is nations and united makes it special. tmnforever has united. I need united!


Top
 Profile  
 
 Post subject: Re: [XAseco] Instant XAseco Restarter
PostPosted: 04 Apr 2009 20:37 
Offline
happy cruiser
happy cruiser
User avatar

Joined: 18 Dec 2007 07:32
Posts: 142
Location: BC Canada, FTW!
Owned TM-games: TMU & TMO
w1lla wrote:
tested on windows and works correct only forgot one thing to add.

Code:
<?php
/**
* XAseco Restarter
* Restarts XAseco instantly.
* Created by Kakkoii of Tet19
*
* Dependencies: none
*
* Intructions:
* When in game, type /reaseco  to restart aseco.
**/

Aseco::addChatCommand('reaseco', 'restarts aseco');

function chat_reaseco($aseco, $command) {
   $admin = $command['author'];
   $login = $admin->login;
   $player = $aseco->server->players->getPlayer($login);
   $playernick = ($player->nickname);

if ($aseco->isMasterAdmin($login)) {
   showReaseco($command['author'], $aseco->chat_commands, 'chat', false, false);
} else {
if ($aseco->isMasterAdmin($admin)) {
   showReaseco($command['author'], $aseco->chat_commands, 'chat', false, false);
} else {   
   $message = '$000[$fffAseco$000]$FC0 Sorry '.$playernick.'$z$s$FC0, you need to be a MasterAdmin to restart Aseco!';           
   $aseco->addCall('ChatSendServerMessage', array($message));
}
}
}
?>

Thanks, and I didn't forget the "restarts aseco" part. It just isn't needed.

_________________
Come visit our server
Tet19 Music Tower


Top
 Profile  
 
 Post subject: Re: [XAseco] Instant XAseco Restarter
PostPosted: 04 Apr 2009 20:48 
Offline
TM-Patrol
TM-Patrol
User avatar

Joined: 23 May 2007 08:20
Posts: 1466
Location: Venray
Owned TM-games: TMU, TMN, TMF
Manialink(s): intr
well it shows me this error

Code:
[PHP Warning] Missing argument 2 for Aseco::addChatCommand(), called in D:\tmn\servertmnf\xaseco\plugins\restarter.php on line 13 and defined on line 1120 in file D:\tmn\servertmnf\xaseco\aseco.php
[XAseco] Try to connect to TM dedicated server on 127.0.0.1:5225

_________________
Code:
tmnforever is nations and united makes it special. tmnforever has united. I need united!


Top
 Profile  
 
 Post subject: Re: [XAseco] Instant XAseco Restarter
PostPosted: 04 Apr 2009 20:56 
Offline
happy cruiser
happy cruiser
User avatar

Joined: 18 Dec 2007 07:32
Posts: 142
Location: BC Canada, FTW!
Owned TM-games: TMU & TMO
w1lla wrote:
well it shows me this error

Code:
[PHP Warning] Missing argument 2 for Aseco::addChatCommand(), called in D:\tmn\servertmnf\xaseco\plugins\restarter.php on line 13 and defined on line 1120 in file D:\tmn\servertmnf\xaseco\aseco.php

It still loads though :). But I guess I'll add that to the function just to put less junk in peoples log file.

_________________
Come visit our server
Tet19 Music Tower


Top
 Profile  
 
 Post subject: Re: [XAseco] Instant XAseco Restarter
PostPosted: 06 Apr 2009 09:18 
Offline
Pit Crew
Pit Crew

Joined: 19 Aug 2007 13:58
Posts: 5622
Owned TM-games: TMN, TMU, TMF, TM²
Kakkoii wrote:
I created this plugin as a quick way to reload XAseco from in game, saving time when trying to code and test other plugin's on the server, instead of having to kill aseco.php in SSH every time. It's also generally just a nice option to have. Also allowing you to let people without SSH access to restart the server. (i.e: Other teammates)

XAseco already has the /admin shutdown command built in, which handles the MasterAdmin test for you as well. You don't need a plugin for restarting, just the looping .sh/.bat files.

Also, your showReaseco function isn't defined in the plugin. Or maybe you're using that to force a PHP crash, but that's really ugly.

_________________
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub


Top
 Profile  
 
 Post subject: Re: [XAseco] Instant XAseco Restarter
PostPosted: 06 Apr 2009 10:07 
Offline
happy cruiser
happy cruiser
User avatar

Joined: 18 Dec 2007 07:32
Posts: 142
Location: BC Canada, FTW!
Owned TM-games: TMU & TMO
Xymph wrote:
Kakkoii wrote:
I created this plugin as a quick way to reload XAseco from in game, saving time when trying to code and test other plugin's on the server, instead of having to kill aseco.php in SSH every time. It's also generally just a nice option to have. Also allowing you to let people without SSH access to restart the server. (i.e: Other teammates)

XAseco already has the /admin shutdown command built in, which handles the MasterAdmin test for you as well. You don't need a plugin for restarting, just the looping .sh/.bat files.

Also, your showReaseco function isn't defined in the plugin. Or maybe you're using that to force a PHP crash, but that's really ugly.

Ah didn't know about that. Well it's still nice for people to have the looping scripts.

_________________
Come visit our server
Tet19 Music Tower


Top
 Profile  
 
 Post subject: Re: [XAseco] XAseco crash rebooter
PostPosted: 02 Feb 2010 20:37 
Offline
TM-Patrol
TM-Patrol
User avatar

Joined: 01 Dec 2007 18:04
Posts: 1845
Location: London, England
Owned TM-games: TMN, TMUF, TM Wii
I posted this in the XAseco v1.10 thread, but got no help - so I'm posting it here too as it seems a fitting place to do so.

I was just wondering, is it possible to force an automatic restart of XAseco on a Dedimania read timeout / connection failure ??

Its just I get this quite often:

Code:
[XAseco] PHP Version is 5.3.1 on WINNT
[XAseco] Load settings [config.xml]
[XAseco] Load admin/ops lists [adminops.xml]
[XAseco] Load banned IPs list [bannedips.xml]
[XAseco] Load plugins list [plugins.xml]
[XAseco] Load plugin [plugin.localdatabase.php]
[XAseco] Load plugin [plugin.custom_chat.php]
[XAseco] Load plugin [plugin.rounds.php]
[XAseco] Load plugin [chat.admin.php]
[XAseco] Load plugin [chat.help.php]
[XAseco] Load plugin [chat.records.php]
[XAseco] Load plugin [chat.records2.php]
[XAseco] Load plugin [chat.recrels.php]
[XAseco] Load plugin [chat.dedimania.php]
[XAseco] Load plugin [chat.players.php]
[XAseco] Load plugin [chat.players2.php]
[XAseco] Load plugin [chat.wins.php]
[XAseco] Load plugin [chat.laston.php]
[XAseco] Load plugin [chat.stats.php]
[XAseco] Load plugin [chat.server.php]
[XAseco] Load plugin [chat.song.php]
[XAseco] Load plugin [chat.me.php]
[XAseco] Load plugin [plugin.tmxinfo.php]
[XAseco] Load plugin [plugin.sminfo.php]
[XAseco] Load plugin [plugin.track.php]
[XAseco] Load plugin [plugin.checkpoints.php]
[XAseco] Load plugin [plugin.dedimania.php]
[XAseco] Load plugin [plugin.rasp.php]
[XAseco] Load plugin [plugin.rasp_jukebox.php]
[XAseco] Load plugin [plugin.rasp_chat.php]
[XAseco] Load plugin [plugin.rasp_karma.php]
[XAseco] Load plugin [plugin.rasp_nextmap.php]
[XAseco] Load plugin [plugin.rasp_nextrank.php]
[XAseco] Load plugin [plugin.rasp_votes.php]
[XAseco] Load plugin [plugin.chatlog.php]
[XAseco] Load plugin [plugin.msglog.php]
[XAseco] Load plugin [plugin.style.php]
[XAseco] Load plugin [plugin.panels.php]
[XAseco] Load plugin [plugin.donate.php]
[XAseco] Load plugin [plugin.uptodate.php]
[XAseco] Load plugin [plugin.autotime.php]
[XAseco] Load plugin [jfreu.plugin.php]
[XAseco] Load plugin [mistral.idlekick.php]
[XAseco] Load plugin [plugin.matchsave.php]
[XAseco] Load plugin [plugin.fufi.widgets.php]
[XAseco] Load plugin [plugin.fufi.menu.php]
[XAseco] Load plugin [plugin.fufi.autoqueue.php]
[XAseco] Load plugin [vineeth.bet.plugin.php]
[XAseco] Load plugin [biggeordie.php]
[XAseco] Load plugin [plugin.xrestart.php]
[XAseco] Load plugin [plugin.google.php]
[XAseco] Load plugin [plugin.slap.php]
[XAseco] Load plugin [plugin.pbs.php]
[XAseco] Load plugin [plugin.elist.php]
[XAseco] Load plugin [plugin.private_message_window.php]
[XAseco] Load plugin [plugin.simplcp.php]
[XAseco] Load plugin [plugin.bestcps.php]
[XAseco] Load plugin [plugin.average.php]
[XAseco] Load plugin [plugin.finishes.php]
[XAseco] Load plugin [plugin.nouse.link.php]
[XAseco] Load plugin [plugin.nouse.button.php]
[XAseco] Load plugin [plugin.nouse.button1.php]
[XAseco] Load plugin [plugin.fave.servers.php]
[XAseco] Load plugin [plugin.teamspeak.php]
[XAseco] Load plugin [plugin.teamspeak.login.php]
[XAseco] Load plugin [plugin.topkarma.php]
[XAseco] Load plugin [plugin.whokarma.php]
[XAseco] Load plugin [plugin.forceMods.php]
[XAseco] Load plugin [plugin.milenco.v1.0.php]
[XAseco] Load plugin [plugin.lotto.php]
[XAseco] Try to connect to TM dedicated server on 127.0.0.1:5003
[XAseco] Try to authenticate with login 'SuperAdmin' and password 'EDIT'
[XAseco] Connection established successfully !
[Local DB] Load settings file [localdatabase.xml]
[Local DB] Try to connect to MySQL server on '127.0.0.1' with database 'xaseco'
[Local DB] MySQL Server Version is 5.1.41
[RASP] Cleaning up unused data
*-*-*-*-*-* RASP is running! *-*-*-*-*-*
|...Loading Settings
|...Loaded!
|...Checking database structure
|...Structure OK!
|...Calculating ranks
|...Done!
[RASP] Pruning records/rs_times for deleted tracks
[01/30,04:07:33] Load default style [styles/DarkBlur.xml]
[01/30,04:07:33] Load default admin panel [panels/AdminBelowChat.xml]
[01/30,04:07:33] Load default donate panel [panels/DonateBelowCPList.xml]
[01/30,04:07:33] Load default records panel [panels/RecordsRightBottom.xml]
[01/30,04:07:33] Load default vote panel [panels/VoteBelowChat.xml]
[01/30,04:07:33] ## ## ##  Lottery initialized! Ignored players: 0  ## ## ##
[01/30,04:07:33] ************* (Dedimania) *************
[01/30,04:07:33] * Dataserver connection on Dedimania ...
[01/30,04:07:33] * Try connection on http://dedimania.net:8018/Dedimania ...
[01/30,04:07:34] Webaccess (dedimania.net:80): send: deflate, receive: gzip
[01/30,04:07:34] * Connection and status ok! :)
[01/30,04:07:34] * NEWS (Dedimania, 08/05): news
[01/30,04:07:34] ------------- (Dedimania) -------------
[01/30,04:07:34] Load stats panel [panels/StatsUnited.xml]
###############################################################################
  XASECO v1.10 running on 127.0.0.1:5003
  Name   : XXX-Ant Forever - xxxantunited
  Game   : TmForever United - Stadium - TimeAttack
  Version: 2.11.23 / 2009-11-19
  Authors: Florian Schnell & Assembler Maniac
  Re-Authored: Xymph
###############################################################################
Begin Challenge
[01/30,04:07:34] forceMods: Stadium=>LoadScreen Island=>LoadScreen Speed=>LoadScreen Rally=>LoadScreen Bay=>LoadScreen Coast=>LoadScreen Alpine=>LoadScreen
[01/30,04:07:34] track changed [none] >> [ProDrift]
[01/30,04:07:34] current record on ProDrift is 1:09.79 and held by aledrobt
[01/30,04:08:45] Webaccess (dedimania.net:8018): Read timeout (20)
[01/30,04:08:45] Webaccess (dedimania.net:8018): send: deflate, receive: deflate
[01/30,04:12:21] Webaccess (dedimania.net:8018): Read timeout (20)
End Round
End Challenge
|...Calculating ranks
|...Done!
[01/30,04:12:23] set min timelimit for [Kinetic Energy]: 5:00 (Author time: 0:49.49)
Begin Challenge
[01/30,04:12:24] forceMods: Stadium=>LoadScreen Island=>LoadScreen Speed=>LoadScreen Rally=>LoadScreen Bay=>LoadScreen Coast=>LoadScreen Alpine=>LoadScreen
[01/30,04:12:24] track changed [ProDrift] >> [Kinetic Energy]
[01/30,04:12:24] current record on Kinetic Energy is 0:58.70 and held by XXX-Ant
[01/30,04:12:26] Webaccess (dedimania.net:8018): Error(10060) A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
, connection failed!
Begin Round
[01/30,04:13:14] Webaccess (dedimania.net:8018): Read timeout (20)


EDIT--> I use this crash rebooter already, but if this could be added too, then that would be very nice :thumbsup:

_________________
My TMF Hub --- Server


Top
 Profile  
 
 Post subject: Re: [XAseco] XAseco crash rebooter
PostPosted: 03 Feb 2010 00:49 
Offline
solid chaser
solid chaser

Joined: 08 Jun 2007 19:48
Posts: 1390
Owned TM-games: all
Dedimania should attempt to reconnect in 30 minutes by default, and should send a chat message stating such. Seems like it's a bug in the webaccess include, not properly setting the isBad connection state when it times out...

Try increasing the $dedi_debug value in plugin.dedimania.php, and see what pops up in the log then.

As for an autorestart on dedimania timing out, perhaps use the $dedi_db global and run a function on the main loop event to restart if(!dedi_db).


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 24 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group