core.libraries.meska.skills.server.init
Metrics-Skill-Achievement Framework (MESKA) The skill-system core functions.
- Servermeska.skills.announceLevel(ply, skill, level)Source ☍
-
Announces a level-up to player.
Parameters
- plyanyPlayer Entity.
- skillanyThe skill.
- levelanyThe level.
- Servermeska.skills.capLevels(ply)Source ☍
-
Caps all levels by meska.conf.defaults[skill].
Parameters
- plyanyPlayer Entity.
- Servermeska.skills.ensureRegistered(skill, cb)Source ☍
-
Creates the
meska_skillsrow that metric and achievement foreign keys point at, if it is missing.namehas no unique index, so the check is in the query:INSERT IGNOREwould add a duplicate row. Concurrent calls share one insert, retried once on a deadlock; a second failure logs and runs no callback.Parameters
- skillstringThe skill name.
- cbfun()?Called once the row exists.
- Servermeska.skills.getProductsBySkillFilter(ply, skill, filter) → table|nilSource ☍
-
Gets eligable products by skill and filter.
Note
This requires the lvl and requirements props to be present in the filter.
Parameters
- plyanyPlayer Entity.
- skillanyThe skill.
- filteranyThe filter.
Returns
- table|nilProducts table or nil.
- Servermeska.skills.getProductsBySkillLevel(ply, skill) → table|nilSource ☍
-
Gets eligable products by skill and level.
Parameters
- plyanyPlayer Entity.
- skillanyThe skill.
Returns
- table|nilProducts table or nil.
- Servermeska.skills.loadFor(ply, cb)Source ☍
-
Fetches player skills from db.
Parameters
- plyanyPlayer Entity. @func[opt] cb Callback Function.
- cbany
- Servermeska.skills.setup(skill, config)Source ☍
-
Setup a new meska skill.
Parameters
- skillanyThe skill name.
- configanySkill configuration.