Dice source code for both server and client