forked from https://github.com/rna88/irrnet which lacked a proper cmake config
Go to file
rna88 85822e682e Fix getPeerCount() to return correct number of peers
Calling getPeerCount() used to return the maximum number
of peers on the host, no matter how many peers were actually
connected. Changing this function to count the elements within
the "players" vector returns the correct peer count.

However calling getPeerCount() within the "onDisconnect" callback
results in an extra peer being present due to the "players"
vector only being updated *after* the callback invocation. Hence
the "onDisconnect" callback is now invoked after the disconnecting
peer is removed from the vector.

* Count peers by looping through the "players" vector.
* Move invocation of "onDisconnect" callback to after peer is deleted.
* Add getPeerCount() calls to example 3 to illustrate use.
2018-03-16 04:07:50 -07:00
enet@236e8a6428 Rename examples numerically 2018-03-16 03:36:19 -07:00
examples Fix getPeerCount() to return correct number of peers 2018-03-16 04:07:50 -07:00
include Initial commit. 2018-03-10 20:07:10 -08:00
lib Fix issue with clients not properly disconnecting 2018-03-16 03:40:45 -07:00
source Fix getPeerCount() to return correct number of peers 2018-03-16 04:07:50 -07:00
zlib@cacf7f1d4e Initial commit. 2018-03-10 20:07:10 -08:00
.gitignore Fix issue with clients not properly disconnecting 2018-03-16 03:40:45 -07:00
.gitmodules Initial commit. 2018-03-10 20:07:10 -08:00
README.md Fix issue with clients not properly disconnecting 2018-03-16 03:40:45 -07:00

README.md

Irrnet

An updated version of the irrNetLite networking library compiled against recent versions of enet and zlib.

Compiling for Linux

When cloning use the --recurse-submodules flag to retrieve the enet and zlib libraries needed by the project:

git clone --recurse-submodules https://github.com/rna88/irrnet.git

Then run make in the source/ directory to build the library, which will be placed in lib/.

Building examples

Navigate to examples/ and run:

./linux_buildAllExamples.sh

or to build them with optimizations:

./linux_buildAllExamples.sh release

The compiled binaries will be found in examples/bin/.

License

Refer to source/ReadMe.txt.