Releases: IS4Code/PawnPlus
Releases · IS4Code/PawnPlus
PawnPlus v0.11.0
Collections
- List iterators return the index via
iter_get_key
. New iterator functions:iter_sizeof
,iter_tagof
,iter_sizeof_key
,iter_tagof_key
. - Movement functions take optional parameter to specify the number of steps.
list_find
for searching in lists (uses variant comparison).- Other functions for maps and lists to create iterators at specific positions.
Memory management
- It is no longer possible to directly move GC-objects between the local and global pool. Instead,
acquire
andrelease
operations are used to increase or decrease the reference count stored in the object. Only objects having the count set to 0 will be in the local pool (and thus collectible). (#11) - As a consequence,
GlobalString
,GlobalVariant
, andGlobalIter
tags are removed, as well as the corresponding tag conversions.acquire
andrelease
should be used explicitly to control the movement. You also shouldn't need to delete these objects directly, if you use these operations correctly. - Guards use
acquire
andrelease
to control the lifetime of the guarded object. For objects controlled by the garbage collector, this manipulates the reference count. For other objects, it callsdelete_deep
on them. - Generic functions
pawn_ref
andpawn_unref
to createRef<T>
without explicit retagging. - Added handles to manage standard objects (like lists and maps) using garbage collection. Handles are garbage-collected, and delete the object when they are collected.
- Handles and guards do not call the destructor if the object was already destroyed via some other way (only works for containers and tasks).
Tasks
- Tasks can store variants (i.e. values of any type and tag). Generic tasks are possible now as well.
task_continue_with
andtask_continue_with_bound
to specify a function which should be called when the task is completed (and which might be used for a new task).
Tags
- Tags derived from generic tags cannot have their operations redefined.
tag_element
to obtain the element tag from a generic tag.- Generic tags no longer have to be explicitly defined. Instead, all generic functions are represented as separate macros.
PawnPlus v0.10.1
v0.10.1
pp_max_recursion
to prevent crashes related to native recursion.task_bind
returns the immediate result if it is available.- A task scheduled to be completed after 0-length time interval will be still executed in the current tick, but postponed after all other code.
task_config
to control which sections of the memory should be stored.- Finishing a task after a time interval:
task_set_result_ms
,task_set_result_ticks
,task_set_error_ms
,task_set_error_ticks
.
v0.10.0
- Tags
ConstString
andConstVariant
have been introduced to better distinguish functions which shall not modify the input object. Their use in code is optional. (Note about tag inheritance:String
inherits fromConstString
.) - Added
task_bind
to create a task from a public function. - All native functions now check for the correct argument count.
PP_ALL_TAGS
may be defined for compilers which support tag wildcard.- Tag instances store their operations with them, so indexing a map is no longer needed when calling operations dynamically. The unknown tag (now with the internal representation of
{...}
) is the base of all other tags. var_inc
andvar_dec
are finally implemented, together with the operator overloads. Dynamically defining or calling these operations now also works.- Dynamically defined tag operations (
tag_set_op
) cache the public function index, making them a lot faster. - Fixed calling
pawn_call_public
andpawn_call_native
with no arguments. - Fixed argument offset in
pawn_register_callback
andpawn_add_filter
.
PawnPlus v0.9
Hooking
- Proper native hooks (
pawn_add_hook
). The original function can be directly called by calling the native again inside the hook, modifying freely the arguments or return value. - Filters reimplemented using the new system.
- Maximum amount of hooks increased to 1024 (was 256).
Callbacks
- Changed how dynamic callbacks work, resulting in higher compatibility with other plugins. Hooking
amx_FindPublic
is no longer necessary. - New options for callbacks, specifying the presence of return value or allowing modification of input arguments.
- The base public function must be provided now in order to register dynamic callbacks (for providing the index and default return value).
Collections
- Added linked lists. Created by
linked_list_new
, a linked list is similar to the standard list, but its elements are kept as separate objects in the memory, linked together via references to neighboring links. Iterators to linked lists remain valid even when the list is modified.
Other
- Task which is currently being completed will not be fully deleted.
- Caching of callback and hook handler names, resulting in speed increase.
pawn_get_args
for obtaining all arguments provided to the function.- Fixed signed characters conversion in strings.
- Partial implementation of GCA. Optional arguments are checked at runtime and several cached values are accompanied by validity checks.
- Generic syntax is now optional (define
PP_SYNTAX_GENERIC
). amx_public_var
fixed.
PawnPlus v0.8.1
- Fixed a compatibility issue with SAMPGDK related to events.
PawnPlus v0.8
- Tasks can store an error/exception state, can be used to signal cancellation or other exceptional events. Waiting for any result or error is performed via
task_wait
(now used together withtask_get_result
intask_await
). - Iterators completely reworked, now are much safer and more powerful, allow for inserting or erasing values, and keep track of their collection's lifetime and modifications.
- Tag system enhanced with dynamically defined tags and tag operations which can be called on values or variants. Properly defined tag operations can automatically collect unused objects or isolate their data. Tag operations can be invoked dynamically.
- Minor additions to string and AMX functions.
- AMX is fully cleaned after saving the sleep state, the stack no longer leaks.
- String coercion operators fixed and definable with
PP_SYNTAX_STRING_OP
.
PawnPlus v0.7.2
map_remove
fixed.- Added
map_has_key
to determine if a certain key in a map exists.
PawnPlus v0.7.1
- Fixed a bug regarding using array variant functions.
PawnPlus v0.7
- Variants can store 2D and 3D arrays now. Many variant functions were updated to work with a variable number of indices.
amx_fork
can specify 3 levels of forking (exec, data, script).- Native hooks are called filters now, both functions merged to
pawn_native_filter
. - Obtaining the tag of a variant can be done via
var_tag_uid
, removing the need to usetagof
. - Optional syntax features are now disabled by default. Define
PP_SYNTAX
to restore them. - Compatible with YSI by default.
PawnPlus v0.6
- Added various
*_clone
functions for deep-cloning objects. - Memory leak fixes related to objects and threads.
- Massive infrastructure change in the various components of the plugin, leading to more manageable and safe code.
- Changes to the tasks API, its garbage collection and adding
task_delete
,task_valid
,task_completed
,task_keep
,task_reset
,task_any
, andtask_all
. - Time-based tasks are stored in a list ordered by the time, making the server more efficient in case of a larger number of active timers.
- Numerous functions related to AMX machines like forking, remote access to variables etc. Usable in other systems like tasks and threading.
PawnPlus v0.5
- Added a couple of functions related to tags (name, unique id, inheritance).
- New functions to construct lists and maps from arguments or array of elements.
pawn_call_native
doesn't require the function to be used in the script.list_delete_deep
andmap_delete_deep
- deletes their contents too (inner maps, lists, variants, strings).- New technique called guards - automatically freeing an object (list/map) when out of scope.
- Hooking natives. Pre-hooks and post-hooks only (not recursive). Modifying parameters or the return value is possible.
str_split
andstr_join
.- Lots of sanity checks for strings, variants, lists, and maps for invalid pointers.
- Naming changes -
*_is_valid
is now*_valid
. Iterator functions renamed tolist_iter_valid
andmap_iter_valid
. - Several
pp_
debugging functions for retrieving sizes of various pools (strings, lists etc.) Useful for debugging memory leaks.