Page 1 of 1

Understanding Energon usage ... any reason for negative Energon balances?

PostPosted: Mon Nov 12, 2018 6:57 pm
by Seibertron
While working to correct the issue that wasn't giving new players Energon, I came across that the HMW database was setup to allow a negative balance of Energon for some reason. I can't think of any reason why a player should or could have negative Energon. Either you have enough or you don't. Out of approximately 6,000 player accounts, only 3 had negative balances. I modified the database tables by eliminating the database table that was used exclusively to store our user IDs in one field and how much Energon we had in another. I don't understand why it was stored in a separate database table, so I moved the Energon for each player into the actual Players database table. All was good, until I was updating the code to reflect this and I see programming in place that also allowed for negative Energon balances, which makes no sense to me. Hopefully I was right with my decision to make it so you can't spend more than you have, but if any of you can think of a reason why negative balances should be allowed, I can make the corrections if needed. Thanks in advance!

Re: Understanding Energon usage ... any reason for negative Energon balances?

PostPosted: Mon Nov 12, 2018 6:59 pm
by Burn
I think it was regarded as a glitch.

How it was done ... maybe through the Battle Beasts gambling?

Re: Understanding Energon usage ... any reason for negative Energon balances?

PostPosted: Mon Nov 12, 2018 7:05 pm
by Seibertron
Burn wrote:I think it was regarded as a glitch.

How it was done ... maybe through the Battle Beasts gambling?


In that case, the change I made will prevent that I think. Maybe. Not sure exactly. Only 3 players were impacted by this correction/change. Please let me know if you guys encounter any errors relating to Energon, especially when you get close to €0.

Re: Understanding Energon usage ... any reason for negative Energon balances?

PostPosted: Mon Nov 12, 2018 7:12 pm
by Phasewing
Well, whatever you did, I see everything and everyone has 0 energon... everywhere.

https://www.seibertron.com/heavymetalwar/index.php
Image
no money won from missions?

https://www.seibertron.com/heavymetalwa ... hp?id=3864
energon total and donations?

https://www.seibertron.com/heavymetalwar/weapons.php & https://www.seibertron.com/heavymetalwar/armor.php
everything is 0 to buy? xD

Re: Understanding Energon usage ... any reason for negative Energon balances?

PostPosted: Mon Nov 12, 2018 7:19 pm
by Burn
Same, my energon has been wiped out.

Re: Understanding Energon usage ... any reason for negative Energon balances?

PostPosted: Mon Nov 12, 2018 7:19 pm
by Wingz
Same here. Lost all energon and donation tracking.

https://www.seibertron.com/heavymetalwa ... p?id=75654

Re: Understanding Energon usage ... any reason for negative Energon balances?

PostPosted: Mon Nov 12, 2018 7:27 pm
by Seibertron
Phasewing wrote:Well, whatever you did, I see everything and everyone has 0 energon... everywhere.

https://www.seibertron.com/heavymetalwar/index.php
Image
no money won from missions?

https://www.seibertron.com/heavymetalwa ... hp?id=3864
energon total and donations?

https://www.seibertron.com/heavymetalwar/weapons.php & https://www.seibertron.com/heavymetalwar/armor.php
everything is 0 to buy? xD


Everything should be fixed. Data casting error caused by me that was nulling out the values of numbers because it didn't think the numbers were integers. Should be all set. If you see any other errors, please let me know. Thanks.

Re: Understanding Energon usage ... any reason for negative Energon balances?

PostPosted: Mon Nov 12, 2018 7:35 pm
by Burn
I'm rich again! €40,393,190 Image

Re: Understanding Energon usage ... any reason for negative Energon balances?

PostPosted: Mon Nov 12, 2018 8:18 pm
by Wingz
Same here =) Thank you!

Re: Understanding Energon usage ... any reason for negative Energon balances?

PostPosted: Wed Nov 14, 2018 7:18 pm
by S.o.L.
Seibertron wrote:
Phasewing wrote:Well, whatever you did, I see everything and everyone has 0 energon... everywhere.

https://www.seibertron.com/heavymetalwar/index.php
Image
no money won from missions?

https://www.seibertron.com/heavymetalwa ... hp?id=3864
energon total and donations?

https://www.seibertron.com/heavymetalwar/weapons.php & https://www.seibertron.com/heavymetalwar/armor.php
everything is 0 to buy? xD


Everything should be fixed. Data casting error caused by me that was nulling out the values of numbers because it didn't think the numbers were integers. Should be all set. If you see any other errors, please let me know. Thanks.


Maybe not an error, but when you go to the main page and it lists mission results:
https://www.seibertron.com/heavymetalwar/index.php
if you lost and won zero energon it used to look like this, showing a zero:
oldzero.jpg
oldzero.jpg (7.7 KiB) Viewed 448497 times

Now it looks like this, no zero:
new zero.jpg
new zero.jpg (9.65 KiB) Viewed 448497 times

Also in the mission results page, it used to show that you got zero xp and energon, but now it shows nothing for zero energon.
https://www.seibertron.com/heavymetalwa ... _id=114101
mission.jpg
mission.jpg (11.44 KiB) Viewed 448497 times

As a side note, maybe the manual CR glitch mentioned in the bug thread is also related to the negative balance energon modifications.

Re: Understanding Energon usage ... any reason for negative Energon balances?

PostPosted: Wed Nov 14, 2018 10:24 pm
by Seibertron
Is that problem affecting all logs or just ones that were processed prior to me fixing the error?

Re: Understanding Energon usage ... any reason for negative Energon balances?

PostPosted: Wed Nov 14, 2018 10:35 pm
by S.o.L.
Seibertron wrote:Is that problem affecting all logs or just ones that were processed prior to me fixing the error?

It is actually all logs, past and current.
https://www.seibertron.com/heavymetalwa ... sion_id=15
https://www.seibertron.com/heavymetalwa ... _id=114303

Re: Understanding Energon usage ... any reason for negative Energon balances?

PostPosted: Wed Nov 14, 2018 11:03 pm
by Seibertron
Fixed.

I added a "Mission Ended" text so that we know when missions end now. I was able to see that the mission ended today so that I no longer needed to ask my above question.

Re: Understanding Energon usage ... any reason for negative Energon balances?

PostPosted: Thu Nov 15, 2018 6:44 am
by Bun-Bun
Seibertron wrote:Fixed.

I added a "Mission Ended" text so that we know when missions end now. I was able to see that the mission ended today so that I no longer needed to ask my above question.

Thank Primus
That's something that's been onmy wish list for years!
It's a little thing but can be very useful when collecting data

Re: Understanding Energon usage ... any reason for negative Energon balances?

PostPosted: Thu Nov 15, 2018 12:41 pm
by S.o.L.
Seibertron wrote:Fixed.

I added a "Mission Ended" text so that we know when missions end now. I was able to see that the mission ended today so that I no longer needed to ask my above question.


Awesome!