summaryrefslogtreecommitdiffstats
path: root/modules/enet/networked_multiplayer_enet.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #48235 from Faless/feature/network-local-port-enet-salvagedRémi Verschelde2021-04-281-32/+29
|\ | | | | [Net] Implement NetworkedMultiplayerENet.get_local_port
| * Implement NetworkedMultiplayerENet.get_local_portFabio Alessandrelli2021-04-281-32/+29
| | | | | | | | Allows retrieving the local port to which the peer is bound.
* | Core: Drop custom `copymem`/`zeromem` definesRémi Verschelde2021-04-271-3/+3
|/ | | | | | | | We've been using standard C library functions `memcpy`/`memset` for these since 2016 with 67f65f66391327b2967a20a89c3627e1dd6e84eb. There was still the possibility for third-party platform ports to override the definitions with a custom header, but this doesn't seem useful anymore.
* Fixes small typos and grammar correctionAnshul7sp12021-03-121-1/+1
|
* Add set_peer_timeout to NetworkedMultiplayerENet.Fabian2021-02-271-0/+9
|
* Initialize class/struct variables with default values in modules/Rafał Mikrut2021-02-081-16/+0
|
* 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 🎆
* Fix crash in ENet changing refuse_new_connectionsFabio Alessandrelli2020-07-291-1/+5
| | | | When the host is not started.
* Funnel refuse_new_connections to Godot ENet.Fabio Alessandrelli2020-07-141-0/+3
|
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-13/+25
| | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* Style: Enforce separation line between function definitionsRémi Verschelde2020-05-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-60/+0
| | | | | | | | | | | | | | Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
* Replace NULL with nullptrlupoDharkael2020-04-021-14/+14
|
* NetworkedMultiplayerENet dtls support.Fabio Alessandrelli2020-02-171-0/+50
|
* Improve error explanations related to NetworkedMultiplayerENetHugo Locurcio2020-02-021-43/+43
|
* Merge pull request #34789 from Faless/enet/disconnect_relayRémi Verschelde2020-01-161-10/+10
|\ | | | | ENet optional server_relay when disconnecting peer
| * ENet optional server_relay when disconnecting peerFabio Alessandrelli2020-01-031-10/+10
| | | | | | | | | | Was not correctly enforced before, always notifying other peers of the disconnection.
* | Fix ENet max clients highest value.Fabio Alessandrelli2020-01-031-1/+1
|/ | | | | Was 4096, while actually it's 4095. Fixed now in both docs and `create_server` check.
* 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.
* Add ENet option to disable server relaying.Fabio Alessandrelli2019-11-271-23/+47
| | | | | It's useless when building fully authoritative servers, and prevents various kinds of abuse.
* Fix memory leak in NetworkedMultiplayerENet.Fabio Alessandrelli2019-11-261-1/+10
| | | | | Dynamically allocated ids of peers where not correctly freed when calling close_connection and disconnect_peer (with now=true).
* Added some obvious errors explanationsqarmin2019-09-251-1/+1
|
* Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in rest of 'modules/'Robin Hübner2019-08-121-9/+2
|
* Add default values to the editor help, docs, and generated RSTBojidar Marinov2019-06-271-1/+3
| | | | | Also, make spacing of "=" in the editor help a bit more consistent. Closes #16086
* Fix ENet incorrectly binding to wildcard.Fabio Alessandrelli2019-06-151-0/+1
| | | | | Values were not properly initialized, and wildcard would evaluate to true in most cases.
* Fix error macro calls not ending with semicolonRémi Verschelde2019-06-111-2/+2
| | | | | | | It's not necessary, but the vast majority of calls of error macros do have an ending semicolon, so it's best to be consistent. Most WARN_DEPRECATED calls did *not* have a semicolon, but there's no reason for them to be treated differently.
* Fix typos with codespellRémi Verschelde2019-05-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using codespell 1.15.0. Method: ``` $ cat > ../godot-word-whitelist.txt << EOF ang curvelinear doubleclick 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 ```
* Merge pull request #25004 from Faless/enet/proto_optimizeHein-Pieter van Braam2019-04-231-9/+7
|\ | | | | Save 4 bytes in ENet multiplayer protocol.
| * Save 4 bytes in ENet multiplayer protocol.Fabio Alessandrelli2019-01-151-9/+7
| | | | | | | | | | | | Avoid sending encoded packet flags (reliable/unreliable/ordered) as that's already been done by ENet itself and we can read them from the incoming packet.
* | Style: Apply new changes from clang-format 8.0Rémi Verschelde2019-04-091-2/+5
| | | | | | | | | | | | It seems to stay compatible with formatting done by clang-format 6.0 and 7.0, so contributors can keep using those versions for now (they will not undo those changes).
* | Fix all -Wtype-limits warnings.marxin2019-02-211-1/+0
| |
* | Add check to validate client IDs in ENet.Fabio Alessandrelli2019-02-201-0/+7
|/ | | | | Server now checks that the ID received from the client is not already used by someone else and is a valid ID (>=2)
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* ENet: Remove redundant if conditionRémi Verschelde2018-09-261-1/+1
| | | | Closes #22445.
* Set ENet service time to 0.Fabio Alessandrelli2018-09-251-2/+2
| | | | Process all packets in queue, but never wait.
* Merge pull request #21982 from luzpaz/misc-typosRémi Verschelde2018-09-131-6/+6
|\ | | | | Misc. typos
| * Misc. typosluz.paz2018-09-121-6/+6
| | | | | | Found via `codespell -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"`
* | Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-3/+3
|/ | | | | | 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.
* Reduce unnecessary COW on Vector by make writing explicitHein-Pieter van Braam2018-07-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | 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.
* Expose channels in NetworkedMultiplayerENetFabio Alessandrelli2018-05-121-6/+79
|
* Document websocket module, further document enetFabio Alessandrelli2018-05-081-2/+2
|
* Enet: Add wait time param to close_connection()mhilbrunner2018-05-071-21/+61
| | | | | | | | Enet: Allow to set client interface/address and port Enet: More error checks Fix comment
* Add DNS resolution in NetworkedMultiplayerEnet::create_client()mhilbrunner2018-04-131-7/+21
|
* Implement get_peer_[address|port] in ENet/WSServerFabio Alessandrelli2018-04-121-1/+31
| | | | | | | Also implement get_connected_host and get_connected_port in WebSocketPeer (not supported in HTML5 due to browser limitation). Add shorthand disconnect_peer(id) for get_peer(id)->close() like in ENet to WebSocketServer.
* NetworkedMultiplayerEnet: Add disconnecting/kicking peersmhilbrunner2018-04-101-46/+70
|
* Bind many more properties to scriptsBojidar Marinov2018-01-121-0/+6
| | | | | | | Notable potentially breaking changes: - PROPERTY_USAGE_NOEDITOR is now PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_NETWORK, without PROPERTY_USAGE_INTERNAL - Some properties were renamed, and sometimes even shadowed by new ones - New getter methods (some virtual) were added
* Add missing copyright headers and fix formattingRémi Verschelde2018-01-051-0/+1
| | | | | | Using `misc/scripts/fix_headers.py` on all Godot files. Some missing header guards were added, and the header inclusion order was fixed in the Bullet module.
* Update copyright statements to 2018Rémi Verschelde2018-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Remove "const" from PacketPeer get_packet/get_varFabio Alessandrelli2017-12-151-2/+2
| | | | | | They are NOT constant methods, as state by the comment message, they fetch the last packet and then forget about it, actively changing the state of the object.
* Made Vector::ptrw explicit for writing, compiler was sometimes using the ↵Juan Linietsky2017-11-251-1/+1
| | | | | | wrong function, leading to unnecesary copy on writes and reduced performance.