XASECO (TMN/TMF) v1.16

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

Moderators: Xymph, TM-Patrol

askuri
road tourist
road tourist
Posts: 83
Joined: 21 Apr 2013 10:01
Owned TM-games: All except TMO
Manialink(s): im
Location: Germany/Rhineland-Palatinate
Contact:

Re: XASECO (TMN/TMF) v1.16

Post by askuri » 13 May 2014 14:39

Afaik not but here is a little mod i just made for you (untested and xaseco 1):
Open aseco.php and search for line 1196:

Code: Select all

foreach ($this->rpc_calls as $call) {
				// display error message if needed
				$err = false;
				if (isset($responses[$call->index]['faultString'])) {
					$this->rpcErrorResponse($responses[$call->index]);
					print_r($call->call);
					$err = true;
				}

				// if an id was set, then save the response under the specified id
				if ($call->id) {
					$this->rpc_responses[$call->id] = $responses[$call->index][0];
				}

				// if a callback function has been set, then execute it
				if ($call->callback && !$err) {
					if (function_exists($call->callback)) {
						// callback the function with the response as parameter
						call_user_func($call->callback, $responses[$call->index][0]);
					}

					// if a function with the name of the callback wasn't found, then
					// try to execute a method with its name
					elseif (method_exists($this, $call->callback)) {
						// callback the method with the response as parameter
						call_user_func(array($this, $call->callback), $responses[$call->index][0]);
					}
				}
			}
Replace it by

Code: Select all

foreach ($this->rpc_calls as $call) {
				// display error message if needed
				$err = false;
				if (isset($responses[$call->index]['faultString'])) {
					$this->rpcErrorResponse($responses[$call->index]);
					print_r($call->call);
					$err = true;
				}

				// if an id was set, then save the response under the specified id
				if ($call->id) {
					$this->rpc_responses[$call->id] = $responses[$call->index][0];
				}

				// if a callback function has been set, then execute it
				if ($call->callback && !$err) {
					$starttime = microtime();
					if (function_exists($call->callback)) {
						// callback the function with the response as parameter
						call_user_func($call->callback, $responses[$call->index][0]);
					}

					// if a function with the name of the callback wasn't found, then
					// try to execute a method with its name
					elseif (method_exists($this, $call->callback)) {
						// callback the method with the response as parameter
						call_user_func(array($this, $call->callback), $responses[$call->index][0]);
					}
					$time = $starttime - microtime();
					
					if ($time > !!!SET NUMBER HERE!!!) {
						$event_time_debug[] = array($call->callback, $time);
					}
				}
			}
			$previous = file_get_contents('event_time_debug.txt');
			file_put_contents('event_time_debug.txt', $previous . PHP_EOL.PHP_EOL . print_r($event_time_debug, true));
It will generate a file called event_time_debug.txt. It wont be sorted but you can set a minimum time for an event to be put into the file (microseconds).
Dunno wether it works, just try it. If it works, it wont be very pretty and easy to use but for few minutes work i think its ok :)

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

Re: XASECO (TMN/TMF) v1.16

Post by TheBigG » 16 May 2014 16:57

Thanks will try it this weekend :1

Kripke
smooth traffic navigator
smooth traffic navigator
Posts: 287
Joined: 16 Oct 2009 18:36
Owned TM-games: tmu
Manialink(s): kripke

Re: XASECO (TMN/TMF) v1.16

Post by Kripke » 29 May 2014 09:47

hi,

If I enter http://www.gamers.org/tmf/dedimania_blacklist.txt in the raps.settings.php and try then to update it, I get "Error: can't access"

How can I fix this?

(btw. the link works in the dedicated_cfg.txt)^^
Do you need Coppers? Click here
Image
Image
________________
PC-specs: Intel Core i7-3770k CPU @ 3.50GHz | 32GB Ram | Windows7 prof. ed. 64 Bit | Nvidia GTX 680

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

Re: XASECO (TMN/TMF) v1.16

Post by Xymph » 29 May 2014 10:02

Kripke wrote:If I enter http://www.gamers.org/tmf/dedimania_blacklist.txt in the raps.settings.php and try then to update it, I get "Error: can't access"
How can I fix this?
(btw. the link works in the dedicated_cfg.txt)^^
There are no access denied errors in our Apache log. At what timestamp exactly (including timezone) are you trying to acces it?
Does it happen every time you join the server or run /admin mergegbl, or just once and it was perhaps an incidental networking hiccup?
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

Kripke
smooth traffic navigator
smooth traffic navigator
Posts: 287
Joined: 16 Oct 2009 18:36
Owned TM-games: tmu
Manialink(s): kripke

Re: XASECO (TMN/TMF) v1.16

Post by Kripke » 29 May 2014 11:33

Xymph wrote:
Kripke wrote:If I enter http://www.gamers.org/tmf/dedimania_blacklist.txt in the raps.settings.php and try then to update it, I get "Error: can't access"
How can I fix this?
(btw. the link works in the dedicated_cfg.txt)^^
There are no access denied errors in our Apache log. At what timestamp exactly (including timezone) are you trying to acces it?
Does it happen every time you join the server or run /admin mergegbl, or just once and it was perhaps an incidental networking hiccup?
.. I did a mistake.. I did not uploaded this file on includes folder and I had the standard values in it, sry..^^

Now it works normal^^
Do you need Coppers? Click here
Image
Image
________________
PC-specs: Intel Core i7-3770k CPU @ 3.50GHz | 32GB Ram | Windows7 prof. ed. 64 Bit | Nvidia GTX 680

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

Re: XASECO (TMN/TMF) v1.16

Post by TheBigG » 04 Dec 2015 06:48

Hi Xymph,

will there be a fix for PHP7? XAseco uses mysql_connect and that is removed in PHP7.
https://secure.php.net/manual/en/functi ... onnect.php

Thanks for info.

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

Re: XASECO (TMN/TMF) v1.16

Post by Xymph » 04 Dec 2015 09:28

TheBigG wrote:will there be a fix for PHP7? XAseco uses mysql_connect and that is removed in PHP7.
https://secure.php.net/manual/en/functi ... onnect.php
I am aware of that, but mysql_* calls are used in 20+ source files, not to mention countless third-party plugins. Rewriting to mysqli_* calls would take far more than a 'fix'. :(

The simple fix? Don't upgrade to PHP 7, or -- for ManiaPlanet, anyway -- switch to a more modern server controller that doesn't use mysql_* calls.

I know... not desirable either.
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

User avatar
maniactwister
sunday driver
sunday driver
Posts: 71
Joined: 01 Jun 2010 00:37
Owned TM-games: TMU, TMUF, TM2
Manialink(s): tdracer
Contact:

Re: XASECO (TMN/TMF) v1.16

Post by maniactwister » 04 Mar 2016 13:56

I'm currently working on porting xasecos (and probably also of some third party plugins later) mysql_* calls to PDO. But don't expect it too soon. ;)

Edit: Xaseco (and Core Plugins) finished. After if have tested everything i'll uploaded it
Image
"My english is not the yellow from the egg ..." ;)

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

Re: XASECO (TMN/TMF) v1.16

Post by Zerbröseler » 12 Jul 2016 20:59

Perfect, Then i can setup the Server again
After an change from HDD to SSD i found out that php7.0 is out
And all Package-Names are different, So i had to relearn them

And then i was wondering why it is not working and searched in forums, and i found the message that mysql will removed in future versions (This text was even in the XAseco.log)
But i have forgetten that :roflol:

I hope the Tests will all be Successfull

amgreborn
pedestrian
pedestrian
Posts: 10
Joined: 05 Jun 2018 15:38
Owned TM-games: TMU

Re: XASECO (TMN/TMF) v1.17

Post by amgreborn » 01 Jul 2018 12:55

Hello. I'd like to suggest a small but useful update to xaseco. My goal was to fix the https problem in chat. We all know that opening https hyperlinks does not work, because they will be opened as "https//" in browser, instead of "https://". I didn't find a full fix for it though. It's more like a hotfix. With this update, all https:// links in chat will automatically be re-written as http://. I accomplished this by making use of the ChatEnableManualRouting method. The changes in code are surprisingly small, and there are 2 additionally things that have changed (by accident) with it. The changelog goes something like this:

- any https:// strings (no matter if hyperlink or not, or if players send it or if /me was used etc.) are now re-written as http://
- when putting white spaces in front of commands, the command will not be shown in chat anymore (example " /rank" would show the message itself in chat, which is not desired behaviour)
- generally when putting any white space at the beginning of text messages, the white spaces will be removed, but only at the beginning of the text message, you can still put lots of white spaces at the end of your text message or inbetween. (examples: "_____hi" will be converted to "hi". "hi____" will remain "hi____". "hi____lol____" will also remain "hi____lol____". I used _ here as whitespaces because the forum editor removed too many spaces itself lol)

I don't know if I like the third change too much, but it does somewhat prevent spam, actually. The changes made in aseco.php are the following:

Line 754-755 (is executed when xaseco starts, inside of the run function)

Code: Select all

// messages send by players must now be manually forwarded. this option enables the ability to modify chat messages before they are sent
$this->client->query('ChatEnableManualRouting', true, true);
Line 1932-1938 (is executed whenever the chat is triggered, in the playerChat function)

Code: Select all

// check for https links and replace with http
$chat[2] = preg_replace('/(https\:\/\/)/', 'http://', $chat[2]);
		
// manually forward player messages to server as normal chat message
if ($chat[0] != $this->server->id && $chat[2] != '' && $chat[2][0] != '/') {
	$this->client->query('ChatSendServerMessage', '$z$g$s['.$this->getPlayerNick($chat[1]).'$z$g$s] '.$chat[2]);
}
One thing I'd like to mention is, that when using 'ChatEnableManualRouting', true instead of 'ChatEnableManualRouting', true, true, the method ChatSendToLogin does not work. On the other hand ChatSendServerMessageToLogin does work. This resulted in a few given commands not to work anymore, such as /help, and also the no admin privileges messages didn't show, because they use ChatSendToLogin. Luckily, by using both parameters (true, true), this was fixed. This has caused some serious debugging yesterday, because I couldn't figure out why the /help command didn't work lol. The only difference between ChatSendServerMessageToLogin and ChatSendToLogin is that ChatSendToLogin puts the nickname of the server in front of the message, that was sent, and that's it. But somehow the ChatEnableManualRouting method views it as a chat message, and blocks it (unless using true, true). So that's that, just in case someone tries to fiddle with these methods and doesn't know why the hell it isn't working.
Furthermore, on the method pages (like http://methods.xaseco.org/methodstmf.php but also http://www.gamers.org/tmf/docs/ListMethods.html) it reads this behind the ChatSendServerMessageToLogin method: "Send a text message without the server login to the client with the specified login". It's not the login of the server, but the nickname of the server.

I didn't make any further changes. The version in the file below is still 1.16. I changed it to 1.17 to test it once, but there is apparently 1 or more files that also need to be changed, because the chat then said the version is 1.17, and then later below said something like "the newest 1.16 version can be found here...". Ill leave it to xymph to change it to make these changes, if he decides to accept this update.

I haven't done any extensive testing with this yet. I tried out a bunch of commands, used packmask nations and united (does that even matter? lol), also with/without admin rights, and so far it seems to be working just fine. The chat looks like it always did. But basically this whole thing is still beta phase.

EDIT: Maybe this could use some config.xml changes too?
EDIT2: the plugin.chatlog.php would also need to get a little update, otherwise the chatlog will still show the https link. i dont know if that's really important, since you can't click links in the chatlog anyway, which is kind of odd actually, because you can click links in chatlog, if they are in the name of the player who wrote the message, lol.

EDIT3: Thanks to NoTimeToDrive, quick update regarding the chat logging functionality.

Line 1991-1998 (reversing changes to its original, new code):

Code: Select all

} else {
	// optionally log all normal chat too
	if ($this->settings['log_all_chat']) {
		if ($chat[0] != $this->server->id && $chat[2] != '') {
			$this->console('({1}) {2}', $chat[1], stripColors($chat[2], false));
		}
	}
}

https://koyaanis.com/tm/dl/xaseco/aseco_117_php.zip
Last edited by amgreborn on 21 Oct 2018 20:46, edited 2 times in total.

ronney.czech
wheelbarrow operator
wheelbarrow operator
Posts: 19
Joined: 11 Aug 2014 09:16
Owned TM-games: TMUF, whole TM2, TMT

Re: XASECO (TMN/TMF) v1.17

Post by ronney.czech » 11 Aug 2018 13:13

amgreborn wrote:
01 Jul 2018 12:55
Hello. I'd like to suggest a small but useful update to xaseco. My goal was to fix the https problem in chat. We all know that opening https hyperlinks does not work, because they will be opened as "https//" in browser, instead of "https://". I didn't find a full fix for it though. It's more like a hotfix. With this update, all https:// links in chat will automatically be re-written as http://. I accomplished this by making use of the ChatEnableManualRouting method. The changes in code are surprisingly small, and there are 2 additionally things that have changed (by accident) with it. The changelog goes something like this:
[...]
https://koyaanis.com/tm/dl/xaseco/aseco_117_php.zip
There's a problem with your update, I have /a together with /admin and only /admin commands work.

amgreborn
pedestrian
pedestrian
Posts: 10
Joined: 05 Jun 2018 15:38
Owned TM-games: TMU

Re: XASECO (TMN/TMF) v1.17

Post by amgreborn » 17 Aug 2018 09:57

ronney.czech wrote:
11 Aug 2018 13:13
amgreborn wrote:
01 Jul 2018 12:55
Hello. I'd like to suggest a small but useful update to xaseco. My goal was to fix the https problem in chat. We all know that opening https hyperlinks does not work, because they will be opened as "https//" in browser, instead of "https://". I didn't find a full fix for it though. It's more like a hotfix. With this update, all https:// links in chat will automatically be re-written as http://. I accomplished this by making use of the ChatEnableManualRouting method. The changes in code are surprisingly small, and there are 2 additionally things that have changed (by accident) with it. The changelog goes something like this:
[...]
https://koyaanis.com/tm/dl/xaseco/aseco_117_php.zip
There's a problem with your update, I have /a together with /admin and only /admin commands work.
Me and ronny just pm'ed a bit and fixed the problem. Just a little mix up.

NoTimeToDrive
tricycle manager
tricycle manager
Posts: 29
Joined: 31 Mar 2013 15:13
Owned TM-games: TMU TMUF

Re: XASECO (TMN/TMF) v1.16

Post by NoTimeToDrive » 16 Sep 2018 08:44

Hey amgreborn

Thanks for fixing this https problem!!
Great job :thumbsup:

I've put it into my server,
and it works like a charm.
It fix any link to correct http :3

I have one minus point!!
The chat in Scoretable work only the last 4 sec.
If you chat anything like.. gg or nt..
it show up in last 4 sec

Normal it was..first 6 sec chat work..
little pauze ranking calculate..
and last 5 sec chat works.
I miss the first 6 sec..chat stay in pauze :?

Maybe any idea? :roll:

Big thanks for the work you have done. :gobananas:

Grt Ed

amgreborn
pedestrian
pedestrian
Posts: 10
Joined: 05 Jun 2018 15:38
Owned TM-games: TMU

Re: XASECO (TMN/TMF) v1.16

Post by amgreborn » 22 Sep 2018 03:13

Hey NoTimeToDrive. Mh I'm not sure what you mean. You mean the scoretable at end round, where it counts down for a few sec and shows all player ranks? I can chat at all times there :roll:. Do you have a custom score maybe? I know that, if xaseco restarts, the chat sometimes delays and is send later, but xaseco shouldn't restart at endround. Can you make a screenshot maybe?

I just tried out the Alternate Scoretable plugin from viewtopic.php?f=127&t=26138 and also had no problems with that. Are you using that plugin?

Greets

NoTimeToDrive
tricycle manager
tricycle manager
Posts: 29
Joined: 31 Mar 2013 15:13
Owned TM-games: TMU TMUF

Re: XASECO (TMN/TMF) v1.16

Post by NoTimeToDrive » 28 Sep 2018 17:24

Hey amgreborn.

Yes..i mean the place between the races.
Where you can see who's the winner and so on.
And yes..where all players rankings are able to see.
Printscreen doesn't help.
There is nothing to see.
Of course you can chat..
but it only show up in last 4 sec.
So if 10 people chat something..
it al appears in the last 4 sec.
To fast to read all message..
If next race is started..you can press C to read it all of course. :wink:

I notice that it also happend if i add or remove a track.
In my case Xaseco have a 20sec timeout if I add or remove a track.
I have 5236 tracks on my server!! :pil
That effects normaly not the chat..
We can type and read at the same time.
But not if I use your script.
We can chat...but it only showup if timeout is over from xaseco.
So that might be causing the problem with me. :oops:

I do use the Vote Manager plugin.
But I don't use Alternate Scoretable or Karma plugin.
I'm very low in plugins..not use to much!

BTW:
Is line 1991 needed in 117?
I saw you change that a little to!
// optionally log all normal chat too
You removed line:
this->settings['log_all_chat']

The https fix is in line 1932 I saw.

I hoping you can read this difficult messages :lol:
A bit hard to tell in broken english. :?
But i hope you got it. :P

Grt Ed

Post Reply