1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 08:47:17 +01:00
Commit Graph

416 Commits

Author SHA1 Message Date
Sandu Liviu Catalin
8846cb9351 Initial revision of the script loading system to be more flexible and accurate. 2016-06-18 20:31:35 +03:00
Sandu Liviu Catalin
b59710ddeb Prepare the script container for the revised script loading system. 2016-06-18 20:29:28 +03:00
Sandu Liviu Catalin
c8d5200dc0 Add a helper funtion to the system path library to obtain the full path of a file. 2016-06-18 20:27:51 +03:00
Sandu Liviu Catalin
fe70560234 Add a helper function to obtain the last system error as a string and throw it. 2016-06-18 20:27:23 +03:00
Sandu Liviu Catalin
4be562c926 Update the script loading system to load and compile all scripts first and then execute them. 2016-06-18 13:09:08 +03:00
Sandu Liviu Catalin
d1ae2fd7e8 Fix the 64bit build on windows by making sure the _WIN32_WINNT macro has the proper value to include GetTickCount64() and also default to regular GetTickCount() on 32bit as the 64bit placeholder. 2016-06-18 10:24:41 +03:00
Sandu Liviu Catalin
24eddb8051 Minor spelling mistakes in core class. 2016-06-17 06:48:13 +03:00
Sandu Liviu Catalin
6a31e9ee58 Allow the option to toggle debugging from configuration file. 2016-06-17 03:33:58 +03:00
Sandu Liviu Catalin
c76acc07dc Use the new script loading system to be able to hold script information for future debugging implementations.
Fixes issue with scripts being sorted rather then being executed in the load order.
2016-06-17 03:28:37 +03:00
Sandu Liviu Catalin
2242ac9394 Make constructor public in script container.
Throw exception if trying to create script container with invalid VM.
2016-06-17 03:26:29 +03:00
Sandu Liviu Catalin
2b6fdcd855 Implement utility to hold script contents for debugging purposes. 2016-06-17 03:15:02 +03:00
Sandu Liviu Catalin
399ef5a292 Fix minor misspelling in core class. 2016-06-17 03:14:26 +03:00
Sandu Liviu Catalin
b3f0e98758 Implement script bundles in the script loading process. 2016-06-17 01:40:10 +03:00
Sandu Liviu Catalin
af9c00298c Fix infinite loop when registering constants. 2016-06-16 03:12:01 +03:00
Sandu Liviu Catalin
f8fabaf0b5 Improve the names of elments in the Skins enumeration to be consistent with the other enumerations. 2016-06-16 02:44:13 +03:00
Sandu Liviu Catalin
9a66f2a5d6 Reduce overall compile time and executable size of constants registration. 2016-06-16 02:43:07 +03:00
Sandu Liviu Catalin
166760fd46 Export functions to at least create shared buffers from modules. 2016-06-15 10:01:07 +03:00
Sandu Liviu Catalin
bca0e1f3c6 More validations on identifiers obtained from the server.
Prevent out_of_range exceptions leak into the script as it would end up in a crash since Sqrat doesn't know how to handle them.
2016-06-15 06:11:47 +03:00
Sandu Liviu Catalin
ef41d0d243 Improve the SetAnimation method on player class.
Make it so that the animation group is optional.
2016-06-15 06:06:03 +03:00
Sandu Liviu Catalin
7391d9391e Prevent triggering the player option change event value din not change.
If the value for the specified option would not be changed then there's no point in triggering any event or attempting to set it again only and have the same effect.
Fixed minor misspelling in the player class source.
2016-06-14 04:42:18 +03:00
Sandu Liviu Catalin
5a225a70b9 Validate identifiers obtained from the server before using them.
Prevent aout_of_range exceptions from leaking to the script in case the server returns a negative identifier. Thus, resulting in a server crash since Squirrel would not know how to handle them.
2016-06-14 02:34:04 +03:00
Sandu Liviu Catalin
4327eaf72c Add helper functions to pack colors into integers.
This removes the need to create an instance of the Color3 or Color4 classes just to obtain a packed color integer.
2016-06-14 02:18:37 +03:00
Sandu Liviu Catalin
a71b45567a Added LastArmor alias to the player class for consistency. 2016-06-14 00:50:20 +03:00
Sandu Liviu Catalin
9c547ae8a8 Add the Colour alias when retrieving the color from Checkpoints. 2016-06-13 01:33:52 +03:00
Sandu Liviu Catalin
67d0360fb3 Add the Colour alias when retrieving the color from Blips. 2016-06-13 00:23:30 +03:00
Sandu Liviu Catalin
eb58f59f81 Implemented the sub logging functionality in linux.
The sub logs used the same color as regular logs, instead of a darker/dim text.
2016-06-11 18:01:26 +03:00
Sandu Liviu Catalin
e3ecc782ef Fix compile time error in Chrono library.
The get tick count functions were defined as members of the Chrono class.
2016-06-11 17:53:55 +03:00
Sandu Liviu Catalin
bc1e7dbde6 Implement the option to specify how many times you want to allow intensive entity events to be forwarded to script callbacks.
Also expose several properties for the vehicle entity type that I forgot about.
2016-06-08 16:53:16 +03:00
Sandu Liviu Catalin
6489dfdf08 Fix the command system which would fail on recursive command execution. 2016-06-08 16:26:55 +03:00
Sandu Liviu Catalin
221e27e090 Remove implementation of the Decimal time. Not worth the troublem. 2016-06-05 04:28:45 +03:00
Sandu Liviu Catalin
3411f7c64b Export basic interaction with the decimal type. 2016-06-05 04:16:42 +03:00
Sandu Liviu Catalin
723f6296e2 Minor addition to the Decimal time. 2016-06-05 04:15:55 +03:00
Sandu Liviu Catalin
a1af9af0d7 Fix wrong includes left over by the merge of numeric libraries. 2016-06-05 04:15:23 +03:00
Sandu Liviu Catalin
17e78b83dd Initial untested implementation of the Decimal type. 2016-06-05 03:54:15 +03:00
Sandu Liviu Catalin
07b8a8b4a0 Minor improvements on the LongInt classes. 2016-06-05 03:53:58 +03:00
Sandu Liviu Catalin
d42040c9c0 Merge the Random and Math libraries into the Numeric library and organize code a bit. 2016-06-05 00:00:59 +03:00
Sandu Liviu Catalin
cce6beb4d5 Fix the exported API for the Chrono library to use unsigned integers. 2016-06-04 23:10:35 +03:00
Sandu Liviu Catalin
2aa7e8b7c2 Furher implementation and improvement of the Chrono types and also exposed them to the module API.
Tighten the safety of exported functions to avoid exceptions leaking outside the host plugin.
2016-06-04 22:33:34 +03:00
Sandu Liviu Catalin
36c49cd09c Forgot to register the Hash and AES sub libraries from the main Crypt library. 2016-06-04 22:32:08 +03:00
Sandu Liviu Catalin
0093bc2dec Implemented and improved more types in the Chrono library. 2016-06-04 19:17:42 +03:00
Sandu Liviu Catalin
ba6acb0d19 Implement the Date type. 2016-06-04 11:55:06 +03:00
Sandu Liviu Catalin
0c92601362 Update the module API and merge shared code between modules and host plugin. 2016-06-03 21:26:19 +03:00
Sandu Liviu Catalin
423bdfcdab Remove duplicate property from player class. 2016-05-26 08:55:48 +03:00
Sandu Liviu Catalin
d8d240285d Fix wrong parameter to format. 2016-05-26 06:57:42 +03:00
Sandu Liviu Catalin
7ee5fe2f0c Remove the {fmt} library from the project. Too many compilation issues with it. 2016-05-25 22:47:55 +03:00
Sandu Liviu Catalin
ec0a01d976 Remove obsolete files from the library folder. 2016-05-25 21:17:30 +03:00
Sandu Liviu Catalin
86a4933525 Release script callbacks properly in main plugin. 2016-05-24 21:36:49 +03:00
Sandu Liviu Catalin
f05e562708 Move most of the reload implementation to the central core. 2016-05-24 19:26:43 +03:00
Sandu Liviu Catalin
9d254a805c Separate micellaneous functions. 2016-05-24 18:45:50 +03:00
Sandu Liviu Catalin
76621cf946 Separate the IO library into smaller sub components.
Merge the INI module with the main plugin IO library.
2016-05-24 18:37:34 +03:00
Sandu Liviu Catalin
d7c4d389eb Throw an error if the given player name is invalid. 2016-05-24 08:26:47 +03:00
Sandu Liviu Catalin
56970f69c2 Exported more enumerations from teh SDK.
Renamed several existing enumerations for consistency.
2016-05-24 08:18:39 +03:00
Sandu Liviu Catalin
f8e845ebd2 Make the function environment optional in global callbacks. 2016-05-24 07:29:35 +03:00
Sandu Liviu Catalin
3ed0b22426 Make the function environment optional in entity callbacks. 2016-05-24 07:29:14 +03:00
Sandu Liviu Catalin
33790805eb Make the function environment optional in routine callbacks. 2016-05-24 07:24:21 +03:00
Sandu Liviu Catalin
75452625cd Enable the reload system in the macros.
Prevent the reload from entering a cyrcular reload when sending plugin commands.
2016-05-24 06:51:40 +03:00
Sandu Liviu Catalin
45c5f1129e Get rid of type aliasing warning. 2016-05-24 05:39:54 +03:00
Sandu Liviu Catalin
efa578e8a6 Add aliases for color and colour. 2016-05-24 04:59:36 +03:00
Sandu Liviu Catalin
82c3fa4439 Update the {fmt} library to fix the colision with C string.h header. 2016-05-23 22:42:49 +03:00
Sandu Liviu Catalin
250407feda Minor changes to the LongInt type. 2016-05-23 18:45:21 +03:00
Sandu Liviu Catalin
c135d4293e Remove irrelevant argument from the IToF function. 2016-05-23 05:39:32 +03:00
Sandu Liviu Catalin
b9b688581b Move routine processing outside the core class. 2016-05-23 03:54:50 +03:00
Sandu Liviu Catalin
86297882d5 Implement the custom event functions. 2016-05-23 03:51:44 +03:00
Sandu Liviu Catalin
fdd06e8c2e Minor aditions to the system path library.
Fixed small const correctness in remaining typename functions.
Added a flag to block certain format warnings on x64 builds.
2016-05-23 03:34:35 +03:00
Sandu Liviu Catalin
6822172f6a Updated the Squirrel and Sqrat libraries to the latest development versions. 2016-05-22 22:51:59 +03:00
Sandu Liviu Catalin
f2361a27c3 Untested update to the new plugin API.
Various other changes to the plugin as well.
2016-05-22 06:20:38 +03:00
Sandu Liviu Catalin
955aa218f2 Explicitly delete any copy/move operations from the logger class. 2016-04-20 09:24:37 +03:00
Sandu Liviu Catalin
1d2a23dd6c Minor changes in the encryption library. 2016-04-20 09:24:04 +03:00
Sandu Liviu Catalin
acdf9300b6 Update the type conversion utility to include more types and be more flexible. 2016-04-20 09:23:18 +03:00
Sandu Liviu Catalin
1017fc5c1a Fix the digit counting helpers to take into account negative values. 2016-04-14 04:50:44 +03:00
Sandu Liviu Catalin
4504ae0550 Remove leftover printf from math library, 2016-04-14 04:44:20 +03:00
Sandu Liviu Catalin
be8b631aea Added several functions to the math library to count integer digts and generate floating point numbers from integers. 2016-04-14 04:39:43 +03:00
Sandu Liviu Catalin
b818a162ee Initial implementation of the standard math library.
Implemented utilities to convert between fundamental types.
Implemented helper functions to retrieve numeric values from the stack at all costs.
Implemented various delegates on the long integer types to mimic the standard types.
Moved most of the stack utilities in a separate source.
Various other fixes and improvements.
2016-04-14 03:08:06 +03:00
Sandu Liviu Catalin
ea9f60e32c Fix a buffer underflow in the Center function from the string library. 2016-04-03 23:23:01 +03:00
Sandu Liviu Catalin
159e2f5929 Fix a posible buffer overflow from the previous commit. 2016-04-03 21:27:57 +03:00
Sandu Liviu Catalin
ef27cf3c5f Update the SToB function to convert the string to lowercase first and then perform the comparison. 2016-04-03 21:26:58 +03:00
Sandu Liviu Catalin
6f4ea3b06d Also include the lower/upper case conversion functions in the string library. 2016-04-03 21:10:17 +03:00
Sandu Liviu Catalin
45f1053f99 Implement the character clasification functions into the string library. 2016-04-03 21:09:49 +03:00
Sandu Liviu Catalin
ab3edcfe4d Remove functions that check character class from the shared code.
Expose the remaining floating point comparison functions.
2016-04-03 21:09:08 +03:00
Sandu Liviu Catalin
484b6978fb Minor changes in modules and host plugin. 2016-04-02 13:13:32 +03:00
Sandu Liviu Catalin
522f6cfd01 Remove legacy casting when packing colors. 2016-04-02 12:33:24 +03:00
Sandu Liviu Catalin
dfacd2c86c Reverse the order of the VM and stack top in stack guard. 2016-04-02 12:32:39 +03:00
Sandu Liviu Catalin
3a08e17cad Remove duplicate information when warning about command name collisions. 2016-03-29 05:58:12 +03:00
Sandu Liviu Catalin
eed7b70374 Helper classes to used CType functions as predicate in algorithms. 2016-03-29 05:39:17 +03:00
Sandu Liviu Catalin
7dffcd0f6e Include another alias for retrieving the current architecture. 2016-03-29 05:37:47 +03:00
Sandu Liviu Catalin
29da6850e4 Avoid GCC error "array subscript is above array bounds" which probably considers that the unsigned char could underflow and access an element out of the months range. 2016-03-27 22:15:51 +03:00
Sandu Liviu Catalin
6647386d30 Forgot to assign the null pointer after destroying components. 2016-03-27 22:14:24 +03:00
Sandu Liviu Catalin
71b255e5dc Use the uint64_t type instead of Uint64 when retrieveing serer time to fix an issue on x64 linux. 2016-03-27 19:06:21 +03:00
Sandu Liviu Catalin
49c2c46341 Remove extraneous character from printf inside the logger under linux. 2016-03-27 18:56:26 +03:00
Sandu Liviu Catalin
b8881b0059 Include the header that contains the PATH_MAX on linux in system path library.
Move the common typedefs inside the namespace otherwise the character type is not found.
2016-03-27 18:55:34 +03:00
Sandu Liviu Catalin
e0c2c01e25 Include the header that contains the PATH_MAX on linux in system environment library.
Use Append string instead of Write string when writing data to a buffer.
Remove leftover semicolon in 'else if' statement.
2016-03-27 18:54:45 +03:00
Sandu Liviu Catalin
e70afea7ad Fixed wrong variable name on linux in chrono library. 2016-03-27 18:43:18 +03:00
Sandu Liviu Catalin
0812472ac5 Forgot to include variable arguments library in shared buffers. 2016-03-27 18:41:10 +03:00
Sandu Liviu Catalin
a4cf2dae85 Added a custom delimiter for time and date and also the option to extract values from strings. 2016-03-26 18:18:41 +02:00
Sandu Liviu Catalin
b5215b38e3 Implement function to retrieve all active vehicles. 2016-03-26 18:17:38 +02:00
Sandu Liviu Catalin
aeba86bddf Implement function to retrieve all active textdraws. 2016-03-26 18:17:31 +02:00
Sandu Liviu Catalin
5d15342342 Implement function to retrieve all active sprites. 2016-03-26 18:17:21 +02:00
Sandu Liviu Catalin
c79598d843 Implement function to retrieve all active players. 2016-03-26 18:17:12 +02:00
Sandu Liviu Catalin
1472594c7f Implement function to retrieve all active pickups. 2016-03-26 18:17:05 +02:00
Sandu Liviu Catalin
6683930250 Implement function to retrieve all active objects. 2016-03-26 18:16:58 +02:00
Sandu Liviu Catalin
534a582561 Implement function to retrieve all active keybinds. 2016-03-26 18:16:50 +02:00
Sandu Liviu Catalin
054b4f080e Implement function to retrieve all active forcefields. 2016-03-26 18:16:41 +02:00
Sandu Liviu Catalin
ea9a370471 Implement function to retrieve all active checkpoints. 2016-03-26 18:16:32 +02:00
Sandu Liviu Catalin
067693d250 Implement function to retrieve all active blips. 2016-03-26 18:16:18 +02:00
Sandu Liviu Catalin
216ac8bbc0 Use unordered maps for storing script instances and options.
Also update some of the code to use braces even for single statements.
2016-03-26 18:16:01 +02:00
Sandu Liviu Catalin
886e525119 Implement a helper function to clamp a value between the ranges of another type. 2016-03-26 18:14:47 +02:00
Sandu Liviu Catalin
b486ecc2fb Fix the hide object function to calculate the correct coordinates but also implement the raw function. 2016-03-26 18:14:00 +02:00
Sandu Liviu Catalin
f9ef0040c9 Remove leftover includes from previous merge of the time utilities. 2016-03-25 14:43:26 +02:00
Sandu Liviu Catalin
e167a59f83 Merge the time utilities under the chrono library. 2016-03-25 14:28:07 +02:00
Sandu Liviu Catalin
f3af787bad Don't remove immediate routines bucket. 2016-03-25 13:11:21 +02:00
Sandu Liviu Catalin
ad9e02e5fb Update the standard printf function to use the dynamic string retrieval method.
Remove leftover includes from the string and crypt libraries.
2016-03-25 02:05:46 +02:00
Sandu Liviu Catalin
c9c0486e9f Remove duplicate code from the Crypt library and use the shared dynamic string argument retrieval. 2016-03-25 02:00:37 +02:00
Sandu Liviu Catalin
8828c004ca Add the declaration of the functions that return buffers in string library. 2016-03-25 01:54:43 +02:00
Sandu Liviu Catalin
299bc5ba77 Update the remaining functions from the string library to a more dynamic style. 2016-03-25 01:50:05 +02:00
Sandu Liviu Catalin
2e3fc1e47e Remove useless code from ToLower function in the string library and also name the shorter alias more appropriately. 2016-03-25 01:44:55 +02:00
Sandu Liviu Catalin
ae5d86e7cf Update most of the helper functions in the string library to allow a more dynamic value retrieval.
Various other bug fixes and adjustments.
2016-03-25 01:41:30 +02:00
Sandu Liviu Catalin
addebc61ff Update the names of certain helpers from the string library to be more appropriate. 2016-03-25 00:32:32 +02:00
Sandu Liviu Catalin
f71d0251c9 Added various helper functions to the standard string library. 2016-03-25 00:25:52 +02:00
Sandu Liviu Catalin
e4b93b020a Implemented a helper class to retrieve a string value from the stack as a string or generate a formatted string if necessary. 2016-03-25 00:25:03 +02:00
Sandu Liviu Catalin
42af986890 Initial implementation of reload mechanism. 2016-03-24 09:32:44 +02:00
Sandu Liviu Catalin
e057f22402 Implement functions to import existing entity instances after loading is complete. 2016-03-24 08:44:01 +02:00
Sandu Liviu Catalin
f5ec4e65ce Also prevent the player entity instance from being destroyed in mid-destruction. 2016-03-24 07:23:01 +02:00
Sandu Liviu Catalin
b877b1701b Don't release the callbacks abruptly in Function destructor. 2016-03-24 06:59:02 +02:00
Sandu Liviu Catalin
ff6cacaf68 Dumb approach to recive some kind of asserts if the program crashes because a component was used after it was deleted. 2016-03-24 06:43:02 +02:00
Sandu Liviu Catalin
3762b5e2ca Fix the exception code and make it use pooled buffers instead of the common buffer. 2016-03-24 05:30:07 +02:00
Sandu Liviu Catalin
01bafd7c4f Fix issues in the entity creation and destruction code.
Implement a locking mechanism to prevent entities be dstroyed in mid-destruction.
Also clean up properly when internal instances are deleted.
2016-03-24 05:28:55 +02:00
Sandu Liviu Catalin
23617b1493 Remove exceptions from entity creation/destruction if the entity already exists or doesn't at all. 2016-03-24 04:20:33 +02:00
Sandu Liviu Catalin
133bedce50 Dumb implementation of GetTickCount to be revised later if necessary. 2016-03-23 00:49:10 +02:00
Sandu Liviu Catalin
bcdb9707f0 Initialize the server callback that notify about player and vehicle updates. 2016-03-22 16:41:15 +02:00
Sandu Liviu Catalin
a23d934482 Implemented the entity pool change server callback to actually create and release entity instances. 2016-03-22 04:27:11 +02:00
Sandu Liviu Catalin
1f0d26da33 Separated the code that deallocates entity instances so it can be shared by entity pool change events from the server.
Minor improvements in the entity allocation methods.
Removed the return value from the function binding method.
2016-03-22 04:12:25 +02:00
Sandu Liviu Catalin
b60c8bc12c Separate the code that actually allocates the entity instance so it can be shared by entity pool change events from the server. 2016-03-22 03:29:27 +02:00
Sandu Liviu Catalin
b8ddc7f3b8 Use script exceptions in central core if if an error occurred when creating entities. 2016-03-22 02:53:22 +02:00
Sandu Liviu Catalin
b24104c99f Revised the standard string library to have cleaner code.
Implemented the Explode/Implode functions that work with a single delimiter.
2016-03-22 02:07:34 +02:00
Sandu Liviu Catalin
ec88d0ae30 Replaced the numeric limits from previous legacy implementation with the one provided by C++11.
Added a few extra constants for numeric limits.
2016-03-22 02:05:50 +02:00
Sandu Liviu Catalin
8088ba94c2 Updated the exception system in the main plugin to also include the location in the source files in debug builds.
Moved the functions that extract base types from strings as static functions under the associated type.
Revised some of the base shared code.
Fixed some of the functions in the String library that did not take into account the null terminator.
2016-03-21 22:37:58 +02:00
Sandu Liviu Catalin
6f417d60bb Reviewd the host plugin exports to prevent exceptions going outside the exported functions and minor improvements on value casting. 2016-03-18 12:56:48 +02:00
Sandu Liviu Catalin
afc72a0162 Fixed a bug in the command system that did not take into account the null terminator when finding the command separator.
Added the option to retrieve the listener instance of the currently executed command.
Moved several helper functions to where they belong.
2016-03-17 22:06:14 +02:00
Sandu Liviu Catalin
ad6aef3637 Remove leftover printf from previous commit. 2016-03-17 09:49:27 +02:00
Sandu Liviu Catalin
bbb4c12f9c Fixed a bug in routines that prevented more than one routine to exist in a bucket.
Also added several helper functions to query information about routines.
2016-03-17 09:25:17 +02:00
Sandu Liviu Catalin
839c3c3434 Allow the retrieval of the currently executed command from the command system.
Also improve the way errors during the execution are handled and resources are released.
2016-03-16 19:11:42 +02:00
Sandu Liviu Catalin
98b2ddfda6 Fix bug in command system when identifiying where the command name ends.
Also add a quick helper function to retrieve the number of existing commands.
2016-03-15 14:12:14 +02:00
Sandu Liviu Catalin
acaf826498 Revised the implementation for the command system to be safer in situations that could lead to the destruction of the listener instance while still used.
Also changed the command system to store the commands in a contiguous container since commands are only inserted once and constantly accessed after.
Documented the command listener member functions.
Various other fixes and improvements.
2016-03-15 10:56:00 +02:00
Sandu Liviu Catalin
bab8146c89 Fixed a range error in the SQLite plugin when validating column indexes.
Added an extra flush overload to flush all elements in a handled manner.
Prefixed the Server table to not clutter the user space.
2016-03-13 13:39:17 +02:00
Sandu Liviu Catalin
a00e8c964f Fixed names of hash functions that were overwriting the hash types. 2016-03-12 22:58:03 +02:00
Sandu Liviu Catalin
5c81af5026 Minor changes in the entity types code style. 2016-03-12 22:51:44 +02:00
Sandu Liviu Catalin
a5b353b104 Adjusted routine messages to exclude unnecessary details except for places where the script error handler will catch the error location. 2016-03-12 22:51:05 +02:00
Sandu Liviu Catalin
d2f3da1747 Catch exceptions during server callbacks.
Allow routines to safely terminate routines during execution.
Various other fixes and improvements.
2016-03-12 08:47:50 +02:00
Sandu Liviu Catalin
386c1d5254 Revert hash functions to their previous names. 2016-03-11 21:38:06 +02:00
Sandu Liviu Catalin
3fa7b17bd7 Fixed the SysPath type returning wrong result in test emptiness.
Added the option to build the path as a string using a speciffic style.
2016-03-11 20:52:00 +02:00