#include <fcntl.h>
#include <netdb.h>
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>

#include "announce.h"
#include "bomber.h"
#include "draw.h"
#include "game.h"
#include "gfx.h"
#include "menu.h"
#include "network.h"
#include "sound.h"
#include "utils.h"

int main(void) {
	char* p;

	strcpy(playername, "ANONYMOUS");
	p = getenv("USER");
	if (p) strncpy(playername, p, sizeof(playername) - 1);

	create_seed_unique();

	opengfx();
	getsocket();
	if (!initannouncer()) exit(1);

	soundopen();
	loadgfx();

	pulseon();
	mainloop();

	soundclose();
	freeannouncer();
	freesocket();
	closegfx();
	return 0;
}
