Jump to content
McKay Development

Recommended Posts

Posted

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)
        );
      }
    });
  });
}
Posted

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);
    });
  }
}

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...