Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: buffer.readCString is not a function #88

Open
dennyb opened this issue Feb 4, 2022 · 1 comment
Open

TypeError: buffer.readCString is not a function #88

dennyb opened this issue Feb 4, 2022 · 1 comment

Comments

@dennyb
Copy link

dennyb commented Feb 4, 2022

Happens I guess during requestGame infos.

/node_modules/csgo/helpers/VDF.js:28
            var name = buffer.readCString();
                              ^

TypeError: buffer.readCString is not a function
    at Object.exports.decode (/node_modules/csgo/helpers/VDF.js:28:31)
    at CSGOClient.handlers.<computed> (/node_modules/csgo/handlers/rich_presence.js:44:20)
    at SteamClient.<anonymous> (/node_modules/csgo/index.js:50:30)
    at SteamClient.emit (events.js:326:22)
    at SteamClient._netMsgReceived (/node_modules/steam/lib/steam_client.js:175:10)
    at SteamClient.handlers.<computed> (/node_modules/steam/lib/steam_client.js:262:10)
    at SteamClient._netMsgReceived (/node_modules/steam/lib/steam_client.js:160:26)
    at Connection.emit (events.js:314:20)
    at Connection._readPacket (/node_modules/steam/lib/connection.js:50:8)
    at Connection.emit (events.js:314:20)
@dabbers
Copy link

dabbers commented May 23, 2023

Looks like changing this line: https://github.com/joshuaferrara/node-csgo/blob/master/helpers/VDF.js#L18

from if(typeof(buffer.readUint8) != "function"){
to if(typeof(buffer.readCString) != "function"){

It correctly wraps the buffer and fixes it.

dabbers added a commit to dabbers/node-csgo that referenced this issue May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants