Results 1 to 3 of 3

Thread: udpClient Rcon

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2007
    Posts
    6

    udpClient Rcon

    Hi guys,

    I'm attempting to program a simple Rcon application for a game.
    This sends a simple text command to the game server and the server responds with simple text.

    My Problem: When sending the command to return all the player data, it returns 1303 bytes which cuts off some of the data.

    I then send another command to find punkbuster data about players and this returns the end part of the data missing from the first command.

    Hope you understand

    On form load I call the getPlayers subroutine.

    Code:
    Public Sub getPlayers()
         Dim receiveString1, receiveString2 As String
            
         receiveString1 = SendCommand(ServerIP, Port, password, "status")
         receiveString2 = SendCommand(ServerIP, Port, password, "pb_sv_plist")
    End Sub
    Code:
    Public Function SendCommand(ByVal ip As String, ByVal port As Integer, ByVal pwd As String, ByVal Command As String) As String
    
         Dim sendBytes As Byte() = System.Text.Encoding.Default.GetBytes("ÿÿÿÿrcon " + pwd + " " + Command + " ")
         udpClient.Send(sendBytes, sendBytes.Length)
         Dim receiveBytes As Byte() = udpClient.Receive(RemoteIpEndPoint)
         ReceiveString = System.Text.Encoding.Default.GetString(receiveBytes)
         Return ReceiveString.Remove(0, 12)
    
    End Function
    Thanks

  2. #2

    Thread Starter
    New Member
    Join Date
    Nov 2007
    Posts
    6

    Re: udpClient Rcon

    It looks like I sorted it.

    Increase the udpclient.client.buffer to 1500.

    Thanks

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2007
    Posts
    6

    Re: udpClient Rcon

    Looks like I spoke to soon. The previous post made no difference.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width