Giter Club home page Giter Club logo

nakama-unreal's People

Contributors

craigkj312 avatar daggersoath avatar dimon4eg avatar gameinstitute avatar intinig avatar jnorberg-zynga avatar jonbonazza avatar jsmidmfg avatar julienbouysset avatar keirmeikle avatar lugehorsam avatar mawiel avatar mikef-wildlight avatar mofirouz avatar novabyte avatar on7line avatar redbaron avatar renanse avatar rikisaurus avatar tkgfabiocorrirossi avatar tomglenn avatar zkennyanderson avatar zyro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nakama-unreal's Issues

Up-To-Date

Hi,

Just wondering if this framework is up to date and working with the latest nakama version?
We recently switched from Unity to UE4 in early stages of development and it looks like it's been a while since this got updated =)

Upgrade to Nakama 2.

Currently the client is compatible with Nakama 1.4.x. We should update the client to use Nakama 2 and use Nakama C++ Client as much as possible to minimise code duplication.

The client should work on Desktop, iOS, Android and as many other target outputs as possible.

CopyToBinaries is consistently problematic

When building or generating a VS project with the Unreal editor open, I am frequently encountering an exception along the lines of:

WARNING: Exception while generating include data for nakama_testEditor: Unable to instantiate module 'Nakama': System.Exception: Failed to copy file: The process cannot access the file 'C:\Users\crowd\Documents\Unreal Projects\NakamaUnrealProto\Plugins\Nakama\Source\Nakama\..\..\..\..\Binaries\Win64\nakama-cpp.dll' because it is being used by another process

I am left wondering what the purpose is of this CopyToBinaries step in the build?

Nakama Component persistence issus?

In unreal world. there is no such things like Don't Destory On Load like unity. how do i use the nakama component provided from this plugin?

I don't want to sublevel to mygame.

new function health-check

Function to use as a healthcheck for reaching the server with the correct connection credentials.

UE 4.24 Build error

UnrealBuildTool : error : Unable to instantiate module 'Nakama': System.Exception: Failed to copy file: Could not find a part of the path 'F:\UnrealProjects\TheLastPiece\Plugins\Nakama\Source\Nakama\Private\shared-libs\win64\v142\Release\nakama-cpp.dll'.
1> at Nakama.CopyFile(String source, String dest) in f:\UnrealProjects\TheLastPiece\Plugins\Nakama\Source\Nakama\Nakama.Build.cs:line 213
1> at Nakama.CopyTo(String Filepath, String toPath) in f:\UnrealProjects\TheLastPiece\Plugins\Nakama\Source\Nakama\Nakama.Build.cs:line 176
1> at Nakama.HandleWindows(ReadOnlyTargetRules Target) in f:\UnrealProjects\TheLastPiece\Plugins\Nakama\Source\Nakama\Nakama.Build.cs:line 110
1> at Nakama..ctor(ReadOnlyTargetRules Target) in f:\UnrealProjects\TheLastPiece\Plugins\Nakama\Source\Nakama\Nakama.Build.cs:line 42
1> (referenced via default plugins -> Nakama.uplugin)
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(44,5): error MSB3075: The command "C:\UnrealEngine\UnrealEngine\Engine\Build\BatchFiles\Build.bat -Target="TheLastPieceEditor Win64 Development -Project="F:\UnrealProjects\TheLastPiece\TheLastPiece.uproject"" -Target="ShaderCompileWorker Win64 Development -Quiet" -WaitMutex -FromMsBuild" exited with code 5. Please verify that you have sufficient rights to run this command.
1>Done building project "TheLastPiece.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========

About iOS Support

First of all, all code are based on my Android support PR, #71

  1. Create a folder in libnakama/ios-arm64, named it nakama-sdk.emeddedframework.
  2. Move nakama-sdk.framework in nakama-sdk.emeddedframework.
  3. Copy Headers folder to libnakama/ios-arm64, for include in plugin.
  4. Zipped nakama-sdk.emeddedframework to nakama-sdk.emeddedframework.
  5. Modify NakamaCore.build.cs:
else if (Target.Platform == UnrealTargetPlatform.IOS)
{
        var frameworkDir = Path.Combine(ModuleDirectory, "libnakama", "ios-arm64");
	var frameworkZip = Path.Combine(frameworkDir,"nakama-sdk.emeddedframework.zip");
	PublicAdditionalFrameworks.Add(new Framework("nakama-sdk",frameworkZip,"",true));
		   
        PublicIncludePaths.Add(Path.Combine(frameworkDir, "Headers"));
}

The hierarchy of nakama-sdk.emeddedframework.zip was:

nakama-sdk.emeddedframework.zip
---nakama-sdk.emeddedframework
------nakama-sdk.framework
---------Headers
---------Info.plist
---------nakama-sdk

The same way couldn't used for Mac OS, I would work on it if I had enough time .

Cursor received from listUsersStorageObjects appears to be garbled

To test I'm calling listUsersStorageObjects with a small limit and logging the cursor. My code looks something like:

auto SuccessCallback = [&, this](NAKAMA_NAMESPACE::NStorageObjectListPtr ObjectListPtr)
{
	UE_LOG(LogNakamaBPExtension, Log, TEXT("Nakama cursor received: %s"), UTF8_TO_TCHAR(ObjectListPtr->cursor.c_str()));
	// Other stuff
};

NakamaBP::Client->listUsersStorageObjects(
	NakamaBP::Session,
	std::string(TCHAR_TO_UTF8(*Collection)),
	std::string(TCHAR_TO_UTF8(*UserID)),
	Limit > 0 ? optional<int>(Limit) : nullopt, // Limit is set to 3 or 4 in tests
	Cursor.IsEmpty() ? nullopt : optional<std::string>(TCHAR_TO_UTF8(*Cursor)), // Cursor is an FString
	SuccessCallback,
	ErrorCallback
);

This the call fires correctly with an empty cursor. However, my logs return: LogNakamaBPExtension: Nakama cursor received: ??ȟ?ഠ綊ƨ or similar (it's never the same value). If I try and make another call with the cursor I receive, I get the error:

[Nakama::RestClient::reqError] NError: InvalidArgument
message: Malformed cursor was used.

I also haven't been able to find an example of what a cursor is supposed to look like, but I assume it's a UUID or something? If I knew what it was that might help me figure out what's going wrong. Thanks for any assistance!

Incorrect build for iOS

Hello,

We were testing builds today, and we managed to make an iOS build, however upon launching it it crashes with the following error:

Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Termination Description: DYLD, dependent dylib '@rpath/libnakama-cpp.dylib' not found for '/private/var/containers/Bundle/Application/EC19A581-3AAF-4685-BBD0-0D641373A09B/Riddlr.app/Riddlr', tried but didn't find: '/private/var/containers/Bundle/Application/EC19A581-3AAF-4685-BBD0-0D641373A09B/Riddlr.app/Frameworks/libnakama-cpp.dylib' '@rpath/libnakama-cpp.dylib' '/usr/local/lib/libnakama-cpp.dylib' '/usr/lib/libnakama-cpp.dylib'

We made sure to download the iOS version and have libnakama-cpp.dylib in the specified iOS directory. We were able to build succesfully for Mac and Android, only iOS is giving us this issue.

EDIT: We are using Unreal 4.24

iOS runtime issue

There has not been a ios build of nakama-cpp since 2.4.0 and nakama-unreal removed the library in v2.5.0.

When I try to use the 2.4.0 ios dylib I can compile the iOS version but the runtime crashes failing to load the library.

Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: DYLD 1 Library missing
Library not loaded: @rpath/libnakama-cpp.dylib
Referenced from: /private/var/containers/Bundle/Application/9C43C5E8-CF5D-4D66-9603-B9F25D741FF2/ServiceProtoClient.app/ServiceProtoClient
Reason: tried: '/private/var/containers/Bundle/Application/9C43C5E8-CF5D-4D66-9603-B9F25D741FF2/ServiceProtoClient.app/Frameworks/libnakama-cpp.dylib' (no such file), '/private/var/containers/Bundle/Application/9C43C5E8-CF5D-4D66-9603-B9F25D741FF2/ServiceProtoClient.app/Frameworks/libnakama-cpp.dylib' (no such file), '/usr/local/lib/libnakama-cpp.dylib' (no such file), '/usr/lib/libnakama-cpp.dylib' (no such file)
(terminated at launch; ignore backtrace)

What is the status of iOS support with nakama-unreal?

XBox/Platstation or Nintendo Switch Support.

As I can can see in plugin the whitelisted platforms are Windows, Android, iOS, Linux and MAC.
Is there a plan for console platforms ?
Is there any work around to them work on consoles.

Unreal - NAKAMA_NAMESPACE often causing "ambiguous symbol" compilation errors

I'm back to revisiting my plan for a simple BP API plugin for Nakama, now that I'm able to open source it. However, the recent updates are making this almost impossible, and I'm not sure why.

My issue seems to be that placing using namespace NAKAMA_NAMESPACE; in a header can cause compilation errors, even if #include "nakama-cpp-c-wrapper/NakamaWrapperImpl.h" is in an unrelated .cpp file. If they were in the same file or a header and accompanying source file I'd understand, but these are unrelated files. However, I'm having a hard time reproducing this in a new project so I'm not sure yet if this is a Nakama problem or a me problem. All I know is that if I create a new file in my problem project which includes "NakamaUnreal.h" and has using namespace NAKAMA_NAMESPACE; it won't compile.

If you'd like I can supply the project that's causing me issues; it might be something silly and obvious but I can't figure out what I'm doing wrong because the error messages are so unhelpful.

NStringMap.h(32): [C2872] 'NStringMap': ambiguous symbol
NStringMap.h(25): [C2872] could be 'NStringMap_ *NStringMap'
NTypes.h(58): [C2872] or       'NakamaWrapper::NStringMap'
NStringMap.h(39): [C2872] 'NStringMap': ambiguous symbol
NStringMap.h(25): [C2872] could be 'NStringMap_ *NStringMap'
NTypes.h(58): [C2872] or       'NakamaWrapper::NStringMap'
... similar stuff repeated

If you can provide some guidance I'd really appreciate it.

Re authenticating after a token expires results in a success callback with an expired token provided again.

If the session is expired and we fail to restore the session. Calling authenticate results in the same expired token provided. We wrote code to detect expired tokens, which either refreshes or attempts to reauthenticate, it is unfortunately resulting in an infinite loop of failure. Any thoughts?

[2022.05.06-20.34.31:385][ 41]LogTemp: Warning: [Nakama] Initializing... [bIsDedicated = false]
[2022.05.06-20.34.31:411][ 42]LogOnlineIdentity: STEAM: Obtained steam authticket
[2022.05.06-20.34.31:511][ 42]LogTemp: Warning: [Nakama] authenticating with token: 1400000071C9C51057C22423E8E3D90E01001001B0857562180000000100000002000000B96FF1BDEE2E063B942C0700A9010000B20000003200000004000000E8E3D90E010010019C7E1C009BD7863C1203A8C0000000002FF17462AFA0906201006B400A00000000000EF8934F85EED508C47565BB397ACB54C720BB4EE5EB1724A42351E40C11AA0059F0BBADBAF44937154A473F43AEC8BAC3D90A5F72E5B3F22ACB52435A7796F073EBDD9466136FA7F70AD01AFAA3419A6BBD3F90AD8329E48CF87C2E44A571B417391C351C19A58FA5D814876F5D62277918ED1E65A66E39F7D0D0B60552ADE2
[2022.05.06-20.34.31:913][ 91]LogTemp: Warning: [Nakama] session token acquired: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiIyNjVhYTRjMC0xMjA5LTRiYTItOTJmMy1jNTk0MTE2NWNmNWUiLCJ1c24iOiLpto_nmq7jgoLjgoIiLCJleHAiOjE2NTI0NzQwOTR9.AICRxGKRwsfE5aEhV_olrdqyEMFzOVlApQgQcv5cAyw
[2022.05.06-20.34.31:913][ 91]LogTemp: Warning: [Nakama] eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiIyNjVhYTRjMC0xMjA5LTRiYTItOTJmMy1jNTk0MTE2NWNmNWUiLCJ1c24iOiLpto_nmq7jgoLjgoIiLCJleHAiOjE2NTI0NzQwOTR9.AICRxGKRwsfE5aEhV_olrdqyEMFzOVlApQgQcv5cAyw
[2022.05.06-20.34.31:913][ 91]LogTemp: Warning: [Nakama] 
[2022.05.06-20.34.31:914][ 91]LogTemp: Warning: [Nakama] 
[2022.05.06-20.34.31:914][ 91]LogTemp: Warning: [Nakama] Session has expired: yes
[2022.05.06-20.34.31:914][ 91]LogTemp: Warning: [Nakama] Session expires at: 0
[2022.05.06-20.34.31:914][ 91]LogTemp: Warning: [Nakama] Session created at: 1651869271913
[2022.05.06-20.34.31:920][ 92]LogTemp: Warning: [Nakama] Auth token expired, restoring session....
[2022.05.06-20.34.31:920][ 92]LogTemp: Warning: [Nakama] Restore session failed, beginning re-authentication.
[2022.05.06-20.34.31:920][ 92]LogOnlineIdentity: STEAM: Obtained steam authticket
[2022.05.06-20.34.32:021][ 92]LogTemp: Warning: [Nakama] authenticating with token: 14000000B084F06ED08C7D2AE8E3D90E01001001B0857562180000000100000002000000C9A048313340CF76922E0700AA010000B20000003200000004000000E8E3D90E010010019C7E1C009BD7863C1203A8C0000000002FF17462AFA0906201006B400A00000000000EF8934F85EED508C47565BB397ACB54C720BB4EE5EB1724A42351E40C11AA0059F0BBADBAF44937154A473F43AEC8BAC3D90A5F72E5B3F22ACB52435A7796F073EBDD9466136FA7F70AD01AFAA3419A6BBD3F90AD8329E48CF87C2E44A571B417391C351C19A58FA5D814876F5D62277918ED1E65A66E39F7D0D0B60552ADE2
[2022.05.06-20.34.32:235][119]LogOnline: OSS: EOSSDK-LogEOS: SDK Config Platform Update Request Successful, Time: 0.842598
[2022.05.06-20.34.32:236][119]LogOnline: OSS: EOSSDK-LogEOSAnalytics: Start Session (User: ...)
[2022.05.06-20.34.32:237][119]LogOnline: OSS: EOSSDK-LogEOS: Updating Product SDK Config, Time: 0.851849
[2022.05.06-20.34.32:544][156]LogTemp: Warning: [Nakama] session token acquired: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiIyNjVhYTRjMC0xMjA5LTRiYTItOTJmMy1jNTk0MTE2NWNmNWUiLCJ1c24iOiLpto_nmq7jgoLjgoIiLCJleHAiOjE2NTI0NzQwOTR9.AICRxGKRwsfE5aEhV_olrdqyEMFzOVlApQgQcv5cAyw
[2022.05.06-20.34.32:544][156]LogTemp: Warning: [Nakama] eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiIyNjVhYTRjMC0xMjA5LTRiYTItOTJmMy1jNTk0MTE2NWNmNWUiLCJ1c24iOiLpto_nmq7jgoLjgoIiLCJleHAiOjE2NTI0NzQwOTR9.AICRxGKRwsfE5aEhV_olrdqyEMFzOVlApQgQcv5cAyw
[2022.05.06-20.34.32:544][156]LogTemp: Warning: [Nakama] 
[2022.05.06-20.34.32:544][156]LogTemp: Warning: [Nakama] 
[2022.05.06-20.34.32:544][156]LogTemp: Warning: [Nakama] Session has expired: yes
[2022.05.06-20.34.32:544][156]LogTemp: Warning: [Nakama] Session expires at: 0
[2022.05.06-20.34.32:544][156]LogTemp: Warning: [Nakama] Session created at: 1651869272544
[2022.05.06-20.34.32:553][157]LogTemp: Warning: [Nakama] Auth token expired, restoring session....
[2022.05.06-20.34.32:553][157]LogTemp: Warning: [Nakama] Restore session failed, beginning re-authentication.
	auto successCallback = [=](NakamaWrapper::NSessionPtr session)
	{
		NakamaAuthToken = session->getAuthToken();
		NakamaSession = session;

		UE_LOG(LogTemp, Warning, TEXT("[Nakama] session token acquired: %s"), UTF8_TO_TCHAR (NakamaAuthToken.c_str()));
		UE_LOG(LogTemp, Warning, TEXT("[Nakama] %s"), UTF8_TO_TCHAR (session->getAuthToken().c_str())); // raw JWT token
		UE_LOG(LogTemp, Warning, TEXT("[Nakama] %s"), UTF8_TO_TCHAR (session->getUserId().c_str()));
		UE_LOG(LogTemp, Warning, TEXT("[Nakama] %s"), UTF8_TO_TCHAR (session->getUsername().c_str()));
		FString SessionExpired = session->isExpired() ? "yes" : "no";
		UE_LOG(LogTemp, Warning, TEXT("[Nakama] Session has expired: %s"), *SessionExpired);
		UE_LOG(LogTemp, Warning, TEXT("[Nakama] Session expires at: %llu"), session->getExpireTime());
		UE_LOG(LogTemp, Warning, TEXT("[Nakama] Session created at: %llu"), session->getCreateTime());

		if(bFirstRun)
		{
			OnNakamaConnected.Broadcast();
			bFirstRun = false;
		}
	};
	
		UE_LOG(LogTemp, Warning, TEXT("[Nakama] authenticating with token: %s"), *AuthToken);
	NakamaClient->authenticateSteam(std::string(TCHAR_TO_UTF8(*AuthToken)), std::string(TCHAR_TO_UTF8(*NickName)), true, {}, successCallback, errorCallback);

Update README with instructions on Nakama Include Paths

Following the steps in the README will allow the project to compile and work, but Visual Studio/Other IDEs show errors for includes on "nakama-cpp"

I suggest updating the README with the following:

For Nakama to operate correctly within Intellisense on any modern IDE you will want to add the public include paths for the plugin in your project's .Build.cs file.

Your code in .Build.cs might look like this:

using UnrealBuildTool;
using System.IO;

public class YourProjectName : ModuleRules
{
	public YourProjectName(ReadOnlyTargetRules Target) : base(Target)
	{
		PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
	
		PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });

		PrivateDependencyModuleNames.AddRange(new string[] { "Nakama" });

        var basePath = Path.GetDirectoryName(RulesCompiler.GetFileNameFromType(GetType()));
        string pluginsPath = Path.Combine(basePath, "..","..", "Plugins");
        PublicIncludePaths.Add(Path.Combine(pluginsPath, "Nakama", "Source", "Nakama", "Public", "nakama-cpp"));
	}
}

2.5.0 removed android and ios support?

When trying to package project with the latest plugin version, build fails, showing this error
image

Packaging with 2.4.0 fixes this issue, but we are unable to use the new real-time party feature.

cpp headers not updated for realtime parties

version 2.5.0 includes parties in the changelog, but it doesn't look like the cpp headers were updated along with that change. I'd expect to see functions to manipulate realtime parties in there somewhere.

NClientInterface::getAccount() not working for non ascii characters

Repro steps:

  1. Create an account
  2. Using developer console change the username or display name to use accented characters. (eg. abcöäüß, also seems to fail with french, spanish and chinese characters)
  3. Using NClientInterface::getAccount() get the account.
  4. Using breakpoints (or similar) examine the NAccount returned in the callback
  5. Non-ascii characters have been replaced by a '?'
    image

Error compiling unreal project with nakama-unreal

Hi. My name is Ehm, I'm part of a research group on digital game based learning at Fraunhofer. Currently I'm evaluating Multiplayer-frameworks for our game projects (UE4 based).

I set up a server on a linux system and a new UE project (version 4.15.3) following the guide given in README.MD. When I tried to compile the project in VS2015, I get some errors:

'Messages while compiling \Unreal Projects\NakamaTest\Intermediate\Build\BuildRules\NakamaTestModuleRules.dll:

Nakama.Build.cs(9,49): error CS1729: 'UnrealBuildTool.ModuleRules' enthält keinen Konstruktor, der 1-Argumente akzeptiert.'
\Nakama.Build.cs(28,9): error CS1502: Die beste Übereinstimmung für die überladene 'UnrealBuildTool.ModuleRules.AddEngineThirdPartyPrivateStaticDependencies(UnrealBuildTool.TargetInfo, params string[])'-Methode hat einige ungültige Argumente.

Nakama.Build.cs(28,54): error CS1503: Argument '1': Konvertierung von 'UnrealBuildTool.ReadOnlyTargetRules' in 'UnrealBuildTool.TargetInfo' nicht möglich.

Nakama.Build.cs(38,24): error CS1061: 'UnrealBuildTool.ReadOnlyTargetRules' enthält keine Definition für 'Platform', und es konnte keine Erweiterungsmethode 'Platform' gefunden werden, die ein erstes Argument vom Typ 'UnrealBuildTool.ReadOnlyTargetRules' akzeptiert (Fehlt eine Using-Direktive oder ein Assemblyverweis?).

And a couple more related lines. Any idea what went wrong here?

Unreal Multiplayer Local Testing Users Have Same ID

It might be worthy to note in docs, or better yet create some functionality in the Unreal Nakama SDK to create different IDs for local host testing.

I kept running into an issue where I couldn't deterministically set who would be host.

I came to find out that both of my local game sessions were issued the same User id.

ie In Unreal, if you set players to > 1 you can execute multiple game sessions. These users are all given the same UserId from the Nakama server.

Am I crazy or is this a real issue?

Support for other C++ engines

The original issue for creating an Unreal client in the main Nakama repo mentioned compatibility for other C++ engines. Is this still a plan for this repo? If not, this report can be closed, and I can open a new report on the main Nakama repo.

I can't Read/Write StorageObjects to the public storage

Hello,

It seems to me that NClientInterface::writeStorageObjects always writes data specifying the owner, and it's impossible not to specify their userID, because it is gathered from thee UserSession. I need to read some data knowing only the Collection and the Key without owner's userID.

I didn't find a way to do so, please tell me is it actually possible?

PermissionRead is set to ENakamaStoragePermissionRead::PUBLIC_READ; and it's written successfully, but readStorageObjects gives me 0 objects

UE4.24 compile error

1>LINK : fatal error LNK1181: cannot open input file 'C:\Tankm\Plugins\Nakama\Source\Nakama\Private\shared-libs\win64\v141\Release.obj' 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(49,5): warning MSB5021: Terminating the task executable "cmd" and its child processes because the build was canceled. 1>Done building project "Tankm.vcxproj" -- FAILED.
Im using win64 package. also why there are different packages why not merge them?

Can't call RPCs: cannot unmarshal object into Go value of type string

I'm trying to write an extension plugin to use Nakama C++ from Blueprints. I have authentication working, and I have set it up so I call functions like getAccount() or listStorageObjects(), but I can't get it to call RPCs. When I try I get the error json: cannot unmarshal object into Go value of type string. I've tried sending with the minimum amount of arguments (only session and RPC ID) and it still errors in the same way. Do you know why I'm having trouble? My code looks something like:

auto Success = [this](const NRpc& RPC) { BroadcastSuccess(OnSuccess, FNakamaRPCResponse(RPC)); };
auto Error = [this](const NError& Error) { BroadcastError(OnError, Error); };

NakamaBP::Client->rpc(
	NakamaBP::Session,
	std::string(TCHAR_TO_UTF8(*RpcID)),
	std::string(TCHAR_TO_UTF8(*Payload)),
	Success,
	Error);

UE5 version

Is there a tutorial to compile it for UE5 (sorry not very familiar with UE5). Seems that UE5 expects me to compile it manually ?
Sorry if it's a stupid question.

Developing on Windows But Deploying to iOS

When I build my Unreal project on Windows 10 using the iOS binary, we get build errors. When I use the Win64 binary it works fine.

To deploy to iOS am I suppose to pull down the code on a Mac, remove the Win64 binary and then rebuild with the iOS binary? ie We develop on Windows and then deploy on Mac.

What is the suggested workflow here?

UserId String length?

Hi I writing my own OSS using Nakama and epic online services and to do that I need to know the user-id string length.
Is this user-id length always same or it may vary in certain case, if so may I know?

Example project?

Hello is there example project?

if i have my project made with standart unreal networking, and i connect this plugin will it work out of the box?

When I start nakama using the docker-compose file I get the connection error. Also OnSuccess delegate is not getting fired.

I use the familiar file from:
wget https://raw.githubusercontent.com/heroiclabs/nakama/master/install/docker/docker-compose.yml

and when I start and check the nakama server I get the following error in the log.
`alam@ubuntu:~$ docker ps

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

06bc93fcf1f2 heroiclabs/nakama:latest "/bin/bash -ecx '/..." 7 hours ago Up 7 hours (healthy) 0.0.0.0:7350-7351->7350-7351/tcp nkserver_nakama_1

6842038d4f8c cockroachdb/cockroach:latest "/cockroach/cockro..." 7 hours ago Up 7 hours 0.0.0.0:8080->8080/tcp, 0.0.0.0:26257->26257/tcp nkserver_cockroachdb_1

alam@ubuntu:~$ docker exec -it nkserver_nakama_1 bash

root@06bc93fcf1f2:/nakama# ./nakama logs

{"level":"warn","ts":"2017-10-04T13:46:39.815Z","msg":"WARNING: insecure default parameter value, change this for production!","param":"socket.server_key"}
{"level":"warn","ts":"2017-10-04T13:46:39.815Z","msg":"WARNING: insecure default parameter value, change this for production!","param":"session.encryption_key"}
{"level":"warn","ts":"2017-10-04T13:46:39.816Z","msg":"WARNING: insecure default parameter value, change this for production!","param":"runtime.http_key"}
{"level":"info","ts":"2017-10-04T13:46:39.816Z","msg":"Nakama starting"}
{"level":"info","ts":"2017-10-04T13:46:39.816Z","msg":"Node","name":"nakama-a391","version":"1.0.2+708da56"}
{"level":"info","ts":"2017-10-04T13:46:39.816Z","msg":"Data directory","path":"/nakama/data"}
{"level":"info","ts":"2017-10-04T13:46:39.816Z","msg":"Database connections","dsns":["root@localhost:26257"]}
{"level":"fatal","ts":"2017-10-04T13:46:39.817Z","msg":"Error pinging database","error":"dial tcp 127.0.0.1:26257: getsockopt: connection refused","stacktrace":"nakama/vendor/go.uber.org/zap.Stack\n\tvendor/go.uber.org/zap/field.go:209\nnakama/vendor/go.uber.org/zap.(*Logger).check\n\tvendor/go.uber.org/zap/logger.go:273\nnakama/vendor/go.uber.org/zap.(*Logger).Fatal\n\tvendor/go.uber.org/zap/logger.go:208\nmain.dbConnect\n\tmain.go:157\nmain.main\n\tmain.go:81"}

root@06bc93fcf1f2:/nakama#
`

I am trying to use the given blueprint nodes like this :
nakamaproblem

Here is the code to setup the nakama:

`// Fill out your copyright notice in the Description page of Project Settings.
#include "NakamaGameInstance.h"
#include "Private/Blueprints/NakamaComponent.h"
#include "NakamaTestProj.h"

UNakamaGameInstance::UNakamaGameInstance(const FObjectInitializer& ObjectInitializer)
{
MainNakamaComp = CreateDefaultSubobject(TEXT("MainNakamaComponent"));
// Binding here

onSuccessMatchRequestDelegate.BindUFunction(this, FName("SuccessfullMatchMade"));
OnFailMatchRequestDelegate.BindUFunction(this, FName("FailedToCreateMatch"));

onSuccessAutheticateRequestDelegate.BindUFunction(this, FName("SuccessfullyAuthenticated"));
OnFailAutheticateRequestDelegate.BindUFunction(this, FName("FailedToAuthenticate"));

}

void UNakamaGameInstance::CallSetupNakamaClient()
{
FString serverKey = "defaultkey";
FString host = "192.168.71.130";
int32 port = 7350;
FString lang = "en";
bool ssl = false;

if(onSuccessAutheticateRequestDelegate.IsBound() && OnFailAutheticateRequestDelegate.IsBound())
	MainNakamaComp->SetupClient(serverKey, host, port, lang, ssl);

//UNBPMatchRequest::CreateMatch(MainNakamaComp, onSuccessMatch, onFail);
//Nakama::NClient someClient = Nakama::NClient::Builder("defaultkey").Host("192.168.71.130").Port(7350).SSL(false).Build();

//std::string token = "sometoken";
//// record start time
//auto start = std::chrono::system_clock::now();
//auto duration = start.time_since_epoch();
//std::chrono::milliseconds millis = std::chrono::duration_cast<std::chrono::milliseconds>(duration);

//Nakama::NSession* someSession = new Nakama::NSession(token, millis);
//
//someClient.Connect(someSession);

//// We'll use device ID for the user. See other authentication options.
//Nakama::NAuthenticateMessage someMessage = Nakama::NAuthenticateMessage::Custom("SimpleTest");

//someClient.Register(someMessage, nullptr, nullptr);

//someClient.Login(someMessage, nullptr, nullptr);

//std::string someID = someSession->GetId();

//FString SessionID(someID.c_str());

//UE_LOG(NakamaTestLog, Warning, TEXT("How do we know if the sessions is started %s"), *SessionID);

}

void UNakamaGameInstance::SuccessfullMatchMade(UNBPMatch * match)
{
GEngine->AddOnScreenDebugMessage(-1, 15.f, FColor::Green, TEXT("This is a success. We have successfully made a match !"));
}

void UNakamaGameInstance::FailedToCreateMatch(UNBPError * error)
{
GEngine->AddOnScreenDebugMessage(-1, 15.f, FColor::Red, FString("This is a failure! We failed to create a match because ") + error->GetErrorMessage());
}

void UNakamaGameInstance::SuccessfullyAuthenticated()
{
GEngine->AddOnScreenDebugMessage(-1, 15.f, FColor::Green, TEXT("This is a success. We have successfully authenticated!"));
}

void UNakamaGameInstance::FailedToAuthenticate(UNBPError * error)
{
GEngine->AddOnScreenDebugMessage(-1, 15.f, FColor::Red, FString("This is a failure! We failed to authenticate because ") + error->GetErrorMessage());
}
`

Where do we being ?

Hello nakama community !
I am trying to use nakama server with unreal engine. I downloaded the plugin from https://github.com/heroiclabs/nakama-unreal. I checked in my test c++ project that the plugin is activated.
I have installed nakama server on VMware ubuntu.
I can view the Cockroach Dashboard at
VM_ip-address:8080/
and
nakama server dashboard at
VM_ip-address:7351/

However, the documentation for using this in an unreal project is not clear.
One of my questions is where do I add this code:

#include "NClient.h"
NClient client = NClient::Default("defaultkey");

I mean where do I begin?
I tried different classes in unreal engine framework - the most common are Actor class objects, by creating a dummy but I get an undefined compile error. I also tried derived UGameInstance class.
I feel there is something missing from the settings of the nakama-unreal.

Documentation?

Hi, The doc links aren't working, where I can find documentation about the Nakama Unreal client?

Not working for Unreal Engine 5

I see there was another thread about UE5, but this is not the same. Basically I can get pass of those compiling failure(just simply removed the Win32 stuff and change the obsolete PublicLibraryPaths function). What really blocks me is the connection to the Nakama Server -- the connection were never able to be established.

I just use the code from the cpp example, it works in UE 4.26, but same code does not work for UE5 official version. After looking into this a little deeper, it seems those callback functions were never called after a bunch of client ticks in UE5. Any hints how may I solve this problem or which direction should I look at? Thanks!

    auto successCallback = [this](NSessionPtr session)
    {
        // to do: save session token in your storage
        _session = session;
        cout << "session token: " << session->getAuthToken() << endl;
        onAuthenticated();
    };

    auto errorCallback = [](const NError& error)
    {
    };

    _client->authenticateDevice(deviceId, opt::nullopt, opt::nullopt, {}, successCallback, errorCallback);

Failed to compile in Unreal 4.23.1

I'm trying to add Nakama-Unreal to an empty unreal project but I get the following error at compile (Project startup):
Failed to copy file: Could not find a part of the path 'C:\Users\Superxwolf\Documents\Unreal Projects\NakamaWrapperProject\Plugins\Nakama\Source\Nakama\Private\shared-libs\win64\v141\Release\nakama-cpp.dll'.
Also LogInit: Warning: Incompatible or missing module: Nakama a bit before,.

For Unreal 4.23.1

UNakamaRealtimeClient::PartyDataReceived delegate doesn't work

If I add some function to the PartyDataReceived delegate, it is never called.

I do it in this way:

FOnReceivedPartyData ReceivedPartyDataDelegate;
ReceivedPartyDataDelegate.AddDynamic(this, &UNakamaManager::OnPartyDataReceived);

NakamaRealtimeClient->PartyDataReceived = ReceivedPartyDataDelegate;
NakamaRealtimeClient->SetListenerPartyDataCallback();

Then I call NakamaRealtimeClient->SendPartyData() with a valid party id. NakamaRealtimeClient is set up and authorized properly, but OnPartyDataReceived isn't called

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.