tolti fixme e todo

This commit is contained in:
Lorenzo Bianchi 2023-06-18 16:13:05 +02:00
parent a01e90cce4
commit af6c6d03f4
11 changed files with 65 additions and 11 deletions

View File

@ -53,7 +53,7 @@ test: comp
comp: server_c client_c
server_c:
@ mkdir bin
@ mkdir bin -p
gcc src/F4Server.c src/custom_sem.c src/custom_shm.c src/custom_sig.c src/custom_msgq.c src/errExit.c src/forza4.c src/client.c src/server.c -o bin/F4Server -I inc/
client_c:
gcc src/F4Client.c src/custom_sem.c src/custom_shm.c src/custom_sig.c src/custom_msgq.c src/errExit.c src/forza4.c src/client.c src/server.c -o bin/F4Client -I inc/

View File

@ -7,4 +7,10 @@ extern pid_t SERVER_PID;
void setupClient(int argc, char *argv[]);
#endif
#endif
/************************************
*VR471576
*Lorenzo Bianchi
*16/06/2023
*************************************/

View File

@ -54,4 +54,10 @@ void sndMove(move_t *move);
void sndPlayer(player_ds *player);
void sndGame_end(game_end_t *game);
#endif
#endif
/************************************
*VR471576
*Lorenzo Bianchi
*16/06/2023
*************************************/

View File

@ -17,4 +17,10 @@ void setupClientSem();
int getSemid(key_t key, int size);
void semOp(int semid, short sem_num, short sem_op);
#endif
#endif
/************************************
*VR471576
*Lorenzo Bianchi
*16/06/2023
*************************************/

View File

@ -17,4 +17,10 @@ tile_t * shmClientAt();
void shmDt(void *shm_ptr);
void shmServerRm(int shmid);
#endif
#endif
/************************************
*VR471576
*Lorenzo Bianchi
*16/06/2023
*************************************/

View File

@ -10,4 +10,10 @@ void sigHandlerServer(int sig);
void setupServerSignalHandler();
void setupClientSignalHandler();
#endif
#endif
/************************************
*VR471576
*Lorenzo Bianchi
*16/06/2023
*************************************/

View File

@ -5,4 +5,10 @@ void errExit(char *func, char *where);
void warningMsg(char *msg);
void errExitMsg(char *msg);
#endif
#endif
/************************************
*VR471576
*Lorenzo Bianchi
*16/06/2023
*************************************/

View File

@ -32,4 +32,10 @@ void insertMove(int pos, int turn);
int isValid(int pos);
#endif
#endif
/************************************
*VR471576
*Lorenzo Bianchi
*16/06/2023
*************************************/

View File

@ -20,4 +20,10 @@ typedef struct {
void setupServer(int argc, char *argv[]);
void end_game(int winner);
#endif
#endif
/************************************
*VR471576
*Lorenzo Bianchi
*16/06/2023
*************************************/

View File

@ -36,4 +36,10 @@ typedef enum {
PLAYER2
} tile_t;
#endif
#endif
/************************************
*VR471576
*Lorenzo Bianchi
*16/06/2023
*************************************/

View File

@ -30,7 +30,7 @@ void setupClientShm() {
}
int getShmidClient() {
return shmget(ftok(KEYFILE, SHMKEY), _ROWS * _COLLUMS * sizeof(tile_t), S_IRUSR | S_IWUSR);
return shmget(ftok(KEYFILE, SHMKEY), _ROWS * _COLLUMS * sizeof(tile_t), IPC_CREAT | S_IRUSR | S_IWUSR);
}
int getShmidServer() {