sourcebans-pp icon indicating copy to clipboard operation
sourcebans-pp copied to clipboard

Begin to break into modules

Open TheByKotik opened this issue 6 years ago • 6 comments

Motivation and Context

Begin to break into modules for preventing duplication of code. Also resolve https://github.com/sbpp/sourcebans-pp/issues/464.

How Has This Been Tested?

I tested it in different situations.

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [x] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • [x] My code follows the code style of this project.
  • [ ] My change requires a change to the documentation.
  • [ ] I have updated the documentation accordingly.
  • [x] I have read the CONTRIBUTING document.

TheByKotik avatar Oct 15 '19 04:10 TheByKotik

I'm think build failed because don't set include dir (spcomp flag -i).

TheByKotik avatar Oct 15 '19 04:10 TheByKotik

Build fixed but It's not quite include. It's something like a module.

TheByKotik avatar Oct 15 '19 06:10 TheByKotik

One connection for all plugins can be implemented too easy, if plugins will be connect to DB in single-thread.

https://sm.alliedmods.net/new-api/dbi/SQL_Connect persistent argument.

CrazyHackGUT avatar Oct 15 '19 14:10 CrazyHackGUT

One connection for all plugins can be implemented too easy, if plugins will be connect to DB in single-thread.

https://sm.alliedmods.net/new-api/dbi/SQL_Connect persistent argument.

If i remember correctly, this function called from main game thread and should have caused a lag.

TheByKotik avatar Oct 15 '19 14:10 TheByKotik

When you starts plugin - what's the difference? Few people launch plugins when people play. These peoples should understand any risks related with starting plugin in the middle of the game.

Yes, you remember correctly. This function really causes the lag.

CrazyHackGUT avatar Oct 15 '19 18:10 CrazyHackGUT

When you starts plugin - what's the difference? Few people launch plugins when people play. These peoples should understand any risks related with starting plugin in the middle of the game.

Yes, you remember correctly. This function really causes the lag.

You are certainly right, loading plugins often causes lags.

However, connection to database can occur at different times, including during important game events, if, for example, something happened with db / db server.

Just as I mentioned above, this is something like a module that is designed to stop duplication of code from plugin to plugin.

TheByKotik avatar Oct 16 '19 04:10 TheByKotik