( search forums )
Soldat Rating System
Soldat Forums - Soldat Talk - Developers Corner
December 3, 2005, 1:30 am

I am currently trying to make a soldat server that rates all the people who play it and i was wondering if anyone here can connect to a soldat server using visual basic.

I want to use wisual basic for this beacuse im going to make a server from scratch and VB is the easyest way to do it.

Can anyone help me with this problem.

Everytime i try to connect to a soldat server using visual basic it says "connection forcefully regected".

Heres my code

Private Sub Form_Load()
Winsock1.Connect "", "23073"
End Sub

its verry basic but it dosent work

does anyone have any suggestions?

December 3, 2005, 2:48 am
as soon as you connect via TCP with anything, you need to send the admin password otherwise you get disconnected (which is what is happening to you)

It has been a while since my VB days, and enesce can help you more than me, but when Winsock1.connected send the admin password to the connection, from then on you will recieve all admin and console data.

December 3, 2005, 3:24 am
How do you do that?

i tried

winsock1.connect "-------", "----" //whateva the ip/port was
winsock1.senddata "password" //which is the servers password

and it said invalid protocoll or connection type to perform your action

December 3, 2005, 5:47 pm
I believe it is like this:
Private Sub Winsock1.Connected()
winsock1.senddata "password"
End Sub

Like I said , i'm very rusty and you should talk to/wait for enesce to show up

December 3, 2005, 6:42 pm
What a hell of a coincidence!

I just wrote (err , I think it's an hour ago) the script to connect to a server.
In the first post I think you tried to connect to a wrong IP , if you connect to your local PC your IP is , not the thing you find on the internet.
In the second post you posted you tried to send something while the winsock wasn't even connected yet

FliesLikeABrick is right but he forgest just one tiny thingy: vbcrlf.

Here's the code:
Private Sub Winsock1_Connect()
Winsock1.SendData text3.text & vbCrLf 'password
end sub

Private Sub Command1_Click()
Winsock1.Connect Text1.Text, Text2.Text 'IP and Port
End Sub

Also , if you send a command don't forget to put vbcrlf in the end!

Grtz , DePhille

December 3, 2005, 7:43 pm
ah yeah, i completely forgot that Dephille is a VB buff as well

December 4, 2005, 12:29 am
sorry thats not working,

my winsock dosent even make it to the connected event

it just generates an error "Connection Forcefully Regected"

December 4, 2005, 9:28 am
That means you are unable to connect to the server.
Where are you connecting to?

Grtz , DePhille

December 4, 2005, 10:12 am
To my own soldat server over the net

December 4, 2005, 10:18 am
If it helps im using...
Windows 98 SE
Visual Studio 6.0 (visual Basic 6.0)
No Firewall
Dial-Up Net

December 6, 2005, 2:53 pm
Is that own server running on the same PC as the app you're making?

December 7, 2005, 11:37 am

December 8, 2005, 12:39 pm
Connect to as IP instead of the other one.
You can't connect to your own PC with any IP address that differs from , otherwise it'll return the error you're getting.

Grtz , DePhille

December 9, 2005, 5:02 am
Still Dosent work,

same error message

Deleted User
December 9, 2005, 6:45 am
have you even set the correct port.... try the IP as localhost aswell

December 9, 2005, 8:37 am
you do have a winsock that's listening huh?
Winsock1.localport = 23000

And then when you connect:
Dim IP_Address as string
IP_Address = text1.text 'Type in here since you connect to your own PC
Winsock2.connect IP_Address , 23000

That should definitely do the trick if done right.

Grtz , DePhille