Winsock

Joined
Oct 24, 2003
Messages
679
Reaction score
1
Well i only just started using winsock and so far i have had no problems.. I set up a nice server status checker for lunentia.. it just checks if the server is online or offline.. this works fine but i want to be able to see how many users are on the server.. i have tried a few things so far but none of them have worked.. anyone got any sugestions for me please? thanx

Sparx
 
How do you know they even send out the user count? Have you tried setting up a data receive event?

Code:
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim Data As string

Winsock1.Getdata data

msgbox data
End Sub


simple as that.. see what data it sends you if any. If it does send user count and you need help parsing it or anything just ask.
 
First think I noticed was when you declared label3.. you didn't use caption.

Your code:
Code:
Label3 = "online"

It needs to be:
Code:
Label3.caption = "online"

Also.. why do you have () around the text boxs in the code? You don't need it. Unless theres something I don't know about.

Everything else should work.
 
well it works... but no msgbox appears even when i put a mirservers ip and port inside the boxes *im using mir as an example as i know that it does output data as i said above* any other ideas? the server does come up as online / offline so thats working fine.. im just getting no data back >_<
 
Try ragezones IP on port 3000 that should work for sure.
 
nope.. i tried it and it says online but nothing appears.. im using the exact program that i put in the post above.. well apart from the changes u told me to make... so i dont see why a msgbox isnt appearing :( also im sorry 2 b such a pain in the ass lol
 
Theres something really wrong with your program, I can't figure it out. I just made a quick test app with winsock and connected and everything work as well as getting the data. I tried changing your code and everything it just won't work.

It will connect then disconnect and reset almost instantly even thought it still says connected(winsock1.state).

I suggest you try make a small test app quick and see how that works out. (don't use text boxes just put the ip and port in the control or in the code itself) Tell me the results!

It might be something stupid i'm missing but honestly its the simpliest program i've seen and I just can't find it lol
 
yey works now lol... i think i found the problem -

Private Sub Winsock1_Connect()
Label3 = "Online"
Winsock1.Close
End Sub

i shouldnt have put that in i dont think lol

thanx for the help m8, now i can see if lulu servers send out data ^_^
 
lol, I can't believe I missed that small thing.


I knew I was missing something. :cry:

Edit: Your program now gets data. Enjoy. If you need help parsing any data just ask.
 
rawr.. im back... lol, is there any chance you could help me see if lunentia sends out data? everything is now working 100% fine but i dont really have any idea which port to connect to... and as the lulu server is hosted on my pc it makes it difficult... when your on and if your willing to help then pm me please. cheers
 
To be honest I doubt it does send a user count out, if it did don't you think they would have user count scripts and all that? o.O

You can port scan your local ip see what ports are open.. (probably not best idea)

You can also look for a program which shows open ports and protocol for the specific target program I remember using one ages ago. I can't remember the name. Something Analyzer.
 
thanx, i found a program and used it and then went through all the ports being used by the lulu files 1 by 1 and none of them returned data :( guess i just cant do it then. thanx anyway
 
you'll have to see if you can request the user count

eg. decompile the server files, and break into them onto the point when you send it data requesting the usercount (can be anything 'hello') and then , follow the source until it comes to a check, it will check it against somthing like 'GetUserCount(0)' or something and this is how you know what to use, and the protocol :)
 
thanx a lot, i will give it a go hehe. wish me luck =P also do you have any recomendations on decompilers? *lol this is gonna be a fun project considering i dont know much*
 
Last edited:
Sparx, I doubt he can even do that himself. I think hes just speaking out of his ass again. :lol:

What i'm saying is don't waste too much of your time because its not that easy. :tooth:.
 
Back