BeamMP-Server
BeamMP-Server copied to clipboard
`MP.Get` and `MP.Set` improvements
New Lua API features:
MP.Get(category, key) -> string|number|tableMP.Set(category, key, value)as an overload to existingMP.Set(enum)
Set settings should not be persisted, that is a different problem to tackle.
The following should work, for example:
MP.Set("General", "Name", "Hello, World!")
local name = MP.Get("General", "Name")
and name, of course, is "Hello, World!".
Acceptance Criteria
- [ ] MP.Get and MP.Set behavior should be as described
- [ ] Return (nil, error) on failure
- [ ] Failure case for invalid value type given to
MP.Set - [ ] Failure case for non-existant category or key, currently no support for custom keys and categories
I think the described behavior is not achievable with current primitives in the server. Extensive filtering of categories like this sounds like a perfect use case for a database imo.