Copyright © 2014 Oculus VR, Inc.
General Information:
- Version: 5.0.0
- Documentation: https://vp817.github.io/RakNetWebsite
Package Contents:
- src: All source files of RakNet
- include: All include directories that contains the header files of RakNet
- Samples: Code samples of using RakNet
- libs: The libraries that can be used to make RakNet easier to use
- Open a terminal window.
- Navigate to the
RakNet
directory. - Run one of the following commands:
g -lpthread -g -I./include/RakNet ./src/*.cpp
: Builds RakNet with debugging information.g -m64 -g -lpthread -I./include/RakNet "./Samples/Chat Example/Chat Example Server.cpp" ./src/*.cpp
: Builds a 64-bit Chat Example server.
- The resulting executable will be named
a.out
.
- Create or open a Visual Studio project.
- Right-click on the project and choose "Add Existing Item".
- Select the
src
directory then theinclude/RakNet
directory from the RakNet package. - Build the project.
- Open a terminal window.
- Navigate to the
RakNet
directory. - Run the following commands:
g -c -DNDEBUG -I -isysroot /Developer/SDKs/MacOSX10.5u.sdk/ -arch i386 -I./include/RakNet ./src/*.cpp
: Builds PowerPC binaries.libtool -static -o raknetppc.a *.o
: Creates a static library for PowerPC.gcc -c -I ../Include -isysroot /Developer/SDKs/MacOSX10.4u.sdk/ -arch i386 -I./include/RakNet ./src/*.cpp
: Builds Intel binaries.libtool -static -o rakneti386.a *.o
: Creates a static library for Intel.lipo -create *.a -o libraknet.a
: Creates a universal binary for both architectures.
-
Install the latest CYGWIN and Android SDK.
-
Create a directory for RakNet within the CYGWIN environment.
-
Copy the
Android.Manifest.xml
and other relevant files from another sample. -
Create a directory named
RakNetIncludes
and copy the contents of theinclude/RakNet
directory into it. -
Copy the
include
directory from the RakNet package to theRakNetIncludes
directory. -
Create a file named
Android.mk
with the following content:LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := RakNet MY_PREFIX := $(LOCAL_PATH)/RakNetSources/ MY_SOURCES := $(wildcard $(MY_PREFIX)*.cpp) LOCAL_C_INCLUDES = $(LOCAL_PATH)/RakNetIncludes LOCAL_SRC_FILES = $(MY_SOURCES:$(MY_PREFIX)%=RakNetSources/%) include $(BUILD_SHARED_LIBRARY)
-
Create a directory named
RakNetSources
and copy the contents of thesrc
directory into it. -
Navigate to the RakNet directory within the CYGWIN environment.
-
Run the following command:
../../ndk-build
This will build a .so
file that can be used in your Android project.
See Samples\nacl_sdk\RakNet_NativeClient_VS2010\HowToSetup.txt
for detailed instructions on how to setup.
To use RakNet in your Windows Phone 8 project:
- Add libraries:
- Add
libs\WinPhone8\ThreadEmulation.cpp
to your project. - Add
libs\WinPhone8\
to your include paths.
- Add
- Define preprocessor macros:
- Add the following preprocessor definitions to your project:
_CRT_SECURE_NO_WARNINGS
WINDOWS_PHONE_8
- Add the following preprocessor definitions to your project:
RakNet currently does not support TCP or IPV6 in Windows Store 8 applications. Only UDP (RakPeer) and IPV4 are available.
To use RakNet in your Windows Store 8 project:
-
Add libraries:
- Add
libs\WinPhone8\ThreadEmulation.cpp
to your project. - Add the following directories to your include paths:
libs\WinPhone8\
libs\WinRT\
- Add
-
Define preprocessor macros:
- Add the following preprocessor definitions to your project:
_CRT_SECURE_NO_WARNINGS
WINDOWS_STORE_RT
_RAKNET_SUPPORT_TCPInterface=0
_RAKNET_SUPPORT_PacketizedTCP=0
_RAKNET_SUPPORT_EmailSender=0
_RAKNET_SUPPORT_HTTPConnection=0
_RAKNET_SUPPORT_HTTPConnection2=0
_RAKNET_SUPPORT_TelnetTransport=0
_RAKNET_SUPPORT_NatTypeDetectionServer=0
_RAKNET_SUPPORT_UDPProxyServer=0
_RAKNET_SUPPORT_UDPProxyCoordinator=0
_RAKNET_SUPPORT_UDPForwarder=0
- Add the following preprocessor definitions to your project: