What #includes for GetNetMode() and appGetGameType()

Dear Friends at Epic,

Feedback: Probably the hardest thing I am encountering programming UE4 C++ is not being able to figure out what #includes to use to run the awesome functions that you have available.

I am still waiting for an answer on what #include I need for:

WindowsPlatformMisc::ClipboardCopy()
WindowsPlatformMisc::ClipboardPaste()

I spent hours trying to figure out what includes I needed on my own, with no success :slight_smile:


I am also needing to know what #includes I need for GetNetMode() (engine.h) and appGetGameType (gametype.h)

none of the below will compile because the functions cannot be found.

Have these symbols been exposed to us Rocket users? (a Staff member used this phrasing with me regardnig a previous compile error of this nature)

//alternate method
ClientMessage(appGetGameType()->ToString());
	
	
ENetMode theNetMode;

theNetMode = GetNetMode(GetWorld());
	
	//Client?
	if (theNetMode == ENetMode::NM_Client)
	{
		ClientMessage("Net Mode >> This is a client!");
	}
	//Listen?
	else if (theNetMode == ENetMode::NM_ListenServer)
	{
		ClientMessage("Net Mode >> This is single player instance!");
	}
	//single?
	else if (theNetMode == ENetMode::NM_Standalone)
	{
		ClientMessage("Net Mode >> This is single player instance!");
	}

Thanks!

Rama

PS: as a side note, using getworld()->IsServer() does not provide accurate info regarding a NM_Standalone game,

this or condition passes even for a single player game instance

UWorld * TheWorld = GetWorld();
if (!TheWorld) return;
if (TheWorld->IsClient() || TheWorld->IsServer())
{
	//this code runs even for standalone games, why? its not a server or a client
}

Hey Nathan,

Those functions should be accessible as long as you include the projects pre-compiled header in the cpp i.e. ‘MyProjectName.h’

Looks like you are missing the F it should be:

FWindowsPlatformMisc::ClipboardCopy()
FWindowsPlatformMisc::ClipboardPaste()

Best Regards,

Ryan

hee heee! you got it Ryan!

I figured this out only a couple of hours ago and posted in the other thread similar to this one that you also very helpfully answered for me.

thanks Ryan!

If I had not figured it out earlier you would have just solved it for me now

:slight_smile:

Rama

Well I figured out part of my question,

GEngine->GetNetMode()

if any of you awesome Epic staff get the chance, please please just answer my questiona bout the clipboard :slight_smile:

WindowsPlatformMisc::ClipboardCopy()
WindowsPlatformMisc::ClipboardPaste()