[Plugin] ManiaLive->Xaseco->ManiaLive freezone fix 0.34

Post here every finished plugin

Moderator: NADEO

Post Reply
reaby
Posts: 925
Joined: 29 Dec 2010, 23:26
Location: Eastern Finland
Contact:

[Plugin] ManiaLive->Xaseco->ManiaLive freezone fix 0.34

Post by reaby » 14 Feb 2011, 11:11

Freezone to Xaseco adaptor

Since I read from the forums there is no existing solution for xaseco and manialive to work together in order to cope with the chat rules... so here is your savior.

The principal:

The plugin basicly does a bridge between manialive and xaseco so the two servercontrollers can talk to each other. Then it sends messages over the bridge and disables the chat ondemand at xaseco side.

The plugin works by disabling chat on all forever players who are forced to spectators. See note at bottom using autoqueue.


Setting up:
Unzip the package, copy the entire subdirectory structure at xaseco and manialive to base folder of the each server controllers.

Xaseco

edit plugins.xml and add folloing line after the last <plugin> entry but before the </xml> entry:

Code: Select all

<plugin>plugin.MLintegration.php</plugin>
Manialive

edit /config/config.ini and find the plugins section. find the last plugins.load[] entry and add the following line:

Code: Select all

plugins.load[] = 'Reaby\XasecoIntegration'

Starting up

The starting order of each server controllers shouldn't be a problem, since the plugins talk over the bridge. But a good way would be to start the manialive first and xaseco then.


Getting the plugin

You can download the latest plugin at:
http://koti.mbnet.fi/reaby/manialive/pl ... _v0.34.zip

Testing report can be found at
initial testing:
http://forum.maniaplanet.com/viewtopic. ... 686#p10269

additional testing, version 0.34:
http://forum.maniaplanet.com/viewtopic. ... =20#p10393

Changelog
0.34 added additional checks for eliminating error messages at console.
0.33 added the xaseco plugin a memory of players who should be muted, so when player tries to rejoin the server he gets another mute.

Other notes
You probably don't want to run autoqueue-plugin with xaseco until we get developer api to freezone plugin --> to get the muted players list.
Last edited by reaby on 20 Feb 2011, 19:11, edited 8 times in total.

User avatar
Knutselmaaster
Posts: 1267
Joined: 15 Jun 2010, 18:03
Location: Somewhere between Paris and Disney in France.
Contact:

Re: [Plugin] ManiaLive->Xaseco->ManiaLive freezone chatrule

Post by Knutselmaaster » 14 Feb 2011, 17:52

Thanks man!

nocturne
Posts: 221
Joined: 23 Jun 2010, 21:31

Re: [Plugin] ManiaLive->Xaseco->ManiaLive freezone chatrule

Post by nocturne » 15 Feb 2011, 01:38

Using echo... nice.

Still don't know why they just don't change the customui change to a later event such as changing to status '4', or even just dbl down and send on both events. That way it wouldn't require any special setup and would work on most installs.

And personally it seems like the entire execution is a bit flawed... Using a list of specs certainly won't work -- what about players who choose to spec, or united players? The least you could have done is a OnlineRights check on each player object while you already have it called in a loop. And you don't really need to send a list of active players -- in the xaseco plugin just use setCustomUIField on all players at once, and then use a sent list of specs with no TMUF credentials to send a specific customui block to ONLY those players. At this point I wouldn't even touch setCustomUIField, but instead just call the customui block and run a str_replace to disable chat on the fetched block to get a block to send specifically to those specs. That way there's no problems with event overruns between scripts, and xaseco will always reset the chat visibility at the beginning of the round.

It may be a good idea to request that farfa change the 'retired' var in the freezone plugin to public instead of protected (I don't see why not -- and it would be a good opportunity to be able to offer some manialink displays ourselves).

I could also whip up an aseco v2.x plugin for the 5 of us still using it.. would really just take a few minutes, though your typical aseco setup doesn't respond to echos.

nocturne
Posts: 221
Joined: 23 Jun 2010, 21:31

Re: [Plugin] ManiaLive->Xaseco->ManiaLive freezone chatrule

Post by nocturne » 15 Feb 2011, 02:04

Oh and if you need coppers... it's no big deal, as long as you have a tmu login that can receive them.

I got about a million of the dang things, and they're only good for servers anyways.

nocturne
Posts: 221
Joined: 23 Jun 2010, 21:31

Re: [Plugin] ManiaLive->Xaseco->ManiaLive freezone chatrule

Post by nocturne » 15 Feb 2011, 03:04

I'm thinking this could be much much more simpler.. The echos only really need to go from ml to xaseco, only to get the spec list once per round (onplayerconnect events would be handled fine by ML I think).

JagaMan
Posts: 11
Joined: 04 Feb 2011, 15:16

Re: [Plugin] ManiaLive->Xaseco->ManiaLive freezone chatrule

Post by JagaMan » 15 Feb 2011, 15:01

i uploaded to my servers and has a big problem, it disbales the chat sometimes even for TMU players too.. i'm using xaseco 1.12, records_eyepice from Undef and the latest version of FreeZone plugin, what should i do ?

nocturne
Posts: 221
Joined: 23 Jun 2010, 21:31

Re: [Plugin] ManiaLive->Xaseco->ManiaLive freezone chatrule

Post by nocturne » 15 Feb 2011, 16:32

You should have read the previous posts, hehe...

There's a simple enough hack to 'fix' it until reaby gets a chance to fix it up right..

Change the sendSpectators function at the bottom of the ML plugin to

Code: Select all

	function sendSpectators() {
	  $specs = array();
	  $players = array();
		foreach ($this->storage->spectators as $spec) {
			if(!$spec->onlineRights) {
				$specs[] = $spec->login;
			}
		}
//		foreach ($this->storage->players as $player) {
//		$players[] = $player->login;
//		}
	$data['command'] = "setSpectators";
	$data['param'] = array($players,$specs);
	$this->sendEcho($data);
	}
And change the ML_setSpecs function at the bottom of the Xaseco plugin to:

Code: Select all

function ML_setSpecs($data) {
	global $aseco;

	foreach ($data[1] as $login) {
	print "disable chat on login $login\n";
	$xml  = '<?xml version="1.0" encoding="UTF-8"?>';
	$xml .= '<manialinks>';
	$bla = getCustomUIBlock();
	$xml .= str_replace('<chat visible="True"/>', '<chat visible="False"/>', $bla);
	$xml .= '</manialinks>';
	$aseco->client->query('SendDisplayManialinkPageToLogin', $login, $xml, 0, false);
	}
}
It'll work, but it's still not perfect...

Edit: Dawned on me that those two functions are the meat of the scripts (really all it should be doing), and there's exactly no reason why it can't all be put in a single Xaseco plugin to be loaded last (at least until farfa lets us access the list of retired players in the FZ plugin).

reaby
Posts: 925
Joined: 29 Dec 2010, 23:26
Location: Eastern Finland
Contact:

Re: [Plugin] ManiaLive->Xaseco->ManiaLive freezone chatrule

Post by reaby » 15 Feb 2011, 17:15

Yeah, until we can't get access to the list of players who are supposed to be disabled, the only way is to disable chat for all spectating players.

Thanks for the fix, it's now added to the download.
http://koti.mbnet.fi/reaby/manialive/pl ... n_v0.3.zip

User avatar
farfa
Nadeo
Nadeo
Posts: 599
Joined: 14 Jun 2010, 16:15
Location: In front of your hood with one lap late

Re: [Plugin] ManiaLive->Xaseco->ManiaLive freezone chatrule

Post by farfa » 15 Feb 2011, 17:42

Player having chat to disable are player forced to spectate, and with onlineRight = 0
Also known as: satanasdiabolo

reaby
Posts: 925
Joined: 29 Dec 2010, 23:26
Location: Eastern Finland
Contact:

Re: [Plugin] ManiaLive->Xaseco->ManiaLive freezone chatrule

Post by reaby » 15 Feb 2011, 18:03

thanks. i prepare the update.

*edit* updated
*edit @19.26* starting testperiod to see possible bugs, using 1 minute TA timelimit for extra fast testing.
I'm runnign the test for 30 minutes, that should disable the chat for forever account exactly 5 times and none for united player, let's see.

test will be at internet server behind a nat using freezone plugin at test mode.
I'll use same computer to dedicated + the server conrollers. I will also run 2x trackmania, 1 forever and 1 united account in dualscreen both maximized.

setup:
1. manialive: latest from svn withn mlepp all plugins enabled + standard plugins
2. xaseco: all standard plugins + fufi 0.8b + cpinfo

*edit @19.47*
2 successful runs behind.
One little defect, the chat is restored at end podium. a little bit annoying to see 2 overlapping texts.
I have solution for it... do a helper class to hold the muted players list and update the customUI block at endpodium too.

*edit 20.00*
3 successful runs behind. Looks like the plugins works now, i'll do one more run and stop the test then, saying it works.

*edit 20.13*
4 successful runs behind. Stopping tests. It works!
Last edited by reaby on 15 Feb 2011, 19:14, edited 5 times in total.

Post Reply

Return to “ManiaLive Plugins”

Who is online

Users browsing this forum: No registered users and 1 guest