ItaloAraújo Posted July 28, 2023 Report Posted July 28, 2023 I'm having some problems sending the skin's paintwear on my response. When I make a request it gets the paintwear and shows on the console, but when I try to send it through Fastify it doesn't bring anything on the data. export async function getFloatSkinController( req: FastifyRequest, reply: FastifyReply ) { const { id } = req.params as { id: string }; const { assetid, inspectLinks } = req.body as { inspectLinks: string; assetid: string; }; console.log("Começando..."); user.on("loggedOn", () => { user.gamesPlayed(730); console.log("Entrou"); csgo.on("connectedToGC", async () => { console.log("Logado!"); if (csgo.haveGCSession) { const filteredID = inspectLinks.split("%D")[1]; csgo.inspectItem(id, assetid, filteredID, ({ paintwear }) => reply.send(paintwear) ); } }); }); } Quote
Dr. McKay Posted July 29, 2023 Report Posted July 29, 2023 Are you logging in fresh for every request? That's a bad idea. Quote
ItaloAraújo Posted July 29, 2023 Author Report Posted July 29, 2023 What would be the right way to do it? help Quote
ItaloAraújo Posted July 31, 2023 Author Report Posted July 31, 2023 I've changed the code, now it isn't constantly loggin. But I still have the same problem, the paint wear shows up on the console, but I can't get the response on the server. import { csgo } from "@/server"; import { FastifyRequest, FastifyReply } from "fastify"; export async function getFloatSkinController( req: FastifyRequest, reply: FastifyReply ) { const { id } = req.params as { id: string }; const { assetid, inspectLinks } = req.body as { inspectLinks: string; assetid: string; }; if (csgo.haveGCSession) { console.log("Float"); const filteredID = inspectLinks.split("%D")[1]; return csgo.inspectItem(id, assetid, filteredID, ({ paintwear }) => { console.log(paintwear); return reply.send(paintwear); }); } } 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.