Henrykvdb Posted July 3, 2016 Report Posted July 3, 2016 I'm sorry if this question is a bit nooby but I was wondering what I am doing wrong. I'm trying to use you're node-steam-user library and your node-globaloffensive library. And steamUser.on (see my code) won't give the connectedToGC event, and my IDE (webstorm) won't let me do csgo.on without giving me an error so I'm unsure where I need to listen for the connectedToGC event. Here's my code with the unnecessary parts cut out: https://gist.github.com/henrykvdb/64003c7104c4157204c46d1824bc3357 (I removed the shared_secret & password out of the gist for obvious reasons. Quote
Dr. McKay Posted July 3, 2016 Report Posted July 3, 2016 WebStorm is giving you an error because csgo doesn't exist when you're trying to listen for an event on it. Create your GlobalOffensive object at the same time as when you create your SteamUser object. Henrykvdb 1 Quote
Henrykvdb Posted July 3, 2016 Author Report Posted July 3, 2016 (edited) Okay I've been looking for how to fix it all day long and couldn't find it. After trying what you said I can confirm that was indeed the problem.Now my code is fully functional but for some reason webstorm still says that csgo.on is undefined, any idea why? (it's strange because it does trigger when the 'connectedToGC' event is emit. https://gist.github.com/henrykvdb/401a6c3f543afdd89c4886ca9ead0d47 PS: Also .getSteam3RenderedID() is underlined with the message that it's an unresolved function or method, wich is also strange since its working perfectly fine. Edited July 3, 2016 by Henrykvdb Quote
Dr. McKay Posted July 3, 2016 Report Posted July 3, 2016 WebStorm sometimes has trouble resolving Node dependencies. Do you have the Node.js plugin installed in WebStorm? Henrykvdb 1 Quote
Henrykvdb Posted July 3, 2016 Author Report Posted July 3, 2016 (edited) Yes I do. Also, I ran into some issues trying to make make a custom request simular to the requestLiveGames request in your node-globaloffensive library. I added this: https://gist.github.com/henrykvdb/6ee2d8bd8e58246f023ae2a57df12800 to the globaloffensive\index.js file (this is also where the globaloffensive.prototype.requestLiveGames is located. And I also added this: https://gist.github.com/henrykvdb/91e556493b9d18dd5b2e93270780d46e to the globaloffensive\handlers.js file (same place as the handler for the globaloffensive.prototype.requestLiveGames is located) But I'm pretty sure I messed up the syntax or some other part of the code somewhere wich causes it to crash.You'll probably see my mistake pretty easilly but here's the crash log anyways: https://gist.github.com/henrykvdb/9b46eab5852a05c6bc4a680f1edff403 PS: The line that makes the code crash is csgo.custom("2943920796","7253158134192955045","1467397635166412633") Edited July 3, 2016 by Henrykvdb Quote
Henrykvdb Posted July 3, 2016 Author Report Posted July 3, 2016 (edited) Woops, uploading a new one in a minute Edited July 3, 2016 by Henrykvdb Quote
Henrykvdb Posted July 3, 2016 Author Report Posted July 3, 2016 Crashlog: https://gist.github.com/henrykvdb/1afe783b38c8fe222c9a7bf5958888a0 Quote
Dr. McKay Posted July 3, 2016 Report Posted July 3, 2016 node-globaloffensive is using an option where instead of underscores, you should provide protobuf fields in camelCase. Basically, just remove the underscores and capitalize the next letter. However, I've added that functionality in v1.1.0. Henrykvdb 1 Quote
Henrykvdb Posted July 3, 2016 Author Report Posted July 3, 2016 node-globaloffensive is using an option where instead of underscores, you should provide protobuf fields in camelCase. Basically, just remove the underscores and capitalize the next letter. However, I've added that functionality in v1.1.0. Wow man thanks a lot, you're awesome! 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.