AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   Spray 'n Display (incl. Web Panel) (https://forums.alliedmods.net/showthread.php?t=127776)

Geit 05-24-2010 18:45

Spray 'n Display (incl. Web Panel)
 
2 Attachment(s)
Spray 'n Display allows you to see all the sprays that have been used on your server in a simple web panel, along with admin tools to block inappropriate sprays

Updating 1.0 to 1.1

  • Run this on the SQL database
    Code:

    ALTER TABLE `sprays`  ADD COLUMN `ip` VARCHAR(16) NOT NULL AFTER `steamid`;
  • Reupload index.php and badspray.png
  • Reupload compiled plugin.

Links:
Spray Tracker in action. (XenForo)
DevIL
ImageMagick


Requirements:

  • SRCDS server with SM installed
  • Web Server:
    • PHP 5.2 or later
    • MYSQL 4.1 or later
  • Imagemagick (commandline)
  • DevIL image Library 1.7.8
Known bugs:
Some sprays may sometimes fail to convert, the cause is unknown.

Credits:
Original idea and reference: Ubercow and the rest at nom-nom-nom.us etc
Original code: Darkimmortal, Geit - Gamingmasters.co.uk
vBulletin intergrate to Barebones conversion of web script: Reag - Reager.org, LasPlagas (CrudeOil) - rrerr.me

Installation:

1l. For linux, you are first required to compile vtfconv with the DevIL library, to do this just run the compile file which is included within the package.
1w. For Windows, simply extract vtfconv.exe and DevIL.dll to your windows\system32 folder or any other folder in your system PATH.
2. You now need to setup the webpanel, see below for installation instructions for Barebones and vBulletin installation
3. Setup the following cron (windows users can use cronw or equivalent) job: */5 * * * * php server/path/to/sprays/sprays/cron/sprays.php &> /dev/null
  • That will set the file to be executed every 5 minutes, the script automatically downloads the vtfs and sends them though vtfconv, making a series of pngs which imagemagick then merges together as a gif, the script then deletes the vtfs and the png frames.
  • Inside sprays.php you can disable the deletion of the vtf files by commenting out line 138.
4. Compile spraytracker.sp, edit if needed as the plugin automatically connects to the default mysql entry on sourcemod.
5. Setup your sourcemod databases.cfg to set it so the plugin can connect to the mysql database.
6. Upload plugin once done and change map to get player details, if no errors player info should now be presented inside the mysql database.

If all went right your system should now be running.


Barebones Webpanel Setup

1. First you need to edit the settings file (webpanel/barebones/settings.php), this holds the INdir, OUTdir, FTP and MySQL details.
  • If you are using an external server FTP will be required to extract the files, if your server is localhost you can disable FTP and set the indir to the server path to where your src server is located/tf/downloads, if not use the provided example and match it to your FTP folder. Once this file is setup, save and close.
2. Proceed to upload the following folders to your webspace under the dir /sprays/: cron, css, images, inc, js and (If on Linux) CHMOD cron/log to 777, this will enable the cron job to print out a simple log of every time it downloads a file to see if it failed or not.
3. Please now import sprays.sql into your created database, if you haven't created one, Do it now, otherwise step 2 was a waste of a time.
4. Remember to edit index.php's line 31, this is used for the simple login system to allow admins to block sprays from view on the server.

vBulletin Webpanel Setup

1. First you need to edit the settings file (webpanel/vbulletin/settings.php), this holds the INdir, OUTdir, FTP and MySQL details and the GID's of the admin groups.
  • If you are using an external server FTP will be required to extract the files, if your server is localhost you can disable FTP and set the indir to the server path to where your src server is located/tf/downloads, if not use the provided example and match it to your FTP folder. Once this file is setup, save and close.
2. Add a new template called 'drops_index' to your Vbulletin installation (AdminCP -> Styles & Templates -> Style Manager -> Add new Template) using the content from webpanel/vbulletin/drops_index.txt -- You will need to add the template for every active style installed!
2. Proceed to upload the following folders to your webspace under the dir {VBULLETINROOT}/sprays/: cron, css, images, inc, js and (If on Linux) CHMOD cron/log to 777, this will enable the cron job to print out a simple log of every time it downloads a file to see if it failed or not.
3. Please now import sprays.sql into your created database, if you haven't created one, Do it now, otherwise step 2 was a waste of a time.

ChangeLog
:

1.1:

  • Added IP tracking to the plugin.
  • Changed index.php so it uses ip:port for server names rather than just port.
  • Changed badspray.png to be more generic
  • (1.11) - Ninja update to fix a bug that would crash servers.

Reag 05-24-2010 18:47

Re: Spray Tracker
 
Hope you all enjoy.

LordVader! 05-25-2010 13:30

Re: [ANY] Spray Tracker
 
Nice! :)

Darkimmortal 05-25-2010 15:16

Re: [ANY] Spray Tracker
 
Enjoy :)

Geit 05-25-2010 15:19

Re: Spray 'n Display (incl. Web Panel)
 
Added support for Windows Servers, changed the thread title, and fixed the public CVar not actually being in the plugin.

Darkimmortal 05-25-2010 15:26

Re: Spray 'n Display (incl. Web Panel)
 
Should add that Windows users will need to set up an equivalent scheduled task or use cronw.

Inflikted 05-26-2010 12:47

Re: Spray 'n Display (incl. Web Panel)
 
i get this error when attempting to compile for linux

Code:

vtfconv.c:47: error: âILuintâ undeclared (first use in this function)
vtfconv.c:47: error: (Each undeclared identifier is reported only once
vtfconv.c:47: error: for each function it appears in.)
vtfconv.c:47: error: expected â;â before âImgIdâ
vtfconv.c:48: error: âILenumâ undeclared (first use in this function)
vtfconv.c:48: error: expected â;â before âErrorâ
vtfconv.c:58: error: âIL_VERSION_NUMâ undeclared (first use in this function)
vtfconv.c:58: error: âIL_VERSIONâ undeclared (first use in this function)
vtfconv.c:70: error: âImgIdâ undeclared (first use in this function)
vtfconv.c:89: error: âIL_FILE_OVERWRITEâ undeclared (first use in this function)
vtfconv.c:90: error: âIL_RGBAâ undeclared (first use in this function)
vtfconv.c:90: error: âIL_UNSIGNED_BYTEâ undeclared (first use in this function)
vtfconv.c:99: error: âIL_NUM_IMAGESâ undeclared (first use in this function)
vtfconv.c:110: error: âIL_FALSEâ undeclared (first use in this function)
vtfconv.c:118: error: âErrorâ undeclared (first use in this function)


FrozenHaxor 05-26-2010 14:24

Re: Spray 'n Display (incl. Web Panel)
 
Looks epic ;)

Inflikted 05-26-2010 14:47

Re: Spray 'n Display (incl. Web Panel)
 
question, I dont really code for sourcemod or anything. Only for php. So this may be entirely wrong. But wouldn't it be more efficient for the gameservers to send the sprays to a centralized location using sockets extension rather than having the web server do it and entering in all the ftp info's/folders/etc. and then have the cron only convert the files from vtf to gif, rather than trying to mass connect to so many different ftp servers. I only say this because we run 16 servers across 4 different dedicated hosts, I'm not sure how well cron would do in completing the task quickly and reliably.

Thanks for the plugin though, its an awesome concept that a lot of server admins will love!!

Darkimmortal 05-26-2010 16:55

Re: Spray 'n Display (incl. Web Panel)
 
Quote:

Originally Posted by Inflikted (Post 1191935)
question, I dont really code for sourcemod or anything. Only for php. So this may be entirely wrong. But wouldn't it be more efficient for the gameservers to send the sprays to a centralized location using sockets extension rather than having the web server do it and entering in all the ftp info's/folders/etc. and then have the cron only convert the files from vtf to gif, rather than trying to mass connect to so many different ftp servers. I only say this because we run 16 servers across 4 different dedicated hosts, I'm not sure how well cron would do in completing the task quickly and reliably.

Just modify it to load a different config based on the command line args sent to the script and have 4 cron jobs set up - better to take as much load off the gameserver as possible :)

Quote:

Originally Posted by Inflikted (Post 1191827)
i get this error when attempting to compile for linux

Code:

vtfconv.c:47: error: âILuintâ undeclared (first use in this function)
vtfconv.c:47: error: (Each undeclared identifier is reported only once
vtfconv.c:47: error: for each function it appears in.)
vtfconv.c:47: error: expected â;â before âImgIdâ
vtfconv.c:48: error: âILenumâ undeclared (first use in this function)
vtfconv.c:48: error: expected â;â before âErrorâ
vtfconv.c:58: error: âIL_VERSION_NUMâ undeclared (first use in this  function)
vtfconv.c:58: error: âIL_VERSIONâ undeclared (first use in this  function)
vtfconv.c:70: error: âImgIdâ undeclared (first use in this function)
vtfconv.c:89: error: âIL_FILE_OVERWRITEâ undeclared (first use in this  function)
vtfconv.c:90: error: âIL_RGBAâ undeclared (first use in this function)
vtfconv.c:90: error: âIL_UNSIGNED_BYTEâ undeclared (first use in this  function)
vtfconv.c:99: error: âIL_NUM_IMAGESâ undeclared (first use in this  function)
vtfconv.c:110: error: âIL_FALSEâ undeclared (first use in this function)
vtfconv.c:118: error: âErrorâ undeclared (first use in this function)


Do you have DevIL installed?

On Fedora simply 'yum install DevIL DevIL-devel' and on other distros you will probably need to build it yourself (Debian particularly has too old a version in its repos).


All times are GMT -4. The time now is 00:01.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.