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

Post here every finished plugin

Moderator: NADEO

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

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

Post by nocturne »

I think the current implementation is a bit overly thought out.. Basically all you need is a function that checks the player list for forced specs without United credentials, after ML forces spec and both Xaseco and it's widget plugin enforces customui changes. So.. onStatusChangeTo4, right? After all, Xaseco will just restore chat on the next round, if ML doesn't get to it first. Simple..

Code: Select all

<?php
/**
 *  FreeZone Chat-Fixulator v.chimichanga by -nocturne=-
 *  no license, no support -- use at your own risk
 */

Aseco::registerEvent('onStatusChangeTo4', 'do_Stuff');
Aseco::registerEvent('onPlayerConnect', 'playerConnect');

	function do_Stuff ($aseco) {
		global $aseco;
		$aseco->client->query('GetPlayerList', 300, 0);
		$players = $aseco->client->getResponse();
		if ($aseco->client->isError()) {
			trigger_error('[' . $aseco->client->getErrorCode() . '] ' . $aseco->client->getErrorMessage(), E_USER_WARNING);
		} else {
			foreach ($players as $pl) {
				if (($pl['Flags'] % 10) > 0) {
					$aseco->client->query('GetDetailedPlayerInfo', $pl['Login']);
					$info = $aseco->client->getResponse();
					if ($info['OnlineRights'] != 3) {
						disableChat($pl['Login']);
					}
				}
			}
		}
	}
	
	function playerConnect ($aseco, $player) {
		$login = $player->login;
		$aseco->client->query('GetPlayerInfo', $login);
		$pl = $aseco->client->getResponse();
		if (($pl['Flags'] % 10) > 0) {
			$aseco->client->query('GetDetailedPlayerInfo', $login);
			$info = $aseco->client->getResponse();
			if ($info['OnlineRights'] != 3) {
				disableChat($login);
			}
		}
	}
	
	function disableChat ($login) {
		global $aseco;
		$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);
	}

?>
Been awhile since I coded for xaseco (and never used the player info 'flags' before), so no idea if that works. Don't know how xaseco manages players lists/objects, so it's possible I suppose to do it out without any xmlrpc queries (well, besides sending the customui block).

Edit: Updated to v.chimichanga
Last edited by nocturne on 26 Feb 2011, 22:03, edited 1 time in total.
User avatar
Knutselmaaster
Posts: 1276
Joined: 15 Jun 2010, 18:03
Location: Somewhere between Paris and Disney in France.
Contact:

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

Post by Knutselmaaster »

All depends if onStatusChangeTo4 is there when disconnecting/reconnecting to the server, else it will only work for players that are already there at the start of the track.
nocturne
Posts: 221
Joined: 23 Jun 2010, 21:31

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

Post by nocturne »

Oops, forgot.. updated the code above to include a connect function, and tweaked the loops a bit.
Pesky
Posts: 39
Joined: 22 Jun 2010, 12:11

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

Post by Pesky »

Hi all

currently i´m trying this Plugin with Manialive and Freezone-Plugin and XAseco 1.12 with Undefs Records Eyepiece.
running in Testmode right now.
Everything seems to work fine
I get forcespec after 5 rounds and i cannot chat, even after a disconnect. But when i get released to play again i still cannot chat but i can drive. Only after another Trackchange i can chat again.

No errors in all Logfiles.

As you can see here it disables the chat for me 2 times in a row

Code: Select all

Begin Challenge
[03/09,18:39:10] track changed [ConnectItaly] >> [Red Planet Cross]
[03/09,18:39:10] current record on Red Planet Cross is 0:49.53 and held by  〜レƒč 〜 ϐαřα¢ปđα
Begin Round
disable chat on login ceegee1967
[03/09,18:42:43] >> player 249 left the game [ceegee1967 : Highway Star : 01:05:11]
[03/09,18:43:12] << player 248 joined the game [ceegee1967 : Highway Star : Germany : 339996 : 95.222.33.238]
disable chat on login ceegee1967
End Round
End Challenge
[03/09,18:46:18] [RASP] Calculating ranks...
[03/09,18:46:19] [RASP] ...Done!
[03/09,18:46:19] set min timelimit for [DUNES]: 7:00 (Author time: 0:55.05)
Begin Challenge
[03/09,18:46:20] track changed [Red Planet Cross] >> [DUNES]
[03/09,18:46:20] current record on DUNES is 0:56.21 and held by RG-enuzi.Šħαδσैŵ²
Begin Round
disable chat on login ceegee1967
[03/09,18:49:48] [LocalDB] player ceegee1967 finished with 64650 and took the 90. LR place!
End Round
End Challenge
[03/09,18:53:26] [RASP] Calculating ranks...
[03/09,18:53:27] [RASP] ...Done!
Any Ideas?
nocturne
Posts: 221
Joined: 23 Jun 2010, 21:31

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

Post by nocturne »

Try the Xaseco plugin I posted above... It basically works by disabling chat for forced spec FZ players at the 'play' event, which occurs after both Xaseco and and your preferred widget plugin institute their forced CustomUI. At no point does it restore chat, instead relying on Xaseco (depending on your built-in score widget config) and the widgets to override the CustomUI at the end of the round.

It's the simplest possible execution I could imagine, so there shouldn't be much chance for conflict.
Pesky
Posts: 39
Joined: 22 Jun 2010, 12:11

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

Post by Pesky »

I tried that code but i was able to chat after disconnect and reconnect, even the big Freezone Message was above the chat-window.
Pesky
Posts: 39
Joined: 22 Jun 2010, 12:11

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

Post by Pesky »

I noticed that i dont see the Podium after the forced spec Track. After the Counter is on Zero it switches to the new Track immideatly. On other Servers with XAseco and Manialive its working fine. I dont have any other Plugins running. Weird.


Edit: Seems to be ok now. It only happens when i´m alone on the Server and no one is finishing while i´m in Spec. as soon someones there i get the Podium and chat is enabled next round. so everything is fine.
Thx
tmdunhill
Posts: 81
Joined: 10 Feb 2011, 02:15

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

Post by tmdunhill »

Hello,

One question, it approved the utilization of xaseco together with manialive?

If authorized, the utilization is joint between the two managers?


Hugs.

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

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

Post by Knutselmaaster »

Using ManiaLive and Xaseco at the same time breaks the freezone plugin (you can chat in forced spec)
This plugin is to prevent that problem.
tmdunhill
Posts: 81
Joined: 10 Feb 2011, 02:15

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

Post by tmdunhill »

Got it, thanks for the information, I'm really liking manialive, I expect improvements in the next version.

Players ask for much Dedimania screens, record, and other ranks, from what I read in the next version, the manialive will come with more features.

Thanks for the feedback.

Dunhill.
:mrgreen: :mrgreen: :mrgreen:
Post Reply

Return to “ManiaLive Plugins”

Who is online

Users browsing this forum: No registered users and 2 guests