Commit graph

176 commits

Author SHA1 Message Date
Rémi Verschelde 9a8a0e20e5 Merge pull request #10552 from RandomShaper/improve-posix
Improve Mac/UNIX conformance/reliability
2017-08-29 00:07:07 +02:00
Matthias Hoelzl b6e1e47e3a Make build scripts Python3 compatible
- The Windows, UWP, Android (on Windows) and Linux builds are
  tested with Scons 3.0 alpha using Python 3.
- OSX and iOS should hopefully work but are not tested since
  I don't have a Mac.
- Builds using SCons 2.5 and Python 2 should not be impacted.
2017-08-27 23:05:39 +02:00
Rémi Verschelde 7ad14e7a3e Dead code tells no tales 2017-08-27 22:13:45 +02:00
Rémi Verschelde bd282ff43f Use HTTPS URL for Godot's website in the headers 2017-08-27 14:16:55 +02:00
Pedro J. Estébanez d806ad4a3d Implement custom thread numbering for POSIX
For every UNIX-derived (Android, Linux, macOS, iOS) flavor, a global counter is atomically incremented on thread start. That id is kept as thread-local storage.

Therefore, thread ids are sequential numbers, trivially comparable. This improves the previous state of things, in which `pthread_t` were casted to `Thread::ID` and unportabily compared. Also big, ugly thread ids appeared.
2017-08-24 07:02:55 +02:00
Pedro J. Estébanez a560a62118 Make OS::delay_usec() more reliable on UNIX
Implemented with `nanosleep()`. `usleep()` is deprecated.
Also loops to ensure that __at least__ the requested time is waited, accounting for spurious interruptions.

May help in situations like reattempting to connect to the debugger.
2017-08-24 07:02:55 +02:00
Juan Linietsky 247c2f7be3 Revert "Reworked change_dir to support symlinks" 2017-08-21 18:06:01 -03:00
Rémi Verschelde 22d21ebef0 Merge pull request #8144 from supagu/symlink
Reworked change_dir to support symlinks
2017-08-17 11:50:21 +02:00
TwistedTwigleg 00f6c85928 Synchronize parameter names in definition and declaration
Fixes #10244.
2017-08-16 17:22:23 +02:00
Wilson E. Alvarez 21d281c4a9 Use const reference where favorable 2017-08-14 13:28:06 -04:00
Fabio Alessandrelli f863c0ca14 Explicitily unsed AI_NUMERICHOST flag to fix HTML5 2017-08-11 19:39:36 +02:00
Indah Sylvia 5ae78fdf6a Makes all Godot API's methods Lower Case 2017-08-07 18:24:35 +07:00
Karroffel 135c2112ad added an optional parameter to OS symbol lookup
When looking up a symbol from a library, previously an error was
shown when the symbol did not exist. That caused confusion when the
lookup was completely optional.
This adds a new parameter to that method so that those errors can
be handled manually if needed.
2017-07-27 11:13:21 +02:00
Juan Linietsky 25678b1876 -Renamed GlobalConfig to ProjectSettings, makes more sense.
-Added system for feature overrides, it's pretty cool :)
2017-07-19 17:06:03 -03:00
Juan Linietsky bbada82f80 -Reorganized all properties of project settings (Sorry, Again).
(Lot's of bloat accumulated, so it was time for clean up.)
-Made EditorSettings and ProjectSettings search more useful (search in sections too)
2017-07-17 22:18:58 -03:00
David Carlier df87ad14d0 get_executable_path slight change to make it work under OpenBSD 2017-07-16 10:53:51 +01:00
Poommetee Ketson e3998528e0 BuildSystem: generated files have .gen.extension 2017-06-25 07:55:01 +07:00
Fabio Alessandrelli a1c41be569 Fix local ip addresses (interfaces) detection.
Ignore non-IP addresses for both windows and unix
2017-05-08 22:27:06 +02:00
Fabio Alessandrelli 020f6a7f20 Socket helpers now fall back to ipv4 on systems where ipv6 is disabled. 2017-05-08 21:53:23 +02:00
Fabio Alessandrelli 5c6715a291 Fix UDP wait() not returning after first received packet 2017-05-05 17:41:11 +02:00
Sergey Pusnei 8589ca3903 Rename [gs]et_pos to [gs]et_position for Controls
Control set_pos -> set_position
Control set_global_pos -> set_global_position
[gs]et_mouse_pos -> [gs]et_mouse_position
[gs]et_global_mouse_pos -> [gs]et_global_mouse_position
fixes #8005
2017-04-10 08:27:34 +02:00
Rémi Verschelde df61dc4b2b Add "Godot Engine contributors" copyright line 2017-04-08 00:11:42 +02:00
Karroffel 741800f5cc [DLScript] fixed android builds now
... really.
2017-04-06 14:00:54 +02:00
Fabian Mathews d3b7d42784 Reworked change_dir to support symlinks 2017-04-06 20:43:34 +09:30
Karroffel fd55308786 added dlscript module
This module was written by bojidar-bg and me, with the help of ClikCode and touilleMan.

This adds a module to Godot that enables the use of dynamic libraries as a source for scripts.
That also allows third party libraries to be linked to Godot more easily and without creating modules.

For a readme see https://github.com/GodotNativeTools/godot_headers/blob/master/README.md
2017-04-03 17:20:11 +02:00
Karroffel 67f59bc2d9 increased maximum number of scripting languages 2017-04-03 16:10:26 +02:00
Karroffel 2281942fb3 Added methods for opening dynamic libraries to OS 2017-03-29 23:05:15 +02:00
Fabio Alessandrelli 5f681d0b0f Allow non blocking UDP put_packet in C++.
- Add blocking mode option to PacketPeerUDP.
- put_packet returns ERR_UNAVAILABLE when operation would block.
- ENet module uses non-blocking UDP.
2017-03-24 02:30:11 +01:00
Rémi Verschelde 15c4d5006e Fix build issue with MSVC
windows.h is a mess.
2017-03-06 09:11:03 +01:00
Rémi Verschelde 5dbf1809c6 A Whole New World (clang-format edition)
I can show you the code
Pretty, with proper whitespace
Tell me, coder, now when did
You last write readable code?

I can open your eyes
Make you see your bad indent
Force you to respect the style
The core devs agreed upon

A whole new world
A new fantastic code format
A de facto standard
With some sugar
Enforced with clang-format

A whole new world
A dazzling style we all dreamed of
And when we read it through
It's crystal clear
That now we're in a whole new world of code
2017-03-05 16:44:50 +01:00
Rémi Verschelde e1c1d7d1d7 Add a bunch of missing Godot headers in own files 2017-03-05 15:47:28 +01:00
Juan Linietsky de0045cf1b -renamed globals.h to global_config.cpp (this seems to have caused a few modified files)
-.pck and .zip exporting redone, seems to be working..
2017-02-21 00:06:30 -03:00
Rémi Verschelde 70b9aa379d Merge pull request #7581 from Faless/v6_wild_bind
TCP/UDP listen bind to address and bugfixes
2017-02-12 23:31:40 +01:00
Hein-Pieter van Braam cff6840ff7 Add a simple signal handler for SIGCHLD on Unix
This fixes #6631
2017-02-09 22:08:35 +01:00
Juan Linietsky 6f2e16306a Several bugfixes, improving the import workflow 2017-02-06 00:38:39 -03:00
Fabio Alessandrelli 5dc7c920bf Fix buffer size check in UDP socket.
We were reserving 12 bytes from the buffer for ip, port, and length, but since
IPv6 introduction we should be reserving 24 (IPv6 are 16 bytes)
2017-01-23 20:18:23 +01:00
Fabio Alessandrelli 9336857132 Use default UDP ring buffer size of 65536 for clients
We should probably create a specific function for setting the
recv buffer anyway. UDP sockets does not need to bind (listen)
to be able to call recvfrom. This is especially useful for clients
who just call set_send_address and start communicating with a server.
2017-01-23 20:18:23 +01:00
Fabio Alessandrelli 68dc969f8c Fix bug causing UDP socket to close after the first send if not listening
The ring buffer for receiving packets was not resized in constructor
2017-01-23 20:18:23 +01:00
Fabio Alessandrelli fa0cb7da0e Avoid deadlock when writing/reading data on a connecting TCP socket
TCP status polling is always performed as non blocking.
Trying to put a packet on a connecting socket will fail immediately.
2017-01-23 20:18:23 +01:00
Fabio Alessandrelli 619e7a2c8b Bind to IPv4 on OpenBSD when using wildcard
OpenBSD does not support binding on both IPv4 and IPv6 using the same socket
2017-01-23 20:18:23 +01:00
Fabio Alessandrelli 88a56ba783 Remove set_ip_type from network classes (no longer needed)
- TCP:
  - `listen` bind to wildcard "*" -> dual stack socket
  - `listen` bind to address -> socket from address type
  - `connect` -> resolve using best protocol (UNSPEC), socket from address type

- UDP:
  - `listen` bind to wildcard "*" -> dual stack socket
  - `listen` bind to address -> socket from address type
  - `put_packet`/`put_var` -> resolve using TYPE_ANY (UNSPEC), socket from address type
    (to change socket type you must first call `close` it)
2017-01-23 20:18:22 +01:00
Fabio Alessandrelli 2fe4ef6699 Implement UDP listen bind address 2017-01-23 20:18:18 +01:00
Fabio Alessandrelli b2839343ca Implement TCP Server bind address 2017-01-23 20:15:20 +01:00
Fabio Alessandrelli 98a7e2b4e0 Convert validity checks of IP_Address to is_valid method. 2017-01-23 20:15:20 +01:00
Fabio Alessandrelli e4b9b37ccf Avoid calling close when polling a UDP peer without socket 2017-01-23 20:15:20 +01:00
Rémi Verschelde a992d3f74f Merge pull request #7510 from Faless/tcp_connect
TCP connect always opens the correct socket type
2017-01-15 00:26:46 +01:00
Rémi Verschelde 479790a841 StreamPeerWinsock: Fix changed declarations
Bug introduced in dcb95ec147.
2017-01-14 16:23:01 +01:00
Juan Linietsky dcb95ec147 removed duplicated functions in class hierarchy that were bound more than once
added a check to detect this case in the future
2017-01-14 11:10:42 -03:00
Rémi Verschelde 93ab45b6b5 Style: Fix whole-line commented code
They do not play well with clang-format which aligns the `//` part
with the rest of the code block, thus producing badly indented commented code.
2017-01-14 14:52:23 +01:00
Juan Linietsky da4170540c Fixed dir access return value, changed it to Error like all other funcs 2017-01-14 09:17:15 -03:00