There were a lot of soldiers getting off the ship with Lance, all disguised as pirates. Every detached group was led by elite veterans. When they sensed that, as the news spread, the pirates started madly rushing toward the mountaintop, they knew the time had come. As they sent up the signal, they followed the plan and tied red cloth around their left arms.
Once the red cloth was on, those soldiers stopped hiding who they were and started carrying out their assigned tasks. First priority was to take the docks and cut off most of the pirates' escape routes.
It's been mentioned before that this harbor is split into sections, each with someone charging fees. The plan to seize the docks was simple, and it tied directly into how the docks were divided up: several big pirates had carved it into different zones, and each zone had its own features.
