unit kontrol_types; interface uses types,messages,classes,Graphics,Windows,syncobjs; const // CONSTANT DECLARATIONS WM_ERRORHANDLER = WM_APP + 2000; WM_UPDATEDEBUG = WM_APP + 2001; WM_PACKETDATA = WM_APP + 2002; WM_SINGLEDONE = WM_APP + 2003; WM_CHALLENGEUPDATE = WM_APP + 2004; WM_INTERFACEUPDATE = WM_APP + 2005; WM_DIALOG = WM_APP + 2006; WM_HTTPRESULT = WM_APP + 2007; PING_CACHESIZE = 150; DEFAULT_PACKETLIMIT = 60; DEFAULT_BYTELIMIT = 30000; SLEEPTIME = 40; COMMANDBATCHCOUNT = 4; THROTTLECOUNT = 20; DEFAULT_THREADLIMIT = 3; PLATFORMREFRESH = 30; LOG_MAXLINES = 500; TIMEOUTMAX = 5; KONTROL_BIGVER = '0.03'; KONTROL_SMALLVER = '030'; // OTHER MISC CONSTANTS BR = chr(10) + chr(13); REGPATH = '\software\coldstorage\kontrol2\'; // INTERFACE CONSTANTS // serverlist COL_NUMBER = 0; COL_SERVERIP = 1; COL_INFO_LOG = 2; COL_INFO_QUERY = 3; COL_SERVERNAME = 4; COL_STATUS = 5; COL_TYPE = 6; COL_MAP = 7; COL_PING = 8; COL_COUNTRY = 9; // GAME CONSTANTS HL_RCON_HLCHALLENGE = '˙˙˙˙challenge rcon'; Q2_NORMALQUERY = '˙˙˙˙'+{chr(2)+}'status'; Q3_NORMALQUERY = '˙˙˙˙getstatus'; Q3_INFOQUERY = '˙˙˙˙'+{chr(2)+}'getinfo'; HL_RULESQUERY = '˙˙˙˙rules'; HL_DETAILSQUERY = '˙˙˙˙details'; HL_PLAYERSQUERY = '˙˙˙˙players'; HL_INFOQUERY = '˙˙˙˙infostring'; UT_GENERALQUERY = '\basic\\info\\players\'; UT_BASICQUERY = '\basic\'; UT_INFOQUERY = '\info\'; UT_PLAYERSQUERY = '\players\'; UT_STATUSQUERY = '\basic\\info\'; URL_WANIP = 'http://www.kquery.com/scripts/lookupip.php'; // TYPE DEFINITIONS { This is our packet storage format (for 'buffering') We store pointers to each record in TList structures which are called bufferIn/bufferOut (listed below) } type Tpacket = {packed} record data: string; ip: string[15]; port: integer; ping: integer; datetime:TDateTime; end; Ppacket = ^Tpacket; // pointer { we use a seperate storage system for calculating ping times so we use less memory than storing ~200 sent packets of the above type. } type Tping = {packed} record ip: string[15]; port:integer; sent:int64; end; Pping = ^Tping; type Tdebugmessage = {packed }record // used for displaying various information in the main program thread // useful for giving users an idea of what's going on... category:integer; text:string; end; Pdebugmessage = ^Tdebugmessage; type Thttpmessage = record stringlist:Tstringlist; end; Phttpmessage = ^thttpmessage; type Tdialogmessage = {packed }record text1:string; text2:string; text3:string; text4:string; integer1:integer; end; Pdialogmessage = ^Tdialogmessage; type Tserver = packed record ip: string[15]; port:integer; hostname : string; password : string; gametype : string; modtype : string; servertype : string; ping : integer; rcon_id : string; rcon_bad : boolean; banned : boolean; map : string; ostype : string; country : string[2]; playercount: integer; maxplayers : integer; reserved : integer; version : string; throttled : integer; // for future use? uses_mod_amx : boolean; uses_mod_adminmod : boolean; timeoutcount : integer; infostring : string; // used to display kontrol status infoicon : integer; // which icon to display // used, but only in parsing playeroffset : integer; playeroffsettype : string; // pointers firstrule : pointer; firstplayer: pointer; log : Tstrings; commandqueue : Tstrings; // holds full commands, not to be interpreted rconqueue : Tstrings; // holds just the rcon text to be executed end; Pserver=^Tserver; type Tplayer = packed record Playerno: Integer; Name: string[30]; Frags: integer; Place: integer; ping: integer; team: string[20]; hostip: string[21]; hostport: integer; globalid: string; localid: string; time: string[15]; address: string[21]; nextplayer: Pointer; country: string[2]; end; PPlayer = ^Tplayer; // pointer type rPlayerTreeData = {packed} record pPlayerData: Pplayer; end; type rTreeData = {packed} record isserver: boolean; iscategory: boolean; // use categories as we may have a hl/q3 category section caption: string[50]; pServerData: PServer; pPlayerData: Pplayer; end; type Trule = packed record name: string[50]; value: string[100]; nextrule: Pointer; end; Prule=^Trule; var INSTALLDIR:string; implementation end.