Jump to content


Photo

[Question] node-globaloffensive


Best Answer Dr. McKay , 03 July 2016 - 05:14 PM

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.

Go to the full post


  • Please log in to reply
9 replies to this topic

#1 Henrykvdb

Henrykvdb

    Newbie

  • Member
  • Pip
  • 9 posts

Posted 03 July 2016 - 07:59 AM

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....4c46d1824bc3357 (I removed the shared_secret & password out of the gist for obvious reasons.

 

 



#2 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,070 posts

Posted 03 July 2016 - 12:56 PM

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 likes this

#3 Henrykvdb

Henrykvdb

    Newbie

  • Member
  • Pip
  • 9 posts

Posted 03 July 2016 - 01:20 PM

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....c4886ca9ead0d47

 

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 by Henrykvdb, 03 July 2016 - 01:23 PM.


#4 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,070 posts

Posted 03 July 2016 - 01:56 PM

WebStorm sometimes has trouble resolving Node dependencies.

 

Do you have the Node.js plugin installed in WebStorm?


  • Henrykvdb likes this

#5 Henrykvdb

Henrykvdb

    Newbie

  • Member
  • Pip
  • 9 posts

Posted 03 July 2016 - 02:50 PM

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....23ae2a57df12800 to the globaloffensive\index.js file (this is also where the globaloffensive.prototype.requestLiveGames is located.

 

And I also added this: https://gist.github....b2e93270780d46e 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....4a680f1edff403 

 

PS: The line that makes the code crash is csgo.custom("2943920796","7253158134192955045","1467397635166412633")


Edited by Henrykvdb, 03 July 2016 - 02:51 PM.


#6 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,070 posts

Posted 03 July 2016 - 03:57 PM

Your crash log gist 404s.


  • Henrykvdb likes this

#7 Henrykvdb

Henrykvdb

    Newbie

  • Member
  • Pip
  • 9 posts

Posted 03 July 2016 - 04:09 PM

Woops, uploading a new one in a minute


Edited by Henrykvdb, 03 July 2016 - 05:04 PM.


#8 Henrykvdb

Henrykvdb

    Newbie

  • Member
  • Pip
  • 9 posts

Posted 03 July 2016 - 04:12 PM

Crashlog: https://gist.github....c9a7bf5958888a0



#9 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,070 posts

Posted 03 July 2016 - 05:14 PM   Best Answer

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 likes this

#10 Henrykvdb

Henrykvdb

    Newbie

  • Member
  • Pip
  • 9 posts

Posted 03 July 2016 - 05:16 PM

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!






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users