The narrative of "The Most Dangerous Game" does not include details on how Rainsford has managed to gain access to the general's room. However, when he is fleeing the dogs after having set a trap with a knife that kills Ivan, Rainsford looks down at the sea, and before he leaps twenty feet into the water, he notices that across a cove he is able to see the "gloomy gray stone of the chateau."
Apparently, then, Rainsford swims the distance to the chateau after having jumped into the sea to escape the pursuit of the general, Ivan, and the dogs. Earlier in the narrative, when Rainsford has awakened from sleeping on the beach where he has washed ashore, he sees what he thinks are lights from a village; following them, he finds
a palatial chateau; it was set on a high bluff, and on three sides of it cliffs dived down to where the sea licked greedy lips in the shadows.
So, Rainford knows that he can access the chateau from the one side that has land. Swimming in the bay until he reaches the shore, he probably scales the wall and enters through a window outside the general's room, or he gains entrance at another spot and comes to Zaroff's room.