forked from https://github.com/rna88/irrnet which lacked a proper cmake config
85822e682e
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. |
||
---|---|---|
enet@236e8a6428 | ||
examples | ||
include | ||
lib | ||
source | ||
zlib@cacf7f1d4e | ||
.gitignore | ||
.gitmodules | ||
README.md |
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
.