Apr 12th, 2012, 03:28 AM
im having a bit of trouble here. I have a minecraft game server. I want to write a tcp client which will send a packet of data. it should then respond back with a string which should contain the server information i.e: motd(message of the day), max player capacity and current player count.
according to a documentation it says i need to send a packet with an id of: 0xFE
It also give an example in php, ruby and python. But i am having difficulty doing this in vb
Here is a snippet of the documentation
do have a look at the examples. You can try pinging this server:
Server List Ping (0xFE)
Client to Server
To load server info in the multiplayer menu, the notchian client connects to each known server and sends an 0xFE.
In return, the server sends a kick (0xFF), with its string containing data (server description, number of users, number of slots), delimited by a UCS-2 '§' (0xA7).
Note that as this is the last packet you'll see, you can get away with just chopping off the first three bytes (the ident and the string length) and decoding the remainder as a UCS-2 string.
If the number of available slots sent is equal to or less than 0, the client should display it as "???".
Example server pinger:
host name: vidhu.game-server.cc
I have copied the php script. you can view it in action here:
thanks a lot,
May 9th, 2012, 01:12 PM
Re: TCP client
It seems you just need to send the hex value 0xFE to the server. Using the TCPClient class, you would get the NetworkStream object and write the value to it then read the response from the server.
EDIT: I did try contacting your server, but it refused the connection. Perhaps there are some configuration steps that still need to be taken?
Dim message As Byte() = Encoding.ASCII.GetBytes("0xFE")
networkStream.Write(message, 0, message.Length)
Last edited by wakawaka; May 9th, 2012 at 01:23 PM.
Click Here to Expand Forum to Full Width
Survey posted by VBForums.