See installation manual supplied with this script.
Full rewrite of the old code, to remove unnecessary complicated code and to reduce coupling between different parts of the script. As a result the code is now better maintainable, more robust and can easily be made to work with other games.
Anyone interested in modifying the source code to Si4 beyond normal install and restyling, a small outline of how the script works:
The directory “data/query/” contains the file “query.php”with in it the function getquerydata( $host, $protocol );
The first argument is the IP address and port of the game server you’re trying to connect to, for instance: “194.171.252.93:27015”.
The second argument is the protocol this server uses, which should correspond to a folder of the same name, for instance: “steam”
The protocol folder should contain the file “adapter.php”, which implements the function get[protocolname]data($host). This method should return the server information in the format described in “data/query/query.php”, or false upon failure.
This method is called by “data/data.php”, which in turn is called by every presentation format to get the server information.
Storage of the server information is automatically called from “data/data.php”, if MySQL is enabled in the configuration file. Any MySQL related sourcecodes can be found in the “data/mysql/” directory.
This server information is stored so the game server will not be queried for the server information every time the script is executed. When the information stored in the database was stored before a certain threshold this information will be used again. If not then the server will be queried for new information, which will in turn be stored.
The file “html/html.php” implements the function html ($host, $type);
The first argument is the IP address and port of the game server you want to display, for instance: “194.171.252.93:27015”.
The second argument is the display mode, which by default can be set to either “small”, “medium” or “large”, representing increasingly large output tables.
Any changes to the html output can be made in this file or the files this file includes.
The file “gdlib/gdlib.php” implements the function gdlib ($host, $type);
The first argument is the IP address and port of the game server you want to display, for instance: “194.171.252.93:27015”.
The second argument is the display mode, which by default can be set to either “small” or “large”, representing increasingly large output images.
Any changes to the png output can be made in this file or the files this file includes.
The file “xml/xml.php” implements the function xml($host);
The argument is the IP address and port of the game server you want to display, for instance: “194.171.252.93:27015”.
The second argument is the display mode, which by default can be set to either “small”, “medium” or “large”, representing increasingly large output tables.
Any changes to the xml output can be made in this file.
The file “cache/cache.php” implements the function putcache($host, $data, $ext);
The first argument is the IP address and port of the game server you want to display, for instance: “194.171.252.93:27015”.
The second argument is the output which needs to be stored.
The third argument is the extension the cache file will be given.
The file “cache/cache.php” also implements the function getcache($host, $ext);
The first argument is the IP address and port of the game server you want to display, for instance: “194.171.252.93:27015”.
The second argument is the extension of the cache file.
This function is called from every output generating function, if caching is enabled.
Caching is done to reduce the load on a web host, by returning the cached information is this information is not older then a set threshold. If it is older then new server information will be retrieved and converted to output, which in turn will be stored.
This method prevents the web host from having to recreate the same output every time the script is called.
Now that you know how the script works, here’s a very brief description of how to handle a few of the basic modifications:
This script is released under the GNU General Public License.
Si4 is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Si4 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Si4; if not, write to
the
Free Software Foundation, Inc.,
Copyright 2006 Tim te Beek
If you feel the need to contact me you can do so by sending an email to: timtebeek@gmail.com