1 /**********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12 ***********************************************************************/
13 #ifndef FC__CONNECTHAND_H
14 #define FC__CONNECTHAND_H
16 #include "support.h" /* bool type */
22 struct packet_authentication_reply
;
23 struct packet_login_request
;
24 struct packet_server_join_req
;
26 void conn_set_access(struct connection
*pconn
, enum cmdlevel new_level
,
29 void establish_new_connection(struct connection
*pconn
);
30 void reject_new_connection(const char *msg
, struct connection
*pconn
);
32 bool handle_login_request(struct connection
*pconn
,
33 struct packet_server_join_req
*req
);
35 void lost_connection_to_client(struct connection
*pconn
);
37 void send_conn_info(struct conn_list
*src
, struct conn_list
*dest
);
38 void send_conn_info_remove(struct conn_list
*src
, struct conn_list
*dest
);
40 struct player
*find_uncontrolled_player(void);
41 bool connection_attach(struct connection
*pconn
, struct player
*pplayer
,
43 void connection_detach(struct connection
*pconn
, bool remove_unused_player
);
45 bool connection_delegate_take(struct connection
*pconn
,
46 struct player
*pplayer
);
47 bool connection_delegate_restore(struct connection
*pconn
);
49 void connection_close_server(struct connection
*pconn
, const char *reason
);
51 #endif /* FC__CONNECTHAND_H */