dawe Posted January 19 Report Posted January 19 o.on('connection', (socket) => { const clientAddress = socket.handshake.headers['x-forwarded-for'] || socket.handshake.address; // Check if the client address is localhost or from a permitted IP range if (allowedAddresses.includes(clientAddress)) { // Connection allowed console.log('Client connected from localhost:', clientAddress); socket.on('startTradeDeposit', (data) => { const { assetIDs, steamID } = data; console.log('Received startTradeDeposit event with NameIDs:', assetIDs); bot.sendDepositTrade(steamID, assetIDs, (err, success, tradeOffer) => { // Log whether the callback is executed if (err && !success) { console.error('Error occurred while sending deposit trade:', err); socket.emit('failure', { message: 'We could not process your request at this time.' }); } else { console.log('Trade offer sent successfully!'); } }); bot.manager.on('sentOfferChanged', (offer, oldState) => { console.log(TradeOfferManager.ETradeOfferState[offer.state]); console.log(oldState) }); }); } }); 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.