Darkthefirst Posted March 4, 2016 Report Posted March 4, 2016 How can i sent trade offer from php? Quote
Dr. McKay Posted March 4, 2016 Report Posted March 4, 2016 The way I generally do it is set up a bot in node.js using steam-tradeoffer-manager, and create a Web server in that bot which accepts commands to send trade offers. Then use curl in php to command the bot to send an offer. I believe there are php libraries for interacting with Steam, but I don't personally think php is well suited for that task. PEPZ 1 Quote
Andrew Posted March 4, 2016 Report Posted March 4, 2016 There are many ways of doing this. One way would be to use MySQL or MongoDB to create a queue for the bot to send. This queue might contain the items to send, the SteamID of the person to send it to, and their token. Then, the bot will poll the database every X seconds to check if there's a new trade offer to send, and, if there is, send it. Websites that I've made use MongoDB to do just that. Another, cleaner, and faster way to do this would be to use Socket.io to emit the trade offer to send just like above. The downside to Socket.io, however, is not having a queue which would build up while the bot is offline, or serve as a log. You could also go with the straight PHP route, using waylaidwanderer's PHP-SteamCommunity. Quote
Infrox Posted March 12, 2016 Report Posted March 12, 2016 I'm concerned about the same thing. I've seen many sites using an ajax query to the .php file which then sends data to node.js bot (I believe).But how can you connect to websocket in php? Don't you need to use javascript? Also, you can view website's javascript with a javascript debugger, wont people be able to manipulate the queries? Quote
Argyl Posted March 23, 2016 Report Posted March 23, 2016 Use ajax to send data to php function to build init db row with required info. Have it verify and do all the data server side. Then send back to client with data, and immediately send it off in a socket request. Quote
seler Posted March 23, 2016 Report Posted March 23, 2016 Better and faster option is create MVC app with node.js than implement it via curl or ajax into php? Quote
Nogtail Posted March 23, 2016 Report Posted March 23, 2016 Better and faster option is create MVC app with node.js than implement it via curl or ajax into php?If you were create a MVC app in Node then what would be the point in having PHP at all? Maybe use Apache or Nginx to serve static content or something, but it seems like PHP would be a bit useless if you were doing everything in Node anyway. Quote
Argyl Posted March 23, 2016 Report Posted March 23, 2016 Welp, I gave you the solution. Just have to make sure that all the data that is taken in is verified to make sure there was no user alteration. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.