summaryrefslogtreecommitdiff
path: root/modules/mono/csharp_script.cpp
AgeCommit message (Collapse)Author
2019-02-03Mono: Lifetime fixes for CSharpInstance and instance binding dataIgnacio Etcheverry
Avoid CSharpInstance from accessing its state after self destructing (by deleting the Reference owner). It's now safe to replace the script instance without leaking or crashing. Also fixed godot_icall_Object_weakref return reference being freed before returning.
2019-02-03Mono: CleanupIgnacio Etcheverry
2019-01-22Mono: Fix hot reload build errors and cleanupIgnacio Etcheverry
2019-01-21Mono: Add assembly reloading to running gamesIgnacio Etcheverry
Add environment variable to specify a custom --debugger-agent for mono.
2019-01-17C#: Fix crash due to missing gchandle ref null checkIgnacio Etcheverry
2019-01-10Merge pull request #24877 from neikeq/issue-24280Rémi Verschelde
Fix properties being lost when reloading placeholder GDScript instance
2019-01-10Fix properties being lost when reloading placeholder GDScript instanceIgnacio Etcheverry
During reloading in `GDScriptLanguage::reload_all_scripts` a placeholder instance that must remain so is replaced with a new placeholder instance. The state is then restored by calling `ScriptInstance::set` for each property. This does not work if the script is missing the properties due to build/parse failing. The fix for such cases is to call `placeholder_set_fallback` instead of `set` on the script instance. I took this chance to move the `build_failed` flag from `PlaceHolderScriptInstance` to `Script`. That improves the code a lot. I also renamed it to `placeholder_fallback_enabled` which is a much better name (`build_failed` could lead to misunderstandings).
2019-01-01Update copyright statements to 2019Rémi Verschelde
Happy new year to the wonderful Godot community!
2018-12-08Tweaks after feedbackBen Rog-Wilhelm
2018-12-07Implement CSharpScript::get_script_method_list and related functionality.Ben Rog-Wilhelm
2018-12-01Fix crash due to ~CSharpInstance() being called on freed instanceIgnacio Etcheverry
This would be the case when calling SetScript on an object with a C# script.
2018-11-30Implement CSharpScript::is_valid()Ignacio Etcheverry
2018-11-30Merge pull request #24091 from neikeq/iiIgnacio Etcheverry
C#: Improve tool script support and fix reloading issues
2018-11-30C#: Improve tool script support and fix reloading issuesIgnacio Etcheverry
2018-11-27Allow signal connecting even if script is invalid (only when compiled with ↵Juan Linietsky
tools), fixes #17070
2018-11-08Improve the C# API projects generationIgnacio Etcheverry
- Now there is only one solution that contains both GodotSharp and GodotSharpEditor project. Previously we had one solution for each project - GodotSharpEditor reference GodotShatp with a 'ProjectReference'. Previously it was a 'Reference' to the assembly - This also simplifies the command line option to generate this solution: 'godot --generate-cs-api <OutputDir>'
2018-10-25Merge pull request #23162 from neikeq/ccIgnacio Etcheverry
Proper support for namespaces and other enhancement/fixes
2018-10-25Parse C# script namespace and classIgnacio Etcheverry
- Added a very simple parser that can extract the namespace and class name of a C# script.
2018-10-25C#: Fix crash when disposing Reference on domain finalizeIgnacio Etcheverry
2018-10-06Remove redundant "== false" codeAaron Franke
Some of this code has been re-organized. f
2018-10-06Remove redundant "== true" codeAaron Franke
If it can be compared to a boolean, it can be evaluated as one in-place.
2018-09-27Mono: Fix not creating generic Array or Dictionary where expectedIgnacio Etcheverry
2018-09-15Clearly deprecate sync too in favor of remotesync.Fabio Alessandrelli
NOTE: This changes the RPC_MODE_* enum values. Games should be re-exported. GDNative rebuilt.
2018-09-15Rename slave keyword to puppetFabio Alessandrelli
The slave keyword will still be available as deprecated in 3.1 but will be dropped from future releases.
2018-09-12Mono: Fix build regression due to wrong return typeIgnacio Etcheverry
2018-09-12C#: Fix explicit enum values when exporting memberIgnacio Etcheverry
2018-09-12Make core/ includes absolute, remove subfolders from include pathRémi Verschelde
This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.
2018-09-12Fix/workaround for issue #21667Ignacio Etcheverry
When a Reference managed instance is garbage collected and its finalizer is called, it could happen that the native instance is referenced once again before the finalizer can unreference and memdelete it. The workaround is to create a new managed instance when this happens (at least for now).
2018-09-12Cleanup of c# api files and bindings generatorIgnacio Etcheverry
- We no longer generate RID and NodePath C# classes. Both will be maintained manually. - We no longer generate C# declarations and runtime registration of internal calls for the following classes: RID, NodePath, String, GD, SignalAwaiter and Godot.Object (partial base). - We no longer auto-generate the base members of Godot.Object. They will be maintained manually as a partial class. This makes it easier to maintain these C# classes and their internal calls, as well as the bindings generator which no longer generates C# classes that don't derive from Godot Object, and it no longer generates the Godot.Object base members (which where unreadable in the bindings generator code). - Added missing 'RID(Object from)' constructor to the RID C# class. - Replaced MONO_GLUE_DISABLED constant macro with MONO_GLUE_ENABLED. - Add sources in module/mono/glue even if glue is disabled, but surround glue files with ifdef MONO_GLUE_ENABLED.
2018-08-25Merge pull request #16927 from neikeq/rework-refcount-notifyJuan Linietsky
Notify instance binding data api of refcount increment/decrement
2018-08-24Add print_verbose to print to stdout only in verbose modeRémi Verschelde
Equivalent of the cumbersome: if (OS::get_singleton()->is_stdout_verbose()) print_line(msg);
2018-08-23Notify instance binding data api of refcount increment/decrementIgnacio Etcheverry
2018-07-29Fix case where exported properties value is lostIgnacio Etcheverry
Fixes exported property modified values lost when creating a placeholder script instance with a failed script compilation - Object set/get will call PlaceHolderScriptInstance's new fallback set/get methods as a last resort. This way, placeholder script instances can keep the values for storage or until the script is compiled successfuly. - Script::can_instance() will only return true if a real script instance can be created. Otherwise, in the case of placeholder script instances, it will return false. - Object::set_script(script) is now in charge of requesting the creation of placeholder script instances. It's no longer Script::instance_create(owner)'s duty. - PlaceHolderScriptInstance has a new method set_build_failed(bool) to determine whether it should call into its script methods or not. - Fixed a few problems during reloading of C# scripts.
2018-07-26Reduce unnecessary COW on Vector by make writing explicitHein-Pieter van Braam
This commit makes operator[] on Vector const and adds a write proxy to it. From now on writes to Vectors need to happen through the .write proxy. So for instance: Vector<int> vec; vec.push_back(10); std::cout << vec[0] << std::endl; vec.write[0] = 20; Failing to use the .write proxy will cause a compilation error. In addition COWable datatypes can now embed a CowData pointer to their data. This means that String, CharString, and VMap no longer use or derive from Vector. _ALWAYS_INLINE_ and _FORCE_INLINE_ are now equivalent for debug and non-debug builds. This is a lot faster for Vector in the editor and while running tests. The reason why this difference used to exist is because force-inlined methods used to give a bad debugging experience. After extensive testing with modern compilers this is no longer the case.
2018-07-25Fix continuous attempt to reload domain with API assemblies out of syncIgnacio Etcheverry
2018-07-25Mono: Fix domain reload never triggeringIgnacio Etcheverry
2018-07-25Fix '!valid' error spam on C# script instance createIgnacio Etcheverry
2018-07-25Mono: Fix null dereferencesIgnacio Etcheverry
2018-07-23Merge pull request #15880 from neikeq/better-collectionsIgnacio Etcheverry
Mono: Add Dictionary and Array classes
2018-07-22Mono: Default to not shipping C# scripts contentRémi Verschelde
Fixes #20053.
2018-07-20Add Array and Dictionary wrapper classes to C#Ignacio Etcheverry
2018-07-04Merge pull request #19872 from exts/export_signalsIgnacio Etcheverry
Mono: Fixes annotated signal loading in exported binaries
2018-07-03Mono: Fixes annotated signal loading in exported binaries=
2018-07-04Merge pull request #16987 from neikeq/pending-exceptionsIgnacio Etcheverry
Mono: Pending exceptions and cleanup
2018-07-04Mono: Pending exceptions and cleanupIgnacio Etcheverry
2018-07-04Changes to default C# script template (#19940)Kelly Thomas
2018-06-11Small changes to the comments in the script templates.Michael Alexsander Silva Dias
2018-06-05Merge pull request #18792 from PJB3005/18-05-11-objectdb-verbose-monoRémi Verschelde
Fixes ObjectDB leak printout with mono.
2018-05-29New sync keywords in GDScript, NativeScript, MonoFabio Alessandrelli
2018-05-29Refactor RPCMode enum and checksFabio Alessandrelli