Problems with variables
BlitzMax Forums/BlitzMax Programming/Problems with variables
| ||
| Hi, I know the title doesn't match the problem perfectly, sorry ;) Ok. I'm trying to get informations about a HL2 game server with BMax and the bnet module. To receive the informations, I have to send a request with the following content: UINT32 0xFFFFFFFF BYTE 0x54 My code looks like this: WriteInt STREAM,$FFFFFFFF WriteByte STREAM,$054 SendUDPMsg(STREAM,ServerIP,ServerPort) But I'm not getting any response from the server. I guess the server just doesn't understand my request. How can I send 0xFFFFFFFF and 0x54 to the server? Thanks badger |
| ||
| Just re-typed the code and this works? Straaaange ;) |
| ||
| Im interested in how you figured out how to communicate with the HL2 master server? Can you direct me to any links that may help me with also doing so? (im interested in this :D) |
| ||
| try WriteLong instead of writeInt, a BMax Int is 32bit signed (a long is 64bit signed) |
| ||
| Where can I get this BNet module? |
| ||
| http://vertex.art-fx.org/bnet.zip |
| ||
For the bb.com board:Local UDP:TUDPStream
Local Temp:String
Local Char:Byte
UDP = CreateUDPStream()
WriteInt UDP, $FFFFFFFF
WriteByte UDP, $54
SendUDPMsg UDP, IntIP("62.4.74.236"), 30900
Repeat
If RecvUDPMsg(UDP) Then
Print "OK: "+Hex(Readint(UDP))
Print "Controllbyte: "+Chr(ReadByte(UDP))
Print "Protocollversion: "+ReadByte(UDP)
Repeat
Char = ReadByte(UDP)
If Char = 0 Then Exit
Temp :+ Chr(Char)
Forever
Print "Servername: "+Temp
Temp = ""
Repeat
Char = ReadByte(UDP)
If Char = 0 Then Exit
Temp :+ Chr(Char)
Forever
Print "Mapname: "+Temp
Temp = ""
Repeat
Char = ReadByte(UDP)
If Char = 0 Then Exit
Temp :+ Chr(Char)
Forever
Print "Gamepath: "+Temp
Temp = ""
Repeat
Char = ReadByte(UDP)
If Char = 0 Then Exit
Temp :+ Chr(Char)
Forever
Print "Gamename: "+Temp
Print "ApplicationID: "+ReadShort(UDP)
Print "Playercount: "+ReadByte(UDP)
Print "Max Playercount : "+ReadByte(UDP)
Print "Botcount : "+ReadByte(UDP)
Print "Dedicated: "+Chr(ReadByte(UDP))
Print "OperatingSystem: "+Chr(ReadByte(UDP))
Print "Password: "+ReadByte(UDP)
Print "Secure Valve Anti Cheat active?: "+ReadByte(UDP)
Exit
EndIf
Forever
CloseUDPStream(UDP)
Endcu olli |