summaryrefslogtreecommitdiffstats
path: root/modules/mono/csharp_script.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Net] Rename RPC constants and annotation arguments.Fabio Alessandrelli2021-10-011-2/+2
| | | | | | | | | any -> any_peer sync -> call_local ordered -> unreliable_ordered Multiplayer.RPC_MODE_ANY -> RPC_MODE_ANY_PEER Multiplayer.TRANSFER_MODE_ORDERED -> TRANSFER_MODE_UNRELIABLE_ORDERED
* Update C# RPC attributes to share new Any/Auth naming conventionEdward Auttonberry2021-09-281-2/+2
| | | | Update attribute class references in mono cache
* Merge pull request #51835 from magian1127/patch1Rémi Verschelde2021-09-171-4/+16
|\
| * check that the element type is indeed StringMagian2021-08-201-6/+13
| |
| * C# Array<String> Export Support Enum(String)Magian2021-08-181-2/+7
| |
* | Merge pull request #52633 from lewiji/mono-build-solution-shortcut-4.0Rémi Verschelde2021-09-141-0/+3
|\ \
| * | Add editor keyboard shortcut for Mono Build solution buttonLewis James2021-09-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Apply suggestions from code review Merging @akien-mga's suggestion with the matching change to the CS project Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
* | | Improve C# method listingPaul Joannon2021-09-121-4/+35
|/ / | | | | | | | | - implement CSharpInstance::get_method_list - loop through parent classes in CSharpInstance::get_method_list and CSharpScript::get_script_method_list (#46408)
* | Merge pull request #52246 from Paulb23/verbatim-stringMax Hilbrunner2021-09-081-1/+1
|\ \ | | | | | | Syntax highlight c# verbatim string literal
| * | syntax highlight c# verbatim string literalPaulb232021-08-301-1/+1
| | |
* | | [Net] Move multiplayer to core subdir, split RPCManager.Fabio Alessandrelli2021-09-071-11/+11
|/ / | | | | | | | | | | | | | | | | | | | | Move multiplayer classes to "core/multiplayer" subdir. Move the RPCConfig and enums (TransferMode, RPCMode) to a separate file (multiplayer.h), and bind them to the global namespace. Move the RPC handling code to its own class (RPCManager). Renames "get_rpc_sender_id" to "get_remote_sender_id".
* / [Net] Rename RPC "puppet" to "auth" (authority). Drop "master".Fabio Alessandrelli2021-08-301-5/+2
|/ | | | | | | | | | | | | | | | | | | | | | This commit completely removes the RPC_MODE_MASTER ("master" keyword), and renames the RPC_MODE_PUPPET to RPC_MODE_AUTHORITY ("auth" keyword). This commit also renames the "Node.[get|set]_network_master" methods to "Node.[get|set]_network_authority". This commit also renames the RPC_MODE_REMOTE constant to RPC_MODE_ANY. RPC_MODE_MASTER in Godot 3.x meant that a given RPC would be callable by any puppet peer on the master, while RPC_MODE_PUPPET meant that it would be callable by the master on any puppet. Beside proving to be very confusing to the user (referring to where it could be called instead of who can call it) the RPC_MODE_MASTER is quite useless. It is almost the same as RPC_MODE_REMOTE (anyone can call) with the exception that the network master cannot. While this could be useful to check in some case, in such a function you would anyway need to check in code who is the caller via get_rpc_sender_id(), so adding the check there for those rare cases does not warrants a dedicated mode.
* Merge pull request #51698 from Paulb23/text-editor-settingsRémi Verschelde2021-08-161-2/+2
|\ | | | | Reorganise text editor settings
| * Reorganise text editor settingsPaulb232021-08-161-2/+2
| |
* | Fix C# native instance bindings after recent re-writeIgnacio Roldán Etcheverry2021-08-161-90/+101
|/ | | | This was needed after: 44691448911f1d29d4d79dbdd5553734761e57c4
* Fix 'script_class' null access when reloading a deleted C# script312021-08-031-0/+7
|
* Use C++ iterators in the Mono moduleRaul Santos2021-07-271-57/+52
|
* Use Ref<T> references as iterators where relevantRémi Verschelde2021-07-261-5/+5
| | | | And const when possible.
* Use const references where possible for List range iteratorsRémi Verschelde2021-07-251-2/+2
|
* Use C++ iterators for Lists in many situationsAaron Franke2021-07-231-21/+10
|
* [Net] Single `rpc` annotation. "sync" no longer part of mode.Fabio Alessandrelli2021-07-201-9/+0
| | | | | | | | | | | | | | | | - Move the "sync" property for RPCs to RPCConfig. - Unify GDScript annotations into a single one: - `@rpc(master)` # default - `@rpc(puppet)` - `@rpc(any)` # former `@remote` - Implement three additional `@rpc` options: - The second parameter is the "sync" option (which also calls the function locally when RPCing). One of "sync", "nosync". - The third parameter is the transfer mode (reliable, unreliable, ordered). - The third parameter is the channel (unused for now).
* [Net] Rename NetworkedMultiplayerPeer to MultiplayerPeer.Fabio Alessandrelli2021-07-121-1/+1
|
* Redo how instance bindings workreduz2021-07-081-3/+11
| | | | | | | | * The harcoded 8 slots are no more and impose limits in the new extension system. * New system is limitless, although it will impose small performance hit with a mutex. * Use a token to request the instance binding. **Warning**: Mono will most likely break as a result of this, will need to be modified to use the new system.
* Rename `instance()`->`instantiate()` when it's a verbLightning_A2021-06-191-5/+5
|
* Consolidate JSON, JSONParseResults and JSONParser into JSONMarcel Admiraal2021-06-191-1/+0
| | | | | Renames JSON.parse_string() to parse() Renames JSON.decode_data() to stringify()
* Fix slow load/save of scenes with many instances of the same scriptPedro J. Estébanez2021-06-131-5/+9
|
* Improve & fix Mono buildPedro J. Estébanez2021-06-131-1/+1
| | | | | | - Fix C++ compile errors about pending variable renames after the `Reference` to `RefCount` change. - Fix C# compile errors due to the recent rename of `EnablePlugin()` and `Build()`, which are now underscore-prefixed in bindings. - Additional rename: `godot_icall_Reference_Dtor` to `godot_icall_RefCounted_Dtor`.
* Rename Reference to RefCountedPedro J. Estébanez2021-06-111-53/+53
|
* Core: Move DirAccess and FileAccess to `core/io`Rémi Verschelde2021-06-111-1/+1
| | | | | File handling APIs are typically considered part of I/O, and we did have most `FileAccess` implementations in `core/io` already.
* Merge pull request #49221 from Faless/mp/4.x_rpc_refactorRémi Verschelde2021-06-071-127/+8
|\ | | | | [Net] Refactor RPCs, remove RSETs
| * [Net] Refactor RPCs, remove RSETsFabio Alessandrelli2021-06-011-127/+8
| | | | | | | | | | | | | | | | | | | | In this PR: - Removed rset - rpc_config can now optionally configure transfer mode (reliable/unreliable/ordered) and channel (channels are not actually implemented yet.) - Refactor how the RPC id is computed to minimize the logic in Node and scripts that now only needs a single `get_rpc_methods` function.
* | Rename Quat to QuaternionMarcel Admiraal2021-06-041-1/+1
| |
* | Rename Variant TRANSFORM to TRANSFORM3DAaron Franke2021-06-031-1/+1
|/ | | Also _transform to _transform3d
* Fix typos with codespellRémi Verschelde2021-05-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using codespell 2.0.0. Method: ``` $ cat > ../godot-word-whitelist.txt << EOF ang curvelinear dof doubleclick fave findn GIRD leapyear lod merchantibility nd numer ois ony que seeked synching te uint unselect webp EOF $ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po" $ git diff // undo unwanted changes ```
* Highlight control flow keywords with a different colorHugo Locurcio2021-05-051-0/+20
| | | | This makes them easier to distinguish from other keywords.
* Remove uses of `auto` for better readability and online code reviewsHugo Locurcio2021-04-261-2/+2
| | | | | | | | The current code style guidelines forbid the use of `auto`. Some uses of `auto` are still present, such as in UWP code (which can't be currently tested) and macros (where removing `auto` isn't easy).
* C#: Fix disconnecting event signals twiceIgnacio Etcheverry2021-03-151-11/+9
| | | | | `disconnect_event_signals` can be called twice (when managed instance is disposed and from the ScriptInstance destructor).
* Fix create c# script after partial class typesboronczyk2021-03-131-1/+1
|
* Add C# source generator for a new ScriptPath attributeIgnacio Etcheverry2021-03-061-60/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This source generator adds a newly introduced attribute, `ScriptPath` to all classes that: - Are top-level classes (not inner/nested). - Have the `partial` modifier. - Inherit `Godot.Object`. - The class name matches the file name. A build error is thrown if the generator finds a class that meets these conditions but is not declared `partial`, unless the class is annotated with the `DisableGodotGenerators` attribute. We also generate an `AssemblyHasScripts` assembly attribute which Godot uses to get all the script classes in the assembly, eliminating the need for Godot to search them. We can also avoid searching in assemblies that don't have this attribute. This will be good for performance in the future once we support multiple assemblies with Godot script classes. This is an example of what the generated code looks like: ``` using Godot; namespace Foo { [ScriptPathAttribute("res://Player.cs")] // Multiple partial declarations are allowed [ScriptPathAttribute("res://Foo/Player.cs")] partial class Player {} } [assembly:AssemblyHasScripts(new System.Type[] { typeof(Foo.Player) })] ``` The new attributes replace script metadata which we were generating by determining the namespace of script classes with a very simple parser. This fixes several issues with the old approach related to parser errors and conditional compilation. It also makes the task part of the MSBuild project build, rather than a separate step executed by the Godot editor.
* Improve resource load cachereduz2021-02-111-1/+1
| | | | | | -Added a new method in Resource: reset_state , used for reloading the same resource from disk -Added a new cache mode "replace" in ResourceLoader, which reuses existing loaded sub-resources but resets their data from disk (or replaces them if they chaged type) -Because the correct sub-resource paths are always loaded now, this fixes bugs with subresource folding or subresource ordering when saving.
* C # mono supports Unicode codemagian11272021-01-191-2/+2
|
* CI: Update to clang-format 11 and apply ternary operator changesRémi Verschelde2021-01-121-2/+2
|
* Update copyright statements to 2021Rémi Verschelde2021-01-011-2/+2
| | | | | | | | | | | | | | Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
* Rename empty() to is_empty()Marcel Admiraal2020-12-281-8/+8
|
* Fixes #42149 and fixes indentation errors to pass clang-formatEyad2020-12-191-5/+10
|
* Refactor DocData into core and editor (DocTools) partsThakee Nathees2020-12-021-1/+1
|
* Variant: Rename Type::_RID to Type::RIDRémi Verschelde2020-11-091-1/+1
| | | | | | | | The underscore prefix was used to avoid the conflict between the `RID` class name and the matching enum value in `Variant::Type`. This can be fixed differently by prefixing uses of the `RID` class in `Variant` with the scope resolution operator, as done already for `AABB`.
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-071-1/+1
| | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* C#: Fix custom event signals crash on hot-reloadIgnacio Etcheverry2020-10-261-5/+10
| | | | | Cleanup and re-initialization of event signals before and after hot-reload should be working correctly now.
* Fix code duplication in CSharpScriptopl-2020-10-131-116/+74
| | | | | | | | Removes code duplication between `CSharpScript::reload()` and `CSharpScript::initialize_for_managed_type()`. Removes a redundant `CSharpScript::update_exports()` call in `CSharpLanguage::reload_assemblies()` as `CSharpScript::reload()` already calls it when appropriate. Fixes missing update of RPC information in `CSharpScript::initialize_for_managed_type()`.