[XAseco2] modernizer (adds support to php 5.6 and php7.0)

Discuss everything about Xymph's Aseco flavoured server control scripts for TM Forever / classic TMN and for TM² Canyon.

Moderators: Xymph, TM-Patrol

Post Reply
reaby
smooth traffic navigator
smooth traffic navigator
Posts: 213
Joined: 02 Jul 2009 21:24
Owned TM-games: TMUF

[XAseco2] modernizer (adds support to php 5.6 and php7.0)

Post by reaby » 21 Jul 2016 19:45

Hi everybody,

You know I have had some critics about xaseco2, but i still love this controller since I learned to code making plugins for this... so xymph and all others, here's my attemt to add some years to xaseco2 triumph :) I had this crazy idea... and looks like it works... this should enable xaseco2 and alot of dependand plugins to work without any additional changes!

So i tried to make it super simple for you and here it goes:

1. Download Modernizer.zip
2. extract it to xaseco2 main folder
3. edit xaseco2.php and add

Code: Select all

require_once('includes/modernizer.inc.php');
to be very first command after <?php and the comments
(there is other require_once, add this to be the very first before others) :)


*edit*
In case you want all-in-one solution, without need of editing any source files... Modernizer is now added to Toffes patched xaseco2 fork, which you might be interested, since it has already patches for https and new serverlogin stuff for MX and it has added 2MB maps support:

you can find it at https://github.com/tomvlk/xaseco2-fork

Have fun,
Reaby
Last edited by reaby on 25 Jul 2016 07:02, edited 3 times in total.

User avatar
undef.de
Pit Crew
Pit Crew
Posts: 1305
Joined: 31 Aug 2009 18:38
Owned TM-games: TMF, TM2C/S/V, SM
Manialink(s): undef, tmkarma
Location: Germany
Contact:

Re: [XAseco2] modernizer (adds support to php 5.6 and php7.0

Post by undef.de » 21 Jul 2016 19:56

Nice idea for XAseco2, but bad for my UASECO port now... 8)
Developer of various plugins for XAseco/XAseco2 and MPAseco,
like Records-Eyepiece, TM-Karma, Alternate Scoretable...
Visit my Lab: www.undef.name

Get it now:
» TM2 Valley
» TM2 Canyon
» TM2 Stadium
» SM Storm

Xymph
Pit Crew
Pit Crew
Posts: 5648
Joined: 19 Aug 2007 12:58
Owned TM-games: TMN, TMU, TMF, TM²
Contact:

Re: [XAseco2] modernizer (adds support to php 5.6 and php7.0

Post by Xymph » 21 Jul 2016 20:14

Didn't try it but it seems like a nice idea. Thanks. :thumbsup:
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

waste of time
highway camper
highway camper
Posts: 2
Joined: 23 Jul 2016 20:08
Owned TM-games: tmuf // tm² stadium

Re: [XAseco2] modernizer (adds support to php 5.6 and php7.0

Post by waste of time » 23 Jul 2016 20:30

tested & working [ ubuntu 16.04 cli ]
i had to disable plugin.fufi.autoqueue.php

a few other plugins generate warnings in the logfile
[XAseco2] PHP Version is 7.0.4-7ubuntu2.1 on Linux

[XAseco2] Load plugin [plugin.checkpoints.php]
[PHP 8192] Methods with the same name as their class will not be constructors in a future version of PHP; Checkpoints has a deprecated constructor on line 34 in file .. /plugins/plugin.checkpoints.php

[XAseco2] Load plugin [plugin.dedimania.php]
[PHP 8192] Methods with the same name as their class will not be constructors in a future version of PHP; IXR_RequestStd has a deprecated constructor on line 164 in file .. /includes/GbxRemote.response.php
[PHP 8192] Methods with the same name as their class will not be constructors in a future version of PHP; IXR_ResponseStd has a deprecated constructor on line 197 in file .. /includes/GbxRemote.response.php
[PHP 8192] Methods with the same name as their class will not be constructors in a future version of PHP; Webaccess has a deprecated constructor on line 121 in file .. /includes/web_access.inc.php
[PHP 8192] Methods with the same name as their class will not be constructors in a future version of PHP; WebaccessUrl has a deprecated constructor on line 318 in file .. /includes/web_access.inc.php
[PHP 8192] Methods with the same name as their class will not be constructors in a future version of PHP; XmlrpcDB has a deprecated constructor on line 13 in file .. /includes/xmlrpc_db.inc.php

[XAseco2] Load plugin [plugin.rasp_jukebox.php]
[PHP 8192] Methods with the same name as their class will not be constructors in a future version of PHP; MXInfo has a deprecated constructor on line 230 in file .. /includes/mxinfosearcher.inc.php

[XAseco2] Load plugin [plugin.musicserver.php]
[PHP 8192] Methods with the same name as their class will not be constructors in a future version of PHP; Music has a deprecated constructor on line 23 in file .. /plugins/plugin.musicserver.php
[PHP 8192] Methods with the same name as their class will not be constructors in a future version of PHP; Ogg_Comments has a deprecated constructor on line 18 in file .. /includes/ogg_comments.inc.php

[XAseco2] Load plugin [plugin.fufi.menu.php]
[PHP 8192] Methods with the same name as their class will not be constructors in a future version of PHP; FufiMenu has a deprecated constructor on line 27 in file .. /plugins/plugin.fufi.menu.php
[PHP 8192] Methods with the same name as their class will not be constructors in a future version of PHP; FufiMenuEntry has a deprecated constructor on line 734 in file .. /plugins/plugin.fufi.menu.php

[XAseco2] Load plugin [plugin.nouse.betting.php]
[PHP 8192] Methods with the same name as their class will not be constructors in a future version of PHP; betting_planets has a deprecated constructor on line 97 in file .. /plugins/plugin.nouse.betting.php

[07/23,19:06:26] [LocalDB] Try to connect to MySQL server on 'localhost' with database 'tm2_modernizertest'
[PHP Warning] Missing argument 1 for mysql_get_server_info(), called in .. /plugins/plugin.localdatabase.php on line 80 and defined on line 171 in file .. /includes/modernizer.inc.php

reaby
smooth traffic navigator
smooth traffic navigator
Posts: 213
Joined: 02 Jul 2009 21:24
Owned TM-games: TMUF

Re: [XAseco2] modernizer (adds support to php 5.6 and php7.0

Post by reaby » 23 Jul 2016 22:00

great to hear!

Code: Select all

[PHP Warning] Missing argument 1 for mysql_get_server_info(), called in .. /plugins/plugin.localdatabase.php on line 80 and defined on line 171 in file .. /includes/modernizer.inc.php
This is now fixed too.. redownload and apply the patch :)

waste of time
highway camper
highway camper
Posts: 2
Joined: 23 Jul 2016 20:08
Owned TM-games: tmuf // tm² stadium

Re: [XAseco2] modernizer (adds support to php 5.6 and php7.0

Post by waste of time » 23 Jul 2016 22:08

fixed
[07/23,23:58:33] [LocalDB] Load config file [localdatabase.xml]
[07/23,23:58:33] [LocalDB] Try to connect to MySQL server on 'localhost' with database 'tm2_modernizertest'
[07/23,23:58:33] [LocalDB] MySQL Server Version is 5.7.13-0ubuntu0.16.04.2
[07/23,23:58:33] [LocalDB] Checking database structure...
!! important info about a new/clean database
[XASECO2 Fatal Error] [LocalDB] Table structure incorrect! Use DOCS/xaseco2.sql to correct this on line etc...
if you get this error when starting xaseco for the first time then:
.. import modern_xaseco2.sql to your sql database
.. restart xaseco

!! edit : autoqueue plugin is working also now

Zerbröseler
highway camper
highway camper
Posts: 4
Joined: 12 Jul 2016 17:50
Owned TM-games: TM2S, TMU, TMN

Re: [XAseco2] modernizer (adds support to php 5.6 and php7.0

Post by Zerbröseler » 24 Jul 2016 15:40

Thank you, This is just Great!
It works!

-

Image

User avatar
undef.de
Pit Crew
Pit Crew
Posts: 1305
Joined: 31 Aug 2009 18:38
Owned TM-games: TMF, TM2C/S/V, SM
Manialink(s): undef, tmkarma
Location: Germany
Contact:

Re: [XAseco2] modernizer (adds support to php 5.6 and php7.0

Post by undef.de » 06 Oct 2016 17:47

Just want to let you know, that the modernizer seems also work for XAseco (and not only for XAseco2).

Tested with

Code: Select all

XAseco/1.16
Ubuntu/16.04.2
PHP/7.0.8 (cli)
MySQL/5.7.15
Add to aseco.php

Code: Select all

require_once('includes/modernizer.inc.php');
right before

Code: Select all

require_once('includes/types.inc.php');
Developer of various plugins for XAseco/XAseco2 and MPAseco,
like Records-Eyepiece, TM-Karma, Alternate Scoretable...
Visit my Lab: www.undef.name

Get it now:
» TM2 Valley
» TM2 Canyon
» TM2 Stadium
» SM Storm

TheBigG
smooth traffic navigator
smooth traffic navigator
Posts: 226
Joined: 16 Oct 2010 19:45
Owned TM-games: TMN! TMF
Location: Germany

Re: [XAseco2] modernizer (adds support to php 5.6 and php7.0

Post by TheBigG » 15 Oct 2016 17:11

can't get it working for xaseco and xaseco2
i get this in my log

Code: Select all

[XAseco] PHP Version is 7.0.11-1~dotdeb+8.1 on Linux
[XAseco] Load settings [config.xml]
PHP Fatal error:  Uncaught Error: Call to undefined function xml_parser_create() in /home/tmf/master_xaseco/includes/xmlparser.inc.php:29
Stack trace:
#0 /home/tmf/master_xaseco/aseco.php(221): Examsly->parseXml('config.xml', true, false)
#1 /home/tmf/master_xaseco/aseco.php(698): Aseco->loadSettings('config.xml')
#2 /home/tmf/master_xaseco/aseco.php(2562): Aseco->run('config.xml')
#3 {main}
  thrown in /home/tmf/master_xaseco/includes/xmlparser.inc.php on line 29
That is really great work to get xaseco running on modern php

User avatar
undef.de
Pit Crew
Pit Crew
Posts: 1305
Joined: 31 Aug 2009 18:38
Owned TM-games: TMF, TM2C/S/V, SM
Manialink(s): undef, tmkarma
Location: Germany
Contact:

Re: [XAseco2] modernizer (adds support to php 5.6 and php7.0

Post by undef.de » 15 Oct 2016 20:11

Did you compiled your PHP with

Code: Select all

--enable-libxml
? It seems there is no XML lib active in your PHP.
Developer of various plugins for XAseco/XAseco2 and MPAseco,
like Records-Eyepiece, TM-Karma, Alternate Scoretable...
Visit my Lab: www.undef.name

Get it now:
» TM2 Valley
» TM2 Canyon
» TM2 Stadium
» SM Storm

TheBigG
smooth traffic navigator
smooth traffic navigator
Posts: 226
Joined: 16 Oct 2010 19:45
Owned TM-games: TMN! TMF
Location: Germany

Re: [XAseco2] modernizer (adds support to php 5.6 and php7.0

Post by TheBigG » 19 Oct 2016 20:02

that was it, thank you.

TheBigG
smooth traffic navigator
smooth traffic navigator
Posts: 226
Joined: 16 Oct 2010 19:45
Owned TM-games: TMN! TMF
Location: Germany

Re: [XAseco2] modernizer (adds support to php 5.6 and php7.0

Post by TheBigG » 28 Oct 2016 20:06

I think there is a memory leak somewhere. After using this the modenizer i get random memory related errors

Code: Select all

PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 1179648 bytes) in /home/tmf/master_xaseco/plugins/plugin.rasp.php on line 320
the plugin vary but it is always memory exhaustion and it takes always days till it happens.

Adgenodux
pedestrian
pedestrian
Posts: 14
Joined: 04 Dec 2016 20:52
Owned TM-games: TMN TMU

Re: [XAseco2] modernizer (adds support to php 5.6 and php7.0

Post by Adgenodux » 05 Dec 2016 18:34

Hi all,

I'm trying to install it under

Code: Select all

PHP 7.0.8-0ubuntu0.16.04.3 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.8-0ubuntu0.16.04.3, Copyright (c) 1999-2016, by Zend Technologies


... using TMU to join TMNF server (Xaseco 1) but after initialization, got some errors:

Code: Select all

###############################################################################
  XASECO v1.16 running on 127.0.0.1:5010
  Name   : Test Server - Do not use ! Thks. - My_TM_server
  Game   : TmForever United - Stadium - TimeAttack
  Version: 2.11.26 / 2011-02-21
  Authors: Florian Schnell & Assembler Maniac
  Re-Authored: Xymph
###############################################################################
Begin Challenge
[XASECO Warning] Could not get challenge info! (Unknown column 'r.ChallengeId' in 'on clause')
sql = SELECT c.Id AS ChallengeId, r.Score, p.NickName, p.Login, r.Date, r.Checkpoints
                  FROM challenges c
                  LEFT JOIN records r ON (r.ChallengeId=c.Id)
                  LEFT JOIN players p ON (r.PlayerId=p.Id)
                  WHERE c.Uid='Ns_UJnRS48POrKiA4H5PZZNP7VO'
                  GROUP BY r.Id
                  ORDER BY r.Score ASC,r.Date ASC
                  LIMIT 50
[12/05,15:26:14] track changed [undefined] >> [My_TM_server]
[12/05,15:26:14] currently no record on My_TM_server
End Round
End Challenge
[12/05,15:35:13] [RASP] Calculating ranks...
[PHP Warning] Missing argument 1 for mysql_insert_id(), called in ../xaseco/plugins/plugin.rasp.php on line 252 and defined on line 100 in file ../xaseco/includes/modernizer.inc.php
[12/05,15:35:13] [RASP] ...Done!
Begin Challenge
[XASECO Warning] Could not get challenge info! (Unknown column 'r.ChallengeId' in 'on clause')
sql = SELECT c.Id AS ChallengeId, r.Score, p.NickName, p.Login, r.Date, r.Checkpoints
                  FROM challenges c
                  LEFT JOIN records r ON (r.ChallengeId=c.Id)
                  LEFT JOIN players p ON (r.PlayerId=p.Id)
                  WHERE c.Uid='Ns_UJnRS48POrKiA4H5PZZNP7VO'
                  GROUP BY r.Id
                  ORDER BY r.Score ASC,r.Date ASC
                  LIMIT 50
[12/05,15:35:15] track changed [My_TM_server] >> [My_TM_server]
[12/05,15:35:15] currently no record on My_TM_server
Begin Round
[12/05,17:33:32] << player 249 joined the game [My_TM_user : $w$o$f30[Admin] $0C3$o$iMy_TM_user : Belgium : 1988400 : xxx.xxx.xxx.xxx]
[XASECO Warning] Could not insert connecting player! (Field 'Id' doesn't have a default value)
sql = INSERT INTO players
                          (Login, Game, NickName, Nation, TeamName, UpdatedAt)
                          VALUES
                          ('My_TM_user', 'TMF', '$w$o$f30[Admin] $0C3$o$iMy_TM_user', 'BEL', '', NOW())
[XASECO Warning] Could not get player's CPs! ()
sql = SELECT cps, dedicps FROM players_extra
                  WHERE playerID=0
[PHP Warning] mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given on line 123 in file ../xaseco/includes/modernizer.inc.php
[PHP Warning] mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given on line 96 in file ../xaseco/includes/modernizer.inc.php
[PHP Warning] mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given on line 123 in file ../xaseco/includes/modernizer.inc.php
[PHP Warning] mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given on line 96 in file ../xaseco/includes/modernizer.inc.php
[XASECO Warning] Could not get player's style! ()
sql = SELECT style FROM players_extra
                  WHERE playerID=0
[XASECO Warning] Could not get player's panels! ()
sql = SELECT panels FROM players_extra
                  WHERE playerID=0
[PHP Warning] mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given on line 123 in file ../xaseco/includes/modernizer.inc.php
[PHP Warning] mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given on line 96 in file ../xaseco/includes/modernizer.inc.php
[XASECO Warning] Could not insert/update record! (1054: Unknown column 'ChallengeId' in 'field list')
sql = INSERT INTO records
                  (ChallengeId, PlayerId, Score, Date, Checkpoints)
                  VALUES
                  (0, 0, 194880, NOW(), '16960,23210,56920,169080,176600,194880') ON DUPLICATE KEY UPDATE Score=VALUES(Score), Date=VALUES(Date), Checkpoints=VALUES(Checkpoints)
[12/05,17:37:00] [LocalDB] player My_TM_user finished with 194880 and took the 1. LR place!
[12/05,17:37:00] [Dedimania] player My_TM_user finished with 194880 and took the 1. WR place!
[XASECO Warning] {RASP_ERROR} Could not get Player ID for My_TM_user !
[XASECO Warning] Could not insert/update record! (1054: Unknown column 'ChallengeId' in 'field list')
sql = INSERT INTO records
                  (ChallengeId, PlayerId, Score, Date, Checkpoints)
                  VALUES
                  (0, 0, 72700, NOW(), '13470,19990,40860,63260,71150,72700') ON DUPLICATE KEY UPDATE Score=VALUES(Score), Date=VALUES(Date), Checkpoints=VALUES(Checkpoints)
[12/05,17:39:15] [LocalDB] player My_TM_user finished with 72700 and took the 1. LR place!
[12/05,17:39:15] [Dedimania] player My_TM_user finished with 72700 and took the 1. WR place!
[XASECO Warning] {RASP_ERROR} Could not get Player ID for My_TM_user !
[12/05,17:40:48] player My_TM_user clicked command "/admin endround"
[12/05,17:40:48] MasterAdmin [My_TM_user] forces round end!
[12/05,17:41:03] player My_TM_user clicked command "/admin endround"
[12/05,17:41:03] MasterAdmin [My_TM_user] forces round end!
[12/05,17:41:17] player My_TM_user clicked command "/admin pass"
[12/05,17:41:44] player My_TM_user used chat command "/help "
[12/05,17:42:03] player My_TM_user used chat command "/toprecs "
[PHP Warning] mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given on line 68 in file ../xaseco/includes/modernizer.inc.php
[PHP Warning] mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given on line 96 in file ../home/TMServers/GCInaugural/xaseco/includes/modernizer.inc.php
[12/05,17:43:30] >> player 249 left the game [My_TM_user : $w$o$f30[Admin] $0C3$o$iMy_TM_user : 00:09:58]
Can someone help to solve ?

Thanks for help...

Adgenodux
pedestrian
pedestrian
Posts: 14
Joined: 04 Dec 2016 20:52
Owned TM-games: TMN TMU

Re: [XAseco2] modernizer (adds support to php 5.6 and php7.0

Post by Adgenodux » 22 Dec 2016 19:24

well,

finaly solved with the help of developpez.net community...

was a db corruption (missing some columns, invalid default date format and missing Id auto-increment) so erased than manualy rebuilt one by one throw phpmyadmin challenges, players, records and rs_x tables using sql files provided with Xaseco, modified the date and datetime default values to "1000-01-01 00:00:00" and now it runs...

Post Reply