SLikeSoft / SLikeNet

SLikeNet™ is an Open Source/Free Software cross-platform network engine written in C++ and specifially designed for games (and applications which have comparable requirements on a network engine like games) building upon the discontinued RakNet network engine which had more than 13 years of active development.
https://www.slikenet.com/
Other
401 stars 63 forks source link

SLikeNet™ 0.1.3

Copyright © 2016-2019 SLikeSoft™ UG (haftungsbeschränkt)

Part of the documentation in this readme file was taken from RakNet 4.082 readme files. These sections are marked with [partially copied from RakNet]. Please see licenses/RakNet license.txt for the underlying license and related copyright.

The latest version and information are available at https://www.slikenet.com/

Table of Contents

  1. Quickstart
  2. What is SLikeNet? 1.1 History of SLikeNet 1.2 Version scheme and deprecation process 1.2.1 Pre 1.0 releases 1.2.2 Alpha releases 1.2.3 Beta releases 1.2.4 1.x.y releases 1.2.5 2.x.y and following releases 1.2.6 Client / Server compatibility 1.2.7 API deprecation and dropping support for 3rd party versions 1.3 Changes between RakNet (4.081/4.082) and SLikeNet
  3. System/Dependency requirements 2.1 Limitations on supported OSs, build environments, and 3rd party libraries 2.2 Compiler support 2.3 OS support 2.4 3rd party libraries/dependencies 2.4.1 Boost 2.4.2 BZip2 2.4.3 FMOD Ex 2.4.4 Independent JPEG Group's free JPEG software 2.4.5 Irrlicht Engine 2.4.6 irrKlang 2.4.7 Jansson 2.4.8 libcatid 2.4.9 Microsoft DirectX SDK / Microsoft Windows SDK 2.4.10 MiniUPnP client 2.4.11 MySQL 2.4.12 NVIDIA Cg Toolkit 2.4.13 NVIDIA Compress YCoCg-DXT 2.4.14 Ogre3D 2.4.15 OpenSSL 2.4.16 PortAudio 2.4.17 PostgreSQL 2.4.18 Autodesk Scaleform GFx 2.4.19 speex 2.4.20 SQLite 2.4.21 Steamworks SDK 2.4.22 SWIG 2.4.23 Xdelta 2.4.24 XMLParser library
  4. Getting Started 3.1 Downloading SLikeNet 3.1.1 Download from the webpage 3.1.1.1 Verifying the file integrity 3.1.1.2 Validating the download package 3.1.2 Downloading via SVN 3.1.3 Downloading via GIT 3.2 Using SLikeNet on Windows 3.2.1 Using prebuilt SLikeNet libraries with Microsoft Visual Studio 3.2.2 Building SLikeNet yourself with Microsoft Visual Studio 3.2.3 Provided default libraries 3.3 Using SLikeNet with Linux and OSX 3.3.1 Building SLikeNet 3.4 RakNet compatibility mode 3.4.1 Migrating from RakNet to SLikeNet 3.4.2 Building RakNet compatibility mode yourself 3.4.3 In-place replacement of RakNet 3.5 Development notes on differences between RakNet and SLikeNet 3.5.1 General notes 3.5.2 Retail configuration 3.5.3 OSX usage of @rpath for install_name 3.5.4 PacketLogger FormatLine() changes 3.5.5 CMake install destination and library names 3.5.6 Swig/C# wrapper changes 3.5.6.1 MakeSwig.bat/.sh 3.5.6.2 C#/Swig Visual Studio projects 3.5.6.3 C# new bindings directory 3.5.7 Changes in bundled 3rd-party dependencies 3.5.7.1 OpenSSL 3.5.8 Reorganized files/path structure 3.6 Configuring SLikeNet 3.6.1 Security relevant settings 3.7 SLikeNet and C# 3.7.1 Using SLikeNet in a C# project 3.7.2 RakNet compatibility mode 3.7.3 Generating C# bindings 3.7.3.1 Generating C# bindings on Windows 3.7.3.2 Generating C# bindings on Linux 3.7.3.3 MakeSwig.sh/.bat syntax 3.7 SLikeNet and C#
  5. Dependent Extensions 4.1 AutopatcherMySQLRepository 4.2 AutopatcherPostgreRepository 4.3 BspCollision 4.4 DXTCompressor 4.5 IrrlichtDemo 4.6 MySQLInterface 4.7 Ogre3DInterpDemo 4.8 Matrices 4.9 PostgreSQLInterface 4.10 Rackspace 4.11 SQLite3Plugin / SQLite3ClientLogger / SQLite3ServerLogger 4.12 Swig
  6. Samples 5.1 AutopatcherClient 5.2 AutopatcherClientGFx3.0 5.3 AutopatcherClientRestarter 5.4 AutopatcherClient_SelfScaling 5.5 AutopatcherServer 5.6 AutoPatcherServer_MySQL 5.7 AutopatcherServer_SelfScaling 5.8 ChatExample 5.9 CloudClient 5.10 CloudServer 5.11 CommandConsoleClient 5.12 CommandConsoleServer 5.13 ComprehensivePCGame 5.14 CrashReporter 5.15 DirectoryDeltaTransfer 5.16 Encryption 5.17 FCM2Host 5.18 FCM2Host_Simultaneous 5.19 FCM2VerifiedJoinSimultaneous 5.20 FullyConnectedMesh 5.21 iOS ChatClient 5.22 LANServerDiscovery 5.23 Lobby2Server_PGSQL 5.24 MessageFilter 5.25 NATCompleteClient 5.26 NATCompleteServer 5.27 PacketLogger 5.28 PHPDirectoryServer2 5.29 Ping 5.30 RackspaceConsole 5.31 RakVoice 5.32 RakVoiceDSound 5.33 RakVoiceFMOD / RakVoiceFMODAsDLL / RakVoiceFMODUsingDLL 5.34 ReadyEvent 5.35 ReplicaManager3 5.36 RoomsPlugin 5.37 Router2 5.38 RPC3 5.39 RPC4 5.40 SendEmail 5.41 SteamLobby 5.42 TeamManager 5.43 Timestamping 5.44 TwoWayAuthentication 5.45 UDP Forwarder 5.46 WinPhone8
  7. Help and Support 6.1 Documentation 6.2 Contact Information and Support
  8. A word on licensing 7.1 SLikeNet licensing (core and extended) 7.2 Licensed Code 7.2.1 (core) RakNet 7.2.2 (core) DR_SHA1.cpp/.h (SHA-1 algorithm - version 2.1) 7.2.3 (core) Rand.cpp (Mersenne Twister random number generator MT19937) 7.2.4 (core) KBhit.h 7.2.5 (core) FindBoost.cmake 7.2.6 (DependentExtension/Autopatcher) ApplyPatch.cpp, CreatePatch.cpp 7.2.7 (DependentExtension/DXTCompressor) OpenGLWindow.hpp 7.2.8 (DependentExtension/IrrlichtDemo) FindIrrlicht.cmake, FindIrrKlang.cmake 7.2.9 (DependentExtension/IrrlichtDemo) CDemo.cpp/.h, CMainMenu.cpp/.h, main.cpp 7.2.10 (DependentExtension/speex related) FindSpeex.cmake, FindSpeexDSP.cmake 7.2.11 (Samples/nacl_sdk) httpd.py 7.2.12 (Samples/Ogre3D related) FindOGRE.cmake, FindOIS.cmake, FindPkgMacros.cmake, PreprocessorUtils.cmake 7.2.13 (Samples/Ogre3D related) BspCollision.cpp
  9. Donations
  10. Thanks / Acknowledgments
  11. Trademark Notes / Affiliation Statement
  1. Quickstart

If you want to get started quickly simply follow these directions:

Windows™: see chapter 3.2.1 and use the prebuilt libraries Linux®/OSX: see chapter 3.3.1 Migrating from RakNet to SLikeNet: see chapter 3.4.1

For quick instructions to comply with license requirements see: licenses/_quick_licensing_slikenet_core.txt and licenses/_quick_licensing_slikenet_extended.txt

  1. What is SLikeNet?

SLikeNet™ is an Open Source/Free Software cross-platform network engine written in C++ and specifically designed for games (and applications which have comparable requirements on a network engine like games) building upon the discontinued RakNet network engine which had more than 13 years of active development. SLikeNet currently supports Windows, Linux and Mac with limited support for iPhone®, Android™, Windows Phone™ 8, and Windows Store 8. SLikeNet is not a simple rebranding of RakNet, but rather incorporates already in its initial version several bug- and security fixes as well as changes to bring the engine back on track with recent compiler and language changes.

1.1 History of SLikeNet Like many teenagers in the 90th and in the early years of the 21st century the developers have been quite into the area of computer games. One of them actually took his hobby over to the professional life and started a career in the games industry. Of special interest for him was the area of multiplayer/network engines which he also took as the topic for his diploma thesis. Unfortunately, even after a decade in the industry and despite his passion for that area, he didn't get the chance to directly work on a multiplayer integration and could only invest his own spare time in this area. 2014 finally came the opportunity to change that when RakNet (http://www.jenkinssoftware.com/), which was developed for over 13 years by Kevin Jenkins / Jenkins Software LLC, got acquired by Oculus VR, LLC. and was put under an open source license. Initially the developers thought about mainly becoming an active member of the community. However, it turned out that since GitHub® wasn't opened up, no organized community established itself and the idea of the development of RakNet being taken over by the community didn't come true. While there were quite a few talented developers who provided patches on GitHub and helped with providing support, there didn't seem to be any endeavor to get an organizational structure around the continuous development of RakNet. Hence, to the developers of SLikeNet the question arose how they could actually help out here and what would be the best way to ensure that RakNet will continue to thrive for several years to come. The conclusion was to found a company (SLikeSoft™) and continue the work RakNet left behind under a fresh name. That should provide a strong fundament and basis for the community to rely on that their ideas, bugfixes, and features won't get lost but rather will be integrated/handled in an organized manner.

1.2 Version scheme and deprecation process SLikeNet is using the Semantic Versioning (version 2.0.0) authored by Tom Preston-Werner. See http://semver.org/ for details.

1.2.1 Pre 1.0 releases The initial versions on the way towards the 1.0.0 release will use the version number 0.x.y to reflect the current (early) development stage of SLikeNet. However, since SLikeNet is heavily based on the very well tested RakNet library, we consider already these early versions way more stable than what you would normally expect from a library with such a version number. Furthermore, since our aim for SLikeNet 1.0.0 is to keep ABI/API/Protocol compatibility with RakNet 4.081/4.082, we consider the API/ABI/Protocol of the 0.x.y releases already stable and do plan to change them only in order to fix (undesired/unintended) API/ABI/Protocol incompatibility with RakNet which might have slipped in during development. Hence, in contrast to what the Semantic Versioning 2.0.0 permits, we are considering the 0.1.0 API being stable, already.

1.2.2 Alpha releases Starting with 1.0.0, for each new release we will go through a >= 2-weeks alpha release period. During this period we will only implement bugfixes which are considered safe or are fixes for regressions. Anything else will be postponed and scheduled for a following version. If significant changes need to be made for the released alpha version, we will release another alpha version and restart the 2-weeks test period. The version numbering for alpha releases will be x.y.z-alpha.d where d begins with 1 and is incremented by 1 for each successive alpha release of the same version.

1.2.3 Beta releases After the alpha version passed without major rework and the risk assessment concurred, we will release a beta version of the new version which starts the beta test phase of at least 2 weeks. During that period we will only fix regressions introduced in the new versions. Anything else will be postponed and scheduled for a following version. If there is a regression fix during the beta phase, we will release a new beta version and restart the 2 week test period. The version numbering will be x.y.z-beta.d where d begins with 1 and is incremented by 1 for each successive beta release of the same version.

1.2.4 1.x.y releases The 1.x.y releases will ensure API, ABI, and protocol compatibility with RakNet 4.081/4.082. This way we allow everybody currently using RakNet in their product to perform a simple in-place test of SLikeNet with as little work as possible. In principle it will allow you to test SLikeNet by simply replacing the RakNet DLLs without even having to recompile your game/application. If you linked RakNet statically, all you need to do is to link against the SLikeNet library. No other changes should be required. You can even run a client built with RakNet 4.082 and connect it to a SLikeNet 1.x.y server (or vice versa).

1.2.5 2.x.y and following releases 2.0.0 will be the first release which breaks backwards compatibility with RakNet. This allows us to integrate performance improvements and new features which would otherwise be impossible to realize with keeping backwards compatibility with RakNet. The server as well as the connecting clients will require both at least running SLikeNet 2.0.0 in order to work together.

1.2.6 Client / Server compatibility Any x.y.z version will always be compatible with any other x.y.z version as long as x is the same (or differs by only 1 digit and is at least 2). For instance: Running a server on 3.0.0 allows clients running 2.x.y up to 4.x.y to connect to that server. From the other point of view: A client running version 4.0.0 can connect to any server running 3.x.y up to 5.x.y.

1.2.7 API deprecation and dropping support for 3rd party versions From time to time we need to deprecate APIs/functions/classes/etc. In some cases this is done in order to keep the network engine maintainable, in other cases we might have to deprecate APIs for security reasons. For versions

= 2.0.0 we will make sure that any API which is deprecated is still available for the next major release (i.e. if we deprecate a version in 2.x.y, it will still be available for all 3.x.y releases but will be dropped in 4.0.0). The same goes for the deprecation of old 3rd party libraries. There are however a couple of cases where we might deviate from this procedure. Examples could be that security fixes require us to deprecate an API or 3rd party library already earlier or we might deprecate 3rd party library versions which are incompatible with new compilers. To comply with the Semantic Versioning 2.0.0 we will announce the deprecation of the API/3rd-party library version at least in a sub version of the current major release branch and then remove it in the following major release. For instance, if we learn that there's a security flaw in SLikeNet 2.0.5 which requires a change to the API we mark the problematic function deprecated and release 2.1.0. In the following 3.0.0 release the function will then be removed.

1.3 Changes between RakNet (4.081/4.082) and SLikeNet RakNet 4.081 was the final release of RakNet with 4.082 having been in development. SLikeNet is based on the sourcecode of RakNet 4.082 and aims for API, ABI, and protocol compatibility with RakNet 4.081/4.082. That way it's possible to use (and evaluate) SLikeNet as an in-place replacement for RakNet.

The major differences/improvements of SLikeNet over RakNet are:

There are also a couple of restrictions SLikeNet has when comparing its feature set with RakNet. Some of them are going to be dealt with in later versions, some of them however are not planned to be resolved. If any of the missing features/support is causing you trouble to try out SLikeNet, drop us a note (see chapter 6) and we'll see whether we find a solution for you. There are mainly the following reasons behind this decision: a) license restrictions prevent us to provide the same support RakNet used to provide (marked with "licensing" in the following list) b) we intentionally dropped support, so to reduce the maintenance work and be able to make use of new language and 3rd-party-library features (marked with "deprecated" in the following list) c) especially for the first versions we had to prioritize the work and had to postpone work on certain parts but are planning to do so in later versions (marked with "later in the following list)

The following list presents the known restrictions:

  1. System/Dependency requirements

2.1 Limitations on supported OSs, build environments, and 3rd party libraries SLikeNet supports a brought variety of different compilers, OSs, build tools, and 3rd part libraries. We are aiming to provide a stable environment for our users to have SLikeNet build with the supported compilers/build tools/3rd party libraries and run on all the supported OSs. Obviously it's unfeasible to test each release with all possible combinations of compilers(-versions), on all OSs, and with all versions of the 3rd party dependencies. Therefore, we decided to restrict the full support as follows:

Compiler/Build tools: We only provide full support for the latest patch release of a compiler. That means that for the Visual Studio 2013 compiler we only support VS 2013 Update 5 (but not Update 1 to Update 4 and also not the unpatched Visual Studio 2013 compiler).

OSs: We test SLikeNet on the fully patched earliest and on the latest version of the supported OS. Full support is only provided for the operation systems listed below. For instance we support Microsoft™ Windows XP but only if Service Pack 3 is installed (and all available OS patches are applied). Windows XP without any service pack or only SP1/SP1a/SP2 installed is unsupported.

3rd party libraries: 3rd party libraries are tested with the earliest supported version and the latest supported one. Furthermore, we are only supporting the latest patch release of a 3rd-party library. As an example this means that we support Boost 1.46.1 but not Boost 1.46.0.

By restricting the support we certainly don't mean that SLikeNet won't work with a compiler version, 3rd party library version or OS version which is not listed here. It simply means that we haven't tested that combination and you might run into issues or warnings might show up during the build. SLikeNet however might still work just fine. If your preferred (build) environment is not listed here and you'd like to get full support for it, please contact us (see chapter 6) so we can see whether we can add full support for your combination. If a compiler/OS/3rd party is listed as supported, we are considering any issue SLikeNet runs into with that environment a problem we have to deal with. If however you are running into problems with an unsupported combination (for instance the code not being compilable with an ancient version of Visual Studio like VC6) we might in the end ask you to upgrade to one of the supported compilers/OSs/3rd-party libraries.

A special note on Xcode® / OSX support: Our test capabilities are limited on OSX atm. Therefore, we cannot test SLikeNet at the moment on any other compiler than the one listed below. Since RakNet originally supported the OSXSDK 10.5+ we are listing that version as limited support. If you are testing SLikeNet with an older version of Xcode and are running into any issues, we'd appreciate a short note (preferably with the compiler error output).

Xbox 360/Playstation Vita/Playstation 3: RakNet originally supported these platforms. Presumably due to license restrictions the support couldn't be made open source however. If you require support for these platforms, please contact us (see chapter 6).

2.2 Compiler support Microsoft Visual Studio™: 2010 SP1, 2012 Update 1, 2013 Update 5, 2015 Update 3, 2017 15.4.1 GNU Compiler Collection: 4.6.4, 4.7.4, 4.8.5, 4.9.3, 5.4.0 Xcode: 7.3.1 (limited support for 3.0+ with OSXSDK 10.5+) CMake®: 2.6.4 2.8.12.2, 3.0.2, 3.1.3, 3.2.3, 3.3.2, 3.4.3, 3.5.2, 3.6.3, 3.7.2

2.3 OS support Microsoft Windows: Windows XP (SP3), Windows XP x64 (SP2), Windows Vista® (SP2), Windows 7 (SP1), Windows 8.1, Windows 10 (1607 / 1703) Linux: Ubuntu 14.04/16.04 OSX: 10.12 (Sierra) (limited support for 10.5 (Leopard) and later)

2.4 3rd party libraries/dependencies While the SLikeNet core engine does not rely on any 3rd party library, several samples, dependent extensions and also certain optional SLikeNet features make heavy use of 3rd party libraries/code. This chapter provides an overview of which 3rd party libraries are used for which configurations/samples and which versions are supported. 3rd party libraries which are bundled with SLikeNet are marked as such. For these we also list the 3rd party library's license and reference the location of the license file.

2.4.1 Boost Description: Boost provides free peer-reviewed portable C++ source libraries. URL: https://www.boost.org/ Supported versions: 1.34.1, 1.35.0, 1.36.0, 1.37.0, 1.38.0, 1.39.0, 1.40.0, 1.41.0, 1.42.0, 1.43.0, 1.44.0, 1.45.0, 1.46.1, 1.47.0, 1.48.0 Used in:

2.4.2 BZip2 Description: bzip2 is a freely available, patent free, high-quality data compressor. URL: http://www.bzip.org/ Supported versions: 1.0.6 (bundled) Used in:

2.4.3 FMOD® Ex Description: FMOD is a sound effects engine for video games and applications developed by Firelight Technologies Pty Ltd. URL: https://www.fmod.com/ Supported versions: 4.38.07+ Used in:

2.4.4 Independent JPEG Group's free JPEG software Description: A package containing C software to implement JPEG image encoding, decoding, and transcoding. URL: http://www.ijg.org/ Supported versions: version 7 (6b for Microsoft DirectX® - 8d for Irrlicht Engine) (version 7 is bundled) Used in:

2.4.5 Irrlicht Engine Description: The Irrlicht Engine is an open source high performance realtime 3D engine written in C++. URL: http://irrlicht.sourceforge.net/ Supported versions: 1.8.4 (some binary files bundled) Dependencies:

2.4.6 irrKlang Description: irrKlang is a cross platform sound library for C++, C# and all .NET languages. URL: http://www.ambiera.com/irrklang/ Supported versions: 1.1.3 Used in:

2.4.7 Jansson Description: Jansson is a C library for encoding, decoding and manipulating JSON data. URL: http://www.digip.org/jansson/ Supported versions: 2.4 (bundled) Used in:

2.4.8 libcatid Description: CatId Common Code Library - a collection of different code snippets. URL: https://github.com/catid/libcat Supported versions: 1.0 (bundled) Used in:

2.4.9 Microsoft DirectX SDK / Microsoft Windows SDK Description: DirectX is a set of low-level APIs for creating games and other high-performance multimedia applications. Note: As of Windows SDK 8.0 DirectX was integrated into the Windows SDK and is no longer shipped as a separate SDK. URL: https://msdn.microsoft.com/library/windows/apps/hh452744 Supported versions: DirectX SDK June 2010 (Matrices contains modified DX sample source code and uses some DX resource files) / WinPhone8: Windows SDK 8.0, 8.0A, 8.1, 8.1A, 10 (builds: 10.0.10240.0, 10.0.10586.212, 10.0.14393.795, 10.0.15063.0, 10.0.16299.0) Dependencies:

2.4.10 MiniUPnP client Description: A UPnP Internet Gateway Device (IGD) control point. URL: http://miniupnp.free.fr/ Supported versions: 1.7 pre-release (1.5 for IrrlichtDemo) (bundled) Used in:

2.4.11 MySQL® Description: MySQL is the world's most popular open source database. URL: https://www.mysql.com/ Supported versions: 5.1.30 Used in:

2.4.12 NVIDIA® Cg Toolkit Description: The Cg Toolkit is a legacy NVIDIA toolkit allowing to use programmable shading with Cg. URL: https://developer.nvidia.com/cg-toolkit Supported versions: 2.2 (bundled) Used in:

2.4.13 NVIDIA Compress YCoCg-DXT Description: This example demonstrates how a pixel shader can be used to compress a dynamically rendered color map into a texture, using both the DXT1 and YCoCg-DXT5 texture formats. URL: http://developer.download.nvidia.com/SDK/10/opengl/samples.html#compress_YCoCgDXT Supported versions: version downloaded 04/17/2017 (partially bundled with modifications) Used in:

2.4.14 Ogre3D Description: OGRE (Object-Oriented Graphics Rendering Engine) is a scene-oriented, flexible 3D engine written in C++ designed to make it easier and more intuitive for developers to produce games and demos utilizing 3D hardware. URL: http://www.ogre3d.org/ Supported versions: 1.7.4 Dependencies:

2.4.15 OpenSSL® Description: OpenSSL is an open source project that provides a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Socket Layer (SSL) protocols. It is also a general-purpose cryptography library. URL: https://www.openssl.org/ Supported versions: 1.0.0d-1.0.2i (1.0.2i bundled) Used in:

2.4.16 PortAudio Description: PortAudio is a free, cross-platform, open-source, audio I/O library. URL: http://www.portaudio.com/ Supported versions: v18.1 (bundled) Used in:

2.4.17 PostgreSQL® Description: PostgreSQL is a powerful, open source object-relational database system. URL: https://www.postgresql.org/ Supported versions: 9.1.24 Used in:

2.4.18 Autodesk® Scaleform® GFx Description: Autodesk Scaleform middleware provides a design-driven workflow for creating powerful and immersive user interface (UI) environments for PCs, game consoles, mobile devies, and consumer electronics. URL: https://www.autodesk.com/products/scaleform/overview Supported versions: 3.x Used in:

2.4.19 speex Description: Speex is an OpenSource/Free Software patent-free audio compression format designed for speech. URL: https://www.speex.org/ Supported versions: 1.1.12 (bundled) Used in:

2.4.20 SQLite® Description: SQLite is a self-contained, high-reliability, embedded, full-featured, public-domain, SQL database engine. SQLite is the most used database engine in the world. URL: https://www.sqlite.org/ Supported versions: 3.6.13 (bundled) Used in:

2.4.21 Steamworks® SDK Description: Steamworks is a free suite of tools available to any developer to use in their game or software on Steam®. URL: https://partner.steamgames.com/ Supported versions: 1.15-1.23a Used in:

2.4.22 SWIG Description: SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages. URL: http://www.swig.org/ Supported versions: 2.0.0-2.0.12 Used in:

2.4.23 Xdelta Description: Xdelta is a C library and command-line tool for delta compression using VCDIFF/RFC 3284 steams. URL: http://xdelta.org/ Supported versions: 3.0.6 Used in:

2.4.24 XMLParser library Description: This is a basic XML parser written in ANSI C++ for portability. URL: http://www.applied-mathematics.net/tools/xmlParser.html Supported versions: 2.44 (bundled) Used in:

  1. Getting Started

We provide different ways to build and integrate SLikeNet yourself. For Windows, we also provide prebuilt libraries to make it as painless as possible for you to get started. Furthermore, if you are currently using RakNet 4.081/4.082, we provide a compatibility mode which allows you to build SLikeNet without any code changes on your side as an in-place replacement (see chapter 3.4). If you are using RakNet via DLLs/shared objects you can even replace the DLLs directly with the correct counterparts of SLikeNet to give it a try.

Note that we also ship the RakNet help as part of SLikeNet. The help files are located in Help/RakNet and provide references, documentation, and tutorials which are still useful even if you are using SLikeNet. Unless you define the macro RAKNET_COMPATIBILITY for your build, you should rename the namespace RakNet -> SLikeNet and use the includes: <slikenet/foo.h> (instead of simply including ). See chapter 3.5 for further details. Otherwise, most of the samples/tutorials provided in the help documentation should still run with SLikeNet the same way.

In the following chapters [SLikeNet] corresponds to the path you extracted the SLikeNet package to.

3.1 Downloading SLikeNet We provide the following ways to download SLikeNet:

3.1.1 Download from the webpage The main download source is via our webpage. Just go to https://www.slikenet.com/ and download the version there. We provide different kind of packages. The packages not marked as "source" are containing prebuilt libraries to simplify getting started and reducing the maintenance overhead, since they do not require setting up a build environment for SLikeNet. Since the packages are however quite large, we also provide the source packages which contain the complete package (including source code and documentation) except for the large prebuild libraries. ZIP and RAR archives are containing the source code and text files with Windows line endings while the TAR.GZ archive contains the files with Linux line endings.

3.1.1.1 Verifying the file integrity The used RAR, TAR.GZ, and ZIP archives have built-in checksums to verify the data integrity of the package. You can use the different archive tools to ensure the package was downloaded correctly and isn't broken. In addition to this, you can calculate the MD5, SHA-1, SHA-256, or SHA-512 hash of the archive and compare it against the hash value noted at the download page.

3.1.1.2 Validating the download package In order to validate the downloaded package was really published by SLikeNet and wasn't altered with by someone else, ASCII armored signatures are provided for each download package (using an OpenPGP key). The corresponding key can be downloaded from the homepage: https://www.slikesoft.com/?page_id=111, the webpage's foaf.rdf-file or from a public key server. Fingerprint: 90BDC5B9C28EBCAD5805930806DED38809EECFCA

3.1.2 Downloading via SVN The latest development version can always be acquired directly via our Subversion® repository at https://www.slikesoft.com/svn/slikenet/. Released versions are tagged (i.e. https://www.slikesoft.com/svn/slikenet/tags/) while the main development trunk is located under https://www.slikenet.com/svn/slikenet/trunk/ . We suggest you use a Subversion client to get your copy from that repository. A list of available Subversion clients is located here: https://subversion.apache.org/packages.html .

3.1.3 Downloading via GIT® In addition to the main SVN repository, we also provide SLikeNet as a fork of RakNet on GitHub (https://github.com/SLikeSoft/SLikeNet). If you are mainly using GIT, this might be the way you wanna got to acquire a copy of SLikeNet.

Note that on GitHub we don't provide the prebuild libraries in the repository due to the implications of large files inside a GIT repository. If you require the prebuild binaries you can download these from our webpage (see 3.1.1) or from the release page on GitHub as separate download packages.

3.2 Using SLikeNet on Windows

3.2.1 Using prebuilt SLikeNet libraries with Microsoft Visual Studio Following is a step-by-step instruction on how to set up a C++ project using the Visual Studio IDE.

  1. Right click your project in the Solution explorer -> Properties
  2. C/C++ -> General -> Additional Include Directories: add [SLikeNet]\Source\include
  3. Linker -> General -> Additional Library Directories: add [SLikeNet]\Lib\prebuild[VS_2010] (where VS_2010 should be replaced with the version of the IDE being used)
  4. Linker -> Input -> Additional Dependencies: add the correct library (see chapter 3.2.3)

That's all you need to get started using SLikeNet. No additional steps are required. You won't even have to compile SLikeNet yourself.

3.2.2 Building SLikeNet yourself with Microsoft Visual Studio If you need a special configuration which we don't provide or if you simply want to build SLikeNet yourself:

  1. Open SLikeNet.sln with Visual Studio
  2. VS2010: skip this step VS2012: Select "Update" in the pop-up dialog: "Update VC++ Compiler and Libraries" VS2013/VS2015: Select "OK" in the pop-up dialog: "Upgrade VC++ Compiler and Libraries" VS2017: Select "OK" in the pop-up dialog: "Retarget Projects"
  3. Adjust NativeFeatureIncludesOverrides.h and define any optional macros to enable (or disable) certain features
  4. Select the correct configuration (Debug, Release, or Retail; with or without Unicode support) and the correct machine type (Win32 or x64)
  5. Build the appropriate project:
    • DLL: to build SLikeNet as a dynamic link library
    • LibStatic: to build SLikeNet as a static library

See chapter 3.4 if you want to build SLikeNet for an in-place replacement of RakNet.

3.2.3 Provided default libraries We ship several libraries which can be used without having to compile SLikeNet yourself. The prebuilt libraries are located under [SLikeNet]/Lib/prebuild/[VS_2010]. VS_2010 corresponds to the Visual Studio version the contained libraries have been built with/for. The naming scheme follows the following pattern: SLikeNet libraries: SLikeNet(DLL)[Debug|Release|Retail]( - Unicode)[core|ext][Win32|x64] RakNet compatibility libraries RakNet(DLL)[Debug|Release|Retail][core|ext][Win32|x64]

_DLL indicates the library is built as a dynamic link library. The absence of _DLL indicates that it's a static library. Debug|Release|Retail correspond to the configuration (see chapter 3.5.2 for details). "- Unicode" indicates the library is built with the Unicode character set. We do not provide this configuration by default with the RakNet compatibility mode, since RakNet did not provide such configuration. Following the "- Unicode" marker is either the _core or _ext (for extended) marker. A core configuration is built with the bare minimum settings for SLikeNet which means: no ipv6, no OpenSSL, and no LIBCAT support. The extended configuration is built with these three features enabled. The last marker indicates whether it's a 32-bit (Win32) or a 64-bit (x64) library.

3.3 Using SLikeNet with Linux and OSX

3.3.1 Building SLikeNet To build SLikeNet on Linux or OSX, you need a supported version of CMake and a supported compiler version. See chapter 2.2 for a list of what is supported.

  1. Create a directory which you will use as the root-directory for SLikeNet (we refer to that directory as [SLikeNetRootDirectory])
  2. Extract the SLikeNet package to [SLikeNetRootDirectory]/source
  3. Adjust [SLikeNetRootDirectory]/source/Source/NativeFeatureIncludesOverrides.h and define any optional macros to enable (or disable) certain features
  4. Create a new directory: [SLikeNetRootDirectory]/cmake
  5. Change the directory to [SLikeNetRootDirectory]/cmake
  6. Run cmake ../source
  7. Run make

This will build SLikeNet as a static as well as the shared object library.

3.4 RakNet compatibility mode

3.4.1 Migrating from RakNet to SLikeNet SLikeNet provides a simple way to migrate from RakNet to SLikeNet. All you need to do is to make sure that your project defines RAKNET_COMPATIBILITY in defineoverrides.h, redirect your include and library folders to the SLikeNet ones (see chapter 3.2.1 for how this is done with Visual Studio), adjust the .lib file name, and rebuild your game/application without further modifications.

Note that you can also continue pointing your include directory to [SLikeNet]/Source (instead of [SLikeNet]/Source/include as it is described in chapter 3.2.1). That way you can more easily switch between RakNet and SLikeNet if you need to.

3.4.2 Building RakNet compatibility mode yourself If you want to build SLikeNet in RakNet compatibility mode yourself on Windows, follow the steps described in chapter 3.2.2 and build the corresponding project listed under RakNet_Backwards_Compatibility in the SLikeNet solution.

Note that at the moment SLikeNet only provides building the RakNet compatibility mode on Windows.

3.4.3 In-place replacement of RakNet A very handy way to give SLikeNet a try is to simply replace the DLL of your application with the corresponding one provided by SLikeNet. You can find the DLLs under [SLikeNet]/Lib/prebuild/[VS_2010]. Replace your existing DLL with the SLikeNet version and start your application. If everything goes well, your game/application will start and run without any issues and no further changes required.

Since the protocol was kept compatible with RakNet, you can even run the server using RakNet and the client(s) running SLikeNet (or vice versa).

This also works for C# projects. See 3.7.2 for details.

3.5 Development notes on differences between RakNet and SLikeNet

3.5.1 General notes There are a couple of differences between RakNet and SLikeNet when it comes to using the libraries which are noteworthy:

  1. (except for RakNet compatibility mode) You should include SLikeNet headers via <slikenet/foobar.h> where RakNet required you to include only .
  2. (except for RakNet compatibility mode) You need to use the SLNet namespace where previously you used the RakNet namespace.
  3. RAKNET_VERSION, RAKNET_VERSION_NUMBER, RAKNET_VERSION_NUMBER_INT, and RAKNET_DATE were kept due to backwards compatibility with RakNet but were updated to 4.082 and 7/26/2017 respectively and will stay at these values for all SLikeNet 0.x.x/1.x.x releases. In order to distinguish between different SLikeNet versions, you should use the newly introduced SLIKENET_VERSION, SLIKNET_VERSION_NUMBER, SLIKENET_VERSION_NUMBER_INT, and SLIKNET_DATE macros.

3.5.2 Retail configuration RakNet only shipped with a debug and a release configuration while SLikeNet ships with 3 different configurations: debug, release, and retail. The debug configuration provides full debugging support without any kind of optimization. The focus of this configuration lies in debugging capabilities (and not on performance). This is in principle the same what RakNet provided. The release configuration provides partial debugging mode with optimizations but configured so it's usable for larger games. In particular the whole program optimization (WPO) and link time code generation (LTCG) is disabled (since this can significantly increase build times on larger projects). The retail configuration is the configuration intended to be used when building the versions which will be shipped to users/customers. It's configured to provide the best performance and no debugging overhead whatsoever. WPO and LTCG are enabled in this configuration too.

To use the retail configuration you also need to define the _RETAIL macro (usually you'd do that via the project properties).

Note that the RakNet 4.081/4.082 configurations were a bit inconsistent. By default the release configuration for RakNet DLL was built with WPO/LTCG enabled while for RakNet Static it was disabled. So if you want to use the corresponding SLikeNet libraries for what RakNet used as the release configurations, you'd use the retail configuration for the dynamic library and the release configuration in case of a static library.

3.5.3 OSX usage of @rpath for install_name SLikeNet uses @rpath for the directory portion of the "install_name" field of shared libraries, if CMake >= 2.8.18 is used. See the CMake documentation regarding MACOSX_RPATH for further details. Since this property was introduced in CMake 2.8.18 building SLikeNet with CMake 2.6.4 will not use this property and instead set the "install_name" field to an absolute path like RakNet did.

3.5.4 PacketLogger FormatLine() changes For security reasons SLikeNet introduces two overloads of the virtual PacketLogger::FormatLine() method which take an additional size parameter for the output buffer. Internally only these new overloads are called. If you overwrote the implementation of the FormatLine() method and relied on this being used/called from the library, you will have to adjust your overrides to overwrite the new variants instead.

3.5.5 CMake install destinations and library names On non-Windows platforms, RakNet used to install its libs/headers into the source directory rather than using lib/include destinations widely established on Linux/OSX platforms. On top of that RakNet named libraries in a way which is common on Windows platforms but practically unused on other platforms (i.e. the static library file name was called RakNetLibStatic.a and the shared one RakNetDLL.so).

As of SLikeNet 0.2.0 this changed. SLikeNet now honors the CMAKE_INSTALL_PREFIX variable, uses the standard naming scheme for the library file names (libslikenet.a/.so) and on top of that adds support to install multiple versions of the library on a single platform by suffixing the install destination and shared object files with the version number, as it is established practice on Linux/OSX.

This most likely requires changes to build steps/integration on your side.

3.5.6 Swig/C# wrapper changes

3.5.6.1 MakeSwig.bat/.sh The MakeSwig script files (batch and bash ones) were completely revised and their usage unified/simplified. This includes that functionality of the old MakeSwigWithExtras scripts is now incorporated in the MakeSwig scripts directly. The old MakeSwigWithExtras scripts were therefore removed. See chapter 3.7.3.3 for a description of the new syntax.

A notable difference is that SLikeNet requires only a single path (to the SLikeNet root directory) while RakNet required the path to the source code directory and in some cases also the path to a dependent extension. Therefore, SLikeNet relies on the source code folder remaining not being modified.

For the bash script RakNet downloaded SWIG 2.0.0 and utilized the su-command. Since changing the user to the root user is usually not required nowadays (and can actually fail depending on the distro/setup), the command was switched to use sudo instead. In addition SLikeNet installs the recommended SWIG version now (which usually is the latest supported one). If you rely on a particular older version being used, you should make sure that particular version is installed prior to using the bash file.

3.5.6.2 C#/Swig Visual Studio projects RakNet contained distinct solution/project files for its C# integration. SLikeNet simplified the usage of these projects significantly and so has them directly included in the main solution now.

3.5.6.3 C# new bindings directory RakNet built the C# bindings in newly created output directories located under DependenExtensions/Swig. This behavior was changed in SLikeNet and generated wrapper/interface files are put into the new bindings directory under the SLikeNet root directory. Related is the change that the interface files are no longer copied to the sample/test project. Instead these projects link the generated C# interfaces now directly from their new bindings directory.

3.5.7 Changes in bundled 3rd-party dependencies SLikeNet bundles certain 3rd-party dependencies for ease of use. While we aim to preserve backwards compatibility where possible, we cannot always ensure this for bundled 3rd-party tools/libs, as this is beyond our control. This section provides an overview where we had to update bundled 3rd-party tools even though this update came with backwards compatibility concerns. Please be aware that nothing speaks against replacing the bundled version with an older version to restore compatibility with your application, if that's necessary (as long as we still support that older version - see chapter 2.4).

3.5.7.1 OpenSSL Originally RakNet shipped OpenSSL 1.0.0d. As the 1.0.0 range is long EOL, no longer receives any updates (incl. security updates), and has build integration issues/limitations with recent build tools, we decided to update the bundled version to a more recent build. In most cases you should not notice any difference. There are however a few cases where you might have to adjust your code/application. The following list mentions the potential breaking changes:

3.5.8 Reorganized files/path structure Compared to RakNet, SLikeNet made some changes to the file and path structure. The following table provides an overview of the more likely cases users of RakNet might have relied on and hence are impacted by the change. If you realize that SLikeNet is missing some files which were previously shipped with RakNet and are required for your case, please contact support@slikesoft.com. We'll then consider to readd these files then in a later version again.

RakNet path | SLikeNet path | Rationale DependentExtensions/openssl-1.0.0d | DependentExtensions/openssl | [1] DependentExtensions/openssl-1.0.0d/*.dll | [REMOVED] | [2] DependentExtensions/openssl-1.0.0d/bin/openssl.cfg | DependentExtensions/openssl/bin/openssl.cnf | [3]

[1] To prevent changes to path whenever the external is upgraded. Additionally lib, bin, and include directories contain subdirectories for the different platforms/configurations now. [2] Removed redundant files. Provided also in DependentExtensions/openssl-1.0.0d/bin/*.dll [3] The file was renamed to its original filename.

3.6 Configuring SLikeNet SLikeNet uses macros to control certain settings. The overview of the available settings can be found in the accompanying Doxygen generated documentation (refer to the documentation regarding defines.h and NativeFeatureIncludes.h). These "settings" can be redefined in the corresponding override-headers (definesoverrides.h / NativeFeatureIncludeOverrides.h).

3.6.1 Security relevant settings When using SLikeNet to transfer files between peers (f.e. via the AutoPatcher or directly via FileListTransfer), SLikeNet allocates a single memory chunk to retrieve the incoming file. For rather large files (up to 4 GiB), this can trigger crashes (due to running out of memory) especially on 32-bit targets or on Windows the receiving peer becoming unresponsive (due to falling back to using page files).

To mitigate these cases, it's strongly suggested to redefine SLNET_MAX_RETRIEVABLE_FILESIZE to a reasonable value for your application. In principle a lower setting is always preferred. So if you know that you never transmit files > 20 MiB over the wire, you'd define the macro to 20971520.

3.7 SLikeNet and C# To use SLikeNet in a C# project, you require a SLikeNet DLL (Windows) or a shared library (Linux/macOS) with built-in C# wrapper capability and the C# interface files. Pre-generated bindings are located in the bindings directory. The prebuilt DLLs shipped in the Lib/prebuild directory are already built with the C# wrapper capability and hence can be used with a C# project directly.

If the default configuration these bindings are built with is not suitable for your needs, customized bindings and DLLs can be generated. See chapter 3.7.3 for further details.

The C# bindings are not only compatible with the .Net Framework, but also with Mono and Portable.Net and hence can be used on Windows, Linux, and macOS. Chapter 3.7.1 describes how to use SLikeNet in a C# project.

If your existing project uses RakNet, you should take a look at chapter 3.7.2: RakNet compatibility mode. That mode allows you to run your existing RakNet project with SLikeNet without any code changes.

Please note that unless you are planning to regenerate the C# bindings yourself, you won't need to install SWIG to use SLikeNet in a C# project.

3.7.1 Using SLikeNet in a C# project To use SLikeNet with C# you need to include the interface files in the project. These files are located under bindings/csharp/interfaces. In addition to that, you need to put a SLikeNet DLL/shared library into the search path so the application can find it. On Windows the easiest way to get started is to copy one of the prebuilt DLLs under Lib/prebuild/VS_xxxx/SLikeNetDLL[configuration][core|ext][platform].dll to the directory where the C# executable will be built to and rename it to SLikeNet.dll. On Linux you are required to build a shared library yourself since SLikeNet doesn't ship with prebuilds for Linux. Simply follow the steps under 3.7.3.2 which will take care about building such library and put it into an appropriate directory.

For Windows you can also take a quick look at the CSharpTestApp project which demonstrates how to access the basic functionality of SLikeNet in C#.

Note that the C# namespace for SLikeNet is the same as the one used in C++: SLNet. The global C# class is named SLikeNet (i.e. SLNet.SLikeNet).

3.7.2 RakNet compatibility mode If you have an existing C# project which uses RakNet, you can utilize SLikeNet in the RakNet compatibility mode. This mode allows you to build your existing RakNet C# project with SLikeNet without any required modifications. To do this, use the bindings under bindings/raknet_backwards_compatibility/chsarp/interfaces with your project and instead of the SLikeNet_DLL_xxxx.dll file use one of the RakNet_DLL_xxxx.dll files (renamed to RakNet.dll). Note that since SLikeNet introduced the Retail configuration, you most likely want to use a DLL of the retail configuration, if you previously used the RakNet release configuration (see chapter 3.5.2 for details).

Note that you can even run your existing C# project built with the C# interface files taken from RakNet 4.082 and replace the RakNet.dll file with one from the SLikeNet prebuild directory (without having to rebuild the project) to give it a quick try. Since the protocol version is compatible, it's even possible to run the server with the RakNet.dll taken from SLikeNet while the clients still use the RakNet 4.082 one (or vice versa).

If you want/need to generate the C# bindings (and DLL) yourself (as explained in chapter 3.7.3 ff.), you can either use the "RakNet_DLL (CSharp bindings)"- project in Visual Studio or call the MakeSwig batch/bash script with the --rakNetCompatibility option (see chapter 3.7.3.3).

Note that in the RakNet compatibility mode the C# namespace and global class are both called RakNet (i.e. the global C# class is therefore RakNet.RakNet).

3.7.3 Generating C# bindings The default bindings shipped with SLikeNet are not built with support for any of the dependent extensions. If you need support for one (f.e. for the SQLite plugin) or if you simply want to generate the bindings yourself, you can do so using SWIG. The following two sections provide step-by-step instructions on how to do this on Windows and Linux.

3.7.3.1 Generating C# bindings on Windows First of all you need a supported version of SWIG installed on your system. Versions can be downloaded directly from the SWIG homepage at http://www.swig.com/. For a list of supported versions see chapter 2.4.22. After you downloaded the version, extract the archive into a directory (for this documentation we assume you extracted the package to C:\swig).

Next you'd add the directory to the Path environment variable. On Windows 10 simply press the Windows start button and enter "advanced system" for the search term. This should bring up the entry: "View advanced system settings". Click on that entry. The "System Properties" dialog should show up. In there click on Advanced -> Environment Variables... This will open the "Environment Variables" dialog. Here you should find two entries for the "Path" variable. One time under "User variables for [username]" and once under "System variables". If you modify the Path variable for the user, SWIG will only be recognized as a command under the current Windows user. If you modify the system variable instead, the command will be recognized for any user on that machine. If unsure which one to modify, edit the "System variables" entry. In the new dialog "Edit environment variable" click the "New" button and enter the directory you extracted the archive to (i.e. C:\swig). Click OK in the dialog to confirm the changes.

After SWIG was installed, open the SLikeNet solution in Visual Studio, select the desired configuration and platform (f.e. Retail and x64), and build the "DLL (CSharp bindings)"-project. This generates the C# interface files (under bindings/csharp/interfaces), the wrapper files for the DLL (under bindings/csharp/wrapper), and also the corresponding DLL in the Lib directory. The name for the DLL follows the following naming convention: SLikeNetDLL[configuration]_[platform].dll. Remember to rename the DLL to SLikeNet.dll (see chapter 3.7.1) before you use it. Note that the "DLL (CSharp bindings)"-project generates the C# bindings without support for any dependent extension. If you need support for a dependent extension or if you don't use Visual Studio, you can also manually generate the C# bindings as described next.

An alternative approach to generate the C# bindings is to run the MakeSwig.bat file manually. For that, open a command prompt and switch to the directory: DependentExtensions/Swig. In there call MakeSwig.bat with the appropriate parameters (see chapter 3.7.3.3 for the full syntax).

Note that after you used MakeSwig.bat you'll have to build the DLL with the included C# wrapper yourself. For Visual Studio the easiest way is to remove the pre-build event for the "DLL (CSharp bindings)"-project and then build that project.

3.7.3.2 Generating C# bindings on Linux To generate the C# bindings, SWIG must be installed. Depending on the distribution you'd usually favor installing SWIG using the package manager, since this ensures the easiest/safest way to install SWIG. Installing SWIG using the package manager on Debian or Ubuntu is usually as simple as running: "sudo apt-get install swig" and then following the on-screen instructions.

However, based on the distribution, the version installed by default could either be an older one than the latest supported version (which is usually the recommended one) or a later version than what SLikeNet supports. If that's the case, you should NOT use the package manager and instead let SLikeNet's MakeSwig bash script handle the installation of the appropriate version for you. Of course you can also manually download and install SWIG directly from http://www.swig.org/ (please follow the instructions in the SWIG docu on how to install the version manually).

To generate the C# bindings (and, if required, run the SWIG installation) open a terminal window, switch to the DependentExtensions/Swig directory and run MakeSwig.sh. To be able to execute the bash script, it must be granted execution privileges first. To do so, run: "chmod 775 ./MakeSwig.sh" Following this, you are able to execute the script. See chapter 3.7.3.3 for details on the syntax.

The script first checks whether the swig command is available and if it is missing downloads and installs the recommended SWIG version itself (you'll have to answer the question whether it should be installed with 'y' or the script aborts). After the successful installation of SWIG the C# bindings will be generated and put into bindings/csharp/interfaces and bindings/csharp/wrapper. Following that, the script will build the shared library with the integrated C# wrapper and copy it to /usr/lib.

3.7.3.3 MakeSwig.sh/.bat syntax The syntax for MakeSwig.sh and MakeSwig.bat are mostly the same with only the following differences:

Examples: ./MakeSwig ../.. Generates the C# bindings without any dependent extension support in SLikeNet mode.

./MakeSwig ../.. [""] --rakNetCompatibility Generates the C# bindings without any dependent extension support in RakNet compatibility mode.

./MakeSwig ../.. [""] SQLITE --rakNetCompatibility Generates the C# bindings with added support for the SQLite dependent extension in RakNet compatibility mode.

Specific example for MakeSwig.bat: MakeSwig.bat .... C:\swig-2.0.0 SQLITE Generates the C# bindings with added support for the SQLite dependent extension using the SWIG version located in C:\swig-2.0.0 in SLikeNet mode.

Complete syntax: MakeSwig [] [--rakNetCompatibility]

slikenet_root_path: Path to the SLikeNet root directory. Usually you'll pass ../.. here, if invoked from inside DependentExtensions/Swig. In case of MakeSwig.bat the path MUST NOT contain any spaces (even not if the argument/path is quoted)!

swig_path: MakeSwig.bat only Path to the SWIG binary (swig.exe). Use "" to indicate using swig.exe from the PATH environment variable.

dependent_extension: The dependent extension which should be included. Supported values: MYSQL_AUTOPATCHER: adds MySQL autopatcher support SQLITE: adds SQLite support

--rakNetCompatibility: If specified, creates the C# wrapper in RakNet compatibility mode.

  1. Dependent Extensions [partially copied from RakNet]

SLikeNet contains several dependent extensions which extend the core functionality of SLikeNet. Following lists and describes the available extensions:

4.1 AutopatcherMySQLRepository Description: Autopatcher Server implemented using MySQL providing patch information and asynchronous database queries to AutopatcherClient. Dependencies:

4.2 AutopatcherPostgreRepository Description: Autopatcher Server implemented using PostgreSQL providing patch information and asynchronous database queries to AutopatcherClient. Dependencies:

4.3 BspCollision Description: Sample project demonstrating the usage of the SQLite3ClientLogger. Dependencies:

4.4 DXTCompressor Description: Image data compressor. Dependencies:

4.5 IrrlichtDemo Description: Demonstrates Irrlicht modified with SLikeNet for peer to peer multiplayer. Dependencies:

4.6 MySQLInterface Description: Interface class for MySQL integration. Dependencies:

4.7 Ogre3DInterpDemo Description: Demonstrates how to lag a client in the past using the interpolation history class in order to get smooth visuals despite the choppy input. Dependencies:

4.8 Matrices Description: DirectX Matrices sample used to copy the backbuffer to the main memory in order to send it to the SQLiteClientLoggerPlugin. Dependencies:

4.9 PostgreSQLInterface Description: Interface class for PostgreSQL integration. Dependencies:

4.10 Rackspace Description: Communication class for the Rackspace Cloud Servers using API v2.0 Dependencies:

4.11 SQLite3Plugin / SQLite3ClientLogger / SQLite3ServerLogger Description: Passes calls to sqlite3_exec over the network. SQLite3ClientLogger and SQLite3ServerLogger extend this to using an SQLite database for logging. Dependencies:

4.12 Swig Description: Generates C# bindings for the SLikeNet. Dependencies:

  1. Samples [partially copied from RakNet]

SLikeNet contains different samples which can also be used as the basis (or direct integration) of certain functionality. The following chapters provide an overview of all the samples:

5.1 AutopatcherClient Description: Console application to provide patching capabilities to an end-user's application.

5.2 AutopatcherClientGFx3.0 Description: Skinnable GUI client using Autodesk Scaleform GFX to provide patching capabilities to an end-user's application. Dependencies:

5.3 AutopatcherClientRestarter Description: Client application to restart the autopatcher process if it got stuck and needs a manual restart. This application should be shipped alongside a client application which uses the Autopatcher.

5.4 AutopatcherClient_SelfScaling Description: Provides patching capabilities to an end-user's application for the AutopatcherServer_SelfScaling project. Dependencies:

5.5 AutopatcherServer Description: This is a sample implementation of the autopatcher server implemented using PostgreSQL. Dependencies:

5.6 AutoPatcherServer_MySQL Description: This is a sample implementation of the autopatcher server implemented using MySQL. Dependencies:

5.7 AutopatcherServer_SelfScaling Description: Extended version of AutopatcherServer. It will self-scale to load, using the Rackspace Cloud to add additional servers when all servers are full. Load balancing is accomplished with the help of ClouseServer / ClouseClient. DynDNS is used to point to the host of the system. Dependencies:

5.8 ChatExample Description: Sample of a simple text-based client/server chat.

5.9 CloudClient Description: Associated with the CloudServer project, this sample provides a directory server implementation. Notes: The application connects to whichever instance of the CloudServer project was passed on the command line. After connection UploadInstanceToCloud(), GetClientSubscription(), and GetServers() are called. UploadInstanceToCloud() uploads the own instance to the cloud. GetClientSubscription() returns a list of all clients. GetServers() returns the list of running servers with the connection counts. ID_CLOUD_GET_RESPONSE is returned if GetServers()/GetClientSubscription() has results. In case of GetServers() it will also reconnect to the server with the least connections (i.e. client-based load balancing). ID_CLOUD_SUBSCRIPTION_NOTIFICATION is returned when the subscription to the client list changes.

5.10 CloudServer Description: Provides ways for queries on remote systems but does not provide a way to discover these. Notes: Using the command line passed domain name:

5.11 CommandConsoleClient Description: Used for console-based remote text administration of servers, this console project connects to a server running RakNetTransport with the ConsoleServer.

5.12 CommandConsoleServer Description: Tests the ConsoleServer class which provide means to administer servers remotely through text commands. telnet and SLikeNet's protocol are supported.

5.13 ComprehensivePCGame Description: This sample demonstrates complete network functionality found in typical PC peer to peer games via the integration of UPNP, HTTPConnection2, NATPunchthrough, TeamManager, ReplicaManager3, FullyConnectedMesh2, RPC4, and ReadyEvent. Dependencies:

5.14 CrashReporter Description: Demonstrates the crash reporter system. When the application crashes, this generates and optionally emails or saves a mini-dump.

5.15 DirectoryDeltaTransfer Description: Demonstration of the DirectoryDeltaTansfer plugin (a patching system without dependencies on a database).

5.16 Encryption Description: Sample project to demonstrate the secure connectivity feature of SLikeNet.

5.17 FCM2Host Description: Demonstrates the FullyConnectedMesh2 plugin host migration.

5.18 FCM2Host_Simultaneous Description: Another demonstration of the FullyConnectedMesh2 plugin host migration.

5.19 FCM2VerifiedJoinSimultaneous Description: Demonstration of two systems calling StartVerifiedJoin() simultaneously

5.20 FullyConnectedMesh Description: Sample of the FullyConnectedMesh2 plugin.

5.21 iOS ChatClient Description: iOS sample chat client (equivalent to ChatExampleClient) connecting to a chat server (see ChatExampleServer)

5.22 LANServerDiscovery Description: Demonstrates how to find other servers on a LAN.

5.23 Lobby2Server_PGSQL Description: Database backend for the Lobby2 system supporting users, clans, friends, and other persistent information. Dependencies:

5.24 MessageFilter Description: Sample project showing the use of the message filter plugin which can be used to filter out network messages on a filter-set basis. For instance one could have a spectator filter to prevent spectators sending gameplay messages.

5.25 NATCompleteClient Description: Client to demonstrates all NAT components in a sample project. Dependencies:

5.26 NATCompleteServer Description: Server to demonstrates all NAT components in a sample project. Notes: Syntax: NATCompleteServer [] [] [] The server starts up in either single IP address mode or dual IP address mode (if at least two IP addresses are specified/detected). In dual IP address mode the NAT punchthrough server supports stride detection which improves its success rate. In that mode, the second IP address uses the specified port increased by 1 (i.e. 61112 by default). If no port is specified, the sample uses the default port (61111). If no IP address is specified, the server picks the first and second (if available) detected local IP address. If an IP address is explicitly specified in the command line, that address is being used. To enforce single IP address mode on a server with multiple IP addresses, explicitly specify only the first IP address and no second address. The server returns an error code upon a startup failure or 0 if terminated normally. The following error codes are returned: 0 = success/normal termination 1 = startup error or no NAT related features supported 2 = invalid specified port 3 = failed to determine local IP address

5.27 PacketLogger Description: Shows how to use the PacketLogger plugin(s).

5.28 PHPDirectoryServer2 Description: Sample to setup a php-based administration page to interact with SLikeNet. Notes: SLikeNet uses a php page to hold listings of running games. For example, one might run a server with the name "MyServer" and the game mode "Deathmatch" and wants to let people know that this server is running. Other people would connect to the webpage to download the list of running servers. Following functions are available:

5.29 Ping Description: Simple project demonstrating pinging.

5.30 RackspaceConsole Description: Allows to control Rackspace API servers through a console. Notes: To use RackspaceConsole OPEN_SSL_CLIENT_SUPPORT must be set to 1.

5.31 RakVoice Description: Sample project to show how to use the RakVoice class. Dependencies:

5.32 RakVoiceDSound Description: Sample project showing how to use Rakvoice together with DirectSound. Dependencies:

5.33 RakVoiceFMOD / RakVoiceFMODAsDLL / RakVoiceFMODUsingDLL Description: Sample project showing how to use RakVoice together with FMOD. Dependencies:

5.34 ReadyEvent Description: Demonstrates how to use the ReadyEvent plugin (for example to have a group of peers all execute a command at the same time).

5.35 ReplicaManager3 Description: Demonstrates how the ReplicaManager3 class is used to distribute and autoserializes objects.

5.36 RoomsPlugin Description: Sample to demonstrate using the independent Lobby2 room system.

5.37 Router2 Description: Shows how to use the Router2 plugin to setup and forward connections through an intermediate (already connected to) system.

5.38 RPC3 Description: Demonstrates how to use the RPC3 plugin to issue remote procedure calls where the call format is very similar to a local function call. Dependencies:

5.39 RPC4 Description: Demonstrates how to use the RPC4 plugin which is a simpler version of the RPC3 plugin without the boost dependency.

5.40 SendEmail Description: A sample project to use TCP to connect to a mail host using the EmailSender class.

5.41 SteamLobby Description: Demonstrates the integration of the Steam lobby and NAT traversal sockets. Dependencies:

5.42 TeamManager Description: Demonstrates the TeamManager in a typical in-game lobby setting with users being able to switch between 3 teams. The sample uses the TeamBalancer, ReplicaManager3, and FullyConnectedMesh2 plugins. Notes: Before using TeamBalancer and ReplicaManager3, we wait until we know who the host is of the session. We do not know this until one other system connects, at which point we get ID_FCM2_NEW_HOST. This is the purpose behind the two calls to SetAutoManageConnections(). When we do know the host, we call RegisterFullyConnectedMesh2Participants() to register all prior connections with ReplicaManager3 and TeamBalancer. Once we get ID_NEW_INCOMING_CONNECTION and ID_CONNECTION_REQUEST_ACCEPTED while we already know the host, we also register those connections with PushConnection() and AddParticipant(). ReplicaManager3 handles object replication to new participants. SerializeConstructionExisting() is called on all teams. The User object is replicated using SerializeConstruction() to send the initial state data. The Team and User classes contain corresponding instances of TM_Team and TM_TeamMember, so SerializeConstruction() is called on those instances. We reference the Team objects before the User objects with ReplicaManager3 first in order to ensure that the Team objects are serialized first. TeamBalancer requires this, since TM_TeamMember::DeserializeConstruction() needs to be able to look up teams in order for these to have been previously registered with TeamBalancer and deseralized. The setup has one team "REFEREE_TEAM" joinable only through a direct request. The other teams are subject to autobalancing. Examples of intended operation:

5.43 Timestamping Description: Illustrates how to use timestamps. Notes: Connect to the server and press 'c' or 's' respectively. The time that shows up on the remote system should be roughly half your ping.

5.44 TwoWayAuthentication Description: Shows how to use the TwoWayAuthentication plugin

5.45 UDP Forwarder Description: Demonstrates the UDP Forwarder class usage and how it forwards diagrams from one system to another.

5.46 WinPhone8 Description: Sample for Win Phone 8 integration. Dependencies:

  1. Help and Support

6.1 Documentation This readme.txt file contains the most up-to-date information and supersedes any older documentation, in case of contradicting statements. The changelog.txt covers the changes of the different releases. Help/Doxygen contains the complete reference manual generated with Doxygen in Microsoft Compiled HTML Help format (SLikeNetManual.chm) and in html format (Help/Doxygen/html/index.html). Help/RakNet contains the documentation which was shipped with RakNet 4.081/4.082 and is provided for cases where updated documentation isn't available yet.

6.2 Contact Information and Support We provide different ways to contact us for support requests:

For security relevant issues, please use either the contact form or send us a mail.

  1. A word on licensing

SLikeNet is completely open source (including any licensed code or bundled 3rd-party library). This means that you can use SLikeNet free of any charge in your product (even if it's a commercial product you are making money with).

SLikeNet itself is distributed under the MIT license. You can find the license in the license.txt provided alongside this readme.txt file. SLikeNet is however heavily based on RakNet (which is licensed under the Simplified BSD License). See chapter 7.2.1 for further details. In addition to that, SLikeNet also contains code licensed under different licenses/conditions and bundles 3rd-party libraries which also carry their own licenses.

For an overview of the licenses of bundled 3rd party libraries, please refer to chapter 2.4. Chapter 7.1 gets into the details on SLikeNet's own license and chapter 7.2 covers the RakNet license as well as other licensed code (which is not particularly a 3rd party library). For help to comply with the license requirements, we provide some quick licensing instructions, which is explained in chapter 7.1 as well.

7.1 SLikeNet licensing (core and extended) The SLikeNet core only relies on RakNet licensed code and code/libraries under public domain or provided under a free license. It does not rely on any 3rd-party library. This means that to comply to the license requirements the only relevant licenses are the SLikeNet license (see license.txt in the same directory as this readme.txt file) and the licenses listed under chapter 7.2 marked with the (core)-prefix. This also applies to the prebuilt libraries marked with "_core".

If you are using the prebuilt libraries marked with "_ext" in addition to the licenses mentioned above, you have to comply to the the OpenSSL license (see chapter 2.4.15) and the libcatid license (see chapter 2.4.8).

Depending on the core feature you enable, the sample you are using, or the dependent extension you utilize, additional 3rd-party libraries might be required. Please see chapter 2.4 for a list of the 3rd-party libraries and their associated licenses.

If you are distributing the SLikeNet source, we also explicitly permit you to rename (and move) the license.txt file to a different location within the package without having to update all the references to the location of the license.txt file, as long as you make it clear in any accompanying documentation where to locate the license terms and clarify that the source code references outdated locations.

In cases where SLikeNet contains modifications to 3rd-party code/libraries, we provide the modifications under the 3rd-party code's/libraries' own license in addition to providing these under the MIT license so to allow our modifications to also being utilized under the same license as the author of the 3rd-party code/library provided his/her own code for. This is mainly done so to not enforce additional license requirements, if someone wants to incorporate our modifications in their own usage of the 3rd party code/library. Where this applies, the copyright/license header in the particular source code file states so.

To simplify handling licensing requirements for the majority of the users, we provide simplified instructions for the two default combinations (core and extended) SLikeNet is shipped with. These instructions are located under licenses/_quick_licensing_slikenet_core.txt and licenses/_quick_licensing_slikenet_extended.txt.

Also we'd like to state that you are not allowed (without prior written permission from SLikeSoft) to suggest that you, your company, and/or your product is affiliated with SLikeSoft.

In addition to the licensing requirements, we'd appreciate if you are considering the following legally NON binding requests:

As mentioned: None of these optional requests are binding. If you don't feel like following any of these requests, we are still glad you decided to use our network library, nevertheless.

7.2 Licensed Code This chapter provides an overview of 3rd-party code directly incorporated into the SLikeNet core. Unless otherwise noted, license texts are directly located in the corresponding source code file.

7.2.1 (core) RakNet The basis of SLikeNet is RakNet (which SLikeNet is derived from). As a result of this, the RakNet license applies to a big portion of the SLikeNet source code. Also the majority of the documentation generated using Doxygen is directly taken from RakNet and hence the RakNet license applies to this documentation as well, as it does to the documentation shipped under Help/RakNet. Last but not least, part of the documentation in sections in this readme file were copied from the RakNet documentation and slightly modified. These sections are marked with: "[partially copied from RakNet]" and the RakNet license applies to this copied/modified documentation as well. RakNet is licensed under the Simplified BSD License and also comes with the grant of patent rights. License file(s): licenses/RakNet License.txt, licenses/RakNet Patents.txt

7.2.2 (core) DR_SHA1.cpp/.h (SHA-1 algorithm - version 2.1) This is a 100% free public domain implementation of the SHA-1 algorithm by Dominik Reichl (dominik.reichl@t-online.de) / http://www.dominik-reichl.de/ .

7.2.3 (core) Rand.cpp (Mersenne Twister random number generator MT19937) This is the 'Mersenne Twister' random number generator MT19937 which generated pseudorandom integers uniformly distributed in 0..(2^32 -1) starting from any odd seed in 0..(2^32 -1). It is a recode by Shawn Cokus (Cokus@math.washington.edu) from March 8th, 1998 of a version by Takuji Nishimura (who had suggestions from Topher Cooper and Marc Rieffel in July-August 1997). The licensing is free: http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/elicense.html "Until 2001/4/6, MT had been distributed under GNU Public License, but after 2001/4/6, we decided to let MT be used for any purpose, including commercial use. 2002-versions of mt19937ar.c mt19937ar-cok.c are considered to be usable freely." The authors asked to be sent an e-mail to (with an appropriate reference to your work) to Makoto Matsumoto and Takuji Nishimaru (matumoto@math.keio.ac.jp) as well as CC Shawn Cokus (Cokus@math.washington.edu). Note: We failed to contact the authors via these mail addresses. Both addresses appear to be dead. We keep these mail addresses here for reference, nevertheless.

7.2.4 (core) KBhit.h _kbhit() and _getch() implementation for Linux/UNIX by Chris Giese (geezer@execpc.com) / http://my.execpc.com/~geezer . His source is public domain.

7.2.5 (core) FindBoost.cmake Modified version of the FindBoost module shipped with CMake 2.8.10.2 https://cmake.org/ . The sourcecode is licensed under the Modified BSD License.

7.2.6 (DependentExtension/Autopatcher) ApplyPatch.cpp, CreatePatch.cpp These source code files which are part of the Autopatcher dependent extension contain code which is copyright 2003-2005 by Colin Percival and licensed under the Simplified BSD license.

7.2.7 (DependentExtension/DXTCompressor) OpenGLWindow.hpp This source code file which is part of the DXTCompressor dependent extension is based on code written by Jeff Molofee 2000. Acknoledgements go to Frederic Echols for cleaning up and optimizing the code. It carries no particular license note but asks to let Jeff Molofee know if the code was found useful via http://nehe.gamedev.net .

7.2.8 (DependentExtension/IrrlichtDemo) FindIrrlicht.cmake, FindIrrKlang.cmake CMake modules to locate the corresponding libraries. These files are copyright (c) 2006 by Andreas Schneider (mail@cynapses.org) and licensed under the New BSD license. License file(s): licenses/FindIrrlicht CMake License.txt

7.2.9 (DependentExtension/IrrlichtDemo) CDemo.cpp/.h, CMainMenu.cpp/.h, main.cpp These are sample files taken from the Irrlicht Engine. The files are copyright 2005-2009 by Nikolaus Gebhardt (actual copyright years vary for each file) (irrlicht@users.sourceforge.net) / http://irrlicht.sourceforge.net . The underlying license is based on the zlib/libpng license. Since the Irrlicht Engine is based in part on the work of the Independent JPEG Group, zlib, and libpng, you have to also comply to these licenses as well. It's also asked for (but not legally required) to acknowledge that you use the Irrlicht Engine, libpng, and zlib in your product. License file(s): licenses/Irrlicht Engine License.txt, licenses/jpglib license v8d.txt, license/libpng license.txt, licenses/zlib license.txt

7.2.10 (DependentExtension/speex related) FindSpeex.cmake, FindSpeexDSP.cmake CMake modules to locate the corresponding libraries. These files are copyright (c) 2006 by Andreas Schneider (mail@cynapses.org) and licensed under the New BSD license. License file(s): licenses/FindIrrlicht CMake License.txt

7.2.11 (Samples/nacl_sdk) httpd.py This file was taken from the Native Client SDK and is Copyright (c) 2012 The Chromium Authors. It is provided under the Modified BSD License. License file(s): licenses/nacl license.txt

7.2.12 (Samples/Ogre3D related) FindOGRE.cmake, FindOIS.cmake, FindPkgMacros.cmake, PreprocessorUtils.cmake CMake modules to locate the corresponding libraries. The source files are part of OGRE (Object-oriented Graphics Rendering Engine) http://www.ogre3d.org/ . They are provided as public domain.

7.2.13 (Samples/Ogre3D related) BspCollision.cpp This is a sample file to demonstrate integration into Ogre3D. The source file is part of OGRE (Object-oriented Graphics Rendering Engine) http://www.ogre3d.org/ and Copyright (c) 2000-2006 Torus Knot Software Ltd. It is provided completely free without an explicit license requirement.

  1. Thanks / Acknowledgments

First of all we'd like to thank Kevin Jenkins for his year long work on RakNet. Without his work SLikeNet wouldn't have seen the light of day at all. Second, we'd like to thank Oculus VR, LLC. which put the RakNet source code under the Simplified BSD License. Without having done that, it would have been impossible for us to continue the effort which went into the RakNet library.

Further, we'd like to thank the following contributors who handed in pull requests to the RakNet project on GitHub which are incorporated in SLikeNet:

We'd also like to thank those contributors who have requested to remain anonymous and/or those who we could not contact at all (due to lack of contact information). If you spot your contribution in our library and haven't been mentioned in the acknowledgment section, simply send us a mail and we'll update the section as soon as possible.

Last but not least, we also acknowledge all the work of the developers and companies related to incorporated/depending 3rd-party libraries (see chapter 2.4) and code snippets (see chapter 7.2).

To comply with the license requirements, we further list these acknowledgment statements: This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit. (http://www.openssl.org/) This product includes cryptographic software written by Eric Young (eay@cryptsoft.com) This product includes software written by Tim Hudson (tjh@cryptsoft.com) this software is based in part on the work of the Independent JPEG Group This software contains source code provided by NVIDIA Corporation.

  1. Donations

We provide SLikeNet completely free of charge and fully rely on donations.

If you are happy with the library and want to support its further development, we would appreciate a donation so we can at least to some degree cover the running costs.

To make a donation, head over to the donation page on our webpage at https://www.slikesoft.com/?page_id=1437&lang=en which provides additional details on benefits for donors and transparency on how we spend the money on the project.

  1. Trademark Notes / Affiliation Statement

Neither SLikeNet nor SLikeSoft is affiliated in any means to any company or other 3rd-party product mentioned in either the source code or the accompanying documentation. Mentioning of product and company names are solely done for the purpose of referencing the actual 3rd-part product or its associated company.

While we tried hard to take best care for properly handling trademarks and follow each trademark holder's guideline with appropriate usage of their property, we can't rule out that some trademark slipped by and didn't get referenced below. Hence, please understand that this list has no obligation of being complete. If a name is not listed in this section or you spot a mistake of how use the trademark we'd appreciate to be dropped a note so we can correct the mistake/oversight.

In general we mark trademarks with ™ and registered trademarks with ® upon first use of the trademark. Any following usages of the same trademark implies the corresponding trademark symbol.

Subversion is a registered trademark of the Apache Software Foundation iPhone and Xcode are registered trademarks of Apple Inc. Autodesk and Scaleform are registered trademarks of Autodesk, Inc. FMOD is a registered trademark of Firelight Technologies Pty Ltd. GITHUB is a registered trademark of GitHub, Inc. libpng is a trademark of Glenn Randers-Pehrson Android is a trademark of Google Inc. SQLite is a registered trademark of Hipp, Wyrick & Company, Inc Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries. CMake is a registered trademark of Kitware, Inc. DirectX, Windows Vista, Windows Phone, and Xbox 360 are registered trademarks of Microsoft Corporation. Microsoft, Visual Studio, and Windows are trademarks of Microsoft Corporation. MySQL is a registered trademark of MySQL AB NVIDIA is a registered trademark of NVIDIA Corporation OpenSSL is a registered trademark of the OpenSSL Software Foundation, Inc. SLikeSoft and SLikeNet are trademarks of SLikeSoft UG (haftungsbeschränkt) GIT is a registered trademark of Software Freedom Conservancy, Inc. Playstation is a registered trademark of Sony Interactive Entertainment Inc. PostgreSQL is a registered trademark of the PostgreSQL Community Association of Canada Steam and Steamworks are registered trademarks of Valve Corporation.