Hi again
I am attempting to use the feature of Nakama where users can add friends to their friend list.
My Unity code is as follows to send the request (this is taken from the Pirate Panic Nakama example):
public async void AddFriend()
{
try
{
string[] usernames = { _usernameSearcher.InputFieldValue };
await _connection.Client.AddFriendsAsync(_connection.Session, new string[] {}, usernames);
ActualizeFriendsList();
}
catch (Exception e) //catching exception, if program entered this code adding friend operation was not successfully completed
{
Debug.LogError("Adding friend failed (" + e.Message + ")");
}
}
When sending the friend request, this error is sent back:
Cannot create a data handler without payload data
The full error stacktrace:
at UnityEngine.Networking.UploadHandlerRaw..ctor (System.Byte[] data) [0x00017] in <39536a03ec01488d9573f19141ef4b8b>:0
at Nakama.UnityWebRequestAdapter.BuildRequest (System.String method, System.Uri uri, System.Collections.Generic.IDictionary`2[TKey,TValue] headers, System.Byte[] body, System.Int32 timeout) [0x00023] in C:\Users\User\Unity\relic-nakama\Relic\Assets\Nakama\Runtime\UnityWebRequestAdapter.cs:91
at Nakama.UnityWebRequestAdapter.SendAsync (System.String method, System.Uri uri, System.Collections.Generic.IDictionary`2[TKey,TValue] headers, System.Byte[] body, System.Int32 timeout, System.Nullable`1[T] cancellationToken) [0x00007] in C:\Users\User\Unity\relic-nakama\Relic\Assets\Nakama\Runtime\UnityWebRequestAdapter.cs:76
at Nakama.ApiClient+<AddFriendsAsync>d__42.MoveNext () [0x0012f] in <3930c37f95f7433fa71239b42efdd1f6>:0
--- End of stack trace from previous location where exception was thrown ---
at Nakama.RetryInvoker+<InvokeWithRetry>d__7.MoveNext () [0x001a6] in <3930c37f95f7433fa71239b42efdd1f6>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <695d1cc93cca45069c528c15c9fdd749>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <695d1cc93cca45069c528c15c9fdd749>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <695d1cc93cca45069c528c15c9fdd749>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <695d1cc93cca45069c528c15c9fdd749>:0
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
at Nakama.Client+<AddFriendsAsync>d__39.MoveNext () [0x001cc] in <3930c37f95f7433fa71239b42efdd1f6>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <695d1cc93cca45069c528c15c9fdd749>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <695d1cc93cca45069c528c15c9fdd749>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <695d1cc93cca45069c528c15c9fdd749>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <695d1cc93cca45069c528c15c9fdd749>:0
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
at Relic.FriendsMenuUI+<AddFriend>d__25.MoveNext () [0x00076] in C:\Users\User\Unity\relic-nakama\Relic\Assets\Relic\Scripts\Menus\FriendsMenuUI.cs:218
Thank you for the help
- Versions: Nakama {3.11.0}, {Docker}, {Unity Client 3.3.0}
- Server Framework Runtime language (If relevant) TS/JS}