int serveur_ecrire(prot_params_t params, int clientfd, prot_reponse_t * rep_client){ if(params.type==sock_tcp){ return h_writes (clientfd, (char *) (rep_client), sizeof (prot_reponse_t)); }else{ return -1; } }
void sendMessage(int idPlayer, Move dpl, TypeMess t_mss) { uint8_t mess = 0x00; mess = idPlayer << 5; switch(t_mss) { case MOVE: mess = (dpl << 2) | MOVE; break; case CONNECT: // Le joueur envoie un message de déconnexion mess = 1 << 3 | CONNECT; break; default: break; } tampon_Send[0] = mess; h_writes(num_soc, tampon_Send, sizeof(char)); }