UE4 如何集成RakNet - 纳金网
联系我们

给我们留言

联系我们

地址:福建省晋江市青阳街道洪山路国际工业设计园纳金网

邮箱:info@narkii.com

电话:0595-82682267

(周一到周五, 周六周日休息)

当前位置:主页 > 3D教程 > 图文教程

UE4 如何集成RakNet

来源: 52vr | 责任编辑:传说的落叶 | 发布时间: 2019-06-06 08:52 | 浏览量:

[UE4]如何集成RakNet

 

原文:

Is it possible to compile RakNet using UE4?

https://answers.unrealengine.com/questions/158112/is-it-possible-to-compile-raknet-using-ue4.html

 

Steps to add RakNet (release) to UE4:

 

1,Download RakNet.

 

2,Copy "RakNet-master" folder to "UE4/Engine/Source/ThirdParty/RakNet/".

 

3,Create there "RakNet.Build.cs"

 
  1. using UnrealBuildTool;  
  2.    
  3. public class RakNet : ModuleRules  
  4. {  
  5.     public RakNet(TargetInfo Target)  
  6.     {  
  7.         Type = ModuleType.External;  
  8.   
  9.         if (Target.Platform == UnrealTargetPlatform.Win64)  
  10.         {  
  11.             PublicIncludePaths.Add(UEBuildConfiguration.UEThirdPartySourceDirectory + "RakNet/RakNet-master/Source/");  
  12.             PublicLibraryPaths.Add(UEBuildConfiguration.UEThirdPartySourceDirectory + "RakNet/RakNet-master/Lib/");  
  13.             PublicAdditionalLibraries.Add("RakNet_vs2008_libstatic_release_x64.lib");  
  14.         }  
  15.     }  
  16. }  

 

4,Open RakNet_VS2008.sln with VS2013. Conversion will be automatically fine.

 

5,Set build mode "Release" / "x64".

 

6,Change "LibStatic" project properties: C/C++/CodeGeneration/Runtime Library = Multi-threaded DLL (taken from https://wiki.unrealengine.com/Linking_Static_Libraries_Using_The_Build_System)

 

7,Build "LibStatic".

 

8,Add to your "Project.Build.cs" following:

 
  1. PrivateDependencyModuleNames.Add("RakNet");  

 

 需要添加的头文件:

 

  1. #include "AllowWindowsPlatformTypes.h" // UE4  
  2.   
  3. #include "RakPeerInterface.h"  
  4. #include "MessageIdentifiers.h"  
  5. #include "BitStream.h"  
  6. #include "RakNetTypes.h"  
  7. #include "Rand.h"  
  8.   
  9. #include "HideWindowsPlatformTypes.h" // UE4  
 

相关文章
网友评论

您需要登录后才可以发帖 登录 | 立即注册

关闭

全部评论:0条

推荐
热门