02.03.2017, 18:00
Quote:
I've 2 connection's type : when i'm on local (OnTestServer) and when I'm not. I'm using OnTestServer in differents commands like /ban, etc..
For this: Code:
- Config ( Core ) - base.pwn ( Global Definitions, MySQL, Server Settings ) - macros.pwn ( Global Macros for shortcuts like FUNCTION: and PUBLIC: ) - plugins.pwn ( Global Plugin Definitions ) "../core/configuration.inc" (GM's inititialization) "../core/MySQLConnections.inc" (Creating table, connection to mysql, etc...) "../core/base.inc" (Macros and constants) That's good? Annnd.. I'm trying a new thing. It's for creating logs (from configuration.inc): PHP Code:
EDIT: Write logs function PHP Code:
|
I prefer lowercase since it just easier to read ( for me anyway ).
As for what you said, If you are able to understand it easily then you can continue the way your doing it, but for the best practices you will need to pretend your not you and you've been given this script by someone else. Then ask yourself questions like does it make sense? is it easy to follow? is it easy to add onto or modifiy?
If I was you I would follow my way, since there literally nothing to be confused about, since every is labeled based on what the file will contain.
I also see, you do not comment your code, which is poor practice, you must always comment your code, even if your the only one modifying it.
If you are having issue finding functions, variables, enums or callbacks. Then your structure is wrong, it must follow a path that is easy to understand.
Also I would add a file in core called database.pwn ( containing the stock functions for connecting to the db ), keep the definitions in base.pwn. Make another file for macros.pwn since these can get messy to look at and also can be long as well as you having many of them. So rename MysqlConnections.pwn (it looks ugly) to database.pwn.