Duplicate code in client_events.c and server_events.c. Let's have events/common.c and a function containing that code.