
[ad_1]
I’m attempting to implement PhotonPeer in Unreal Engine 4.8 however I’m caught on the join perform. I would like to offer an AppId, however nothing I strive is accepted by UE4.
Here’s my code:
DALGameInstance.h
// Fill out your copyright discover within the Description web page of Project Settings.
#pragma as soon as
#embody "Engine/GameInstance.h"
#ifdef __clang__
#pragma clang diagnostic ignored "-Woverloaded-virtual"
#endif
#if _EG_WINDOWS_PLATFORM
#embody "AllowWindowsPlatformTypes.h"
#endif
#pragma warning (disable: 4263)
#pragma warning (disable: 4264)
#embody "Photon/Photon-cpp/inc/PhotonPeer.h"
#embody "Photon/Photon-cpp/inc/PhotonListener.h"
#pragma warning (default: 4263)
#pragma warning (default: 4264)
#if _EG_WINDOWS_PLATFORM
#embody "HideWindowsPlatformTypes.h"
#endif
#embody "DALGameInstance.generated.h"
/**
*
*/
UCLASS()
class DALGAME_API UDALGameInstance : public UGameInstance
{
GENERATED_UCLASS_BODY()
public:
//UDALGameInstance(const class FObjectInitializer& ObjectInitializer);
ExitGames::Photon::PhotonPeer* peer;
ExitGames::Photon::PhotonListener* listener;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = DALGameInstancePhoton)
FString ServerAddress = "127.0.0.1:5055";
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = DALGameInstancePhoton)
FString ApplicationName = "MasterServer";
};
DALGameInstance.cpp
// Fill out your copyright discover within the Description web page of Project Settings.
#embody "DALGame.h"
#embody "DALGameInstance.h"
UDALGameInstance::UDALGameInstance(const class FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
peer = new ExitGames::Photon::PhotonPeer(*listener, ExitGames::Photon::ConnectionProtocol::UDP);
UE_LOG(LogTemp, Warning, TEXT("Connecting to server"));
if(!peer->join(*ServerAddress, **ApplicationName**))
{
UE_LOG(LogTemp, Warning, TEXT("Connection failed"));
}
else
{
UE_LOG(LogTemp, Warning, TEXT("Connection established"));
}
}
The half with ApplicationName is the issue. BuildTool complains No appropriate conversion from FString to const nByte. I’ve tried every little thing to get this up and operating however with no luck in any respect.
Does somebody have the identical challenge or a touch at what I missed?
[ad_2]