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

2Moons engine resource losses #220

Open
yamilrh opened this issue Jun 2, 2020 · 2 comments
Open

2Moons engine resource losses #220

yamilrh opened this issue Jun 2, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@yamilrh
Copy link

yamilrh commented Jun 2, 2020

Retomando lo planteado aquí 8c1ee6b#commitcomment-39607702 y #219
En el foro soporte hace un tiempo leí que en 2Moons es normal que los usuarios tengan perdidas de recursos es algo random no es que siempre pasa, y hace poco en el proyecto que llevo... Empezaron dichas perdidas es que esto ocurre el 99.9% cuando transportas de X Lunas para X plantea o X Luna o sea que el fleet_start_type = 3 y el fleet_end_type = 3 o 1 surgen dichas perdidas incluyendo a eso que los recursos sean mayor xxx.xxx.xxx digase metal, cristal o deuterio. y entonces estudiando y estudiando con lo que pusieron el en foro soporte y en lo que yo entiendo al parecer el class.PlanetRessUpdate.php en la función public function SavePlanetToDB, que supongo yo que sea la que guarda o agrega los recursos que llegan o están en el planeta esto floatToString($Count);
function floatToString($number, $Pro = 0, $output = false){
return $output ? str_replace(",",".", sprintf("%.".$Pro."f", $number)) : sprintf("%.".$Pro."f", $number);
}
Esto de acá junto al shortly_number() sean los culpables de que surjan dichas perdidas.
Porque llega el reporte de la Torre de control Informe de transporte como que llego dicho transporte pero no agregan los recursos.
Esto se aplica para los Colectores intergalácticos de Materia Oscura que también llega el reporte pero aveces no ingresa la Materia Oscura.
Ejemplo:
02. Jun 2020, 13:52:45 Torre de control Informe de transporte
Una de tus flotas ha llegado sin interrupciones al planeta LUna SupremaG7 [7:284:8] y ha entregado 2.500.000.000 Metal, 1.300.000.000 Cristal y 500.000.000 Deutério.

@Qwatayean
Copy link
Contributor

Blame how the barbaric ResourceUpdate class works.

The problem is how class.planetressupdate overwrites anything due to save funcion from abstractgamepage. So, by the difference of a second, if fleet transport metal and player is active on that planet and builds something with metal from that planet, its possible the metal of fleet returning to that planet its lost.

Its hard to reproduce, because its a reaction of milisseconds.

@Qwatayean Qwatayean added the bug Something isn't working label Jun 2, 2020
@Qwatayean
Copy link
Contributor

By the way, this explains #152

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants