//This is the required header file for using CEBot
//Created by Mine GO BOOM, only required functions are:
//extern "C" __declspec (dllexport) void CALLBACK CEBOT_Cmd(BOT_CMD *bc,BOT_MSG *bm);
//extern "C" __declspec (dllexport) void CALLBACK DATABOT_Cmd(BOT_INFO *bi);
//extern "C" __declspec (dllexport) void CALLBACK WEBBOT_Cmd(BOT_WEB *bw,BOT_MSG2 *bn);

#ifndef CEBOT_HEADER
#define CEBOT_HEADER

#define BOT_HEADER_VERSION		"0.11"		//Do NOT edit this!
#define BOT_HEADER_MIN			"0.11"		//This is used so if the core is updated, but the header stays the same, the core can check a 'range' since the last header major change happened. In other words, ignore...

#define MAX_PLAYERS				256			//max players allowed
#define MAX_BALLS				10			//max balls allowed
#define MAX_FLAGS				256			//max flags allowed
#define MAX_DLLS				50			//max ammount of dlls allowed
#define MAX_ZONE_LIST			50			//max ammount of zones allowed to ping
#define MAX_ARENALENGTH			16			//max length an arena name can be
#define MAX_ARENAS				50			//max # of arenas can have listed, doubtful will ever get to 50 :P
#define MAX_PACKET_SIZE			180			//max length for any chat packet size
#define MAX_MESSAGE_SIZE			512			//max size that a bot message can be
#define MAX_MESSAGE_BUFFER		2			//max ammount of messages that a bot can have stored for it
#define MAX_MESSAGE_ALIVE		5000			//max ammount of time (in ms) a message will be stored for (if it hits over this limit, it may still be stored, but if buffer fills, will then be overwritten)

typedef struct {
	char			Name[32];					//Shorthand for what this dll can be called   (NOTE: Has to be a "websafe" name, ie, no spaces, periods, etc if you want bot to be able to display webinfo)
	char			Info[255];				//A nice short description for what this dll does
	char			Version[32];				//Bot version
	char			HeaderVersion[8];			//Send BOT_HEADER_VERSION through here
	int			MaxBotsAllowed;			//A number must be sent through here. No more than this count could ever be opened of bot (for unlimited, set to MAX_DLLS)
} DLL_INFO;

typedef struct {
	char			*FileName;				//Dll's file name
	char			*IP;						//Zone IP bot connected to
	int			Port;					//Zone Port bot connected to
	char			*BotName;					//Name bot logged in as
	char			*Arena;					//Which arena this bot is in
	short		UID;						//Bot's UID in this zone
	int			iConnection;				//How far they are connected, if at all
	int			BotID;					//To talk with bot, this is their ID
										//If this is an Online Bot info call, than this value is always avaible, even if bot isn't connected to a zone yet
	int			DllID;					//To start a bot with this dll, this is its ID
										//This value is ALWAYS avaible. This is used if you wish to start a clone of this bot, or for a bot to test if any others are online, so can pick a new name that isn't currently being used
	unsigned int	iStartTime;				//GetTickCount when bot was created
	BOOL			IsValid;					//If this dll is in existance
	BOOL			Loaded;					//If this dll is loaded (if false, then ONLY FileName is valid)
} BOT_STATUS;

typedef struct {
	char			Name[32];					//The name the programmer goes by
	char			Email[64];				//Programmer's email address
} DLL_MAKER;

typedef struct {
	DLL_INFO		*DllInfo;					//Info about the DLL that this bot is using, please fill in this information in the DATABOT_Cmd call
	BOT_STATUS	*BotStatus;				//This is all information that the core will handle, so other bots can know where this bot is
	DLL_MAKER		*DllMaker;				//Information can be recorded here for who created this dll and such
} BOT_INFO;

typedef struct {
	char			*Line;					//Full line of text received
	char			*CmdStr;					//If found command in text, displays the command string here
	char			*Params;					//If found command in text, has parameters attached to command here
	char			*Name;					//Their name, if linetype is chat/cross zone msg (NOTE: Is not 100% reliable !!!)
	char			*Msg;					//Their message, if linetype is chat/cross zone msg (NOTE: Is not 100% reliable !!!)
	char			LineType;					//One of the LINETYPE_ for this msg
	char			Sound;					//If a sound, the sound number
	short		ChatChannel;				//If this is a LINETYPE_CHAT, this is which chat channel # it was sent from
} LINE_DATA;

typedef struct {
	//Used inside Player data
	BOOL			Stealth;					//if stealthed turned on
	BOOL			Cloak;					//if cloaked turned on
	BOOL			XRadar;					//if x-radar turned on
	BOOL			AntiWarp;					//if anti turned on
	BOOL			UFO;						//if currently UFO ship
	BOOL			WarpImage;				//if they were currently warped
	BOOL			Safe;					//if they are in a safety zone
	BOOL			Shields;					//if they have shields
	BOOL			Super;					//if they have super
	char			Burst;					//how many bursts they have ...
	char			Repel;					//the rest should explain themselves...
	char			Decoy;
	char			Thor;
	char			Brick;
	char			Rocket;
	char			Portal;
} ITEM_LIST;

typedef struct {
	char			Type;					//which weapon (0=none)
	char			WeaponLevel;				//what level of weapon
	char			ShrapBounce;				//if shrap bounces or not
	char			ShrapLevel;				//what level of shrapnel this is
	char			ShrapCount;				//how many shrapnel
} WEAPON_DATA;

typedef struct {
	//Player data
	//This data should always be accurate
	char			Name[20];					//name
	char			Squad[20];				//squad
	unsigned int	KillPoints;				//points from kills
	unsigned int	FlagPoints;				//points from flags
	unsigned short	Kills;					//kills
	unsigned short	Deaths;					//deaths
	short		AttachedTo;				//if on turret, uid of player they are on

	char			Lastship;					//ship they were in (valid only during ship change)
	char			Shiptype;					//current ship (1-8 = ships, 0 = spec)
	short		LastFreq;					//last freq they were on (valid only during freq change)
	short		Freq;					//current freq they are on
	BOOL			HasBanner;				//if they have a banner
	char			Banner[96];				//byte info of their banner if one

	//This data should always be correct also, but is updated internally inside
	//the bot, not from server source...
	unsigned int	TotalPoints;				//total points
	short		Rating;					//ratings
	float		AvgKill;					//avg kill

	//Data only correct from the last time received packets about it
	short		Bounty;					//current bounty
	short		XCoord;					//X location in map
	short		YCoord;					//Y location in map
	short		XSpeed;					//speed they are traveling in X direction
	short		YSpeed;					//speed they are traveling in Y direction
	char			ShipDirection;				//which way they are aiming
	short		Energy;					//their energy
	ITEM_LIST		Items;					//which items they are using, if any
	WEAPON_DATA	Weapons;					//weapons they use/have
//	unsigned int	LastUpdate;				//This is just the GetTickCount() when the Position Packet was received
	unsigned int	LastTick;					//This is the updated GetTickCount() to include player lag
	BOOL			Crown;					//if they have a crown
	short		S2CLag;					//their S2C lag

	//Basic data for bot use
	BOOL			IsValid;					//if data is valid or not (if not true, then data maybe corrupt and do not read from it)
	short		UID;						//uid of player
	short		OpLevel;					//can be used by bot to set a BotOp level to player, will last until player (or bot) leaves arena
										//feel free to set this varible how ever you like it
} USERS_DATA;

typedef struct {
	//Data about each flag
	short		XCoord;					//X location in map
	short		YCoord;					//Y location in map
	short		Freq;					//owned by which freq
	BOOL			Carried;					//if the flag is being carried or not
	BOOL			Neutral;					//if flag is owned or not
	BOOL			Exists;					//if flag exisits or not (if not true, data is not valid and maybe corrupt)
	short		PUID;					//if being carried, their UID
} FLAG_DATA;

typedef struct {
	//Data about each ball
	short		XCoord;					//X location in map
	short		YCoord;					//Y location in map
	short		XSpeed;					//speed ball is traveling in X direction
	short		YSpeed;					//speed ball is traveling in Y direction
	short		PUID;					//if someone holding ball, player's UID
	unsigned int	Time;					//GetTickCount() when last updated
	BOOL			Exists;					//if this ball is valid (if not, data maybe corrupt)
} BALL_DATA;

typedef struct {
	//This data struct is filled in a responce to ?arena
	char			ArenaName[MAX_ARENALENGTH];	//arena's name (if strlen==0, then not valid data)
	short		PlayerCount;				//# of players in this arena
	BOOL			Private;					//if a private arena or not
	BOOL			MyArena;					//if I am currently in this arena
} ARENA_DATA;

typedef struct {
	//When sent info about a brick, this has all its info
	short		BrickID;					//the id of the brick
	short		Freq;					//which freq owns this brick
	short		X1;						//starting X coord of this brick
	short		Y1;						//starting Y coord of this brick
	short		X2;						//ending X coord of this brick
	short		Y2;						//ending Y coord of this brick
	unsigned int	CreateTime;				//the GetTickCount() when brick was created
} BRICKS_DATA;

typedef struct {
	char			Rotation;					//Which angle your aiming (0 = up, clockwise around to 39)
	short		XCoord;					//Your X location
	short		YCoord;					//Your Y location
	//the core does NOT update your locations from your speed, do not set them to anything but 0 unless you want to do lots of work
	short		XSpeed;					//Your X speed
	short		YSpeed;					//Your Y speed
	short		Bounty;					//Your bounty
	short		Energy;					//Your current energy
	short		Timer;					//Time left for your flag to drop (should usually leave to 0 even if you have a flag)
	ITEM_LIST		Items;					//Your items you are currently using (do not set ufo, will do that internally, but set cloak for ufo)
} POSITION_DATA;

typedef struct {
	short		Last;					//Last ping we got
	short		Low;						//Lowest ping we got
	short		High;					//Highest ping we got
	short		Average;					//Average ping we got
} GAME_PING;

typedef struct {
	short		BulletFireDelay;
	char			BombBounceCount;
	short		BombFireDelay;
	short		BombSpeed;
	short		BombThrust;
	short		BulletSpeed;
	BOOL			DoubleBarrel;
	BOOL			EmpBomb;
	short		InitialBounty;
	short		LandmineFireDelay;
	char			MaxMines;
	short		MultiFireAngle;
	short		MultiFireDelay;
	short		SoccerBallFriction;
	short		SoccerBallProximity;
	short		SoccerBallSpeed;
	short		SoccerThrowTime;
	char			TurretLimit;

} SHIP_SETTINGS;

typedef struct {
	SHIP_SETTINGS	Ships[8];					//For each ships (0=warbird ... 7=shark, in otherwords, Ship-1)
	short		BrickTime;				//Brick:BrickTime
	int			BulletAliveTime;			//Bullet:BulletAliveTime
	short		BBombDamagePercent;			//Bomb:BBombDamagePercent
	int			BombAliveTime;				//Bomb:BombAliveTime
	int			BombDamageLevel;			//Bomb:BombDamageLevel
	short		BombExplodeDelay;			//Bomb:BombExplodeDelay
	short		BombExplodePixels;			//Bomb:BombExplodePixels
	short		EBombDamagePercent;			//Bomb:EBombDamagePercent
	short		EBombShutdownTime;			//Bomb:EBombShutdownTime
	short		ProximityDistance;			//Bomb:ProximityDistance
	short		DoorDelay;				//Door:DoorDelay
	short		DoorMode;					//Door:DoorMode
	char			CarryFlags;				//Flag:CarryFlags
	int			FlagDropDelay;				//Flag:FlagDropDelay
	short		FlagDropResetReward;		//Flag:FlagDropResetReward
	short		FlaggerBombFireDelay;		//Flag:FlaggerBombFireDelay
	char			FlaggerBombUpgrade;			//Flag:FlaggerBombUpgrade
	short		FlaggerDamagePercent;		//Flag:FlaggerDamagePercent
	char			FlaggerGunUpgrade;			//Flag:FlaggerGunUpgrade
	short		BountyIncreaseForKill;		//Kill:BountyIncreaseForKill
	short		EnterDelay;				//Kill:EnterDelay
	char			AllowAudioMessages;			//Message:AllowAudioMessages
	char			TeamMaxMines;				//Mine:TeamMaxMines
	int			MineAliveTime;				//Mine:MineAliveTime
	char			ExtraPositionData;			//Misc:ExtraPositionData
	char			SoccerBallBounce;			//Soccer:SoccerBallBounce
	char			SoccerMode;				//Soccer:SoccerMode
	short		SoccerPassDelay;			//Soccer:SoccerPassDelay
	int			MaxFrequency;				//Team:MaxFrequency
	char			MaxPerPrivateTeam;			//Team:MaxPerPrivateTeam
	char			MaxPerTeam;				//Team:MaxPerTeam
	short		AntiwarpPixels;			//Toggle:AntiwarpPixels

} ARENA_SETTINGS;

typedef struct {
	char			*Message;					//Message to be sent to bot
	int			Length;					//Size of message (incase it isn't a null-ended string) (NOTE: if this message is invalid, length = 0)
	int			SenderId;					//Behavior that sent it
	unsigned int	TickSent;					//GetTickCount() when message was sent
} MESSAGE_BUFFER;

typedef struct {
	BOOL			Best;					//If this was our best game
	short		MyRank;					//The bot's rank for this game
	unsigned int	MyPoints;					//The bot's points for this game

	short		UID[5];					//The UID's of the top 5 players, in order of rank (if UID == -1, then there was no one for this rank)
	unsigned int	Points[5];				//The points of the top 5 players, in order of rank
} SPEED_DATA;

typedef struct {
	//This struct contants all information sent to the dll from the exe
	int			Cmd;						//which BOTCMD_ being used
	char			BehaviorID;				//your bot's ID, to be sent back with every function

	int			iConnection;				//how far along the bot is connected, 0 = none, -1 = waiting to accept, -2 = accepted, 1 = connected (normal), 2 = downloading map, 3 = waiting to enter an arena
	char			*cArenaName;				//arena currently in - public arenas will be in the form of (Public #)
	short		iMyUID;					//which UID I am
	BOOL			bBilling;					//if zone is connected to billing server, valid only after EnterZone event

	//If you want to receive stuff, set to true, if not, set to false
	BOOL			bPlayerUpdates;			//if you want a call everytime we get a player position packet
	BOOL			bBallUpdates;				//if you want a call everytime we get a ball location
	BOOL			bWeaponFired;				//if you want a call everytime someone fires a weapon
	BOOL			bPositionSending;			//if you want a call everytime the core wants to send a position packet (requires a LOT of work)
	unsigned int	iTickDelay;				//set to time in ms you want every tick msg sent, starts at 0 ms, which means you won't receive any
										//you won't receive any ticks unless your iConnection becomes 1
										//WARNING: If you set below 50, you will NOT receive any at all

	//Structs for certain data operations
	BALL_DATA		*Balls;					//should be valid while connection=1
	FLAG_DATA		*Flags;					//should be valid while connection=1
	USERS_DATA	*UserList;				//should be valid while connection=1
	ARENA_SETTINGS	*Settings;				//should be valid while connection=1
	GAME_PING		*Ping;					//should be valid while connection=1
	USERS_DATA	*UserData;				//any action that has userdata will be filled in here
	USERS_DATA	*Killed;					//userdata of person being killed (bounty is updated with the points given for the kill)
	USERS_DATA	*Killer;					//userdata of person with the kill
	ARENA_DATA	*ArenaList;				//valid only during the arena request
	SPEED_DATA	*SpeedStats;				//valid only during BOTCMD_SpeedStats
	LINE_DATA		*Line;					//valid only during BOTCMD_Line
	BOT_INFO		*BotInfo;					//should always be valid
	BOT_INFO		*DllInfo;					//should always be valid
	BRICKS_DATA	*Brick;					//when someone lays a brick, has the info about it here
	MESSAGE_BUFFER	*Message;					//should always be valid
	POSITION_DATA	*Position;				//should be valid while connection=1, edit this to change your position

	//Single data for certain msgs
	int			Data1;					//Used for extra data
	int			Data2;					//Used for extra data
	char			*DataC;					//Used for extra data

	//Data that each dll will save for itself
	void			*BotData;					//this is independent of each bot
	int			BotDataSize;				//size of the BotData
} BOT_CMD;

typedef struct {
	int			DllID;					//The DllID of this dll
	int			WebID;					//Used to send back your webpage, do not edit
	BOT_INFO		*BotInfo;					//Array of all valid online bots
	BOT_INFO		*DllInfo;					//Array of all dlls
	char			*Url;					//The url request
} BOT_WEB;

typedef int		(*EZFUNC) (BOT_CMD *bc,char *IP,int Port,char *Name,char *Password,char *Arena,char ArenaType,short XRes,short YRes);
typedef int		(*CAFUNC) (BOT_CMD *bc,char *Arena,int ArenaType);
typedef int		(*TMFUNC) (BOT_CMD *bc,char LineType,short UID,char Sound,char *Line,...);
typedef int		(*SRFUNC) (BOT_CMD *bc,short UID);
typedef int		(*CFFUNC) (BOT_CMD *bc,short Freq);
typedef int		(*ATFUNC) (BOT_CMD *bc,short UID);
typedef int		(*DIFUNC) (BOT_CMD *bc,short UID,short Bounty);
typedef int		(*PRFUNC) (BOT_CMD *bc,short XCoord,short YCoord,short GreenID);
typedef int		(*PFFUNC) (BOT_CMD *bc,short FlagID);
typedef int		(*DFFUNC) (BOT_CMD *bc);
typedef int		(*CSFUNC) (BOT_CMD *bc,char Ship);
typedef int		(*EKFUNC) (BOT_CMD *bc);
typedef int		(*SBFUNC) (BOT_CMD *bc,char BallID,short XCoord,short YCoord,short XSpeed,short YSpeed);
typedef int		(*PBFUNC) (BOT_CMD *bc,char BallID);
typedef int		(*BAFUNC) (BOT_CMD *bc,char *Banner);
//typedef int		(*RFFUNC) (BOT_CMD *bc,char *Name,char *Email);
//typedef int		(*NUFUNC) (BOT_CMD *bc);
typedef int		(*DSFUNC) (BOT_CMD *bc,int DataSize);
typedef int		(*SDFUNC) (BOT_CMD *bc);
//typedef int		(*BIFUNC) (BOT_CMD *bc,int Online);
typedef int		(*BMFUNC) (BOT_CMD *bc,int BotID,char *Message,int Length);
typedef int		(*RMFUNC) (BOT_CMD *bc,int Map);
typedef int		(*FWFUNC) (BOT_CMD *bc,char WeaponType,char Level,char ShrapBounce,char ShrapLevel,char ShrapCount);
//typedef int		(*SPFUNC) (BOT_CMD *bc,POSITION_DATA *pd);
typedef int		(*BDFUNC) (BOT_CMD *bc,int BotID);
typedef int		(*BSFUNC) (BOT_CMD *bc,int DllID);
typedef int		(*SWFUNC) (BOT_WEB *bw,char *WebPage,...);

typedef struct {
	ATFUNC		SendAttachTo;				//Params: BOT_CMD *bc,short UID
	BAFUNC		SendBanner;				//Params: BOT_CMD *bc,char *Banner
//	BIFUNC		SendBotInfo;				//Params: BOT_CMD *bc,int Online
	BMFUNC		SendBotMessage;			//Params: BOT_CMD *bc,int BotID,char *Message,int Length
	BDFUNC		SendBotShutdown;			//Params: BOT_CMD *bc,int BotID
	BSFUNC		SendBotStartup;			//Params: BOT_CMD *bc,int DllID
	CAFUNC		SendChangeArenas;			//Params: BOT_CMD *bc,char *Arena,int ArenaType
	CFFUNC		SendChangeFreq;			//Params: BOT_CMD *bc,short Freq
	CSFUNC		SendChangeShips;			//Params: BOT_CMD *bc,char Ship
	DSFUNC		SendDataSize;				//Params: BOT_CMD *bc,int DataSize
	DIFUNC		SendDie;					//Params: BOT_CMD *bc,short UID,short Bounty
	DFFUNC		SendDropFlags;				//Params: BOT_CMD *bc
	EKFUNC		SendEndKOTH;				//Params: BOT_CMD *bc
	EZFUNC		SendEnterZone;				//Params: BOT_CMD *bc,char *IP,int Port,char *Name,char *Password,char *Arena,char ArenaType,short XRes,short YRes
	FWFUNC		SendFireWeapon;			//Params: BOT_CMD *bc,char WeaponType,char Level,char ShrapBounce,char ShrapLevel,char ShrapCount
//	NUFUNC		SendNewUser;				//Params: BOT_CMD *bc
	PBFUNC		SendPickupBall;			//Params: BOT_CMD *bc,char BallID
	PFFUNC		SendPickupFlag;			//Params: BOT_CMD *bc,short FlagID
	PRFUNC		SendPrize;				//Params: BOT_CMD *bc,short XCoord,short YCoord,short GreenID
	RMFUNC		SendRequestFile;			//Params: BOT_CMD *bc,int Map
//	RFFUNC		SendRequestForm;			//Params: BOT_CMD *bc,char *Name,char *Email
//	SPFUNC		SendPosition;				//Params: BOT_CMD *bc,POSITION_DATA *pd
	SBFUNC		SendShootBall;				//Params: BOT_CMD *bc,char BallID,short XCoord,short YCoord,short XSpeed,short YSpeed
	SDFUNC		SendShutdown;				//Params: BOT_CMD *bc
	SRFUNC		SendSpecRequest;			//Params: BOT_CMD *bc,short UID
	TMFUNC		SendTextMessage;			//Params: BOT_CMD *bc,char LineType,short UID,char Sound,char *Line,...
} BOT_MSG;

typedef struct {
	SWFUNC		SendWebPage;				//Params: BOT_WEB *bw,char *WebPage,...
} BOT_MSG2;

//Defines used for bot

//Line Types for receiving and sending messages
#define LINETYPE_ARENA			0			//No UserData
#define LINETYPE_MACRO			1			//Has UserData
#define LINETYPE_PUBLIC			2			//Has UserData
#define LINETYPE_TEAM			3			//Has UserData
#define LINETYPE_FREQ			4			//Has UserData
#define LINETYPE_PRIVATE			5			//Has UserData
#define LINETYPE_CROSSZONE		7			//No UserData (Has semi-reliable Line data for their name and text)
#define LINETYPE_SYSOP			8			//No UserData
#define LINETYPE_CHAT			9			//No UserData (Has semi-reliable Line data for their name and text)

//Reasons for why bot isn't connected to a zone anymore
#define QUITREASON_Normal		0			//We wanted to leave
#define QUITREASON_Kicked		1			//Server kicked us out, either from arena/zone recycle, security reasons, or kicked by staff
#define QUITREASON_Lagout		2			//Didn't get any response from zone, lagged out

//When entering a zone, this happened
#define ENTERINFO_NonMod			-1			//As a safety check, ALL bots must log in with atleast mod access to start with
#define ENTERINFO_Normal			0			//Got into zone normally without any errors, Data2 has news checksum, reply back if to request to download it
#define ENTERINFO_NewName		1			//This name is new, need to relogin with newname flag set
#define ENTERINFO_Password		2			//Wrong password
#define ENTERINFO_IPorFull		3			//Either your IP is blocked out, or zone is currently full
#define ENTERINFO_Banned			4			//You are banned from entering zone right now
#define ENTERINFO_Permission		5			//Zone is permission based, you cannot enter
#define ENTERINFO_PermSpecOnly	6			//Zone is permission based, you can enter, but only spec
#define ENTERINFO_BadName		11			//Your name is invalid
#define ENTERINFO_Obscene		12			//Your name includes an obscene word
#define ENTERINFO_NoBilling		13			//No billing server, can still enter anyways
#define ENTERINFO_Busy			14			//Billing server currently busy with other login requests
#define ENTERINFO_LittleHours		15			//Zone requires more user hours
#define ENTERINFO_NoName			16			//You forgot to send me a name

//Arena Types
#define ARENATYPE_Private		0			//Everything not a public arena
#define ARENATYPE_Public			1			//This is a public arena, with the arena number the first byte of the string
#define ARENATYPE_Random			2			//We want a random public arena

//Weapon Types
#define WEAPON_None				0			//No weapons being used
#define WEAPON_Bullet			1			//Non-bouncing bullet
#define WEAPON_BulletMulti		2			//Non-bouncing multi-fire bullet
#define WEAPON_BouncyBullet		3			//Bouncing bullet
#define WEAPON_BouncyBulletMulti	4			//Bouncing bullet with multi
#define WEAPON_Bomb				5			//Bomb without prox
#define WEAPON_ProxBomb			6			//Bomb with prox
#define WEAPON_Mine				7			//Mine without prox
#define WEAPON_ProxMine			8			//Mine with prox
#define WEAPON_Burst			9			//Burst
#define WEAPON_Repel			10			//Repel
#define WEAPON_Thor				11			//Thor
#define WEAPON_Decoy			12			//Decoy

//Bot Commands, these are the switch for what the call is for
#define BOTCMD_Init				0			//Dll was just loaded, and the core wants to know where to connect to
#define BOTCMD_EnterZone			1			//Core received login reply packet, Data1 contains an ENTERINFO type, and if normal, Data2 will be set to 1 if zone wants user-form submission, and DataC[0] will be 1 if news is updated
#define BOTCMD_Tick				2			//Your iTickDelay timer has been toggle
#define BOTCMD_Disconnect		3			//We were disconnected from zone, reason why is in Data1, and is a QUITREASON
#define BOTCMD_Shutdown			4			//Bot core is shutting you down, either by request or you've lagged out
//#define BOTCMD_BotInfo			5			//You requested info about other bots, so here it is (Data1 contains array size)
	//This has been removed because it is always sent
//#define BOTCMD_Message			6			//Another bot is messaging you, the message id is in Data1
	//This has been removed because messages are always sent, but if a message IS updated, you will receive a BOTCMD_Tick at that time..
#define BOTCMD_Line				7			//A message was receieved from the zone - May have UserData if the linetype allows it
#define BOTCMD_FlagSet			8			//A flag was set by the zone, the flag id number is in Data1
#define BOTCMD_FlagPickup		9			//Someone picked up a flag, flag id number is in Data1 - Has UserData on person who picked up the flag
#define BOTCMD_FlagDrop			10			//This flag was dropped, flag id number is in Data1 - Has UserData on person who dropped the flag
#define BOTCMD_FlagReset			11			//All flags were reseted, Data1 contains winning freq, Data2 contains points awarded (if Data1 = -1, then flaggame was reseted without a winner)
#define BOTCMD_EnteredArena		12			//We entered an arena, arena name is in DataC
#define BOTCMD_PlayerEntering		13			//A player is entering the arena (or they may already be there if we just entered the arena) - Has UserData
#define BOTCMD_PlayerLeaving		14			//A player is leaving the zone (if they had any flags, DropFlags will be toggled before hand) - Has UserData
#define BOTCMD_PositionUpdate		15			//A player's position was updated (may include weapons) - Has UserData
#define BOTCMD_Kill				16			//Someone died, points given is in Data1, number of flags transfered in Data2, has Killer and Killed filled
#define BOTCMD_Green			17			//Someone got a green, Data1 has green type (same as used for *prize # - Has UserData for person who picked up green
#define BOTCMD_ScoreUpdate		18			//Player's score was updated by the zone - Has UserData
#define BOTCMD_SoccerGoal		19			//Someone scored a goal, Data1 contains which freq scored, Data2 contains points given
#define BOTCMD_FreqChange		20			//Someone changed freqs - Has UserData
#define BOTCMD_Attach			21			//Someone attached to someone else, Data1 contains the Driver's UID while the UserData has attacher's information
#define BOTCMD_FileReceived		22			//Zone sent us a file, Data1 has file size, DataC has file name
#define BOTCMD_TurretKickoff		23			//The person we are attached to kicked us off the turret
#define BOTCMD_SendFile			24			//Zone wants a file from us, DataC has file name. If you do NOT want to send the file, set Data1 to 0
#define BOTCMD_ScoreReset		25			//Someone's score is being reseted, Data1 contains their UID. If uid is -1, then everyone is being reseted - Has UserData if pid is not -1   - NOTE: This call is sent before the core will clear out their scores, so this is their score before the reset
#define BOTCMD_ShipReset			26			//We are being shipreseted
#define BOTCMD_BeingSpeced		27			//Someone is specing/unspecing on us, Data1 is true if someone speced us, Data1 is false if they stop specing us
#define BOTCMD_ShipChange		28			//Someone is changing ships (also, they have changed freqs, such as a Warbird vs Jav settings or entering/leaving spec) - Has UserData
#define BOTCMD_Banner			29			//Someone set their banner - Has UserData
#define BOTCMD_Prized			30			//We are given prize(s), Data1 contains prize id (0 = random prizes), Data2 contains how many we were given
#define BOTCMD_Brick			31			//Has Brick data filled out for this brick
#define BOTCMD_Reward			32			//A Periodic Reward was given, Data1 contains freq, Data2 contains points awarded to that freq
#define BOTCMD_Ufo				33			//If we are a ufo, Data1 is true, else Data1 is false
#define BOTCMD_MapName			34			//DataC contains map name, Data1 is true if the map we have is different than the zone's
#define BOTCMD_KotHEnd			35			//The KotH game has eneded
#define BOTCMD_KotHStart			36			//The KotH game has started
#define BOTCMD_KotHLost			37			//Someone lost their crown - Has UserData
#define BOTCMD_Ball				38			//Ball with the id in Data1 was updated
#define BOTCMD_ArenaList			39			//Data1 contains the size of the arena list, arena info is in bc->ArenaList
#define BOTCMD_PositionRequest	40			//Bot Core wants you to update our stuff
#define BOTCMD_TurfUpdate		41			//Turf flags were updated, in mass (WARNING: if x/y coords = -1, then either map isn't loaded, or not down d/ling yet, and will be updated soon)
#define BOTCMD_WarpTo			42			//Someone sent you a /*warpto X Y. Data1 contains their X, Data2 contains their Y. Please note, these X,Y's are in tile coords, to convert to ss coords, * 16
#define BOTCMD_SpeedStats		43			//Speed game over, zone sending top 5 people and your rank (Has bc->SpeedStats filled in)

//List of return values for Send* functions
#define BOTERROR_None			0			//No errors
#define BOTERROR_InvalidTiming	1			//Connection status is off for this call (IE: trying to log into a zone when already in a zone)
#define BOTERROR_InvalidIP		2			//IP sent with connection function is invalid
#define BOTERROR_NoData			3			//Some data sent with the function is missing and is needed for it to work
#define BOTERROR_BadData			4			//Data sent with the function is bad (invalid characters, too long, etc)
#define BOTERROR_BadPlayer		5			//The UID sent with call is bad, or the requirements for that user is bad (ie: specing a spec)
#define BOTERROR_AlreadyDone		6			//This has already been done (IE: changing freqs to the same freq)
#define BOTERROR_DataSize		7			//When the core tried to set data from SendDataSize, it either didn't exist or errored
#define BOTERROR_BadBotId		8			//The bot you are trying to talk to does not exist
#define BOTERROR_MessageError		9			//When trying to send the message, the memory could not be allocated, so message was not sent
#define BOTERROR_NotInShip		10			//To send weapons, need to be in a ship
#define BOTERROR_CannotStart		11			//Cannot start the bot because either hit max bots allowed for dll or for core
#define BOTERROR_DllUsed			12			//To unload a dll, no bots can be using it yet..
#define BOTERROR_DllUnFreeable	13			//When trying to call FreeLibrary, it error

extern "C" __declspec (dllexport) void CALLBACK DATABOT_Cmd(BOT_INFO *bi);
extern "C" __declspec (dllexport) void CALLBACK CEBOT_Cmd(BOT_CMD *bc,BOT_MSG *bm);
extern "C" __declspec (dllexport) void CALLBACK WEBBOT_Cmd(BOT_WEB *bw,BOT_MSG2 *bn);

#endif

