Game server query problems

R

Randy W

[Note: parts of this message were removed to make it a legal post.]

Hello,
I'm relatively new to Ruby, so some of this is foreign, but despite trying
for several hours I can't seem to get this query to work.

My goal is to create a query that's consistent with this (
http://www.int64.org/docs/gamestat-protocols/gamespy2.html)

Here's the code I have so far:

require 'socket'

message = [0xFE,0xFD,0x00,0x43,0x4F,0x52,0x59,0xFF,0xFF,0x00].pack("c*")
socket = UDPsocket.new
socket.connect('64.34.186.176', 29900)
socket.send(message, 0)
receive = socket.recvfrom(1400)
puts receive

In return I should receive some data, but no matter how long I leave it
running I never get a response from the server. Apparently I'm doing
something wrong, but I can't seem to figure out what I'm messing up.

Any assistance is appreciated!
 
J

Jim Menard

Randy,

Hello,
I'm relatively new to Ruby, so some of this is foreign, but despite trying
for several hours I can't seem to get this query to work.

My goal is to create a query that's consistent with this (
http://www.int64.org/docs/gamestat-protocols/gamespy2.html)

Here's the code I have so far:

require 'socket'

message = [0xFE,0xFD,0x00,0x43,0x4F,0x52,0x59,0xFF,0xFF,0x00].pack("c*")
socket = UDPsocket.new
socket.connect('64.34.186.176', 29900)
socket.send(message, 0)
receive = socket.recvfrom(1400)
puts receive

Try TCPSocket instead of using UDP.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top