Commit graph

43 commits

Author SHA1 Message Date
marauder2k7 b0f8a5f9bd tscript change
Adds the ability to declare defaults for function arguments

eg
function testFunc(%x = 1, %y = 1)
{
    return %x + %y;
}

can now be called as
testFunc(10) and it will return the value of 11.
2025-11-15 17:38:13 +00:00
marauder2k7 ee0cf872a0 moar leak plug attempts 2025-05-12 11:50:29 +01:00
marauder2k7 bab75a3a46 clang-tidy complained about std::moves 2025-05-12 11:50:26 +01:00
marauder2k7 e2c4f88faf plugging moar leaks
Namespace Leaks: these leaks would have been freed on app kill but they were still contaminating the log so free em.
Con::shutdown: gGlobablVars again another leak that would of been freed on app kill
AssetManager onRemove should be clearing its lists
Scripting language needs a free for its strings these destructors free after the rule is executed so the data is cached internally and then freed. This may be needed for other types in the union (should not be used on nodes just raw data)
2025-05-12 11:50:20 +01:00
AzaezelX 1ea74bf8c6 enhanced argc reporting
in a method argc out of bounds scenario, report how many it got, and what range it expected
2024-05-01 18:20:14 -05:00
Triston a2cdbebfa1 removes a use after freed in consoleInternal 2024-03-24 18:36:42 -05:00
AzaezelX b366ff9b1c script stabilization tweaks
Con::EvalResult CodeBlock::exec -
 objectCreationStackIndex needs to be signed as we test if it goes sub-zero
ConsoleValue Namespace::Entry::execute -
compiler yells about returning a temp via std::move
bool TorqueScriptRuntime::executeFile -
report the name of the dso output file, not the source scxript input file
2024-01-02 18:15:21 -06:00
Lukas Aldershaab 83ea6cd0df Improvements based on experience from implementing Python runtime 2023-09-13 10:33:28 +02:00
Lukas Aldershaab 89b0c7f73b Console Refactor 2023-09-13 10:33:20 +02:00
AzaezelX b86716c670 further console cleanups. mostly of the form of correcting uninitialized values. some arithmatic sizes
(cherry picked from commit 833149e962d165aa4c10e6c760bb1a1116d1baf8)
2023-05-01 10:41:33 -05:00
AzaezelX a8e74787b7 new method, getMethodSigs. spits out callback proto-functions 2023-02-15 17:38:45 -06:00
Jeff Hutchinson 1940becb2d Compilation fixes for C++20 2022-11-28 21:39:06 -05:00
Jeff Hutchinson 59312d7d52 debugger support 2021-08-19 22:05:43 -04:00
Jeff Hutchinson acde0c3f0b Merge branch 'Preview4_0_DevHead' into tsneo
# Conflicts:
#	Engine/source/console/consoleInternal.cpp
2021-06-18 21:13:49 -04:00
bank 5d1c29f54b
Fix return value conversion when using SimObject::call() method from scripts. 2021-06-15 19:03:43 +03:00
Jeff Hutchinson a2dea07d8b fixed internal types. 2021-04-12 21:42:18 -04:00
Jeff Hutchinson 93500b6ac4 more changes. 2021-04-12 21:26:26 -04:00
Jeff Hutchinson 3e04196a53 make tests pass. 2021-04-03 01:53:40 -04:00
Jeff Hutchinson f776e73b04 cleanup 2021-04-02 00:57:49 -04:00
Jeff Hutchinson 02447f0996 compile fixes. 2021-03-31 22:12:58 -04:00
Jeff Hutchinson 50df52ecfc more console refactor. 2021-03-31 21:09:23 -04:00
Jeff Hutchinson 35500a87c6 initial port of the new interpreter 2021-03-30 19:33:19 -04:00
Lukas Aldershaab c999baf7ed Moves from using dStrCmp to the new String::compare static functions. Keeps things cleaner, consistent, and works with intellisense. 2020-10-03 14:37:55 +02:00
AzaezelX 2c1508c169 uninitialized variables-console 2020-05-11 14:40:31 -05:00
Glenn Smith 79c34c68db Use strncpy instead of strcpy because again, buffer overflows 2018-03-06 02:35:33 -05:00
Glenn Smith 7769da9434 Use strncat instead of strcat to prevent some buffer overflows 2018-03-06 00:48:44 -05:00
Lukas Joergensen ae6b035f10 Improve console dump with additional information, such as array sizes and variadic function 2017-12-08 20:50:44 +01:00
Areloch d666322a1b Merging 2017-11-05 22:33:32 -06:00
Thomas "elfprince13" Dickerson 45ae5e71cb fixed lots of tabs and space 2017-01-06 18:04:28 -05:00
Azaezel 1ee127b753 more unused variable cleanups 2016-10-16 14:41:34 -05:00
James Urquhart e5c28b4d7f Simplify buffer check when adding a registered variable 2015-05-16 14:57:40 +01:00
James Urquhart 15169eab9f Fix issue with registered variables becoming corrupted when string value was accessed. 2015-05-16 14:50:20 +01:00
James Urquhart 942c7a48f4 Fix corruption issue with string iterator was using an absolute pointer. Also adds a special relative pointer type for constructed strings on the stack. 2015-02-16 21:23:42 +00:00
James Urquhart f44a3f27d6 Fix stack balancing problems by refactoring execution calls
- Con::executef now uses a template
- All public execution functions now restore the console stack upon return
- Fixed bad parameters on some callbacks
- Reverts get*Arg behavior
2015-02-08 00:08:18 +00:00
Luis Anton Rebollo 6492028bb2 Merge pull request #1035 from bpay/memfixes
Memfixes
2015-01-25 13:42:32 +01:00
Ben Payne 81e7dafb94 Fix delete of malloc'ed memory 2014-12-11 17:24:40 -05:00
James Urquhart bfca94da5c Initialize mResetLocked too 2014-12-10 11:37:50 +00:00
James Urquhart 82fd1794e6 Fix issue where console stack values were getting overwritten inside a C++ function 2014-12-10 00:42:06 +00:00
Daniel Buckmaster b507dc9555 Merge branch 'master' into console-func-refactor
Conflicts:
	Engine/source/app/net/net.cpp
	Engine/source/console/astNodes.cpp
	Engine/source/console/compiledEval.cpp
	Engine/source/console/console.h
	Engine/source/console/consoleInternal.h
	Engine/source/console/engineAPI.h
2014-10-14 15:09:11 +11:00
LuisAntonRebollo fcf7bee64a Fix x64 problems for WIN64. 2014-09-14 21:42:51 +02:00
jamesu 08d4f6ebc0 Improvements to console refactor code
- Prevent stack corruption in a few places
- Use correct type in printfs
- Reduce type conversions in EngineApi & dAto*
- Fix compilation on GCC
- Tidy up code
2012-10-12 19:12:06 +01:00
James Urquhart 38c8e52c1d Beginnings of the "pass everything using a native type wrapper" console code.
- ConsoleValue class is now the base value class.
- ConsoleValueRef is now used to supply function parameters. Values are disposable.
- Script functions return values instead of just strings where possible.
- Variables can be disposable strings
- Bytecode changed

Fix the issues with console method parameters and fields which prevented missions from loading.
2012-10-12 18:56:17 +01:00
DavidWyand-GG 7dbfe6994d Engine directory for ticket #1 2012-09-19 11:15:01 -04:00