32 #define SPECLIST_TAG voteinfo
33 #define SPECLIST_TYPE struct voteinfo
35 #define voteinfo_list_iterate(alist, pitem) \
36 TYPED_LIST_ITERATE(struct voteinfo, alist, pitem)
37 #define voteinfo_list_iterate_end LIST_ITERATE_END
51 "%s() called before votinfo_queue_init()!",
68 struct voteinfo_list *removed;
75 removed = voteinfo_list_new();
78 if (vi !=
nullptr && vi->remove_time > 0 && now - vi->remove_time > 2) {
79 voteinfo_list_append(removed, vi);
87 if (voteinfo_list_size(removed) > 0) {
91 voteinfo_list_destroy(removed);
102 "%s() called before votinfo_queue_init()!",
123 "%s() called before votinfo_queue_init()!",
147 "%s() called before votinfo_queue_init()!",
220 if (vi !=
nullptr && pindex !=
nullptr) {
234 struct packet_vote_submit packet;
262 send_packet_vote_submit(&
client.
conn, &packet);
bool can_client_control()
Returns TRUE iff the client can control player.
#define fc_assert_ret_msg(condition, message,...)
#define fc_assert_ret_val_msg(condition, val, message,...)
client_options * gui_options
bool voteinfo_bar_new_at_front
enum client_vote_type client_vote
#define sz_strlcpy(dest, src)
static int voteinfo_queue_current_index
void voteinfo_queue_delayed_remove(int vote_no)
Remove the vote with number 'vote_no' after a small amount of time so that the user can see that it w...
void voteinfo_do_vote(int vote_no, enum client_vote_type vote)
Convenience function for submitting a vote to the server.
struct voteinfo * voteinfo_queue_get_current(int *pindex)
Get the voteinfo record at the start of the vote queue.
void voteinfo_queue_init()
Initialize data structures used by this module.
void voteinfo_queue_remove(int vote_no)
Remove the given vote from the queue immediately.
#define voteinfo_list_iterate(alist, pitem)
void voteinfo_queue_next()
Cycle through the votes in the queue.
void voteinfo_queue_free()
Free memory allocated by this module.
int voteinfo_queue_size()
Returns the number of pending votes.
struct voteinfo * voteinfo_queue_find(int vote_no)
Find the voteinfo record corresponding to the given vote number.
static struct voteinfo_list * voteinfo_queue
#define voteinfo_list_iterate_end
void voteinfo_queue_check_removed()
Check for old votes that should be removed from the queue.
void voteinfo_queue_add(int vote_no, const char *user, const char *desc, int percent_required, int flags)
Create a new voteinfo record and place it in the queue.
void voteinfo_gui_update(void)
Refresh all vote related GUI widgets.