/*
===========================================================================
Copyright (C) 1999-2005 Id Software, Inc.
Copyright (C) 2006 Robert Beckebans <trebor_7@users.sourceforge.net>

This file is part of XreaL source code.

XreaL source code is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.

XreaL source code is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with XreaL source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
===========================================================================
*/

// protocol.h
#ifndef PROTOCOL_H
#define PROTOCOL_H

//Ignore __attribute__ on non-gcc platforms
#ifndef __GNUC__
#ifndef __attribute__
#define __attribute__(x)
#endif
#endif

/*
==============================================================

PROTOCOL

==============================================================
*/

//#define FORTEV_NET_TEST // raynorpat: allows evq3 to work with FortEv tests on my lan
//#define OPENARENA	//raynorpat: allows evq3 to be compatible with OpenArena

#define	PROTOCOL_VERSION 68
#define EVQ3_PROTOCOL_VERSION 70
// 1.31 - 67
// 1.30 - 66
// 1.2x - 48

// maintain a list of compatible protocols for demo playing
// NOTE: Only works with two digit protocols...
extern int demo_protocols[];

#ifndef FORTEV_NET_TEST
#define	UPDATE_SERVER_NAME		"update.quake3arena.com"
#define MASTER_SERVER_NAME		"master.quake3arena.com"
#define	AUTHORIZE_SERVER_NAME	"authorize.quake3arena.com"
#elif OPENARENA
#define	UPDATE_SERVER_NAME		"update.quake3arena.com"
#define MASTER_SERVER_NAME		"dpmaster.deathmask.net"
#define	AUTHORIZE_SERVER_NAME	""
#else
#define	UPDATE_SERVER_NAME		"update.quake3arena.com"
#define MASTER_SERVER_NAME		"192.168.2.5"
#define	AUTHORIZE_SERVER_NAME	""
#endif

#define	PORT_MASTER				27950
#define	PORT_UPDATE				27951
#define	PORT_AUTHORIZE			27952
#define	PORT_SERVER				27960

#define	NUM_SERVER_PORTS		4	// broadcast scan this many ports after PORT_SERVER so a single machine can run multiple servers.

// the svc_strings[] array in cl_parse.c should mirror these:

// server to client
enum svc_ops_e
{
	svc_bad,
	svc_nop,
	svc_gamestate,
	svc_configstring,			// [short] [string] only in gamestate messages
	svc_baseline,				// only in gamestate messages
	svc_serverCommand,			// [string] to be executed by client game module
	svc_download,				// [short] size [size bytes]
	svc_snapshot,
	svc_EOF
};

// client to server
enum clc_ops_e
{
	clc_bad,
	clc_nop,
	clc_move,					// [[usercmd_t]
	clc_moveNoDelta,			// [[usercmd_t]
	clc_clientCommand,			// [string] message
	clc_EOF
};

#endif // PROTOCOL_H
