Mitigates issue caused by moving around deleted effect objects, otherwise the push_weak_ref function would've been called on a garbage lua state pointer
Currently, if both patrician of darkness and must attack effects were in play, th eturn player was still able to select an attack target among the monsters affected by the must attack effect, ignoring the selection performed by the opponent
Split actual constants exposed by the various core messages into a separate header file to make clear the fact those are the constants expected to be used by applications consuming the library
If PROCESSOR_VARIANT_CAP was set to a value which made the subvariants have Processors::SelectPlace and Processors::SelectDisField not be part of the same variant, emplacing a new variant object caused a compile error due to ambiguity on which variant to pick.
To fix this SelectDisField is no longer listed in the processor_unit tuple so that the base class will always be taken in consideration, this prevents `emplace_back(std::in_place_type<T>,` from being used tho when not using the subvariant approach.
No longer manage a Group's lifetime explicitly in native code, but instead leverage Lua's garbage collector to handle it's lifetime.
In this change, Groups will be stored internally in the core inside a weak table, so that they will still be reference-able when needed, but if no reference were to exist in Lua code, they will be subject to garbage collection.
Whenever a Group is used by native code, its wrapped by a owned_lua template class, this is akin to std::shared_ptr--It reference counts the usages of that group internally in the core, including managing it in the Lua registry index when in use, so that it won't be collected.
With this approach, the exponential memory usage growth caused by long running procedures due to the creation hundredths of thousands of groups per iteration, is mitigated, since the temporary groups will be reaped more frequently, as opposed to the old approach of them being cleared only after the topmost Lua function had finished executing.
For now a single GC step is triggered whenever the total number of groups is more than 2048--an arbitrary value that seems to work well enough, but which can be changed/optimized after proper profiling.
A major upgrade with this approach is the removal of the concept of Groups "kept alive" and having to "explicitly delete" them to make them outlive a Lua function execution, since they will now follow Lua's variables lifetime properly.
In lua 5.4 and later, it's now possible to specify the number of userdata value slots, including 0, unlike in earlier versions where the slots were always fixed at 1.
Since they're unused in our case, use the full function to have 0 slots available and save some space for each userdata object
Prevents errors down the line due to overpaying since a card with sum_param of 0 will never contribute to the total and error out when the client sends a response