Beispiel #1
0
        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);
        }
Beispiel #2
0
        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());
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
 private static void SetupUser3()
 {
     Client.Send(NFriendAddMessage.ById(NakamaManager.Instance.Session.Id), b => { }, ErrorHandler);
 }
Beispiel #5
0
        public void AcceptFriend()
        {
            var friend = StateManager.Instance.Friends[_friendSelectorDropdown.value];

            NakamaManager.Instance.FriendAdd(NFriendAddMessage.ById(friend.Id));
        }