﻿using galaxy.core.communication.packets.outgoing.messenger;
using galaxy.core.communication.packets.outgoing.rooms.session;
using galaxy.core.habbolib.gameclients;
using galaxy.core.habbolib.rooms;

namespace galaxy.core.communication.packets.incoming.messenger
{
    class FindNewFriendsEvent : IPacketEvent
    {
        public void handle(GameClient Session, ClientPacket Packet)
        {
            Room Instance = GalaxyEnvironment.GetGame().GetRoomManager().TryGetRandomLoadedRoom();

            if (Instance != null)
            {
                Session.SendPacket(new FindFriendsProcessResultComposer(true));
                Session.SendPacket(new RoomForwardComposer(Instance.id));
            }
            else
            {
                Session.SendPacket(new FindFriendsProcessResultComposer(false));
            }
        }
    }
}
