Bitcoin Forum

Bitcoin => Bitcoin Discussion => Topic started by: Anonymous on June 26, 2011, 12:33:09 AM



Title: Bitcoin Game Server Plugin
Post by: Anonymous on June 26, 2011, 12:33:09 AM
Would it be possible for somebody to create a sourcemod plugin for source-based games, like Team Fortress 2 and Counter-strike; that would allow server owners to collect Bitcoin from the CPU power of its players? Does the code allow for this?


Title: Re: Bitcoin Game Server Plugin
Post by: AltPluzF4 on June 26, 2011, 01:08:26 AM
About the only hope of that would be loading a webpage on the client (similar to how the radio plugins work) that runs a javascript miner.
I'm sure this would cause people to greatly hate your server though, since it would seem as if the server is lagging terribly.

Sounds like a bad idea, but then again, I'm responsible for some pretty bad "ideas" myself (cough, fake bot avatars + ping.)
As far as a server-side plugin though, you have no real control over what clients do. Most client-side effects that are created are already programmed into the game's client and sent via "UserMessages" in a packet from the server to the client. Which, can lead to an "assumed" control over the client. For example, it's somewhat popular for evil admins to send a temp entity (effect) to a client with a garbage value to cause a crash.

Now, there is one little exploit where you could force a client to download a server plugin to be autoloaded, then the dll could run any code you want. However, I believe Valve recently patched this (since many users were using client-loaded server plugins for cheating purposes.)
Honestly, I'm a bit out of the loop though. I've not really played anything in several months (except when I grabbed Portal 2, finished it and all co-op).
I'm sure someone who knows a lot more about exploits could come up with some clever way to get a client to hash, but I believe it would be terribly ineffective.

Short answer; the code doesn't "allow" for this, but an exploit may be possible. After all, µTorrent's code doesn't "allow" for a fake upload modifier, but that doesn't stop memory injection ;-)

Good luck.


Title: Re: Bitcoin Game Server Plugin
Post by: Jack of Diamonds on June 26, 2011, 01:15:43 AM
As said above it's not worth it with an embedded CPU miner.
Even if you set affinity to about 5%, a dozen players would create less than 1 bitcent per day.

There's also the chance of players with weaker processors joining that will definitely notice the increased workload & their game will start lagging.


Title: Re: Bitcoin Game Server Plugin
Post by: Lech_Walesa on June 26, 2011, 01:21:32 AM
silkroad, mtgox hacked and CPU power theft on games servers - is it publicity we need  ???


Title: Re: Bitcoin Game Server Plugin
Post by: Electrongolf on June 26, 2011, 01:32:30 AM
Why can't there just be a game created in which the economy is built around BTC. It would encourage the exchange of BTC which is what we need right now.

I wish there was a way to earn BTC in a game based on skill.


Title: Re: Bitcoin Game Server Plugin
Post by: Anonymous on June 26, 2011, 01:33:39 AM
It isn't theft if use of your server is voluntary. ; )


Title: Re: Bitcoin Game Server Plugin
Post by: TiagoTiago on June 26, 2011, 01:35:55 AM
I don't think the more serious players would appreciate the artificially induced lag...


Title: Re: Bitcoin Game Server Plugin
Post by: finack on June 26, 2011, 01:45:12 AM
I don't think you could do it as a mod. Pretty sure you'd have to rebuild the game client with some additional code to do the calculations. Some simplistic games like CS wold lend themselves to the process, because at least if you set a frame cap at like 60 modern video cards will have a lot left over. The biggest hurdle would be writing the client to do the calculations in d3d or ogl in artificial ways with textures. Before CUDA and OpenCL came along people used to accomplish some amount of GPGPU calculations by finding the graphics work that happened to mimic the calculations they needed to do, but it was far from straight forward.

You could do the whole thing with CPUs much more easily, but the result would probably be pretty underwhelming (see javascript mining etc.)