Jump to content


Photo
Question

Help with getServerList

node.js node-steam-user xedom steam

Best Answer McMuffinDK , 29 March 2018 - 11:57 AM

client.getServerList(NULL, 100, (servers) => {
	console.log(servers);
})

You can find information about filters here: https://developer.va...Protocol#Filter

Go to the full post


  • Please log in to reply
11 replies to this topic

#1 xedom

xedom

    Member

  • Member
  • PipPip
  • 10 posts

Posted 29 March 2018 - 08:32 AM

I need help with Help with getServerList().

 

https://github.com/D...-limit-callback

 

Someone can help me, with a exemples?

 

Thanks?



#2 McMuffinDK

McMuffinDK

    Advanced Member

  • Member
  • PipPipPip
  • 49 posts

Posted 29 March 2018 - 11:57 AM   Best Answer

client.getServerList(NULL, 100, (servers) => {
	console.log(servers);
})

You can find information about filters here: https://developer.va...Protocol#Filter


Edited by McMuffinDK, 29 March 2018 - 11:58 AM.

  • xedom likes this

#3 xedom

xedom

    Member

  • Member
  • PipPip
  • 10 posts

Posted 29 March 2018 - 12:39 PM

client.getServerList(NULL, 100, (servers) => {
	console.log(servers);
})

You can find information about filters here: https://developer.va...Protocol#Filter

 

ok, but now i have this error --> http://prntscr.com/iy52v0

 

[nodemon] starting `node steamBot.js`
E:\dev\nodejs\less_three\steamBot001\steamBot.js:119
client.getServerList(NULL, 100, (servers) => {
                     ^

ReferenceError: NULL is not defined
    at Object.<anonymous> (E:\dev\nodejs\less_three\steamBot001\steamBot.js:119:22)
    at Module._compile (module.js:649:30)
    at Object.Module._extensions..js (module.js:660:10)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:501:12)
    at Function.Module._load (module.js:493:3)
    at Function.Module.runMain (module.js:690:10)
    at startup (bootstrap_node.js:194:16)
    at bootstrap_node.js:666:3
[nodemon] app crashed - waiting for file changes before starting...


#4 McMuffinDK

McMuffinDK

    Advanced Member

  • Member
  • PipPipPip
  • 49 posts

Posted 29 March 2018 - 01:07 PM

Sorry, my bad.. NULL must be null


  • xedom likes this

#5 xedom

xedom

    Member

  • Member
  • PipPip
  • 10 posts

Posted 29 March 2018 - 01:58 PM

Sorry, my bad.. NULL must be null

ok, now i have no error, but i don't get server list -> http://prntscr.com/iy69sr :)



#6 McMuffinDK

McMuffinDK

    Advanced Member

  • Member
  • PipPipPip
  • 49 posts

Posted 29 March 2018 - 02:48 PM

Try to add setTimeout with a few sec and see if it helps, might be called too early


  • xedom likes this

#7 xedom

xedom

    Member

  • Member
  • PipPip
  • 10 posts

Posted 29 March 2018 - 03:35 PM

Try to add setTimeout with a few sec and see if it helps, might be called too early

nice, now it work thank you :)

i made so:

setTimeout(() => {
    client.getServerList(null, 100, (servers) => {
        console.log(servers);
    });
},5000);

Edited by xedom, 29 March 2018 - 03:35 PM.


#8 xedom

xedom

    Member

  • Member
  • PipPip
  • 10 posts

Posted 29 March 2018 - 04:20 PM

to search csgo server i should make so : 
 

client.getServerList("\appid\740", 20000, (servers) => {

?



#9 McMuffinDK

McMuffinDK

    Advanced Member

  • Member
  • PipPipPip
  • 49 posts

Posted 29 March 2018 - 04:31 PM

to search csgo server i should make so : 
 

client.getServerList("\appid\740", 20000, (servers) => {

?

Yes, i would say so. Notice that the max limit is 5000


  • xedom likes this

#10 xedom

xedom

    Member

  • Member
  • PipPip
  • 10 posts

Posted 29 March 2018 - 04:43 PM

Yes, i would say so. Notice that the max limit is 5000

i made with 10 server, but it return []

http://prntscr.com/iy8l8e


Edited by xedom, 29 March 2018 - 04:45 PM.


#11 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 1,998 posts

Posted 29 March 2018 - 04:46 PM

You need to escape your backslashes (\\ instead of \). Also CS:GO's appid is 730, not 740 (use the game appid, not the server appid).


  • xedom likes this

#12 xedom

xedom

    Member

  • Member
  • PipPip
  • 10 posts

Posted 29 March 2018 - 05:08 PM

You need to escape your backslashes (\\ instead of \). Also CS:GO's appid is 730, not 740 (use the game appid, not the server appid).

ok, thank you now it work :)







Also tagged with one or more of these keywords: Question, node.js, node-steam-user, xedom, steam

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users