Commit 3647bea769d5f7d13af7ee97046bbdae9bfecdad
1 parent
9f59b128f3
Exists in
master
Fixed?
Showing 3 changed files with 17 additions and 17 deletions Side-by-side Diff
server/server.c
View file @
3647bea
... | ... | @@ -93,7 +93,7 @@ |
93 | 93 | main(int argc, char *argv[]) |
94 | 94 | { |
95 | 95 | int ssockfd, csockfd, err;; |
96 | - unsigned int magic, x, y; | |
96 | + unsigned short magic, x, y; | |
97 | 97 | unsigned int u; |
98 | 98 | struct addrinfo hints, *srvinfo, *p; |
99 | 99 | struct sockaddr_storage caddr; |
... | ... | @@ -293,7 +293,7 @@ |
293 | 293 | |
294 | 294 | if ((nbytes = recv(i, &magic, sizeof magic, 0 )) <= 0) |
295 | 295 | { |
296 | - if (nbytes < 0) | |
296 | + if (nbytes < 0) | |
297 | 297 | { |
298 | 298 | perror("recv"); |
299 | 299 | } |
... | ... | @@ -324,11 +324,11 @@ |
324 | 324 | Player *coll; |
325 | 325 | int movPnum = justMoved->playerno; |
326 | 326 | |
327 | - /* | |
328 | - * If the player that just moved is a hunter, and it | |
329 | - * just stepped on a regular player, kill the (regular) | |
330 | - * player! | |
331 | - */ | |
327 | + /* | |
328 | + * If the player that just moved is a hunter, and it | |
329 | + * just stepped on a regular player, kill the (regular) | |
330 | + * player! | |
331 | + */ | |
332 | 332 | if (justMoved->type && |
333 | 333 | (coll = check_collision(pset, justMoved)) != NULL) |
334 | 334 | { |
... | ... | @@ -340,10 +340,10 @@ |
340 | 340 | FD_CLR(dead, &master); |
341 | 341 | } |
342 | 342 | |
343 | - /* | |
344 | - * Avoid sending the data to the current client and | |
345 | - * server. | |
346 | - */ | |
343 | + /* | |
344 | + * Avoid sending the data to the current client and | |
345 | + * server. | |
346 | + */ | |
347 | 347 | if (j != ssockfd |
348 | 348 | && j != i |
349 | 349 | && sendMov(j, movPnum, x, y) == -1) |
... | ... | @@ -374,7 +374,7 @@ |
374 | 374 | { |
375 | 375 | char *pname; |
376 | 376 | unsigned char pnum; |
377 | - unsigned int magic; | |
377 | + unsigned short magic; | |
378 | 378 | unsigned int u; |
379 | 379 | |
380 | 380 | /* |
... | ... | @@ -416,7 +416,7 @@ |
416 | 416 | } |
417 | 417 | |
418 | 418 | static void |
419 | -send_dc(Player *p, int pno_removed, unsigned int sig) | |
419 | +send_dc(Player *p, int pno_removed, unsigned short sig) | |
420 | 420 | { |
421 | 421 | sendshort(p->fd, sig); |
422 | 422 | sendshort(p->fd, pno_removed); |
... | ... | @@ -492,7 +492,7 @@ |
492 | 492 | void |
493 | 493 | begin_game(Player_set *pset) |
494 | 494 | { |
495 | - unsigned int magic; | |
495 | + unsigned short magic; | |
496 | 496 | int j = 0,i = 0; |
497 | 497 | short int hpno = mrand(0, pset->last_pno); |
498 | 498 | Player *cur, *info; |
server/server.h
View file @
3647bea
... | ... | @@ -59,7 +59,7 @@ |
59 | 59 | void rm_player(Player_set *set, Player *p); |
60 | 60 | Player *player_byfd(Player_set *s, int fd); |
61 | 61 | Player *player_byindex(Player_set *s, int fd); |
62 | -void pset_map(Player_set *s, void (*func)(), int fd, unsigned int sig); | |
62 | +void pset_map(Player_set *s, void (*func)(), int fd, unsigned short sig); | |
63 | 63 | |
64 | 64 | int mrand(int floor, int ceil); |
65 | 65 | void handle_connecting_player(int newfd, Player_set *pset); |
server/srv_player.c
View file @
3647bea
... | ... | @@ -115,8 +115,8 @@ |
115 | 115 | } |
116 | 116 | |
117 | 117 | void |
118 | -pset_map(Player_set *s, void (*func)(Player *p, int a, unsigned int sig), | |
119 | - int fd, unsigned int sig) | |
118 | +pset_map(Player_set *s, void (*func)(Player *p, int a, unsigned short sig), | |
119 | + int fd, unsigned short sig) | |
120 | 120 | { |
121 | 121 | Player *this = s->first; |
122 | 122 |