Beispiel #1
0
        /// <summary>
        /// Gets the player's pending friends
        /// </summary>
        /// <returns>The list of pending friends</returns>
        public List <Friend> GetPending()
        {
            RequestPending();
            GetPendingEvent pendingEvent = WaitForServerEvent <GetPendingEvent>(Timeout);

            if (pendingEvent == null)
            {
                return(null);
            }

            return(pendingEvent.Pending);
        }
        /// <summary>
        /// Processes the message
        /// </summary>
        /// <param name="connectionBase">The connection base</param>
        /// <param name="message">The playerio message</param>
        /// <param name="handled">Whether the message was already handled</param>
        public void Process(ConnectionBase connectionBase, Message message, bool handled)
        {
            List <Friend> pending = new List <Friend>();

            for (uint i = 0; i < message.Count; i++)
            {
                Friend pendingFriend = new Friend((LobbyConnection)connectionBase, message.GetString(i));
                pending.Add(pendingFriend);
            }

            GetPendingEvent getPendingEvent = new GetPendingEvent()
            {
                Pending = pending,
                Raw     = message
            };

            connectionBase.RaiseServerEvent <GetPendingEvent>(getPendingEvent);
        }