write the player vote in the database (maniakarma)

UASECO is a fork of the XAseco2/1.03 controller for Trackmania and has been overhauled to support the Modescript Gamemodes of Trackmania².

Moderators: undef.de, NADEO

Post Reply
User avatar
bern
Posts: 119
Joined: 26 Dec 2013, 21:38
Contact:

write the player vote in the database (maniakarma)

Post by bern »

Hello undef. ,, is it possible to write the vote of each player in the database without waiting to finish the map?
The cause is that I have designed another plugin that works with maniakarma and needs to calculate the result from the database.
A greeting. :thumbsup:
User avatar
undef.de
Posts: 2095
Joined: 06 Apr 2011, 21:57
Location: Germany, North Sea Coast
Contact:

Re: write the player vote in the database (maniakarma)

Post by undef.de »

The ManiaKarma plugin calculates the Karma on the fly (with the same method the server does) and therefore the Karma has the correct value in that moment as a player vote.

The ManiaKarma plugins sends the votes at once to the server to reduce the load of the server. This has been changed several years ago where the ManiaKarma plugin was sending each vote (and the changes) as soon as a player has voted. The server wasn't able to handle that load.
Developer of UASECO, a controller with support of the Modescript Gamemodes for TM².
Visit the official website for more: UASECO.org


Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name

You like what I do? Then award a ManiaStar.
User avatar
bern
Posts: 119
Joined: 26 Dec 2013, 21:38
Contact:

Re: write the player vote in the database (maniakarma)

Post by bern »

undef.de wrote: 27 Jul 2020, 10:55 The ManiaKarma plugin calculates the Karma on the fly (with the same method the server does) and therefore the Karma has the correct value in that moment as a player vote.

The ManiaKarma plugins sends the votes at once to the server to reduce the load of the server. This has been changed several years ago where the ManiaKarma plugin was sending each vote (and the changes) as soon as a player has voted. The server wasn't able to handle that load.
I think I understand ,,, but the votes of each player are not written in the database until starting the next map ,,, my plugin calculates on the existing data in the database ,, and has to wait until the next map to perform the calculations
User avatar
undef.de
Posts: 2095
Joined: 06 Apr 2011, 21:57
Location: Germany, North Sea Coast
Contact:

Re: write the player vote in the database (maniakarma)

Post by undef.de »

You can listen on the event "onKarmaChange" from the ManiaKarma plugin to receive the current Karma (and many more).

Code from the ManiaKarma plugin

Code: Select all

// Release a KarmaChange Event
$aseco->releaseEvent('onKarmaChange',
	array(
		'Karma'			=> $this->karma['global']['votes']['karma'],
		'Total'			=> $this->karma['global']['votes']['total'],
		'FantasticCount'	=> $this->karma['global']['votes']['fantastic']['count'],
		'FantasticPercent'	=> $this->karma['global']['votes']['fantastic']['percent'],
		'BeautifulCount'	=> $this->karma['global']['votes']['beautiful']['count'],
		'BeautifulPercent'	=> $this->karma['global']['votes']['beautiful']['percent'],
		'GoodCount'		=> $this->karma['global']['votes']['good']['count'],
		'GoodPercent'		=> $this->karma['global']['votes']['good']['percent'],
		'BadCount'		=> $this->karma['global']['votes']['bad']['count'],
		'BadPercent'		=> $this->karma['global']['votes']['bad']['percent'],
		'PoorCount'		=> $this->karma['global']['votes']['poor']['count'],
		'PoorPercent'		=> $this->karma['global']['votes']['poor']['percent'],
		'WasteCount'		=> $this->karma['global']['votes']['waste']['count'],
		'WastePercent'		=> $this->karma['global']['votes']['waste']['percent'],
	)
);
Developer of UASECO, a controller with support of the Modescript Gamemodes for TM².
Visit the official website for more: UASECO.org


Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name

You like what I do? Then award a ManiaStar.
User avatar
bern
Posts: 119
Joined: 26 Dec 2013, 21:38
Contact:

Re: write the player vote in the database (maniakarma)

Post by bern »

to collect the vote in real time on the same track ,,, it should include some commands inside the maniakarma plugin ,,, and it will calculate the result without having to go to the database ,,, something complicated for me ,,, years ago I modified your maniakarma plugin with the positive signs of + up to ++++++ ,,, for a league of mappers ,,,, perhaps it is to find the "result" string and apply my formula. ufff a mental crime for my brain :roflol:
Post Reply

Return to “UASECO”

Who is online

Users browsing this forum: No registered users and 1 guest