bizzlesnaff / mwenhanced

Automatically exported from code.google.com/p/mwenhanced
0 stars 1 forks source link

[SOLVED]65K voting points problem #183

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1. user take vote reward from vote system
2. user press F5 (refresh) page few times
3. vote system do: points - vote_reward few times
4. points are already in negative (-)
5. mysql or php or idk, do his job and it convert negative points in positive 
value like 65355+- points
6. user has not 65K+ points and he can take whatever he like from rewards

well NOT ANYMORE - problem solved on MYSQL level with that:

CREATE TRIGGER t_UpdatePoints BEFORE UPDATE ON voting_points
  FOR EACH ROW BEGIN
  IF NEW.POINTS < 0 THEN SET NEW.POINTS=0; END IF;  
END;

insert this query once and you are done for good

Original issue reported on code.google.com by 13st...@gmail.com on 16 Jul 2010 at 1:01

GoogleCodeExporter commented 9 years ago
Correction:

6. user has NOW 65K+ points and he can take whatever he like from rewards

Original comment by 13st...@gmail.com on 16 Jul 2010 at 1:08

GoogleCodeExporter commented 9 years ago
Lol. So basically, if a users points go negative, it resets his points to zero. 
That's good in a sense that it prevents hacks and "accidents", but what if I 
had 300 points? Idk. I will take alook at this.

Original comment by wilson.steven10@gmail.com on 16 Jul 2010 at 1:35

GoogleCodeExporter commented 9 years ago
you can refresh many times now, and you will get your reward till you have 
positive points ofc, after that you will get 0... 

Original comment by 13st...@gmail.com on 16 Jul 2010 at 1:37

GoogleCodeExporter commented 9 years ago
I develped a couple more tables in the DB as well as modified the script a bit. 
But the new vote system fixes this issue. It logs in the DB how many vote 
points you have earned and spent, as well as how many times you have voted. 
Also the vote admin panel will show users who have more points then they are 
suppossed to (etc: you have spent more points then you have earned). But 
without my internet, it will have to wait a few days before I can upload. :(

Original comment by wilson.steven10@gmail.com on 16 Jul 2010 at 6:02

GoogleCodeExporter commented 9 years ago
Fixed with the newest updates.

Original comment by wilson.steven10@gmail.com on 24 Jul 2010 at 3:31