summaryrefslogtreecommitdiffstats
path: root/core/io/multiplayer_api.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #36144 from akien-mga/remove-deprecated-allow-decodingRémi Verschelde2020-02-131-2/+2
|\ | | | | Remove deprecated PacketPeer allow_object_decoding
| * Remove deprecated PacketPeer allow_object_decodingRémi Verschelde2020-02-131-2/+2
| | | | | | | | | | | | | | | | It was added for 3.2 in #27485 to preserve backwards compatibility, but we can now remove it. It is still needed in MultiplayerAPI as it's the only way to control it for the internal put_var calls.
* | Remove deprecated sync and slave networking keywordsRémi Verschelde2020-02-131-2/+0
|/ | | | | | Those keywords were deprecated for 3.1 in #22087. Also fix token name for `TK_REMOTE`, should be "remote" like the keyword.
* ObjectID converted to a structure, fixes many bugs where used incorrectly as ↵Juan Linietsky2020-02-121-1/+0
| | | | 32 bits.
* Optmized data sent during RPC and RSet calls.Andrea Catania2020-02-121-93/+403
| | | | | | | | | | - Now is sent the method ID rather the full function name. - The passed IDs (Node and Method) are compressed so to use less possible space. - The variant (INT and BOOL) is now encoded and compressed so to use much less data. - Optimized RPCMode retrieval for GDScript functions. - Added checksum to assert the methods are the same across peers. This work has been kindly sponsored by IMVU.
* Remove duplicate ERR_PRINT macro.Marcel Admiraal2020-02-051-8/+8
|
* Fix MultiplayerAPI crash when peer impl misbehave.Fabio Alessandrelli2020-01-211-0/+1
| | | | | Also fix WebSocketMultiplayer::get_available_packet_count() return value when peer is not configured to use the multiplayer API.
* MultiplayerAPI: Fix disconnect errors when passing invalid peerRémi Verschelde2020-01-031-2/+3
| | | | Fixes #34634.
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* MultiplayerAPI cleanup cache when peer disconnectsFabio Alessandrelli2019-10-251-1/+10
| | | | | We used to only cleanup path_get_cache and not path_send_cache causing issues when a peer disconnects and then reconnects with the same ID.
* Added some obvious errors explanationsqarmin2019-09-251-2/+1
|
* Add network profilerjfons2019-09-051-0/+146
|
* Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in 'core/' and 'editor/'Braden Bodily2019-08-171-109/+53
| | | | | | | | | Condensed some if and ERR statements. Added dots to end of error messages Couldn't figure out EXPLAINC. These files gave me trouble: core/error_macros.h, core/io/file_access_buffered_fa.h (where is it?), core/os/memory.cpp, drivers/png/png_driver_common.cpp, drivers/xaudio2/audio_driver_xaudio2.cpp (where is it?)
* Add default values to the editor help, docs, and generated RSTBojidar Marinov2019-06-271-0/+1
| | | | | Also, make spacing of "=" in the editor help a bit more consistent. Closes #16086
* Better handle some self-RSET/RPC in MultiplayerAPIFabio Alessandrelli2019-05-121-6/+10
| | | | | Allow calling yourself via RPC/RSET if the mode allows it. Better error messages when you are not allowed to call yourself.
* Avoid _can_call_mode resetting error message in MultiplayerAPIFabio Alessandrelli2019-05-081-4/+6
|
* Sender network id is now set to local network id for local rpc calls.Daniel Eliasinski2019-04-161-0/+13
|
* Revert "Properly explain RPC/RSET mode failure."Rémi Verschelde2019-04-051-9/+7
| | | | | This reverts commit 95ad747deaa474b30c04b01f60634f2be9a5ea18. It introduced regressions, see #27655.
* Fix -Wimplicit-fallthrough warnings from GCC 8Rémi Verschelde2019-04-051-1/+2
| | | | | | | | | | | | Adds `FALLTHROUGH` macro to specify when a fallthrough is intentional. Can be replaced by `[[fallthrough]]` if/when we switch to C++17. The warning is now enabled by default for GCC on `extra` warnings level (part of GCC's `-Wextra`). It's not enabled in Clang's `-Wextra` yet, but we could enable it manually once we switch to C++11. There's no equivalent feature in MSVC for now. Fixes #26135.
* Properly explain RPC/RSET mode failure.Fabio Alessandrelli2019-04-031-7/+9
| | | | | | | | _can_call_mode used to call is_network_master/get_network_master internally. This would reset any potential last error set via ERR_EXPLAIN, preventing it from being displayed correctly. _can_call_mode now expects the node master ID to be passed instead.
* Add object encoding param to serialization methodsFabio Alessandrelli2019-04-011-7/+22
| | | | | | | | | Network peers get_var/put_var File get_var/store_var GDScript/Mono/VisualScript bytes2var/var2bytes Add MultiplayerAPI.allow_object_decoding member which deprecates PacketPeer.allow_object_decoding. Break ABI compatibaility (API compatibility for GDNative).
* Multiplayer API now respects allow_object_decodingFabio Alessandrelli2019-04-011-6/+6
| | | | Add doc about allow_object_decoding in PacketPeer
* Don't reset MultiplayerAPI when setting same peer.Fabio Alessandrelli2019-01-151-0/+2
| | | | | | | | | | | | | | A GDScript call to: `multiplayer.network_peer.some_prop = true` seems to transalte to: ``` var temp = multiplayer.network_peer temp.some_prop = true multiplayer.network_peer = temp ``` Which caused the MultiplayerAPI to be resetted. The call to set_network_peer is now ignored if the peer that's beeing set is the same as the currently set one.
* Fix MultiplayerAPI initialization, clear.Fabio Alessandrelli2019-01-151-0/+3
| | | | | | | | | rpc_sender_id is now correctly initialized to 0 so get_rpc_sender_id() work reliably even if called before receiving any RPC. root_node is initialized to NULL (fix crashes when incorrectly using the MultiplayerAPI). clear function now resets the packet cache size to free more memory when not running.
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Remove redundant "== false" codeAaron Franke2018-10-061-1/+1
| | | | | | Some of this code has been re-organized. f
* Remove redundant "== true" codeAaron Franke2018-10-061-1/+1
| | | If it can be compared to a boolean, it can be evaluated as one in-place.
* Better MultiplayerAPI error logs.Fabio Alessandrelli2018-09-251-54/+98
|
* Skip RPC/RSET when MASTERSYNC and we are master.Fabio Alessandrelli2018-09-251-5/+8
|
* doc: Sync classref with current sourceRémi Verschelde2018-09-151-2/+2
|
* Clearly deprecate sync too in favor of remotesync.Fabio Alessandrelli2018-09-151-7/+3
| | | | | NOTE: This changes the RPC_MODE_* enum values. Games should be re-exported. GDNative rebuilt.
* Rename slave keyword to puppetFabio Alessandrelli2018-09-151-5/+6
| | | | | The slave keyword will still be available as deprecated in 3.1 but will be dropped from future releases.
* Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-1/+2
| | | | | | 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.
* doc: Sync classref with current sourceRémi Verschelde2018-07-261-1/+1
| | | | Fix various missing arguments in bindings.
* Reduce unnecessary COW on Vector by make writing explicitHein-Pieter van Braam2018-07-261-18/+18
| | | | | | | | | | | | | | | | | | | | | | | 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.
* MultiplayerAPI::send_bytes transfer mode support.Fabio Alessandrelli2018-07-081-2/+5
| | | | | Added as extra parameter, allow you to specify which transfer mode to use for those specific bytes
* New sync RPC modes to match all combinationsFabio Alessandrelli2018-05-291-0/+9
|
* Refactor RPCMode enum and checksFabio Alessandrelli2018-05-291-64/+83
|
* Revert "RPCMode refactor, more sync modes"Max Hilbrunner2018-05-291-92/+64
|
* New sync RPC modes to match all combinationsFabio Alessandrelli2018-05-261-0/+9
|
* Refactor RPCMode enum and checksFabio Alessandrelli2018-05-261-64/+83
|
* Add missing copyright headersGuilherme Felipe2018-05-161-0/+30
|
* Allow sending raw bytes through MultiplayerAPIFabio Alessandrelli2018-05-121-1/+38
|
* Internal methods in MultiplayerAPI start with _Fabio Alessandrelli2018-05-081-20/+20
|
* Add new MultiplayerAPI classFabio Alessandrelli2018-03-031-0/+722
Handles all the high level networking stuff