tomirons / pw-web

This is an open source user/admin panel for the game Perfect World.
28 stars 25 forks source link

so far bugs #21

Closed HyperSin closed 8 years ago

HyperSin commented 8 years ago
  1. level up feature does not increase hp and mp with every level
  2. vote gold ether not sending or takes forever to send (mite not be a panel problem, but needs looked at)
  3. factions for 1.5.1 do not work anymore
BahaStriker commented 8 years ago

I already gave you a fix for the Gold issue

autocubifix.php ` <?php $DBHost = "localhost"; $DBUser = "root"; $DBPassword = "password"; $DBName = "pw";

$Link = MySQL_Connect($DBHost, $DBUser, $DBPassword) or die ("Can't connect to MySQL"); MySQL_Select_Db($DBName, $Link) or die ("Database ".$DBName." does not exist.");

mysql_query("UPDATE usecashnow SET creatime='0000-00-00 00:00:00' WHERE creatime <> 1"); ?> `

Then put a cron job to run every 5 minutes or so */5 * * * * php /var/www/html/public/autocubifix.php >> /dev/null 2>&1

Not sure about Lvl up function, it seems kind of hard to fix, though I'll give you a hint It's in /var/www/html/public/panel/app/Http/Controllers/Front/ServicesController.php

Search for public function level_up $role_data['status']['level'] = $role_data['status']['level'] + $request->quantity; $role_data['status']['pp'] = $role_data['status']['pp'] + ( $request->quantity * 5 );

You can add these after $role_data['status']['hp'] = $role_data['status']['hp'] + 3000; $role_data['status']['mp'] = $role_data['status']['mp'] + 2300

Just an example though

HyperSin commented 8 years ago

wouldn't it work with $role_data['status']['hp'] = $role_data['status']['hp'] + ( $request->quantity * 3000 );

HyperSin commented 8 years ago

your php file dint work, i dont think my cronjob works all that well

BahaStriker commented 8 years ago

Not it wouldn't work, because for example if you put quantity 149 which will level you up from 1 to 150 you're basically giving 75 + (149 * 3000) HP

HyperSin commented 8 years ago

Ok

HyperSin commented 8 years ago

i mean your php to fix cubi dint work

BahaStriker commented 8 years ago

Make sure the patch is right for the file in cron */5 * * * * php /var/www/html/public/autocubifix.php >> /dev/null 2>&1

Go to your database then vote and check if the value is changed in "creatime" field located in usercashnow table

You can also try to manually check if it work by directly executing the file by going to http://URL/public/autocubifix.php

tomirons commented 8 years ago

$role_data['status']['hp'] = $role_data['status']['hp'] + ( $request->quantity * 3000 );

It would have to be something like that, cause otherwise if you buy more than 1 level it will only give you 3k more hp.

HyperSin commented 8 years ago

My path is /var/www/pw-web/public/autocubifix.php >> /dev/null 2>&1 and i fugired it would have to be like that hulu or every level you did you got 3000 hp

BahaStriker commented 8 years ago

$role_data['status']['hp'] = $role_data['status']['hp'] + ( $request->quantity * 3000 );

Still, it's not valid.. Let's say You're lv1 with 75 HP and you bought 149Lvls to get to 150 so it would be 75 + (149 * 3000) that's 447075 HP, it's messed up. I'm not good with math but I'll try to come up with an equation that's reasonable enough

BahaStriker commented 8 years ago

Best I could come up with it $role_data['status']['hp'] = $role_data['status']['hp'] + ( $request->quantity * 30 );

Lv 150 = 4545 HP

tomirons commented 8 years ago

How much HP & SP do you get per level?

BahaStriker commented 8 years ago

I just checked, each lvl should give you exactly +30 HP and + 18 MP

HyperSin commented 8 years ago

I think it verys on the class dont it

tomirons commented 8 years ago

Then do this:

$role_data['status']['hp'] = $role_data['status']['hp'] + ( $request->quantity * 30 );
$role_data['status']['mp'] = $role_data['status']['mp'] + ( $request->quantity * 18 );`
BahaStriker commented 8 years ago

I think it verys on the class dont it indeed

for Magic classes it adds +20 HP and +28 MP You can add a control statement like

if ( !in_array( $role_data['base']['cls'], [ 9, 1, 2, 3, 7 ] ) ) { $role_data['status']['hp'] = $role_data['status']['hp'] + ( $request->quantity * 20 ); $role_data['status']['mp'] = $role_data['status']['mp'] + ( $request->quantity * 28 ); } elseif ( !in_array( $role_data['base']['cls'], [ 6, 5 ] ) ) { $role_data['status']['hp'] = $role_data['status']['hp'] + ( $request->quantity * 26 ); $role_data['status']['mp'] = $role_data['status']['mp'] + ( $request->quantity * 22 ); } else { $role_data['status']['hp'] = $role_data['status']['hp'] + ( $request->quantity * 30 ); $role_data['status']['mp'] = $role_data['status']['mp'] + ( $request->quantity * 18 ); }

This should give Heavy class 30HP and 18MP Magic class 20HP and 28Mp LA (Assassin and Archer) class 26HP and 22MP

HyperSin commented 8 years ago

Cool, wish we dint have to add that every time we update the panel

tomirons commented 8 years ago

I'll add it in soon, but it won't be an update. It will just be a commit.

tomirons commented 8 years ago

Done, you can download the source.