Historical when enterering harbors, the ships signalled to the patrol boats/ships. For every day there was a specific code the ships should use to signal to one another, in order to be recognized as friendly.
So there might be some realism in this suggest