[VB.Net] Metin2 RCon (Socket Connection)

08/26/2013 19:41 JachuPL#1
Hi I'm trying to create a socket connection to my server, but there's something that does not work. Connection works fine, no error achieved but no reaction for the commands. Anybody could help? Thanks in advance, MfG :)

Code:
Dim query As String = "@SHOWMETHEMONEY.@EVENT TEST 1."
        Dim host As IPAddress = Nothing
        Dim mySock As Socket = Nothing

        Try
            If Not IPAddress.TryParse("192.168.1.102", host) Then
                MessageBox.Show("This IP is not valid")
                Exit Sub
            End If

            Dim ep As IPEndPoint = New IPEndPoint(host, Integer.Parse(30000))
            mySock = New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)

            mySock.Connect(ep)

            If mySock.Connected Then

                mySock.Send(Encoding.ASCII.GetBytes(query))

                MsgBox("Sended!")
            End If
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
bumping thread, nobody knows the answer?
11/16/2013 20:26 JachuPL#2
bump, somebody help please
11/16/2013 20:36 Jоe#3
xD Did you really think, that those commands would further work as String signs?
You lol'd my day!
11/16/2013 20:46 JachuPL#4
Quote:
Originally Posted by Jоe View Post
xD Did you really think, that those commands would further work as String signs?
You lol'd my day!

so how am i supposed to send them?
11/16/2013 20:59 Jоe#5
hex rays.
11/17/2013 00:09 Tyrar#6
Quote:
Originally Posted by Jоe View Post
xD Did you really think, that those commands would further work as String signs?
You lol'd my day!
Quote:
Originally Posted by Jоe View Post
hex rays.
:facepalm: You just failed :facepalm:

Quote:
Originally Posted by JachuPL View Post
Hi I'm trying to create a socket connection to my server, but there's something that does not work. Connection works fine, no error achieved but no reaction for the commands. Anybody could help? Thanks in advance, MfG :)

Code:
Dim query As String = "@SHOWMETHEMONEY.@EVENT TEST 1."
        Dim host As IPAddress = Nothing
        Dim mySock As Socket = Nothing

        Try
            If Not IPAddress.TryParse("192.168.1.102", host) Then
                MessageBox.Show("This IP is not valid")
                Exit Sub
            End If

            Dim ep As IPEndPoint = New IPEndPoint(host, Integer.Parse(30000))
            mySock = New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)

            mySock.Connect(ep)

            If mySock.Connected Then

                mySock.Send(Encoding.ASCII.GetBytes(query))

                MsgBox("Sended!")
            End If
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
bumping thread, nobody knows the answer?
Try UDP.
11/17/2013 05:47 Anohros#7
Maybe helps you my file attachment. I don't know if it still works, it's from three years ago.

With regards,
Anohros
11/17/2013 12:58 JachuPL#8
Quote:
Originally Posted by Anohros View Post
Maybe helps you my file attachment. I don't know if it still works, it's from three years ago.

With regards,
Anohros
It still works, and fits my need :) :handsdown: Thank You Very Much and all the best
Kind Regards, JachuPL