Exemple #1
0
 private static void on_friend_removed_you(Event_FriendRemovedYou ev)
 {
     if (!BasicPlayerInfoOps.RemoveOne(friends, ev.PlayerInfo))
     {
         Debug.Log("Server told us a friend has been removed but the data store did not know about the friend.");
     }
 }
Exemple #2
0
 private static void on_friend_request(Event_FriendAcceptedRequest ev)
 {
     if (BasicPlayerInfoOps.Contains(pending_friends_incoming, ev.PlayerInfo))
     {
         Debug.LogErrorFormat("Request from {0} is already pending.", ev.PlayerInfo.DisplayName);
         return;
     }
     pending_friends_incoming.Add(ev.PlayerInfo);
 }
Exemple #3
0
        private static void on_friend_accepted_request(Event_FriendAcceptedRequest ev)
        {
            if (!BasicPlayerInfoOps.RemoveOne(pending_friends_outgoing, ev.PlayerInfo))
            {
                Debug.Log("Server told us a friend request has been accepted but the data store did not know about the outgoing friend request.");
            }

            friends.Add(ev.PlayerInfo);
        }
Exemple #4
0
 private static void on_remove_friend(BasicPlayerInfo player, RemoveFriendResult r)
 {
     if (r.NoLongerFriend)
     {
         if (!BasicPlayerInfoOps.RemoveOne(friends, player))
         {
             Debug.Log("Tried to remove friend but friend was not well... a friend.");
         }
     }
 }
Exemple #5
0
 private static void on_unignored_player(BasicPlayerInfo player, UnIgnorePlayerResult r)
 {
     if (!r.IsIgnored)
     {
         if (!BasicPlayerInfoOps.RemoveOne(ignored, player))
         {
             Debug.LogError("Server said to us player is ignored but according to the data store the player was never ignored!");
         }
     }
 }
Exemple #6
0
        private static void on_friend_online_state_changed(Event_FriendOnlineStateChanged ev)
        {
            var friend = BasicPlayerInfoOps.GetInList(friends, ev.PlayerId);

            if (friend == null)
            {
                Debug.LogError("Server told us about online state of player. But we do not know about the player and server does not send any player info here.");
                return;
            }
            friend.Online = ev.OnlineState == OnlineState.Online;
        }
Exemple #7
0
 private static void on_send_friend_request(BasicPlayerInfo target, FriendRequestResult r)
 {
     if (r.IsNowPending)
     {
         if (BasicPlayerInfoOps.Contains(pending_friends_outgoing, target))
         {
             Debug.LogError("Server added pending outgoing friend but the datastore thinks the player is already in the pending list.");
             return;
         }
         pending_friends_outgoing.Add(target);
     }
 }
Exemple #8
0
        private static void on_answer_friend_request(BasicPlayerInfo player, AnswerFriendRequestResult r)
        {
            if (r.NowFriend)
            {
                if (BasicPlayerInfoOps.Contains(friends, player))
                {
                    Debug.LogError("Server added friend but the data store thinks the player is already a friend");
                    return;
                }

                friends.Add(player);
            }
        }
Exemple #9
0
        private static void on_ignore_player(BasicPlayerInfo player, IgnorePlayerResult r)
        {
            if (r.IsIgnored)
            {
                if (BasicPlayerInfoOps.Contains(ignored, player))
                {
                    Debug.Log("Server said to us player is ignored and the data store already have that player as ignored. Hopefully we just tried to ignore an already ignored player.");
                    return;
                }

                ignored.Add(player);
            }
        }