Giter VIP home page Giter VIP logo

cs2-map-configs-prefix's Introduction

[CS2] Map-Configs-Prefix (1.0.5)

Map Configs Depend Map Name

・Add Many Cfg You Like Depend Map Name to Execute Per Map Inside csgo/cfg/Map-Configs-Prefix/

Example Normal Cfg (Will be edit on json ExecMode and ExecXTimes):

・Prefix (aim_.cfg) will execute on any map start with aim_

・if plugin cannot find (aim_.cfg) will start search config name (aim_deagle_.cfg)

・if plugin cannot find (aim_deagle_.cfg) will start search full map name config (aim_deagle_lego.cfg)

・if plugin cannot find (aim_deagle_lego.cfg) will execute (_default_.cfg)

Example Force Cfg (Will be edit on json ForceExecMode and ForceExecXTimes):

・Prefix (f_aim_.cfg) will execute on any map start with aim_

・if plugin cannot find (f_aim_.cfg) will start search config name (f_aim_deagle_.cfg)

・if plugin cannot find (f_aim_deagle_.cfg) will start search full map name config (f_aim_deagle_lego.cfg)

Note

Note: If you like to invert the search path enable InvertPathMode

.:[ Dependencies ]:.

Metamod:Source (2.x)

CounterStrikeSharp

.:[ Configuration ]:.

{
  //Plugin Find Route Configs In csgo/cfg/Map-Configs-Prefix/
  //----------------------------------------------------------------
  //false: aim_.cfg ==> aim_deagle_.cfg ==> aim_deagle_lego.cfg ==> _default_.cfg
  //true: aim_deagle_lego.cfg ==> aim_deagle_.cfg ==> aim_.cfg ==> _default_.cfg
  "InvertPathMode": false,
  
//-----------------------------------------------------------------------------------------

  //-----------Event Calls Path-----------//
  //-------------------------------------//
  //OnMapStart: Will Be Called On Map Start 1 Time Only
  //OnWarmupStart: Will Be Called On WarmUp Only
  //OnRoundStart: Will Be Called On Every Round Start Include WarmUp
  //OnMatchStart: Will Be Called On Match Started (Round 1) 1 Time Only
  //OnPlayerSpawn: Will Be Called On Every Player Spawn
  //-------------------------------------//
  
  //This On Normal Cfg example de_.cfg or de_dust2.cfg or _default_.cfg
  "ExecMode": "OnMapStart,OnWarmupStart,OnRoundStart,OnMatchStart",
  //How Many Time You Want ExecMode To Be Exec (More = Better To Override)
  "ExecXTimes": 3,
  
//-----------------------------------------------------------------------------------------

  //This On Force Cfg example f_de_.cfg or f_de_dust2.cfg
  "ForceExecMode": "OnPlayerSpawn",
  //How Many Time You Want ForceExecMode To Be Exec (More = Better To Override)
  "ForceExecXTimes": 1,
  
//-----------------------------------------------------------------------------------------

  "EnableErrorLogChecker": false,
  
//-----------------------------------------------------------------------------------------
  "ConfigVersion": 1
}

.:[ Change Log ]:.

(1.0.5)
-Fix Some Bugs
-Rework Prefix Plugin
-Added InvertPathMode
-Added More prefix

(1.0.4)
-Fix Some Bugs
-Rework Prefix Plugin
-Added "ExecMode"
-Added "ExecXTimes"
-Added "ForceExecMode"
-Added "ForceExecXTimes"

(1.0.3)
-Fix Some Bugs
-Fix Warmup Not Execute cfg

(1.0.2)
-Fix Some Bugs
-Remove "ConVarEnforcer"
-Now Cfg will Override Any Map

(1.0.1)
-Fix Some Bugs

(1.0.0)
-Initial Release

.:[ Donation ]:.

If this project help you reduce time to develop, you can give me a cup of coffee :)

paypal

cs2-map-configs-prefix's People

Contributors

oqyh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

cs2-map-configs-prefix's Issues

Performance Improvement

Hi, I was checking your plugin, and I noticed that is repeating the applying process if server is empty (endless)
and I'm getting CPU% spikes on my server due of that.

Could be better if you just use EventRoundAnnounceMatchStart & EventRoundAnnounceWarmup?

Timers causing problems (maybe)

Demo:
image

Hi @oqyh,
I have a problem on my server related to this cvar, mp_equipment_reset_rounds.

Sequence:

  1. At mapstart (or first round) everything is ok.
  2. At second round cvars are applied with delay (like 1s), I discovered it spamming console cvar, that allows me get current value applied to that cvar as I showed in demo image.

I think it's 'cos mp_equipment_reset_rounds is set at 0 as default config in this workshop map. So that's why only have problems with this cvar, but could have more problems with other cvars if that were setted as default in the config of the workshop map.

So, as solution, I think that you could provide a manual setting for timer through json file. Or set the first config call without a timer.

Why I think that's related to timers?
That's 'cos I tested CS2Jailbreak this plugin is without timers related to cvar applying and mp_equipment_reset_rounds doesn't have that delay problem.

I hope you understand the proposed logic, if there is something I left out or was not understood, let me know.

[Enhancement]: Invert how plugin analyzes each map config

Hi @oqyh, (idk if next enhancement it's possible)

README.MD:
・if plugin cannot find (surf_.cfg) will start search to full map name config (surf_boreas.cfg).
・if plugin cannot find (surf_boreas.cfg) will execute (default.cfg).

The instructions in the README.MD file specify that the plugin first analyzes the map prefix and then looks for a specific configuration for that map. However, it would be more logical to invert this process. Consider a scenario where there are many maps with the "aim_" prefix, and the need arises to configure specific settings for certain maps, such as aim_deagle and aim_awp. In this case, it would be more practical for the plugin to first search for full map name, then part of map name and then analyze the map prefix if specific configuration wasn't found.

  • With "specific config" I mean => aim_deagle_lego.cfg
  • With "map prefix config" I mean => aim_.cfg

So in resume the new scan should be in this order:

  1. aim_deagle_lego.cfg => full map.
  2. aim_deagle_.cfg => part of map name.
  3. aim_.cfg => just prefix.
  4. default.cfg => default if previous wasn't found.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.