1 | |
1 | |
2 | /* |
2 | /* |
3 | * static char *rcsid_loop_c = |
3 | * static char *rcsid_loop_c = |
4 | * "$Id: loop.c,v 1.1 2006/02/03 07:14:44 root Exp $"; |
4 | * "$Id: loop.c,v 1.2 2006/04/17 06:11:40 root Exp $"; |
5 | */ |
5 | */ |
6 | |
6 | |
7 | /* |
7 | /* |
8 | CrossFire, A Multiplayer game for X-windows |
8 | CrossFire, A Multiplayer game for X-windows |
9 | |
9 | |
… | |
… | |
78 | */ |
78 | */ |
79 | |
79 | |
80 | typedef void (*func_uint8_int_ns) (char*, int, NewSocket *); |
80 | typedef void (*func_uint8_int_ns) (char*, int, NewSocket *); |
81 | |
81 | |
82 | struct NsCmdMapping { |
82 | struct NsCmdMapping { |
83 | char *cmdname; |
83 | const char *cmdname; |
84 | func_uint8_int_ns cmdproc; |
84 | func_uint8_int_ns cmdproc; |
85 | }; |
85 | }; |
86 | |
86 | |
87 | typedef void (*func_uint8_int_pl)(char*, int, player *); |
87 | typedef void (*func_uint8_int_pl)(char*, int, player *); |
88 | struct PlCmdMapping { |
88 | struct PlCmdMapping { |
89 | char *cmdname; |
89 | const char *cmdname; |
90 | func_uint8_int_pl cmdproc; |
90 | func_uint8_int_pl cmdproc; |
91 | uint8 flag; |
91 | uint8 flag; |
92 | }; |
92 | }; |
93 | |
93 | |
94 | /** |
94 | /** |
… | |
… | |
113 | { "ncom", (func_uint8_int_pl)NewPlayerCmd, 1}, |
113 | { "ncom", (func_uint8_int_pl)NewPlayerCmd, 1}, |
114 | { "lookat", LookAt, 1}, |
114 | { "lookat", LookAt, 1}, |
115 | { "lock", (func_uint8_int_pl)LockItem, 1}, |
115 | { "lock", (func_uint8_int_pl)LockItem, 1}, |
116 | { "mark", (func_uint8_int_pl)MarkItem, 1}, |
116 | { "mark", (func_uint8_int_pl)MarkItem, 1}, |
117 | { "mapredraw", MapRedrawCmd, 0}, /* Added: phil */ |
117 | { "mapredraw", MapRedrawCmd, 0}, /* Added: phil */ |
|
|
118 | { "mapinfo", MapInfoCmd, 0 }, /* CF+ */ |
118 | { NULL, NULL, 0} /* terminator */ |
119 | { NULL, NULL, 0} /* terminator */ |
119 | }; |
120 | }; |
120 | |
121 | |
121 | /** Face-related commands */ |
122 | /** Face-related commands */ |
122 | static struct NsCmdMapping nscommands[] = { |
123 | static struct NsCmdMapping nscommands[] = { |
… | |
… | |
709 | if (pl->last_weight != -1 && pl->last_weight != WEIGHT(pl->ob)) { |
710 | if (pl->last_weight != -1 && pl->last_weight != WEIGHT(pl->ob)) { |
710 | esrv_update_item(UPD_WEIGHT, pl->ob, pl->ob); |
711 | esrv_update_item(UPD_WEIGHT, pl->ob, pl->ob); |
711 | if(pl->last_weight != WEIGHT(pl->ob)) |
712 | if(pl->last_weight != WEIGHT(pl->ob)) |
712 | LOG(llevError, "esrv_update_item(UPD_WEIGHT) did not set player weight: is %lu, should be %lu\n", (unsigned long)pl->last_weight, WEIGHT(pl->ob)); |
713 | LOG(llevError, "esrv_update_item(UPD_WEIGHT) did not set player weight: is %lu, should be %lu\n", (unsigned long)pl->last_weight, WEIGHT(pl->ob)); |
713 | } |
714 | } |
714 | if (pl->ob->map && pl->ob->map->in_memory==MAP_IN_MEMORY) |
715 | /* draw_client_map does sanity checking that map is |
|
|
716 | * valid, so don't do it here. |
|
|
717 | */ |
715 | draw_client_map(pl->ob); |
718 | draw_client_map(pl->ob); |
716 | if (pl->socket.update_look) esrv_draw_look(pl->ob); |
719 | if (pl->socket.update_look) esrv_draw_look(pl->ob); |
717 | } |
720 | } |
718 | } |
721 | } |
719 | } |
722 | } |
720 | } |
723 | } |