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

no more sql-injections; fixed dungeon exp rewarding; refactoring. #2

Merged
merged 20 commits into from
Aug 8, 2023

Conversation

TemirkhanN
Copy link
Contributor

It's too big and very messy in terms of amount of changes. Will be difficult to dive in and review by all means.

Feel free to go through the commits one after another to see the changes in a more sophisticated way.

These changes are backward compatible - no behavior was changed.

This mr mostly ensures that there are no ambiguous cases when something happens implicitly.

./tabs/ directory now only renders the data and handles the signals. All changes in the database happens only through ./src/.

Database interaction is now happening through https://github.com/doctrine/dbal. It was not essential but simplifies some things(changing database driver without rewriting an app at any moment).
Also, the wrapper has been adjusted to execute prepared statements so, no need for mysql_real_escape_string and so on.
To prevent the injection one can now use

$this->dbconnection->fetchRow('SELECT * FROM table WHERE some_field=?', [$someFieldValue]);

Behavior changing

  • Chat is going through api based interaction. Page is not refreshed on new message add rather it refreshes the message list using api.
  • Banned player can no longer log in(I did not perform force-logout for now).
  • Dungeon rewarding now uses actual monster exp to calculate the reward based on amount of minutes passed.
  • Player can no longer receive exp above the stamina he has. Previously if the cronjob was not running and there was a delay between previous run, player who had 5 stamina left could receive exp as if he spent days in the dungeon.

Breaking

  • Unfortunately I broke something in level calculation and now if player's experience is higher than the highest value in the exp_table, then his level can not be calculated and status-bar fails due to that error.

@crilleaz
Copy link
Owner

crilleaz commented Aug 6, 2023

The breaking is caused by selecting the experience from exp_table, while the user has equal or more than what is the highest in the table, was not finished with that part, added some 20 levels or so!

Other than that, i'll go through as soon as i get some free time, but first glance it looks nothing but good.

I don't know if doctrine/dbal is necessary, but I don't mind!

You are doing great work here, much appreciated!

@crilleaz crilleaz merged commit f73c62a into crilleaz:main Aug 8, 2023
@skxnxt skxnxt mentioned this pull request Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants