Page 1 of 1
write the player vote in the database (maniakarma)
Posted: 27 Jul 2020, 10:08
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.

Re: write the player vote in the database (maniakarma)
Posted: 27 Jul 2020, 10:55
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.
Re: write the player vote in the database (maniakarma)
Posted: 27 Jul 2020, 13:14
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
Re: write the player vote in the database (maniakarma)
Posted: 27 Jul 2020, 16:49
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'],
)
);
Re: write the player vote in the database (maniakarma)
Posted: 28 Jul 2020, 09:55
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
