UE4 And PhotonEngine 4.0.5 Using VS2015

I'm currently following this tutorial as a reference for Photon integration:

https://youtube.com/watch?v=puyUgl_ULno&index=6&list=PL3VHTk_NqLzDqnxMjMSCmLa9htXOMGBa9

While using your guide to make sure I'm following along. Except I'm getting the same error mentioned here:

forum.photonengine.com/discussion/4868/unreal-engine-4-and-photon-c-client-api

I have changed all the files needed, and even changed E_FLOAT to MYFLOAT, as the user in the previous post suggested. But this has not changed a thing, and I am still getting hundreds of errors like this:

note: could be 'unsigned long DWORD' 2> c:\program files\epic games\4.10\engine\source\runtime\core\public\Misc/DisableOldUETypes.h(34): note: or 'DoNotUseOldUE4Type::DWORD'

The code I'm using to import the engine is right here:

#ifdef __clang__ #pragma clang diagnostic ignored "-Woverloaded-virtual" #endif #if _EG_WINDOWS_PLATFORM #include "AllowWindowsPlatformTypes.h" #endif #pragma warning (push) #pragma warning (disable: 4263) #pragma warning (disable: 4264) #include "Photon-cpp/inc/PhotonListener.h" #include "Photon-cpp/inc/PhotonPeer.h" #pragma warning (default: 4263) #pragma warning (default: 4264) #if _EG_WINDOWS_PLATFORM #include "HideWindowsPlatformTypes.h" #endif

I've heard that commenting out "using namespace DisableOldUETypes" could be the solution, but I'm pretty sure you would have to rebuild the entire engine.

My folder directory goes a little something like this:

- Source
-- Game
-- Common-cpp
-- Photon-cpp
-- lib

And the relevant parts of the build file are here:

private string ModulePath { get { return Path.GetDirectoryName(RulesCompiler.GetModuleFilename(this.GetType().Name)); } } private string PhotonPath { get { return Path.GetFullPath(Path.Combine(ModulePath, "..")); } // If the photon-cpp and common-cpp were in a subfolder CHANGE THIS } private void AddPhotonLibPathWin(TargetInfo Target, String name) { string PlatformString = (Target.Platform == UnrealTargetPlatform.Win64) ? "x64" : "Win32"; PublicAdditionalLibraries.Add(Path.Combine(PhotonPath, "lib", "Windows", name + "-cpp_vc12_release_windows_md_" + PlatformString + ".lib")); } public bool LoadPhotonSystem(TargetInfo Target) { if ((Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Win32)) { Definitions.Add("_EG_PLATFORM_WINDOWS"); AddPhotonLibPathWin(Target, "Common"); AddPhotonLibPathWin(Target, "Photon"); } else { // This means we aren't windows, or i boggled some code so throw new Exception("Platform not supported: " + Target.Platform); } PublicIncludePaths.Add(Path.Combine(PhotonPath, ".")); return true; } }

Is there anything I'm doing wrong? Help is much appreciated.

Comments

  • Hi @hello_.

    Have you followed the stp-by-step guide at doc.photonengine.com/en/realtime/current/sdks-and-api/sdk-unreal-engine?
  • Yes, that was the guide I was referring to.
  • Please double-check that you have not missed a file when doing the changes from step 5:

    Photon/Common-cpp/inc/Enums/TypeCode.h @@ -18,7 +18,7 @@ - static const nByte FLOAT = 'f'; /**<float*/ + static const nByte EG_FLOAT = 'f'; /**<float*/ // Photon/Common-cpp/inc/Helpers/ConfirmAllowed.h @@ -76,7 +76,7 @@ - static const nByte typeName = TypeCode::FLOAT; + static const nByte typeName = TypeCode::EG_FLOAT; // Photon/Common-cpp/inc/Helpers/ConfirmAllowedKey.h @@ -43,7 +43,7 @@ - static const nByte typeName = TypeCode::FLOAT; + static const nByte typeName = TypeCode::EG_FLOAT;

  • I've checked that twice over, and it doesn't seem that I've missed anything.
  • OK, in that case I am afraid that I don't see any obvious reason, why you are still seeing these errors.

    Maybe something got mixed up when you were following both, the youtube tutorial and the guide from our website.

    Could you please try and start all over again with an empty project, following solely the steps from our guide?