467 Commits
Author SHA1 Message Date
Bryan Tabor 0e3bc3655c add null check (#74) 2024-10-19 14:11:02 +02:00
Nathan 987595211f remove experimental-wasm-threads node option in pipeline (#75) 2024-10-19 13:51:24 +02:00
Bryan Tabor dd736adc3c copy log level from config (#73) 2024-10-19 12:53:57 +02:00
Bryan Tabor c9a2ccbe2d don't skip packets before connection accepted in webrtc native driver (#69) 2024-09-12 12:11:33 +02:00
Nathan a33a169f41 emscripten 3.1.64 (#72) 2024-09-12 11:33:38 +02:00
Bryan Tabor 77e14db612 fix up initialization (#70)
* fix up initialization

* typo
2024-09-12 10:42:32 +02:00
BIAGINI Nathan 75cfb93bee fix RPC message not being properly handled on client side 2024-09-11 18:53:22 +02:00
stemvork fadfa5d3c9 fix possible bug in nbnet.h related to NBN_GameServer_RejectIncomingConnection (#67)
reproducing the possible bug:
- cd examples/echo
- cmake . && make
- ./echo_server (terminal 1) and ./echo_client TEST (terminal 2) and ./echo_client TEST (terminal 3)

error message related to possible bug:
```
Assertion failed: (client->is_accepted || outgoing_msg->type == NBN_CLIENT_ACCEPTED_MESSAGE_TYPE), function GameServer_SendMessageTo, file nbnet.h, line 5498
```

suggested fix if this is indeed a bug:
- add `|| outgoing_msg->type == NBN_CLIENT_CLOSED_MESSAGE_TYPE` to assertion
2024-08-22 16:29:13 +02:00
Volodymyr FialkoandBIAGINI Nathan 15d823dab6 Enable build flags and fix compilation warnings (gcc 14.1.0) (#66)
* Fix rpc build with other examples

CPP_COMPILE is an option, a cache variable, thus regular unset() is not
working for it since it tries to unset the scope variable.

This causing cmake to skip compilation of rpc.
Unset CPP_COMPILE from CACHE to make it work as intended.

* Fix compiler flags with build targets

Currently tests, soak and examples are build without extra flags,
because add_compile_options is specified after defining build targets.

From add_compile_options() docs:
Adds options to the compiler command line for targets in the current
directory and below that are added *after* this command is invoked.

* Pass debug callbacks as struct

Fixes:
warning: ISO C forbids conversion of function pointer to object pointer
type

* Move global variables under NBNET_IMPL

Nb net could be included multiple times, to prevent creation of global
variables in each file move them under NBNET_IMPL.

Also use designated initializer to initiate a driver structure to
remove warnings about partial initialization. Designated initializer
would initialize other members to zero.

* Resolve unused variables warnings.

Cast unused function arguments to (void) to suspend warnings.

* Resolve signed vs unsigned warnings

Remove unnecessary lt 0 checks and sync types to remove signed vs
unsigned warnings.

* Resolve string related warnings

Fixes:
nbnet/tests/string_tests.c:18:9: error: ‘strncpy’
output truncated before terminating nul copying 5 bytes from a string of
the same length
[-Werror=stringop-truncation]
   18 |         strncpy(res + pos, b, len_b);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

nbnet/tests/string_tests.c:24:9: error: ‘strncpy’
specified bound depends on the length of the source argument
[-Werror=stringop-truncation]

* Resolve function defined but not used warnings

Mark GameServer_GetClientCount() as inline.

* Attempt to fix warning in ASSERT_VALUE_IN_RANGE

In case when value in unsigned type and min is 0, this commit just
obfuscates types, maybe there's better solution.

Fixes:
warning: comparison of unsigned expression in ‘>= 0’ is always true
[-Wtype-limits]

* Ensure that read len is less than word size

In release mode(-DCMAKE_BUILD_TYPE=Release) tests returning following
error:
nbnet/tests/../nbnet.h:2272:9: error: ‘memcpy’ forming offset [4, 7] is
out of the bound s [0, 4] of object ‘word’ with type ‘Word’ {aka
‘unsigned int’} [-Werror=array-bounds=]
 2272 |         memcpy(bytes, &word, length); |
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Add check to verify that length is less than Word size.

* add -Wno-unknown-pragmas flag

* fix examples compilation on windows

* fix examples compilation on windows

* fix examples compilation on windows

* fix unit tests compilation on windows

* fix soak test compilation on windows

* fix unit tests compilation on windows

* fix unit tests compilation on windows

---------

Co-authored-by: BIAGINI Nathan <nath.biagini@gmail.com>
2024-08-10 12:02:42 +02:00
Nathan c5d34df9fd Merge pull request #65 from web3gamedev/master
cast jitter to double before dividing by 1000
2024-07-22 18:44:06 +02:00
web3gamedev 4cd581be62 cast jitter to double before dividing by 1000 2024-07-21 15:41:48 -07:00
Nathan 32b1b62781 remove encryption support from core library (#59)
remove encryption support from the core library
2024-07-16 23:34:00 +02:00
Nathan ac9405445d Merge pull request #63 from nathhB/fix-wrtc-package
address wrtc module compatibility issues with arm64
2024-07-15 19:23:26 +02:00
BIAGINI Nathan 357c37b109 fix require in webrtc js code 2024-07-15 19:19:57 +02:00
BIAGINI Nathan 3c8de60010 address wrtc module compatibility issues with arm64 2024-07-15 19:07:22 +02:00
Nathan 01f821366b Merge pull request #62 from alufers/fix-signalling-json-buffer-overflow
Fix buffer overflow when handling large signalling descriptions
2024-07-15 18:58:48 +02:00
alufers 15394bad3b Use NBN_Allocator/NBN_Deallocator instead of malloc/free 2024-07-15 13:32:11 +02:00
alufers 20612760ce Fix buffer overflow when handling large signalling descriptions
This can happen when a computer has lots of network interfaces, for example
when running docker.
2024-07-12 12:25:54 +02:00
BIAGINI Nathan 23b9fc8627 fix driver registering in echo example 2024-06-23 08:48:06 +02:00
Nathan 2148088753 Merge pull request #60 from preston-thompson/fix-channel-destroy-leak
Fix memory leak for read_chunk_buffer and write_chunk_buffer
2024-05-25 17:19:03 +03:00
Nathan 018593cf13 Merge pull request #61 from ashn-dot-dev/master
Add void parameter list to csprng_create declaration and definitions
2024-05-25 17:18:35 +03:00
ashn 0285d6cf28 Add void parameter list to csprng_create declaration and definitions
C99 functions declared with an empty parameter list may accept any
number of arguments. Add a void parameter list to the declaration and
definitions of csprng_create to indicate that they accept zero
arguments.
2024-05-18 09:52:53 -04:00
Preston Thompson 2a9b557d92 Fix memory leak for read_chunk_buffer and write_chunk_buffer 2024-05-12 16:29:01 -07:00
Nathan 09337a2f39 Merge pull request #58 from ashn-dot-dev/master
Update Sunder bindings text in README
2024-04-27 11:49:44 +03:00
ashn a0ce1484a9 Update Sunder bindings text in README 2024-04-22 10:46:46 -04:00
Nathan 36088bc906 Merge pull request #56 from sshsphere/compatibility-improvements
Fix c++ and windows compatibility
2024-02-10 18:59:51 +01:00
sshsphere 6ce182a18e fix c compiler errors 2024-02-10 18:28:33 +02:00
sshsphere 42a8d2f16c Use Sleep instead of nanosleep on windows 2024-02-09 20:45:54 +02:00
sshsphere 6abf3ccc00 Fix c++ compile errors 2024-02-09 20:45:09 +02:00
BIAGINI Nathan 0e1974d287 update copyright year 2024-02-07 22:28:54 +01:00
Nathan a0d605e27f [WIP] Rework native webrtc driver (ditch facil.io) (#52)
Remove the dependency of the native webrtc driver to facil.io entirely.
2024-02-07 22:03:20 +01:00
Nathan ad2c3c3151 Update README.md 2024-01-06 17:53:31 +01:00
BIAGINI Nathan 0b9c7b9477 remove soak log files 2024-01-06 09:46:00 +01:00
BIAGINI Nathan 2b8e781bab remove .DS_Store file and add it to .gitignore 2024-01-06 09:43:44 +01:00
Nathan 435d6aeaee Update README.md 2024-01-03 19:03:54 +01:00
Nathan e8368ace47 Fix url in raylib example README 2024-01-03 17:58:43 +01:00
Nathan bb401c914a Merge pull request #54 from nathhB/conn-vector-remove-rewrite
rewrite NBN_ConnectionVector_RemoveAt function in a simpler way
2023-11-25 17:38:38 +01:00
BIAGINI Nathan 576717f8ad rewrite NBN_ConnectionVector_RemoveAt function in a simpler way 2023-11-25 17:32:12 +01:00
Nathan 7a6b5d32fe Merge pull request #53 from nathhB/fix-get-disconnected-client
fix NBN_GameServer_GetDisconnectedClient
2023-11-13 09:19:41 +02:00
BIAGINI Nathan faa67417be fix NBN_GameServer_GetDisconnectedClient 2023-11-12 15:54:38 +01:00
Nathan e751369b99 Merge pull request #50 from ashn-dot-dev/master
Log and error and return in `Endpoint_CreateOutgoingMessage` when the outgoing message pool is full
2023-10-28 17:27:30 +02:00
ashn 02383a2197 Log and error and return in Endpoint_CreateOutgoingMessage when the outgoing message pool is full 2023-10-28 10:07:30 -04:00
Nathan 4df322c001 Merge pull request #48 from ashn-dot-dev/master
Indicate that `npm install` should be run before invoking browserify
2023-10-13 16:19:17 +02:00
ashn 7399766849 Indicate the npm install should be run before invoking browserify 2023-10-10 07:50:08 -04:00
Nathan a682a44900 Merge pull request #47 from ashn-dot-dev/master
Declare NBN_ConnectionTable struct with a name in typedef declaration
2023-09-28 07:55:29 +02:00
ashn b3c187dd68 Declare NBN_ConnectionTable struct with a name in typedef declaration 2023-09-27 16:57:36 -04:00
BIAGINI Nathan ce2ed6518c fix issue with incorrect time computations 2023-09-25 18:41:32 +02:00
Nathan ce433eeaff Merge pull request #44 from nathhB/dependabot/npm_and_yarn/net_drivers/webrtc/minimist-1.2.8
Bump minimist from 1.2.5 to 1.2.8 in /net_drivers/webrtc
2023-09-25 17:52:53 +02:00
Nathan b8d51a4e6b Merge pull request #45 from nathhB/dependabot/npm_and_yarn/net_drivers/webrtc/minimatch-3.1.2
Bump minimatch from 3.0.4 to 3.1.2 in /net_drivers/webrtc
2023-09-25 17:52:31 +02:00
dependabot[bot] 5f1002c9b4 Bump minimatch from 3.0.4 to 3.1.2 in /net_drivers/webrtc
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2.
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-24 17:43:58 +00:00