Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cancel research/building queues error #3

Merged
merged 3 commits into from Jan 28, 2018
Merged

Fix cancel research/building queues error #3

merged 3 commits into from Jan 28, 2018

Conversation

@mys
Copy link
Contributor

mys commented Jan 27, 2018

  1. Fix of error when cancelling research

Message: Undefined offset: 120
File: /includes/pages/game/ShowResearchPage.class.php
Line: 61
URL: http://steemnova.intinte.org/game.php?page=research
PHP-Version: 7.0.19-1
PHP-API: fpm-fcgi
2Moons Version: 1.8.git
Debug Backtrace:
#0 /includes/pages/game/ShowResearchPage.class.php(61): errorHandler(8, 'Undefined offse...', 'FILEPATH ...', 61, Array)
#1 /includes/pages/game/ShowResearchPage.class.php(342): ShowResearchPage->CancelBuildingFromQueue()
#2 /game.php(57): ShowResearchPage->show()
#3 {main}

Misstyped $USER[$resource] with $PLANET?


  1. Fix of error when cancelling queued building

Message: DateTime::setTimestamp() expects parameter 1 to be integer, float given
File: /includes/GeneralFunctions.php
Line: 143
URL: http://steemnova.intinte.org/game.php?page=buildings
PHP-Version: 7.0.22-0ubuntu0.16.04.1
PHP-API: apache2handler
2Moons Version: 1.8.git
Debug Backtrace:
#0 [internal function]: errorHandler(2, 'DateTime::setTi...', 'FILEPATH ...', 143, Array)
#1 /includes/GeneralFunctions.php(143): DateTime->setTimestamp(6.3588806566614E+209)
#2 /includes/pages/game/ShowBuildingsPage.class.php(231): _date('U', 6.3588806566614E+209, 'Europe/Berlin')
#3 /includes/pages/game/ShowBuildingsPage.class.php(271): ShowBuildingsPage->getQueueData()
#4 /game.php(57): ShowBuildingsPage->show()
#5 {main}

$ListIDArray[] values mistake? Original code was scaling build time as a "estimated cost" instead of "building level" power of estimated build end time. Giving enormous numbers (E+209 ~INF)

@mys mys requested a review from fervi Jan 27, 2018
@mys mys changed the title Fix cancel running research error Fix cancel research/building queues error Jan 27, 2018
@mys

This comment has been minimized.

Copy link
Contributor Author

mys commented Jan 27, 2018

Reverted @fervi change of UNIXTIME calculation that work now with fixes above for buildings and researches.

@mys mys merged commit 76821d3 into steemnova:master Jan 28, 2018
@jkroepke

This comment has been minimized.

@mys Any reason for doing this?

This comment has been minimized.

Copy link
Contributor Author

mys replied Jan 31, 2018

if [$QueueID - 2] then 'Cancel' doesn't remove further levels of building.
https://i.imgur.com/mlwCX5z.gif

This comment has been minimized.

Copy link

jkroepke replied Jan 31, 2018

Ahh, got it.

mys pushed a commit that referenced this pull request Mar 29, 2018
Getting my fork up to date
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.