Update paths/build/package name/etc. to 'attac-man'
[attac-man.git] / include / net.h
blob3b07a22f16c61f4502aeff6857b529bae40f60f4
1 /*
2 Pacman Arena
3 Copyright (C) 2003 Nuno Subtil
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
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.
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 /* $Id: net.h,v 1.1 2003/11/27 22:11:57 nsubtil Exp $ */
22 #ifndef _NET_H
23 #define _NET_H
25 extern int server_running;
26 extern int client_running;
28 /* new connection request */
29 #define PTYPE_REQ_NEWCONN 1
30 struct packet_newconn
34 /* connection accepted */
35 #define PTYPE_REPLY_CONNOK 2
36 struct packet_r_connok
38 int player_id;
41 #define NET_PACMAN_PORT 1203
42 #define NET_MAX_PACKET_SIZE 10
44 void net_server_init(void);
45 void net_client_init(char *hostname);
46 void net_wait_packet(UDPsocket sock, UDPpacket *pack);
47 void net_send_packet(UDPsocket sock, Uint8 ptype, void *pdata, IPaddress dest);
48 void net_encode(UDPpacket *pack, Uint8 ptype, void *pdata);
49 int net_decode_ptype(UDPpacket *pack);
50 void net_decode_pdata(UDPpacket *pack, void *data);
51 void net_pack_byte(UDPpacket *pack, Uint8 value);
52 void net_pack_int32(UDPpacket *pack, Uint32 value);
53 void net_server_update(void);
54 void net_client_update(void);
56 #endif