#ifndef __I_CLMAIN_H__
#define __I_CLMAIN_H__

#include "i_net.h"
#include "d_ticcmd.h"

extern netadr_t  serveraddr;

// some QW code again...
typedef enum 
{
	ca_disconnected,   // full screen console with no connection
	ca_demostart,      // starting up a demo
	ca_connected,      // netchan_t established, waiting for svc_serverdata
	ca_onserver,       // processing data lists, donwloading, etc
	ca_active          // everything is in, so frames can be rendered
} cactive_t;

extern cactive_t clact;


extern bool		noservermsgs;
extern int		last_received;
extern int		oldgametic;	// [BC]

extern buf_t     net_buffer;

#define MAXSAVETICS 70
extern struct ticcmd_t  localcmds[MAXSAVETICS];

extern bool predicting;

void CL_QuitNetGame(void);
void CL_SpawnMobj(void);
void CL_InitNetwork (void);
void CL_TryToConnect(void);
void CL_ParseCommands(void);
void CL_ReadPacketHeader(void);
void CL_SendCmd(void);
void CL_SaveCmd(void);
void CL_MoveThing(AActor *mobj, fixed_t x, fixed_t y, fixed_t z);
void CL_PredictMove (void);
void CL_SendUserInfo(void);
bool CL_Connect(void);

#endif