Hello there,
I´m trying to implement PhotonPeer in Unreal Engine 4.8 but stuck at the connect function. I need to provide a AppId, but nothig I try is accepted by UE4.
Here’s my code:
DALGameInstance.h
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "Engine/GameInstance.h"
#ifdef __clang__
#pragma clang diagnostic ignored "-Woverloaded-virtual"
#endif
#if _EG_WINDOWS_PLATFORM
#include "AllowWindowsPlatformTypes.h"
#endif
#pragma warning (disable: 4263)
#pragma warning (disable: 4264)
#include "Photon/Photon-cpp/inc/PhotonPeer.h"
#include "Photon/Photon-cpp/inc/PhotonListener.h"
#pragma warning (default: 4263)
#pragma warning (default: 4264)
#if _EG_WINDOWS_PLATFORM
#include "HideWindowsPlatformTypes.h"
#endif
#include "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 notice in the Description page of Project Settings.
#include "DALGame.h"
#include "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->connect(*ServerAddress, **ApplicationName**))
{
UE_LOG(LogTemp, Warning, TEXT("Connection failed"));
}
else
{
UE_LOG(LogTemp, Warning, TEXT("Connection established"));
}
}
The red part is the problem. BuildTool complains No suitable conversion from FString to const nByte. I have tried everything to get this up and running but no chance at all.
Has someone the same issue or an hint what I missed?
Thanks in advance