Page 2 of 2

Re: XASECO (TMN/TMF) v1.16

Posted: 13 May 2014 14:39
by askuri
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 :)

Re: XASECO (TMN/TMF) v1.16

Posted: 16 May 2014 16:57
by TheBigG
Thanks will try it this weekend :1

Re: XASECO (TMN/TMF) v1.16

Posted: 29 May 2014 09:47
by Kripke
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)^^

Re: XASECO (TMN/TMF) v1.16

Posted: 29 May 2014 10:02
by Xymph
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?

Re: XASECO (TMN/TMF) v1.16

Posted: 29 May 2014 11:33
by Kripke
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^^

Re: XASECO (TMN/TMF) v1.16

Posted: 04 Dec 2015 06:48
by TheBigG
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.

Re: XASECO (TMN/TMF) v1.16

Posted: 04 Dec 2015 09:28
by Xymph
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.

Re: XASECO (TMN/TMF) v1.16

Posted: 04 Mar 2016 13:56
by maniactwister
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

Re: XASECO (TMN/TMF) v1.16

Posted: 12 Jul 2016 20:59
by Zerbröseler
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

Re: XASECO (TMN/TMF) v1.17

Posted: 01 Jul 2018 12:55
by amgreborn
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.

https://koyaanis.com/tm/dl/xaseco/aseco_117_php.zip

Re: XASECO (TMN/TMF) v1.17

Posted: 11 Aug 2018 13:13
by ronney.czech
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.

Re: XASECO (TMN/TMF) v1.17

Posted: 17 Aug 2018 09:57
by amgreborn
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.

Re: XASECO (TMN/TMF) v1.16

Posted: 16 Sep 2018 08:44
by NoTimeToDrive
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

Re: XASECO (TMN/TMF) v1.16

Posted: 22 Sep 2018 03:13
by amgreborn
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