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

Not working properly #12

Closed
ageblade opened this issue Jan 26, 2019 · 4 comments
Closed

Not working properly #12

ageblade opened this issue Jan 26, 2019 · 4 comments

Comments

@ageblade
Copy link

I tried to do a decode/encode test on the same Sharecode you posted in the Readme section,.
It always return false

const ShareCode = require('csgo-sharecode');

const match = ShareCode.decode('CSGO-GADqf-jjyJ8-cSP2r-smZRo-TO2xK');
const code = ShareCode.encode(match.matchId, match.reservationId, match.tvPort);
console.log(code === match);
@akiver
Copy link
Owner

akiver commented Jan 26, 2019

You are comparing an object to a string which is not valid in JS.

I think what you are trying to do is:

const ShareCode = require('csgo-sharecode');

const expectedCode = 'CSGO-GADqf-jjyJ8-cSP2r-smZRo-TO2xK'
const match = ShareCode.decode(expectedCode);
const code = ShareCode.encode(match.matchId, match.reservationId, match.tvPort);
console.log(code === expectedCode);

@ageblade
Copy link
Author

You are right, I will check it and close the issue if it's working properly

@ageblade
Copy link
Author

OK so the thing is I'm trying to make sure your tool works.
I changed the testing code as you mentioned but still if I provide any sharecode from the latest games, it doesn't work properly.

For example codes like:
CSGO-bPQEz-PrYTq-u5w8E-ZbUy7-ZeQ3A
CSGO-wBrm6-7fkM6-AzBC5-u6GmR-iHLHA

I fetched them from CS:GO watch section.

@akiver akiver closed this as completed in 277509a Jan 26, 2019
@akiver
Copy link
Owner

akiver commented Jan 26, 2019

Fixed in 1.2.0, thanks for reporting!

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