NotJustin / SkillAutoBalance

12 stars 3 forks source link

Make GetScore function more abstract #17

Closed NotJustin closed 4 years ago

NotJustin commented 4 years ago

It can be a lot neater, and use a lot less lines. From alliedmodders discord, Impact showed this:


switch (scoreType)
{
    case TYPE_GAMEME:
    {
        QueryGameMEStats("playerinfo", client, GameMEStatsCallback, 1);
    }
    case TYPE_RANKME:
    {
        g_iClientScore[client] = float(RankMe_GetPoints(client));
    }
    default:
    {
        LogError("Neither kento_rankme nor gameme was found.");
    }
}

CreateTimer(0.1, Timer_CheckScore, GetClientUserId(client), TIMER_FLAG_NO_MAPCHANGE);```

I can use this and use an enum struct for the rest to make it more abstract.
WhyFaust commented 4 years ago

Just a funny thing is that for example, two or more rpg plugins can not stand on the server. 1000%. As well as two different statistics (HLStat, LVL Ranks, Rank ME). This doesn't make any sense. That's why I told you to unite all the statistics in one block and all the statistics in another.

NotJustin commented 4 years ago

I wonder if it is worth it for me to split plugin into modules. I make a module for each rpg/statistic plugin, and then you use skillautobalance + the module for the rpg/statistics you want to use?

WhyFaust commented 4 years ago

Oh, well, that's just great.)

NotJustin commented 4 years ago

I wonder if it is worth it for me to split plugin into modules. I make a module for each rpg/statistic plugin, and then you use skillautobalance + the module for the rpg/statistics you want to use?

I do not think it is worth it. It makes installation more complicated.

Currently, you install one plugin, then change the autoexecconfig to be what you want.

If I make modules, you have to install main plugin, second plugin you want, and then you still need to change autoexecconfig for other stuff.

No benefit I think.

NotJustin commented 4 years ago

What if I make a bunch of files, and you just pick which one you need. Don't need to split it into "main plugin" and "second plugin" - I can just make a different version for each.

I will work on it and I think I will upload it as a different branch.

NotJustin commented 4 years ago

https://github.com/NotJustin/SkillAutoBalance/tree/split

I do not know if I should replace the original yet. I need to decide some things.

For everything besides skillautobalance, sab_scoretype is not used. For skillautobalance alone, Timer_CheckScore is not used.

WhyFaust commented 4 years ago

So why can't you just make it so that if this module is loaded, you can use the settings from it. There's no need to change any cvars after.

NotJustin commented 4 years ago

Look here, that is what I did I think https://github.com/NotJustin/SkillAutoBalance/tree/split/scripting

WhyFaust commented 4 years ago

Yeah, well, I saw that. Except that it's very difficult for me to understand how you implemented it without any natives, etc.

NotJustin commented 4 years ago

Yeah. I think I did not make it modular. I made a different version of the plugin for each other plugin (NCRPG, SMRPG, RankMe, etc.)

All versions use the same things in the SkillAutoBalance folder (when the plugin is compiled, all of those .sp files in the folder are compiled with it)

All of the files outside of the SkillAutoBalance folder are different versions. You only use one of them.

To be clear, you would use skillautobalance-ncrpg.sp, and you would NOT use skillautobalance.sp (i should rename that one to skillautobalance-default, maybe).

WhyFaust commented 4 years ago

Ahhh... Now I get it.