messi set

This commit is contained in:
Lorenzo Bianchi 2023-05-17 10:45:16 +02:00
parent 5fd1e35411
commit a8a4caaddb
2 changed files with 3 additions and 2 deletions

View File

@ -47,7 +47,7 @@ typedef struct {
typedef struct {
long mtype; // type 3
int id;
char name_player[MAX_NAME];
char *name_player;
} player_names_t;
#endif

View File

@ -151,7 +151,7 @@ int main(int argc, char *argv[]){
semOp(semid, 2, -1);
player_names_t names; // lo so si possono usare nomi piu chiari ma problema tuo (mi riferisco a te e me futuro)
char name[2][MAX_NAME];
char *name[2];
// ricevuta nome primo client
if (msgrcv(msgid, &names, sizeof(player_names_t) - sizeof(long), 3, 0) == -1) {
@ -159,6 +159,7 @@ int main(int argc, char *argv[]){
}
// name[names.id] = names.name_player;
printfServer("Player ");
printf("%s connected\n", name[names.id]);