diff --git a/server/server.c b/server/server.c index 80a74bf..ea1b94f 100644 --- a/server/server.c +++ b/server/server.c @@ -93,7 +93,7 @@ int main(int argc, char *argv[]) { int ssockfd, csockfd, err;; - unsigned int magic, x, y; + unsigned short magic, x, y; unsigned int u; struct addrinfo hints, *srvinfo, *p; struct sockaddr_storage caddr; @@ -293,7 +293,7 @@ main(int argc, char *argv[]) if ((nbytes = recv(i, &magic, sizeof magic, 0 )) <= 0) { - if (nbytes < 0) + if (nbytes < 0) { perror("recv"); } @@ -324,11 +324,11 @@ main(int argc, char *argv[]) Player *coll; int movPnum = justMoved->playerno; - /* - * If the player that just moved is a hunter, and it - * just stepped on a regular player, kill the (regular) - * player! - */ + /* + * If the player that just moved is a hunter, and it + * just stepped on a regular player, kill the (regular) + * player! + */ if (justMoved->type && (coll = check_collision(pset, justMoved)) != NULL) { @@ -340,10 +340,10 @@ main(int argc, char *argv[]) FD_CLR(dead, &master); } - /* - * Avoid sending the data to the current client and - * server. - */ + /* + * Avoid sending the data to the current client and + * server. + */ if (j != ssockfd && j != i && sendMov(j, movPnum, x, y) == -1) @@ -374,7 +374,7 @@ handle_connecting_player(int newfd, Player_set *pset) { char *pname; unsigned char pnum; - unsigned int magic; + unsigned short magic; unsigned int u; /* @@ -416,7 +416,7 @@ handle_connecting_player(int newfd, Player_set *pset) } static void -send_dc(Player *p, int pno_removed, unsigned int sig) +send_dc(Player *p, int pno_removed, unsigned short sig) { sendshort(p->fd, sig); sendshort(p->fd, pno_removed); @@ -492,7 +492,7 @@ choose_hunter(Player_set *pset) void begin_game(Player_set *pset) { - unsigned int magic; + unsigned short magic; int j = 0,i = 0; short int hpno = mrand(0, pset->last_pno); Player *cur, *info; diff --git a/server/server.h b/server/server.h index 1d4cf93..749deb5 100644 --- a/server/server.h +++ b/server/server.h @@ -59,7 +59,7 @@ void add_player(Player_set *set); void rm_player(Player_set *set, Player *p); Player *player_byfd(Player_set *s, int fd); Player *player_byindex(Player_set *s, int fd); -void pset_map(Player_set *s, void (*func)(), int fd, unsigned int sig); +void pset_map(Player_set *s, void (*func)(), int fd, unsigned short sig); int mrand(int floor, int ceil); void handle_connecting_player(int newfd, Player_set *pset); diff --git a/server/srv_player.c b/server/srv_player.c index 74aa3a1..f095bba 100644 --- a/server/srv_player.c +++ b/server/srv_player.c @@ -115,8 +115,8 @@ player_byindex(Player_set *s, int index) } void -pset_map(Player_set *s, void (*func)(Player *p, int a, unsigned int sig), - int fd, unsigned int sig) +pset_map(Player_set *s, void (*func)(Player *p, int a, unsigned short sig), + int fd, unsigned short sig) { Player *this = s->first;