Problems with API calls integer parameters for writeStorageObjects, listStorageObjects and listMatches

I am working on Unreal Engine 5 multiplayer game project. We are using Nakama v1.23.0 with golang v1.27.1. We are hosting Nakama server on VM in our network.
We encountering problems when making various API calls from our game client. Integer parameters values in calls get changed. Here are examples:
Call writeStorageObjects on game client:

std::vector<NStorageObjectWrite> StorageObjects;
NStorageObjectWrite WriteObject;
...
WriteObject.permissionRead = NStoragePermissionRead::OWNER_READ;
WriteObject.permissionWrite = NStoragePermissionWrite::OWNER_WRITE;
StorageObjects.push_back(WriteObject);

NakamaClient->writeStorageObjects(
	NakamaSession, 
	StorageObjects, 
	WriteStorageFromQueueSuccessCallback, 
	WriteStorageFromQueueErrorCallback
);

Log on Nakama back-end in before hook:

{"level":"debug","ts":"2022-10-28T10:21:49.792Z",
"caller":"nakama-project-template/before_write_storage.go:71",
"msg":"permissionRead: 513 permissionWrite: 513",
"runtime":"go","api_id":"writestorageobjects","mode":"before"}

So, values for permissionRead and permissionWrite changed from 1 and 1 to 513 and 513.

Call from listStorageObjects on game client:

const int32_t list_limit = 20;
NakamaClient->listStorageObjects(
	NakamaSession, 
	CollectionName, 
	list_limit, 
	Cursor, 
	ListStorageSuccessCallback, 
	ListStorageErrorCallback
);

Log on Nakama back-end in before hook:

{"level":"debug","ts":"2022-10-28T10:23:35.562Z",
"caller":"nakama-project-template/before_list_storage.go:38",
"msg":"Collection: xxx | Limit: 513",
"runtime":"go","api_id":"liststorageobjects","mode":"before"}

So, value for limit changed from 1 to 513.

Call from listMatches on game client:

const int32_t min_size = 1;
const int32_t max_size = 9;
const int32_t list_limit = 20;
NakamaClient->listMatches(
	NakamaSession, 
	min_size, 
	max_size, 
	list_limit, 
	std::string(""), 
	false, 
	ListMatchesSuccessCallback, 
	ListMatchesErrorCallback
);

Log on Nakama back-end in before hook:

{"level":"debug","ts":"2022-10-28T10:23:35.435Z",
"caller":"nakama-project-template/before_list_matches.go:39",
"msg":"MinSize: 1 | MaxSize: 1 | Limit: 33281",
"runtime":"go","api_id":"listmatches","mode":"before"}

So values for MinSize, MaxSize and Limit changed from 1, 9 and 20 to 1, 1 and 33281.

I have created a workaround by creating before hooks for these calls where I check integer values and if they have become broken I change them to intended values.

We have tried many different ways to fix this issue: inputting literal values, defining global constants, class constants, but problem remains. And there are no rules how integer value will change, will it increase, decrease or remain unchanged.

Another problem was that when these integer values get changed to something not valid, we did not received any kind of Error Callback on client side, which made debugging of this issues difficult.

Also, there is a plug-in crash issue connected to this problems. As these API calls (with bad integer parameters values) are made and no error callbacks are received, after 30 or more calls, without any response callback, plug-in crashes.

Hey Dachadan we’re taking a look. Are you running on Windows?

Yes, Windows 10 Pro. Microsoft Visual Studio 2019 Version 16.11.20

Thanks – could you share what version of the SDK you are using? If you aren’t on v2.6.0 could you upgrade to it?

We are at [2.5.0] - [2021-09-13]. We will upgrade to v2.6.0 and test.

1 Like

Thanks. You can see the release notes here: Release v2.6.0 · heroiclabs/nakama-unreal · GitHub