UDP was never made to be reliable. If you want reliability, use TCP, reliability is built in.
That said, if you want to make your own bloated version of UDP that has reliability you may want to code some of the following features:
- Packet numbering / sequencing - UDP packets arrive out of order, so you can either hard code only sending the next packet when you receive an acknowledgement that it has arrived, or you can put a sequence number and have the receiver rebuild the packets.
- Delivery acknowledgement (ACK) - server sends an ACK that the message was received. Also remember that the server may send an ACK, but the client may not get it, so you could be stuck receiving a packet that you already have because the client doesn't get your message saying that you received it.
- Resend timeout - resend the packet if you didn't receive an ACK for it after a while, you'll obviously want to limit this otherwise your protocol would be vulnerable to being abused in a DDoS attack.
- Packet checksums - make sure the data integrity is kept, otherwise don't ACK the packet and wait for it to be sent again.
- Packet length prefixes - easier for the server to determine how much data you sent.
Easily said... just use TCP for reliability.