XAseco - Tournament Plugin v0.2.5

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

Moderators: Xymph, TM-Patrol

vineeth.h
happy cruiser
happy cruiser
Posts: 116
Joined: 09 Mar 2009 09:47
Owned TM-games: TMUF

XAseco - Tournament Plugin v0.2.5

Post by vineeth.h » 26 Jul 2009 14:45

I just recently started php about a few weeks ago, and was thinking about what to make as my first plugin, thats around the same time i was planning on hosting a tournament for my server,and thought,why must i waste time making a website with all the details about the tournament? and so decided to make a tournament plugin - where the users can view all details in relation to the tournament on the server with the "/tournament" chat command and can register in-game while playing in the server with the "/tour_reg" command which gets saved to the database.

1.)Open your phpMyAdmin through your browser by typing 127.0.0.1
and login with "root" username and your password.
2.)There open your xaseco database from the column on the left and then find "Create new table on database xaseco" and there type in "tour" and no. of fields - 1 and click GO.
3.)In field type in "Login",Type choose "VARCHAR" and in Length type 100 and click SAVE and set it to UNIQUE to prevent duplicates.
4.) Download "vineeth.plugin.php" from


http://www.hotlinkfiles.com/files/27084 ... plugin.zip


and copy it to your "plugin/ " folder and in the plugins.xml file add <plugin>vineeth.plugin.php</plugin.php>

You can change the pop up messages in the php file itself .
Available commands from the plugin :
/tournament - To view all commands
/tour_details -- Details of the race type
/tour_tracks -- To view the names of the 5 tracks and authors
/tour_register -- Details on how to register
/tour_dat -- details on Date and Time(dat)
/tour_prizes -- details on the prizes
/tour_contact -- Server admins/masteradmin contact
/tour_del -- to delete your entry from the tournament
And your good to go!

To see the plugin in action visit my server with trackmania url
tmtp://#join=vineeth_server

or just paste $ltmtp://#join=vineeth_server in the chatbox in any trackmania server,and then click the link.

Updates in v0.2:


I have added two very important features which i thought were.....well....important!! And a third one,which seems important now, asked to be added by scg-flighthigh.

New Feature
#1:/tour_list - To view a list of all registered users so far. Can be accesed by all players - Helpful for the MasterAdmin as well to see who all have registered so far.
#2:/tour_kick - Only to be used once the tournament is about to start - Can be accesed only by the MasterAdmin - It will KICK all unregistered players, so only the registered players remain on the server - because someone might leak the server password,and unregistered players will show up ,so once the tournament starts you can use the command and kick them.
#3: When the player types "/tour_reg" to register, his/her Nickname is also registered to the table along with his LoginId.

For the #3 feature to work, in addition to my earlier post on steps for making the table "tour" you will have to add one more FIELD AFTER Login and name it 'Nickname' and set the TYPE to VARCHAR and LENGTH to 100 and click GO.




UPDATE v.0.2.5:


Updated the REGISTERED PLAYERS manialink which can be viewed by the command ,"/tour_list"

Previously it was a fixed page which could show limited no. of registered players.

Now changed it to a multi page manialink ,which displays 10 registered players/page and you can go through the other pages to see all the registered players.

So download and replace the vineeth.plugin.php with the new one.


http://www.hotlinkfiles.com/files/27084 ... plugin.zip
Last edited by vineeth.h on 31 Jul 2009 07:06, edited 11 times in total.
Owner of lllllNASCAR 80K
Join my server : NASCAR 80K

Image
Image

User avatar
TheM
Pit Crew
Pit Crew
Posts: 286
Joined: 25 Feb 2009 16:43
Owned TM-games: TMU(F), TMN(F), TM2
Location: Brabant, Netherlands
Contact:

Re: XAseco - Tournament Plugin

Post by TheM » 26 Jul 2009 15:29

Looks good, but here is a suggestion:
I think it would be better to use a chat message for the registered/unregisterd commands.
Registered/Unregistered wrote:

Code: Select all

if ($aseco->server->getGame() == 'TMF') 
	  {
	
		$header = '{#welcome}Unregistered';
		$data=array();
		$data[] = array('You have been unregistered');
		display_manialink($command['author']->login, $header, array('Icons64x64_1', 'TrackInfo', -0.01), $data, array(0.9), 'OK');
	  }
will be:

Code: Select all

$data = "You have been unregistered";
$aseco->client->query('ChatSendServerMessageToLogin', $data, $command['author']->login);
and

Code: Select all

if ($aseco->server->getGame() == 'TMF') 
	  {
	
		$header = '{#welcome}Registered';
		$data=array();
		$data[] = array('You have been registered');
		display_manialink($command['author']->login, $header, array('Icons64x64_1', 'TrackInfo', -0.01), $data, array(0.9), 'OK');
	  }
will be:

Code: Select all

$data = "You have been registered";
$aseco->client->query('ChatSendServerMessageToLogin', $data, $command['author']->login);
And make an comment at the top of your plugin, like:

Code: Select all

/**
 * Tournement plugin
 * Made by vineeth.h
 * Version: XX.X
 * Contributors: people who helped you... (changed some stuff for example)
 */
With those changes your file will be like this: http://files.klaversma.eu/vineeth.2.plugin.zip ;)

vineeth.h
happy cruiser
happy cruiser
Posts: 116
Joined: 09 Mar 2009 09:47
Owned TM-games: TMUF

Re: XAseco - Tournament Plugin

Post by vineeth.h » 26 Jul 2009 16:26

Oh yes,thank you for updating that and good idea!
But after reading your idea,i thought it would be better if the message - "Player $player->login registered for the tournament" would be sent to all players currently playing on the server at that time, so everyone will read it and will know about the tournament! :)

I've updated my link, check it out.
http://www.hotlinkfiles.com/files/26973 ... plugin.zip
Last edited by vineeth.h on 27 Jul 2009 11:15, edited 1 time in total.
Owner of lllllNASCAR 80K
Join my server : NASCAR 80K

Image
Image

User avatar
TheM
Pit Crew
Pit Crew
Posts: 286
Joined: 25 Feb 2009 16:43
Owned TM-games: TMU(F), TMN(F), TM2
Location: Brabant, Netherlands
Contact:

Re: XAseco - Tournament Plugin

Post by TheM » 26 Jul 2009 17:46

Instead of sending everyone a message with the SendServerMessageToLogin function, you can better send everyone a message once...

Code: Select all

foreach ($aseco->server->players->player_list as $playa) 
	{
	 //if ($playa->login != $player->login) 
	 {
	  $aseco->addCall('ChatSendServerMessageToLogin', array($data, $playa->login));
	 }
	}
will be:

Code: Select all

$aseco->client->query('ChatSendServerMessage', $data);
;)

scg-flighthigh
smooth traffic navigator
smooth traffic navigator
Posts: 199
Joined: 05 May 2009 15:52
Owned TM-games: TM2

Re: XAseco - Tournament Plugin

Post by scg-flighthigh » 27 Jul 2009 06:44

Hello

very nice Tool. I put it on one of our Servers and make some test. It work fine. :thumbsup:

Is it possbile that you make a second row into the Database for the gamenick. I think thats it what i need for my next Tournament. There i want make a Quali over two Days and then i want too look for the best 30 Players of this Days for the Mainevent. And this Players i want to put in a Guestlist so they can join the Server without a Passwordrequest.

My Problem is, that i have the Gamenicks in the TopRanklist and not the Loginname. In the Database i have the Loginname but not the Gamenick.

I hope you understood my Question.

vineeth.h
happy cruiser
happy cruiser
Posts: 116
Joined: 09 Mar 2009 09:47
Owned TM-games: TMUF

Re: XAseco - Tournament Plugin

Post by vineeth.h » 27 Jul 2009 11:12

Thank you for that 'TheM' - i've changed it,much better now!
My Problem is, that i have the Gamenicks in the TopRanklist and not the Loginname. In the Database i have the Loginname but not the Gamenick.
I have added what you asked me to,now when the player registers his nickname will also get registered.



Updates in v0.2:

http://www.hotlinkfiles.com/files/26973 ... plugin.zip

I have added two very important features which i thought were.....well....important!! And a third one,which seems important now, asked to be added by scg-flighthigh.

New Feature
#1:/tour_list - To view a list of all registered users so far. Can be accesed by all players - Helpful for the MasterAdmin as well to see who all have registered so far.
#2:/tour_kick - Only to be used once the tournament is about to start - Can be accesed only by the MasterAdmin - It will KICK all unregistered players, so only the registered players remain on the server - because someone might leak the server password,and unregistered players will show up ,so once the tournament starts you can use the command and kick them.
#3: When the player types "/tour_reg" to register, his/her Nickname is also registered to the table along with his LoginId.

For the #3 feature to work, in addition to my earlier post on steps for making the table "tour" you will have to add one more FIELD AFTER Login and name it 'Nickname' and set the TYPE to VARCHAR and LENGTH to 100 and click GO.

Thats it,you're good to go.

Have fun ! :)
Last edited by vineeth.h on 27 Jul 2009 12:49, edited 1 time in total.
Owner of lllllNASCAR 80K
Join my server : NASCAR 80K

Image
Image

User avatar
TheM
Pit Crew
Pit Crew
Posts: 286
Joined: 25 Feb 2009 16:43
Owned TM-games: TMU(F), TMN(F), TM2
Location: Brabant, Netherlands
Contact:

Re: XAseco - Tournament Plugin

Post by TheM » 27 Jul 2009 11:29

I think it would be better if you use commands like /tour list instead of /tour_list ...

scg-flighthigh
smooth traffic navigator
smooth traffic navigator
Posts: 199
Joined: 05 May 2009 15:52
Owned TM-games: TM2

Re: XAseco - Tournament Plugin

Post by scg-flighthigh » 27 Jul 2009 11:36

vineeth.h :thumbsup: I makt the second Row into the Database und load the File into the Pluginfolder and restart the Xaseco.

Nice thats it what i looking for. So i have a List of all Gamenicks wiht Loginnames and can make my Guestlist.

You got 10 of 10 Points :wink:

vineeth.h
happy cruiser
happy cruiser
Posts: 116
Joined: 09 Mar 2009 09:47
Owned TM-games: TMUF

Re: XAseco - Tournament Plugin v0.2

Post by vineeth.h » 28 Jul 2009 19:03

Ty scg! Glad to know that you like it!
Owner of lllllNASCAR 80K
Join my server : NASCAR 80K

Image
Image

vineeth.h
happy cruiser
happy cruiser
Posts: 116
Joined: 09 Mar 2009 09:47
Owned TM-games: TMUF

Re: XAseco - Tournament Plugin v0.2

Post by vineeth.h » 31 Jul 2009 07:04

UPDATE v.0.2.5:

Updated the REGISTERED PLAYERS manialink which can be viewed by the command ,"/tour_list"

Previously it was a fixed page which could show limited no. of registered players.

Now changed it to a multi page manialink ,which displays 10 registered playeys/page and you can go through the other pages to see all the registered players.

So download and replace the vineeth.plugin.php with the new one.


http://www.hotlinkfiles.com/files/27084 ... plugin.zip
Owner of lllllNASCAR 80K
Join my server : NASCAR 80K

Image
Image


vineeth.h
happy cruiser
happy cruiser
Posts: 116
Joined: 09 Mar 2009 09:47
Owned TM-games: TMUF

Re: XAseco - Tournament Plugin v0.2

Post by vineeth.h » 31 Jul 2009 17:14

Lol - I just saw your id exit my server a few seconds ago - So instead of the screenshots you can check out the plugin directly from there again?
Owner of lllllNASCAR 80K
Join my server : NASCAR 80K

Image
Image

jeffroselier
road tourist
road tourist
Posts: 102
Joined: 25 Oct 2006 07:59
Location: MARSEILLE

Re: XAseco - Tournament Plugin v0.2

Post by jeffroselier » 31 Jul 2009 17:40

yes actually I just saw your server, or I have :roll: ... anything :ftw: .

He would practice in the next release there have clickable buttons on a bit as fast, this would be much more convenient.

Good work so far gg :thumbsup:

Greco
happy cruiser
happy cruiser
Posts: 144
Joined: 13 May 2009 18:40
Owned TM-games: TMN

Re: XAseco - Tournament Plugin v0.2

Post by Greco » 02 Jun 2010 10:54


scg-flighthigh
smooth traffic navigator
smooth traffic navigator
Posts: 199
Joined: 05 May 2009 15:52
Owned TM-games: TM2

Re: XAseco - Tournament Plugin v0.2.5

Post by scg-flighthigh » 02 Jun 2010 12:14


Post Reply