Retrieving screencaps from Client.

So, I know this is possible. Or at least was a few months ago.

I want to retrieve a screenshot from a client at will. The idea is when we suspect someone of hacking we can dump/upload/symlink to web gallery for moderating.

Only, I’ve no idea where to start when uploading the image from a client so any help would be loved.

An example of uploading an image would be perfect, but any help would be nice.

The general idea is reading the screen pixel by pixel, then having the client transmit that data to the server. You’d probably have to send it via datastream (easier) or setup your own system to send it through console commands. Once GMod 13 comes out you could easily use the net table to send it.
Then it’s up to you what to do with the pixel information on the server, you could upload it to a MySQL server that’ll in turn rewrite it to an image with a php script or something else.

(It’s very expensive to draw the image raw (pixel by pixel) in the server for admins to see, therefore I’m recommending that you have something that converts it to an image)

[editline]9th April 2012[/editline]
However you have to keep in mind that the table could be very large if you want to capture the entire screen, it might take a long time to transfer the pixels and the client could possibly even disconnect during that time.

The idea was to upload the jpeg to the server and display them out of the game, can be linked to a web server via a simple symlink relation to be viewed out of game or inside an HTML element. Not pixel by pixel.

Tobba was testing something similar on me a few months ago. Taking a client side screenshot using ‘jpeg’ and then uploading it to the servers data folder. Or screenshot folder, I forget.
I’ll ask Tobba how he did it when he’s back online.

Ahhh, was using Sourcenet3, no idea how to do it with that either but I guess I’ll have to research.

You can always use the downsample shader to reduce it to 512x512/1024x1024, then reduce the color palette to 16 and send the image, which would be then either 512kb or 2mb.

Additionally you could use garry’s compression system to squeze out some last bytes.

The server could easily save the retrieved data as jpeg or a bmp.

The screenshot + compression would take about 5 seconds and could be shown as “lag”.