ManiaControl Promotion plugin

ManiaControl, the completely new designed and easy to use controller managing all your Maniaplanet server.

Moderators: kremsy, Jocy, Wabbitface, steeffeen, NADEO

User avatar
chco
Posts: 256
Joined: 24 Dec 2012, 09:11

ManiaControl Promotion plugin

Post by chco » 30 Jun 2014, 10:06

Hi all.
I've just uploaded a plugin for ManiaControl to display promotional server messages in the chat.
It allows up to 10 messages to be displayed at a definable interval and either in a random or orderly fashion.
The message can hold manialink color codes and link codes. 4 different examples are included.
To use random mode set the mode setting to : random
To have the messages shown in order use : linear
Interval is in seconds.

Cheers,
Charly
Image

kremsy
Posts: 1723
Joined: 21 Jul 2011, 09:51

Re: ManiaControl Promotion plugin

Post by kremsy » 30 Jun 2014, 10:30

Thank you very much.

Some small things which could be improved, the PROMOTE_SETTING could be replaced by an SET of values (can't write directly an example here due time resons.)

And there wold be ways to make infinite messages dynamically possible, maybe I will write the idea for that later ;).

Another thing is instead of the every second, or nextMessage time you could just use a timer, wich you start at the begining and occurs every xx seconds, or you start after every message a new timer.
Lukas alias Kremsy, Developer of:
ManiaControl: http://www.maniacontrol.com
ParagonLeague: http://league.paragon-esports.com
MPAseco: http://mpaseco.org
ManiaViewer: http://www.maniaviewer.com

User avatar
chco
Posts: 256
Joined: 24 Dec 2012, 09:11

Re: ManiaControl Promotion plugin

Post by chco » 30 Jun 2014, 11:00

Thanks Kremsy, I'll have a look at setting values.

On the timer.. just wanted to be safe as I had some issues with the loadscreen plugin and timers, so I thought to play safe and control it all myself.
Might just give that a second try ;)
kremsy wrote:Thank you very much.

Some small things which could be improved, the PROMOTE_SETTING could be replaced by an SET of values (can't write directly an example here due time resons.)

And there wold be ways to make infinite messages dynamically possible, maybe I will write the idea for that later ;).

Another thing is instead of the every second, or nextMessage time you could just use a timer, wich you start at the begining and occurs every xx seconds, or you start after every message a new timer.
Image

User avatar
chco
Posts: 256
Joined: 24 Dec 2012, 09:11

Re: ManiaControl Promotion plugin

Post by chco » 30 Jun 2014, 16:52

I added a version that uses just the one timer set every x seconds, instead of on every second.
Hope it holds as I did notice that time-outs happen when a timer is triggered while a map is loading, causing MP to crash.
In regards of what you mentioned, I need to dig into how you guys have set it up and I don't have the time currently.
Image

kremsy
Posts: 1723
Joined: 21 Jul 2011, 09:51

Re: ManiaControl Promotion plugin

Post by kremsy » 30 Jun 2014, 17:19

The timeouts have nothing Todo with our Timer functions, and our timerfunctions are working, they only werent working in one version of mc due a big structural change.

To define settings as sets you can do it like that:

$this->maniaControl->settingManager->initSetting($this, SETTINGNAME, array("Option1", "Option2"...));

while you can use Option1 and 2... just constants you define, the first option is the defualt selected option.
Lukas alias Kremsy, Developer of:
ManiaControl: http://www.maniacontrol.com
ParagonLeague: http://league.paragon-esports.com
MPAseco: http://mpaseco.org
ManiaViewer: http://www.maniaviewer.com

User avatar
chco
Posts: 256
Joined: 24 Dec 2012, 09:11

Re: ManiaControl Promotion plugin

Post by chco » 30 Jun 2014, 19:55

Thanks for the info.
Is there a plugin currently using those sets ?
Image

User avatar
steeffeen
Translator
Translator
Posts: 2472
Joined: 14 Oct 2012, 16:22
Location: Germany

Re: ManiaControl Promotion plugin

Post by steeffeen » 30 Jun 2014, 21:46

chco wrote:Is there a plugin currently using those sets ?
don't know about a plugin right now but the UpdateManager is using a Set for its channel setting
    Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

    ManiaControl, FancyManiaLinks

    kremsy
    Posts: 1723
    Joined: 21 Jul 2011, 09:51

    Re: ManiaControl Promotion plugin

    Post by kremsy » 01 Jul 2014, 11:27

    Most of the plugins didnt have it yet, and did not have some other good features, but they should get it in the next weeks ;).
    Lukas alias Kremsy, Developer of:
    ManiaControl: http://www.maniacontrol.com
    ParagonLeague: http://league.paragon-esports.com
    MPAseco: http://mpaseco.org
    ManiaViewer: http://www.maniaviewer.com

    User avatar
    chco
    Posts: 256
    Joined: 24 Dec 2012, 09:11

    Re: ManiaControl Promotion plugin

    Post by chco » 01 Jul 2014, 12:09

    For the time being, the plugin does work, why not add it?
    Image

    kremsy
    Posts: 1723
    Joined: 21 Jul 2011, 09:51

    Re: ManiaControl Promotion plugin

    Post by kremsy » 04 Jul 2014, 09:55

    I think as you noticed, plugins need no approvment anymore by us at the moment ;).

    To make Sets in your plugin its just simply, just change:

    Code: Select all

    $maniaControl->settingManager->initSetting(get_class(), self::SETTING_PROMOTE_MODE, 'random'); //random or linear
    to

    Code: Select all

    $maniaControl->settingManager->initSetting(get_class(), self::SETTING_PROMOTE_MODE,array('random','linear'));
    Better would be to define "random" and "linear" as constants, because you are using them anyway on other places too, like:

    Code: Select all

    $maniaControl->settingManager->initSetting(get_class(), self::SETTING_PROMOTE_MODE,array(self::SETTING_PROMOTE_TYPE_RANDOM, self::SETTING_PROMOTE_TYPE_LINEAR));
    It's not like that we criticicing other code or something else, we just give hint's how can something be improved to get more stable ;).
    Lukas alias Kremsy, Developer of:
    ManiaControl: http://www.maniacontrol.com
    ParagonLeague: http://league.paragon-esports.com
    MPAseco: http://mpaseco.org
    ManiaViewer: http://www.maniaviewer.com

    Post Reply

    Return to “ManiaControl”

    Who is online

    Users browsing this forum: No registered users and 3 guests