In 1888 , Brunei became a British protectorate ; independence was achieved in 1984 .