Hi again
Im using 2moons 2.0
As the original Battle Engine was quite buggy for us I decided to switch to OPBE as some in this forum suggested. It was said that OPBE should be compatible with any 2moons-version but there might be some complications so maybe this problem is a problem with the version? anyway, lets geht to the error:
Sometimes a fleet of a player is locking so I have to unlock it via admin-panel. This happens around twice a day. This is the error.log which seems to be the reason but im not sure as I sometimes have 2 lockes Fleets of 2 different players but only one error
Display All
so as it seems i get negative values for the Techlevels. To be honest I dont understand the variables in the ShipType.php:
Display All
Is there a Problem with the $level-variable? maybe the problem lies in the calculateAttack.php?
I hope someone can help me finding the problem
happy new year btw
Im using 2moons 2.0
As the original Battle Engine was quite buggy for us I decided to switch to OPBE as some in this forum suggested. It was said that OPBE should be compatible with any 2moons-version but there might be some complications so maybe this problem is a problem with the version? anyway, lets geht to the error:
Sometimes a fleet of a player is locking so I have to unlock it via admin-panel. This happens around twice a day. This is the error.log which seems to be the reason but im not sure as I sometimes have 2 lockes Fleets of 2 different players but only one error
Source Code
- [03-Jan-2020 14:16:49] USER ERROR: "Trying to decrease tech"
- File: /var/www/html/fjdn/2moons/includes/libs/opbe/models/ShipType.php | Line: 106
- URL: https://fjdn.ddns.net/fjdn/2moons/game.php?page=overview | Version: 2.0.git
- Stack trace:
- #0 /includes/libs/opbe/models/Fleet.php(69): ShipType->setWeaponsTech(-1)
- #1 /includes/libs/opbe/models/Player.php(64): Fleet->setTech(-1, 0, -3)
- #2 /includes/libs/opbe/implementations/2Moons/1_7_2_injectionMode/calculateAttack.php(110): Player->addFleet(Object(HomeFleet))
- #3 /includes/classes/missions/MissionCaseExpedition.class.php(361): calculateAttack(Array, Array, '30', '0')
- #4 /includes/classes/class.FlyingFleetHandler.php(86): MissionCaseExpedition->EndStayEvent()
- #5 /includes/FleetHandler.php(31): FlyingFleetHandler->run()
- #6 /includes/common.php(127): require('/var/www/html/f...')
- #7 /game.php(24): require('/var/www/html/f...')
- #8 {main}
so as it seems i get negative values for the Techlevels. To be honest I dont understand the variables in the ShipType.php:
Source Code
- public function setWeaponsTech($level)
- {
- if (!is_numeric($level))
- return;
- $level = intval($level);
- $diff = $level - $this->weapons_tech;
- if ($diff < 0)
- throw new Exception('Trying to decrease tech');
- $this->weapons_tech = $level;
- $incr = 1 + WEAPONS_TECH_INCREMENT_FACTOR * $diff;
- $this->singlePower *= $incr;
- $this->fullPower *= $incr;
- }
Is there a Problem with the $level-variable? maybe the problem lies in the calculateAttack.php?
I hope someone can help me finding the problem
happy new year btw