private static void SetupUser1() { Client.Send(NFriendAddMessage.ById(NakamaManager.Instance.Session.Id), b => { }, ErrorHandler); var builder = new NGroupCreateMessage.Builder("Thanksgiving"); builder.Description("Turkey eating at my house!"); builder.Lang("en"); Client.Send(builder.Build(), b => { }, ErrorHandler); }
private static void SetupMainUser() { // let's add two users as friends NakamaManager.Instance.FriendAdd(NFriendAddMessage.ById(_user1Session.Id), false); NakamaManager.Instance.FriendAdd(NFriendAddMessage.ById(_user2Session.Id), false); var builder = new NGroupCreateMessage.Builder("School friends"); builder.Description("Weekend getaway"); builder.Lang("en"); NakamaManager.Instance.GroupCreate(builder.Build()); builder = new NGroupCreateMessage.Builder("Iranian friends"); builder.Description("Loving groups of Farsi speaking friends!"); builder.Lang("fa"); NakamaManager.Instance.GroupCreate(builder.Build()); }
public void AddFriendAgain() { ManualResetEvent evt = new ManualResetEvent(false); var committed = false; var message = NFriendAddMessage.ById(FriendUserId); client.Send(message, (bool completed) => { committed = completed; evt.Set(); }, _ => { evt.Set(); }); evt.WaitOne(1000, false); Assert.IsTrue(committed); }
private static void SetupUser3() { Client.Send(NFriendAddMessage.ById(NakamaManager.Instance.Session.Id), b => { }, ErrorHandler); }
public void AcceptFriend() { var friend = StateManager.Instance.Friends[_friendSelectorDropdown.value]; NakamaManager.Instance.FriendAdd(NFriendAddMessage.ById(friend.Id)); }