Commit Graph

413 Commits

Author SHA1 Message Date
f7d852b532 Merge pull request #54350 from akien-mga/clang-format-dont-align-operands 2021-10-28 17:10:52 +02:00
6b090e325a Merge pull request #53526 from KoBeWi/super_print 2021-10-28 15:47:52 +02:00
3a6be64c12 clang-format: Various fixes to comments alignment from clang-format 13
All reviewed manually and occasionally rewritten to avoid bad auto formatting.
2021-10-28 15:43:36 +02:00
b0725a3b7d GDScript: Avoid crash if missing setter signature 2021-10-15 15:53:24 -03:00
f930d54140 Merge pull request #53103 from ZuBsPaCe/gdscript-analyze-properties-fix
GDScript: Report property type errors
2021-10-11 11:01:39 -03:00
41e271af6e Remove redundant String operation from GDScript enum exports 2021-10-11 02:11:32 +03:00
551ceb590b GDScript: Report property type errors
Inline getters & setters are now FunctionNodes.
Their names are set in the parser, not in the compiler.
GDScript-Analyzer will now run through getter and setter.
Also report wrong type or signature errors regarding getset properties.
Added GDScript tests for getters and setters.
#53102
2021-10-08 22:06:15 +02:00
54ec66a700 [Net] Rename RPCConfig.sync to call_local.
For consistency with the other user facing changes.
2021-10-08 12:39:09 +02:00
31012fd060 Change print_line() to use any number of Variants 2021-10-07 16:28:22 +02:00
44b68f08b4 Fix outdated no_call_local, use call_remote 2021-10-06 23:51:57 +02:00
dc046e5cbe GDScript Check for null list in for loop 2021-10-02 13:53:56 -04:00
24a949ea11 [Net] Rename RPC constants and annotation arguments.
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
2021-10-01 18:14:38 +02:00
c63b18507d Use range iterators for Map 2021-09-30 15:09:12 -06:00
679f70c1e1 Merge pull request #52906 from vnen/gdscript-show-error-on-yield 2021-09-21 20:36:39 +02:00
b3b4860d2e Merge pull request #52905 from vnen/gdscript-single-line-declaration 2021-09-21 20:35:36 +02:00
262d6c6bef GDScript: Show specific error when "yield" is used
To help people porting code, it gives a hint to use "await" instead of a
generic error.
2021-09-21 14:38:14 -03:00
e5ebc9710d GDScript: Allow classes declaration to be done in single line
Incidentally, allow multiple statements in single line functions when
using semicolon as a terminator.
2021-09-21 14:14:46 -03:00
bab0afc821 GDScript: Allow multiple lines in signal parameters declaration 2021-09-21 13:40:39 -03:00
651319de11 GDScript: Properly catch error when missing index in subscript 2021-09-17 14:31:51 -03:00
b8fdeb6467 Merge pull request #51671 from RandomShaper/fix_gdscript_crash
Fix some GDScript bugs
2021-09-17 12:29:40 -03:00
a4187c9235 Merge pull request #52706 from vnen/gdscript-ternary-operator-crash
GDScript: Show error when missing expression after ternary else
2021-09-15 17:20:52 +02:00
107af38fd1 GDScript: Show error when missing expression after ternary else 2021-09-15 11:43:36 -03:00
d49046938a GDScript: Show error on unary operators without argument 2021-09-15 11:08:59 -03:00
5d31ce4b16 GDScript: Allow string keys on Lua-style dictionaries
Which is useful when the key isn't a valid identifier, such as keys with
spaces or numeric keys.
2021-09-15 09:56:24 -03:00
4059cf2f02 Merge pull request #52068 from ThreeRhinosInAnElephantCostume/fixgdscript
Fix parse error on statement-less files with only newlines, add a warning for empty files.
2021-09-13 17:30:31 +02:00
e99730340b Fix error on parsing statement-less GDScript files,
add an empty file warning,
add relevant tests.
2021-09-11 20:38:15 +02:00
d72f12a561 Implement iterator variable typing in GDScript 2021-09-11 11:35:25 +02:00
1d1aa7a02f GDScript: Removed spurious UNASSIGNED_VARIABLE warning for locals
Variable->assignment needs to be incremented when assigned a value.
Also fixed and improved unit test 'variable_declaration.gd'.
Fixes #52551
2021-09-10 22:26:50 +02:00
6423e891a6 Merge pull request #52063 from KoBeWi/double_comma_of_doom
Fix crash with consecutive commas in Dictionary
2021-09-10 11:24:51 -03:00
c7452a9940 Fix crash with consecutive commas in Dictionary 2021-09-10 15:38:24 +02:00
11e457e594 Merge pull request #51593 from KoBeWi/if
Prevent crash when awaiting in a getter/setter
2021-09-10 10:36:25 -03:00
1234c2bdd9 Merge pull request #52081 from ThreeRhinosInAnElephantCostume/fixmatchfreeze
Fix gdscript pattern matching expressions
2021-09-10 09:28:18 -03:00
bf9aae09ba [Net] Move multiplayer to core subdir, split RPCManager.
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".
2021-09-07 11:14:30 +02:00
15ccd83ada Added tests for expression matching 2021-09-03 06:59:13 +02:00
fafddbc143 [GDScript] [Net] Allow mixing rpc annotation paramters.
The strings no longer needs to be in order.
The last parameter (channel), still requires all the other parameters to
be present.
2021-08-30 00:54:38 +02:00
64b9f30b92 [Net] Rename RPC "puppet" to "auth" (authority). Drop "master".
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.
2021-08-30 00:54:38 +02:00
e77338978f Print error message when await is not followed by signal or coroutine
When await was not followed by a signal or coroutine the GDScript parser would
crash.

This fix will check if await is followed by a signal or coroutine in case that
isn't true (element == nullptr) then an error message is printed.
2021-08-28 17:29:35 +02:00
79578a5625 Fixed crash when parsing an empty assignment.
Resolves #51620.
2021-08-25 18:48:08 +02:00
6c258a89de Fixed pattern matching with expressions 2021-08-25 15:30:41 +02:00
583b6a594a Merge pull request #51971 from aaronfranke/https
Replace HTTP URLs with HTTPS for sites with HTTPS versions
2021-08-23 15:58:54 +02:00
ae1702bee5 Replace HTTP links with HTTPS for sites with HTTPS versions 2021-08-22 20:13:11 -05:00
c86db8b710 Remove redundant assignments.
Use used_in_transfer instead of used_in_compute twice.
2021-08-21 19:20:07 +05:45
5161c97c9c Remove underscore hacks
Way less cruft. :)

Co-authored-by: Ignacio Roldán Etcheverry <neikeq@users.noreply.github.com>
2021-08-17 16:10:28 +02:00
bcfc591f86 Reorganise text editor settings 2021-08-16 17:18:49 +01:00
8a605d227d Prevent crash when awaiting in a getter/setter 2021-08-13 00:19:55 +02:00
e0572f7ef7 Fix crash when parsing Dictionary 2021-08-10 15:57:56 +02:00
d7dca072aa [Net] Default @rpc annotation should be puppet, not master. 2021-08-06 02:39:22 +02:00
ac3322b0af Use const references where possible for List range iterators 2021-07-25 12:22:25 +02:00
4e6efd1b07 Use C++ iterators for Lists in many situations 2021-07-23 17:38:28 -04:00
4bd5e4fd9b Use the standard C INFINITY and NAN constants directly
The `Math_INF` and `Math_NAN` defines were just aliases for those
constants, so we might as well use them directly.

Some portions of the code were already using `INFINITY` directly.
2021-07-21 10:41:08 +02:00