1 /* 2 * Biloba 3 * Copyright (C) 2004-2008 Guillaume Demougeot, Colin Leroy 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 18 */ 19 20 #ifndef __NET_H__ 21 #define __NET_H__ 22 23 #include "utils.h" 24 #include "player.h" 25 #include "llist.h" 26 #include "game.h" 27 28 void net_init(void); 29 void net_stop(void); 30 int net_init_game(const char *gamename, int numplayers, 31 InputSystemMethod methods[], char *names[]); 32 int net_wait_ready(int num_players, char **player_names); 33 LList *net_get_games(int numplayer); 34 int net_get_info(Game *game); 35 int net_join(int id, int nump, const char *my_player_name); 36 void net_send_event(int player, int x, int y); 37 void net_get_event(int player, int *x, int *y); 38 void net_end_game(int player); 39 void net_close(void); 40 void net_set_server(const char *srv); 41 int net_get_servers(char ***distant_servers); 42 void net_stop_getting_servers(void); 43 44 void net_pull_recv_msg(void); 45 46 int net_is_typing_msg(void); 47 void net_set_typing_msg(int typing); 48 const char *net_get_pending_msg(void); 49 void net_type_msg(unsigned char c); 50 51 #endif 52