Need to find a better solution for screenshots

CPx4
A semi-regular
A semi-regular
Posts: 27
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Fri Mar 23, 2012 10:15 am

Re: Need to find a better solution for screenshots

Post by CPx4 »

Our Web server runs Windows Server. This *might* work on Linux servers with some modifications.
Here's how I have our server grabbing screenshots:

Web Server runs a 'Batch' (.bat) file, which calls a set of FTP commands. It FTP's to the NFO server, grabs the latest screenshots into a publicly available directory on the web server. Then, deletes them on the Game server. A scheduled task runs this every ~5 mins or so.

Note: The 1st time you run it, it will be SLOW since it has to catch up and copy all screenshots. After that point, the synch every 5 mins is small and not noticeable to players.

RDP to your web server. (You will NEED access to your web server for this-- or be very clever in scripting/coding to create this.)

Create a "C:\PB_Screenshot\" folder
On your web server's root, create a sub-folder for each server. (I'll give an example of 2 servers.): C:\Apache\htdocs\pbss\Server_1\
C:\Apache\htdocs\pbss\Server_2\

In the C:\PB_Screenshot folder, create a "GrabPBSS.bat" and "GrabPBSS.txt" files. Paste the contents in...

For the "GrabPBSS.bat" file:

Code: Select all

ftp -v -i -s:C:\PB_Screenshot\GrabPBSS.txt
In the "GrabPBSS.txt" file:

Code: Select all

REM =======Server_1=======
open YOUR_SERVER_1.game.nfoservers.com
YOUR_FTP_USERNAME
YOUR_FTP_PASSWORD
lcd C:\Apache\htdocs\pbss\Server_1
ascii
cd svss
get pbsvss.htm
mget pb*.htm
binary
mget pb*.png
mdelete pb0*.png
mdelete pb0*.htm
close
REM =======Server_2=======
open YOUR_SERVER_2.game.nfoservers.com
YOUR_FTP_USERNAME
YOUR_FTP_PASSWORD
lcd C:\Apache\htdocs\pbss\Server_2
ascii
cd svss
get pbsvss.htm
mget pb*.htm
binary
mget pb*.png
mdelete pb0*.png
mdelete pb0*.htm
close
Your game server's hostname, FTP User/Pass should be available in your NFO control panel. It's not the same as your User/Pass to get into the Forum/Panel.

Now, as bhzdclan suggested, just throw the "Main Stream Gamers' PunkBuster Screenshot Viewer" HTML file ("msgpbssv.html") into the "Server_1" and another copy into "Server_2" folder. Then, you just point your web visitors to...
http://www.YOUR_WEBSITE/pbss/Server_1/msgpbssv.html
http://www.YOUR_WEBSITE/pbss/Server_2/msgpbssv.html

For shorter URLs, you could also rename "msgpbssv.html" to "index.html" and shorten the url to /Server_1/ and /Server_2/

Run the ".bat" file and make sure it works. You should see ".png" and ".htm" files populate in the folders you made, and they will be removed from the BF3 game server after the copy. Assuming it works, set a scheduled task to run the ".bat" file every 5 mins (or however long you wish).

Folder/File names changed to protect our servers :) But, hopefully it is clear! Good luck.

- CPx4
CPx4
A semi-regular
A semi-regular
Posts: 27
Joined: Fri Mar 23, 2012 10:15 am

Re: Need to find a better solution for screenshots

Post by CPx4 »

FYI, as a follow-up to my previous post (above this), I realized that the "pbsvss.htm" file grew huge, and my script didn't account for it.

So, if interested, I'll re-post my instructions and include an extra 'PowerShell' script that cleans the file so it can be re-uploaded to the game server.
Post Reply