#########################################################################################################################
#########################################################################################################################
##########                                      UgLy game search engine v rc10                                 ##########
##########                                      Written for the valhalla LAN                                   ##########
##########                                      To be used whith many programs eg,                             ##########
##########                              Gametrakker, Serverquery or any qstat backing prog                     ##########
##########                                      Contact uglygs@uglypunk.com                                    ##########
#########################################################################################################################
#########################################################################################################################



Introduction:

UgLy game search engine was first to be Used at the Valhalla LAN Party in Adelaide, Australia. It was developed to be
used to make it easier for the lanners to find the game server and to see which ones had gamers on them. Since it was first 
designed it was changed many times until it was stable and then after it proved itself at a 450 person LAN event i decided 
to release it to the gaming community.

Design:
	
UgLy game search engine  is designed to look at the network on the most common ports that game servers are using (note but 
not only the default port). Many lanners run multiple servers of the same game there for only looking at the default port became 
useless. Uglygs looks at the default and the next few ports so that it doesn't miss any servers. It is designed to update 
itself every 4-5 min which can be changed depending on what you require. It uses a modified version of qstat to look for the
servers. The modification adds details on around 4-5 more games. 




Installation :

Check the INSTALL file for details






Configuration:

NOTE: UGLYGS NEEDS TO BE LOCATED IN A NONE WEB DIRECTORY, ONLY ITS OUTPUT SHOULD BE SEEN FROM THE WEB
        eg. usr/local/uglygs/           For the install directory
            /var/www/html/uglygs/       For the output directory

Configuring Uglygs is simple it involves changing options in a config file. the options are listed below.


//	UglyGS has the option to run in 2 modes, they are loop or run
//	"run" runs the script once then stops "loop" puts the script in a continuing loop 

$runmode = "loop";  


//	The Result file that is created by UgLyGS
//	it is what is passed to all the programs and post processing

$configfile = "servers.cfg";                                    


//	Location of the modified Qstat program 
//	note: the standard qstat program will not work

$qstat = "qstat/qstat";                                         


//	The cat file location

$cat = "/bin/cat";                                              


//	The directory where data files are keeps (should not be changed)

$data = "./data";                                               


//	The location of the template directory (should not be changed)

$tmp = "./tmp";                                                 


//	The location of the template directory in the /templates Directory there are some exaples of them

$template = "./templates";                                      


//Servers.static:
//        If you have dedicated servers on unusual ports or a server that isn't getting detected
//        it can be added to the servers.static file. the layout of the file comes in the form of a code
//        and an ip address. eg.
//	  PORTS MUST BE INCLUDED
//
//                UNS 192.168.0.32:8888
//                Q3S 192.168.0.20:25800 
//
//                AP2S           query Alien Vs Preditor 2 server
//                AMS            query America's Army
//                BDS            query Battlefield 1942 server
//                BDL            query Battlefield 1942 LANserver
//                BFS            query BFRIS server
//                D3G            query Descent3 Gamespy Protocol server
//                D3S            query Descent3 server
//                DKS            query Daikatana
//                GOS            query Global Operations server
//                GRS            query Gore server
//                H2S            query Hexen II server
//                HLS            query Half-Life server
//                HRS            query Heretic II server
//                HWS            query HexenWorld server
//                IGIS           query IGI-2 Covert Strike server
//                J2S            query Jedi Knight 2 server
//                KPS            query Kingpin server
//                MHS            query Medal of Honor: Allied Assault server
//                NWS            query Never Winter Night Server
//                QS             query Quake server
//                QWS            query QuakeWorld server
//                Q2S            query Quake II server
//                Q3S            query Quake III: Arena server / Return to Castle Wolfenstein server /Star Trek: Elite Force server
//                RMS            query Rally Masters server
//                RGS            query Command and Conquer: Renegade server
//                RWS            query Return to Castle Wolenstein
//                SDS            query Soldat server
//                SNS            query Sin server
//                SGS            query Shogo: Mobile Armor Division server
//                SMS            query Serious Sam server /Serious Sam 2 Server
//                SFS            query Soldier of Fortune server
//                SF2S           query Soldier of Fortune 2 server
//                TBS            query Tribes server
//                T2S            query Tribes 2 server
//                UNS            query Unreal server /Unreal Tournament
//                V8C            query V8 Supercar Challenge server
//                VCG            query VietCong server
//                GPS            query Gamespy Protocol server

$staticcfgfile = "$data/servers.static";                        


//	Would you like to log the Process

$log = "y";                                                   


// 	Your log file location

$logfile = "./log.uglygs";                                    

 
// 	Do u want Reset your log  on Rotation

$logrotate = "y";    


// 	Currently tribes/tribes 2 kills this option due to its lack of broadcast 
// 	Support but if tribes to is deselected. the script needs a refresh time before it
//	re-searches the network, time is in seconds

$refresh = "180";


//	Server Query is a Free win32 client to display game server details. I RECCOMEND THIS PROGRAM 
//	it can be found at http://www.serverquery.com/ with modded dll's to fully support UgLyGS
//  	Do you wish to use Server Query

$serverquery = "n";                                             


//	Server query requires a cfg file in a web directory. It uses this file to keep Server Query up to
//	Date. Where would you like this file put eg. var/www/html/servers.cfg = http://your.host/servers.cfg

$serverqueryfile = "/var/www/html/servers.cfg";                 


// 	UgLyGS is able to make a graph in html using the templates, header.html, data.html, footer.html in the $template directory
//	Do you wish to have html output

$html = "n";                                             


// 	Where would you like the html files located u must create a directory under this called servers

$htmldir = "/var/www/html/servers.html";                     


//	 # The html Directory Alias eg http://uglygs.uglypunk.com/#######/index.html

$htmlalias = "/uglygs";                                         


// 	What would you like the html Extensions to be eg html, php, asp

$htmlext = "html";                     

// 	What would you like the root html file named

$htmlfile = "servers.html";                     


//            This option enables or disables the scan 
//            I added this for people who just wanted to show static servers as listed in the stac.servers file


$rrdtool = "/usr/bin/rrdtool";                                  
//		Location of rrdtool executable file



//	Do you want the scan enabled if disabled it will only use the data in the server.static 
//	file to graph and send to server query
//	Disabling this makes the script perfect for monitoring online servers
 
$doscan = "y"; 


//	This option is your network Broadcast address, if you are not sure what that is run "ifconfig"
//
//	eth0      Link encap:Ethernet  HWaddr 00:A0:C9:5D:A4:B5  
//	          inet addr:192.168.13.1  Bcast:192.168.15.255  Mask:255.255.252.0
//	          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
//	          RX packets:2834451 errors:0 dropped:0 overruns:0 frame:3
//	          TX packets:3031288 errors:0 dropped:0 overruns:0 carrier:0
//	          collisions:51741 txqueuelen:100 
//	          RX bytes:712599194 (679.5 Mb)  TX bytes:1274600524 (1215.5 Mb)
//	          Interrupt:5 Base address:0x1000 
//
// 	your Broadcast address is the Bcast result. In this example the broadcast is "192.168.15.255"

$netmaskbc = "192.168.0.255";                                   


// 	This is a static way of adding more options to your qstat command line it is in standard qstat format
//	eg. $addports ="-uns 192.168.0.25:7900 -q3s 162.168.2.24"

$addports ="";                                                

#####################################################################################################
##########################################  Game support ############################################
#####################################################################################################


// 	Game Support need i say more simple y or n answers and then the ports to look at
//	the ports are seperated by a comma (and only a comma)









Notes about the templates:

Most options in the templates are in a standard qstat format which can be found here
http://www.qstat.org/qstatdoc.html

In the first line of gamedata.html and data.html this line must exist
<!-- gamedetails $TOTALPLAYERS $TYPEPREFIX $MAP Do Not delete or modify this line--> 


The colors for the graphs are located in the templates/game/graphs.conf file
The options are listed below

$rrdback = "#000000";                                           # RRD Background Color
$rrdcanvas = "#000000";                                         # RRD Canvas Color
$rrdshadea ="#000000";                                          # RRD Shade A Color
$rrdshadeb ="#000000";                                          # RRD Shade B Color
$rrdgrid = "#FFFFFF";                                           # RRD Grid Color
$rrdmgrid = "#FFFFFF";                                          # RRD MGrid Color
$rrdfont = "#FFFFFF";                                           # RRD Font Color
$rrdframe ="#000000";                                           # RRD Frame Color
$rrdarrow = "#FFFFFF";                                          # RRD Arrow Color
$rrdbar = "#FFFFFF";                                            # RRD Graph Color
// Colors for the rrdtool graph


