When any affray shall happen during the sitting of any court within this State and within the hearing or to the disturbance of the court, the court shall order the sheriff or other lawful officer to take the affrayers or other disturbers of the peace or those guilty of contempt and bring the offenders before the court and the court shall make such order thereon as may be consistent with law, justice and good order.