PDA

Click to See Complete Forum and Search --> : [VB6] - Multi-User Chat Example (Winsock)


DigiRev
Aug 5th, 2007, 06:05 PM
I wrote this last night out of boredom and after reading a lot of posts about people wanting to make a basic multi-user chat room.

This is the most stripped-down code I could come up with that does things "correctly". For that reason, some of the code may seem more complex than it needs to be but I commented it pretty well.

I am going to write a tutorial to go along with it, as soon as I get free time. ;)

One common mistake a lot of client/server programs make is they don't program according to the TCP (streaming) protocol. Sometimes "packets" get split up, truncated, sent together, etc. and this data arrival event is coded to expect that and handle it smoothly.

I set it up so you can add in your own commands easily to the Data Arrival event.

If you have any questions/comments/suggestions, post them here. I kept out most features like private messages, file transfers, web cams, etc. to keep things simple and straightforward, but if someone wants something added in here let me know.

MrMakealotofsmoke
Aug 6th, 2007, 01:17 AM
did i make you want to start this?

BTW, thanks for helping me out :)

DigiRev
Aug 6th, 2007, 05:38 PM
did i make you want to start this?
Yes, actually, your thread (and a few others) is what inspired me to write this.

BTW, thanks for helping me out :)
You're welcome. :)

Debug.Assert
Aug 8th, 2007, 05:24 AM
This is a nice lil project.
Is there a way that the Server could remove a user from the server and prevent their return?
What are some safe (safe = not likely to be in use) ports that can be used other than your default "1234"?

Thanks for sharing this.

Paul M
Aug 8th, 2007, 06:17 AM
Service Port
HTTP 80
FTP 20,21
Gopher 70
SMTP 25
POP3 110
Telnet 23
Finger 79
Local loops/callbacks 0

Here are some publicly acceptable ports for the corresponding commuincation types.

DigiRev
Aug 8th, 2007, 11:02 AM
This is a nice lil project.
Is there a way that the Server could remove a user from the server and prevent their return?
What are some safe (safe = not likely to be in use) ports that can be used other than your default "1234"?

Thanks for sharing this.

Along with Hell-Lord's post, here's another list:
http://www.governmentsecurity.org/articles/CommonPorts.php

To remove a user from the server, do you mean to ban them? By IP? If you like, I can add that in there real quick.

psychotomus
Aug 8th, 2007, 11:44 AM
how about allowing people to change the text colour? not how you have it now.

but if a user bolds there text, it will be bold on the other clients comps too. know what i'm saying? This is what I am having difficulty doing atm.

DigiRev
Aug 8th, 2007, 01:48 PM
I'll add in text font/color/b/i/u, and IP banning. And I guess private messages while I'm at it.

Debug.Assert
Aug 8th, 2007, 04:29 PM
To remove a user from the server, do you mean to ban them? By IP? If you like, I can add that in there real quick.

Yes, thats what I meant. To remove a person from the chat "room"

DigiRev
Aug 8th, 2007, 08:56 PM
Yes, thats what I meant. To remove a person from the chat "room"

Adding in both a kick and ban feature. :)

psychotomus
Aug 9th, 2007, 04:09 PM
Heres some more things you can add. invite only chats (must be in the chat room and invite someone to enter), password chats,and set a user limit on chats.

Allready have password chats in my messenger. working on invite only chats now. kinda like mIRC channel modes.

DigiRev
Aug 10th, 2007, 02:03 AM
Thanks psycho.

I've decided since I'm adding in these other things I might as well make it multi-room also like mIRC. So next update will have:


Private messages
Font, color, bold/italic/underline, etc.
Multiple rooms
Invites to rooms
Private and passworded rooms
Other things like hyperlinks


Thanks for all the ideas, if anyone has anymore let me know.

zynder
Aug 10th, 2007, 10:29 PM
Im waiting for it Digi.

psychotomus
Aug 10th, 2007, 10:38 PM
if he don't updateit soon. i'll update his source =)

DigiRev
Aug 11th, 2007, 03:07 PM
Sorry I've been busy with work and other projects but I've already almost finished the update (which is a pretty big update). It will be uploaded tomorrow.

TheBigB
Aug 11th, 2007, 03:44 PM
Ever tried smileys?
The only way I got it to work once was with the copy-from-clipboard method to RTF-box.

DigiRev
Aug 11th, 2007, 08:21 PM
Ever tried smileys?
The only way I got it to work once was with the copy-from-clipboard method to RTF-box.

You can insert them directly into the .TextRTF property but I prefer the clipboard method because the other one can be buggy from my experience. I've got so many other projects going on right now I don't know if I will get the smilies put in.

If you want smilies, then apparently you can ask psycho to put them in since he is planning on updating this code anyway. ;)

DigiRev
Aug 12th, 2007, 12:50 AM
Sorry for another post. I've decided to just start from scratch and keep this first one as a basic example. The one I'm working on now will have more features than what is listed, so I hope this will satisfy everyone. :D It will be up sometime tomorrow afternoon/evening.

DigiRev
Aug 15th, 2007, 10:12 PM
Sorry it's taking so long. I've gotten a lot of requests from people to add in even more features. :sick:

So I'm working on file transfers, web cameras, whiteboard, and more. You can visit this program's new website:

http://www.dannydotguitar.com/VBChat/

The site is new but I will be updating it so check back.

zynder
Sep 6th, 2007, 01:55 PM
I cant download your chat app on your website.

DigiRev
Sep 8th, 2007, 03:06 PM
It's coming soon. I've been working on a website for someone and it's taking all my time, but it's paying good money.

So I haven't given up on it or anything.

itzviper
Oct 4th, 2007, 06:13 AM
have you given up yet digirev? or you just been busy? haha, just want to see if this project is still active.

werny
Oct 20th, 2007, 04:44 PM
I am having troubles, me and my friend are trying this, and it works when he hosts the server but when i host he cant connect, it tells him he timed out, I tried turning off my firewall and it still gives him the time our message, has this happened to anybody else?

TheBigB
Oct 20th, 2007, 04:59 PM
you probably connect to the net with a router.
am I correct?

You'd need to set up an UPnP configuration.
Dunno how to do that, but solves problems for p2p applications.

werny
Oct 20th, 2007, 06:52 PM
ok ill look into it, I have never heard of that before

GDOG34
Oct 21st, 2007, 12:06 AM
Here is a problem i encountered.

On my computer i run the server appkication
2. on another computer i cannot connect to the ip. Why?
Do i have to use telnet or what?

TheBigB
Oct 21st, 2007, 05:00 AM
what does the ip look like?
is it in the ranges:

10.0.0.0 - 10.255.255.255
172.16.0.0 - 172.31.255.255
192.168.0.0 - 192.168.255.255

btw, NAT traversal (http://en.wikipedia.org/wiki/NAT_traversal) is the part I meant in the UPnP technologies

werny
Oct 21st, 2007, 09:04 AM
192.168 range, class c i believe, and holy crap I am lost with all this upnp and NAT traversal crap, I cant find any download links or anything

TheBigB
Oct 21st, 2007, 09:36 AM
an ip in the ranges I mentioned is a 'private' ip.
it's your computer's ip within a network.
your network connects to the internet through a router. (which in for example my case is the wireless router)
the router has the public ip; the ip that connects you to the world. connections go to the router, and the router determines the destination of the packets within that private network.

problem is; winsock doesn't know what computer it should target behind the public ip.

you probably have the router and you act as server within the private network.
your friend sends a packet to your router, but as there is no further destination info the router doesn't know what to do with the packet so it dumps it.

GDOG34
Oct 21st, 2007, 02:46 PM
My ip looks like 192.168.1.72. Is there still a way where this can work? I never worked with winstock.

itzviper
Oct 21st, 2007, 11:05 PM
you would need to setup port forwarding on your router. Log into your router, i'm not going to go into details on this, you can do a google search for the model number of your router and should find some kind of documentation. you need to forward the port that you're trying to connect on (example: port 2000) to your computers local IP (in your case 192.168.1.72). This lets the router know that if a connection comes in on 2000 that it should relay the connection to your IP. Without the port forward the router would deny the request.

TheBigB
Oct 22nd, 2007, 12:09 AM
http://portforward.com/english/routers/port_forwarding/routerindex.htm
of course an automatic alternative would be better for an application.

GDOG34
Oct 28th, 2007, 10:49 PM
Woot i got it to work i had to alter the ports telling it which ones to use. I have a few question.

1. Is there a way to restreive the list of online users and put them in a listbox? This listbox differs from the one in the chat window.

2nd. Is there a way with this code where i can add a button and make a new chat window and be able to privite chat with a selected user?

Thx!

psychotomus
Oct 29th, 2007, 02:13 PM
try changing the ip address to localhost. it will connect to yourself no matter what. i'm also about to release sim-chat as open source. link in sig =]

GDOG34
Oct 29th, 2007, 11:02 PM
May i have an example?

GDOG34
Oct 29th, 2007, 11:47 PM
I have a question i have this code and i and wondering if this can be inserted into the messenger above. There is a problem thought evertime it send the smile it will popup with your picture editor to show the picture. Can this be added to the code above to send smileys?

Private Sub Command1_Click()
'First, just add plain text:
rchText1.SelText = rchText1.SelText & "Guest: " & Text1 & vbCrLf

'Then change what needs to be changed to pictures:
RefreshPics
DoEvents
rchText1.SelStart = Len(rchText1.Text) 'Put the start at the end, thats where you want to add the next line
Text1 = ""
Call Text1.SetFocus
End Sub

Private Sub Form_Load()
rchText1.OLEObjects.Clear 'Clear the ole objects to prevent errors
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
DoEvents
rchText1.OLEObjects.Clear 'You must add this or the
'program will crash. This doesnt
'happen in Windows 2k
DoEvents
End Sub

Sub RefreshPics() 'This scans the text for :) and (l)'s to change
Dim lFoundPos As Long 'Position of first character
'of match
Dim lFindLength As Long 'Length of string to find

Dim MakeSure As Boolean 'I have this to do the procedure twice, just to "make sure"


GoTo Skip:
Start:
MakeSure = True
Skip:

lFoundPos = rchText1.Find(":)", 0, , rtfNoHighlight)
While lFoundPos > 0
rchText1.SelStart = lFoundPos
'The SelLength property is set to 0 as
'soon as you change SelStart
rchText1.SelLength = 2
rchText1.SelText = ""
rchText1.OLEObjects.Add , , App.Path & "\smile.bmp" 'Add the picture after it has deleted the string
DoEvents
'Attempt to find the next match
lFoundPos = rchText1.Find(sFindString, lFoundPos + 2, , rtfNoHighlight)
Wend
If MakeSure = False Then GoTo Start

' I guess by changing or adding a few lines, you
' can make it add more pictures with different strings.

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Command1_Click
End Sub

GDOG34
Nov 5th, 2007, 09:48 PM
No help? The code above works but i need help inserting it into the project. Can someone alter this code where it can send images?

Thx

Justin M
Dec 23rd, 2007, 02:50 AM
This is better than the chat i have in my program already, may I use this instead???

DigiRev
Jan 29th, 2008, 03:08 AM
Hey guys...

Wow, I haven't been in here in forever. :D I've been so busy trying to land a good job, build up a portfolio, do some freelance webdesigning for money, etc., that I haven't had much time at all to work on anything in VB. :(

Anyway, that time is coming to an end and I will be able to get back to work on VBChat, the open source VB instant messenger.

I'll let you know as it progresses.

Justin M
Jan 30th, 2008, 10:35 PM
lol I have a certian IP adress, but while I can connect to the chat thing, no one else can??????????

the port thing is set to port 1234, should that be changed?

TheBigB
Jan 31st, 2008, 12:34 AM
You're probably behind a router, making it unable for outsiders to access your chat-server.

Try redirecting port 1234 to your local IP if that's the case.
You should then also make sure you have the public IP address and not the local one.

Reserved (Default) Local IP's:
10.0.0.0 - 10.255.255.255
172.16.0.0 - 172.31.255.255
192.168.0.0 - 192.168.255.255

You can get your public IP by going to whatismyip.com (http://www.whatismyip.com/).
And as I mentioned before in this thread, a guide to port forwarding (http://portforward.com/english/routers/port_forwarding/routerindex.htm).

Justin M
Jan 31st, 2008, 12:45 AM
You are right, I have a router, what is the local and public IP address and how can I find them out?

EDIT: Ok I got my public IP its different than my local one though.

And when I find them, when people want to connect to my chat server what would they type in on the client end?

EDIT2: When I try to connect using my public IP and port 1234 I get the error connectionj forcefully rejected.

TheBigB
Jan 31st, 2008, 12:52 AM
Look at the port forwarding I mentioned.

NOTE: you should be running the server application.

Justin M
Jan 31st, 2008, 01:08 AM
Ok I picked my router on the site, but it asks to select the program you are forwarding ports for from the list below

What would I pick?

TheBigB
Jan 31st, 2008, 09:06 AM
The last line says:
If you do not see the program you are forwarding ports for, be sure to visit our Default Guide for this router.

Click that Default Guide.

Justin M
Jan 31st, 2008, 06:02 PM
Ok it asks me if I want to forward a single port, is this what I want? And if yes, I want to forward port 1234?

TheBigB
Feb 1st, 2008, 12:30 AM
Yes and yes.

Justin M
Feb 1st, 2008, 08:37 AM
Ok, I did it, but when I try to connect I get a time out error on my client end?

DigiRev
Feb 1st, 2008, 01:34 PM
Ok, I did it, but when I try to connect I get a time out error on my client end?

As was said before, the port needs to be opened (1234 unless you change it). You shouldn't be getting any error which is why I think either the port was not opened correctly, or there is a firewall blocking access.

Here are some steps you (or anyone else experiencing this problem) should follow:

1. Disable the Windows XP Firewall (or other firewall if you have one) or allow BOTH the server and client to access the internet through your firewall.

2. Go to Start -> Run -> and type "cmd" and press enter. (You may need to enter "command" for other versions of Windows). This will open a command prompt.

3. Type "ipconfig" and press enter. It should show your LOCAL IP address if you are behind a router (ie: 192.168.1.101). This is the IP address you will use to setup your router.

4. Now, you need to get into your router settings. You can usually do this by opening a web browser (Internet Explorer/FireFox, etc) and typing in your router's IP address. This is usually 192.168.1.1 or something like that.

5. It will prompt you for a username and password. The defaults are usually something like "admin/admin", "admin/administrator", etc.

6. Once you are in your router settings, you need to find "Port Forwarding". There are several fields. For the application name, enter anything, like "VBChat" or whatever. Then enter the starting port, and ending port. For this program, by default, the port is 1234. So enter 1234 in both boxes.

7. Then there is a "Protocol" dropdown box. This program uses TCP, but to be on the safe side, just select the "Both" option.

8. Enter the last 3 digits of your LOCAL IP, that was found in step #3.

9. Then save the settings. Close all instances of VBChat that you might have open, and restart it. It should work.




The quickest way, is to find the "DMZ" option in your router settings and enable it for your IP address. However, I don't recommend doing this as it opens ALL ports on your router and leaves your computer wide open.

DigiRev
Feb 1st, 2008, 01:38 PM
I downloaded the source code and am currently adding in some more features (multiple rooms, private messages, maybe emoticons, webcams, file transfers, whiteboard, and probably a few other things so stay tuned :p).

Justin M
Feb 1st, 2008, 07:53 PM
Thanks for the help, but in step 8:Enter the last 3 digits of your LOCAL IP, that was found in step #3 , where do I enter that?

DigiRev
Feb 2nd, 2008, 04:05 AM
Thanks for the help, but in step 8:Enter the last 3 digits of your LOCAL IP, that was found in step #3 , where do I enter that?

It should be in the port forwarding settings. Here is a screenshot.

Justin M
Feb 2nd, 2008, 01:28 PM
Ok So I attached an image of my router settings, I am wondering if I did it right.

DigiRev
Feb 2nd, 2008, 03:09 PM
That looks right if you entered the correct IP address. Now you should run the server and have people connect to you.

Justin M
Feb 4th, 2008, 01:05 AM
Ok Could you do me a favor and see if you can connect to IP 192.168.2.12 with port 1234?

No one is in my chat room :(

MrMakealotofsmoke
Feb 4th, 2008, 01:20 AM
192.168.2.12 is your lan ip
www.whatismyip.com to get your external ip. If u have a dynamic ip it will change every 24 hours or so

Justin M
Feb 4th, 2008, 01:29 AM
Its my computer IP, so my external IP would be my router which is 142.167.89.15

What would I have to change?

DigiRev
Feb 4th, 2008, 04:50 AM
Its my computer IP, so my external IP would be my router which is 142.167.89.15

What would I have to change?

Your router settings look right. You use your local IP (192.x.x.x) for that, like you did.

Your external IP (142.167.89.15) is what you give to someone who wants to connect to your server.

Edit: I am connected to your server so it works. :)

Justin M
Feb 4th, 2008, 05:11 AM
OMG thank you so much, sorry if I don't reply to you in the chat room I have to go to school but thanks a million!!!!!

DigiRev
Feb 4th, 2008, 11:32 AM
OMG thank you so much, sorry if I don't reply to you in the chat room I have to go to school but thanks a million!!!!!

You're welcome.

Next (big) version will be out in the next day or two, features I am including are:

File transfers
Webcams
Custom rooms
Password-protected rooms
Whiteboard
Private messages
Kick/ban

Those are what I have planned for now, I might think of some other ones in the process.

Justin M
Feb 4th, 2008, 12:29 PM
Kick and ban would be good.

Justin M
Feb 11th, 2008, 03:25 AM
Wait a sec, if people who join my server can see my router IP and my comp IP would that mean they can hack me???

TheBigB
Feb 11th, 2008, 06:49 AM
If you use internet explorer or the windows firewall, there's a big chance people can :D

Just kidding.
But I personally have more faith in a non-M$ firewall.

DigiRev
Feb 11th, 2008, 05:50 PM
Wait a sec, if people who join my server can see my router IP and my comp IP would that mean they can hack me???

If you're so worried about getting hacked from someone knowing your IP, then may want to unplug your modem and not use the internet. ;)

Justin M
Feb 24th, 2008, 12:10 AM
lol Thanks but I would like to have a sound play when someone sends a message, where would I put the play sound code?

And when some enters the chat?

DigiRev
Feb 24th, 2008, 11:26 PM
lol Thanks but I would like to have a sound play when someone sends a message, where would I put the play sound code?

And when some enters the chat?

Look in the DataArrival() event to find the name of the sub that is responsible for handling when a message is received and when someone enters/leaves.

Then go to the code for that sub and put your "play sound" code there.

Sorry it's taking so long for the update. I've been real busy doing jobs on www.rentacoder.com and haven't had any free time.

Justin M
Feb 25th, 2008, 11:32 AM
lol thanks, its ok. Out of curosity, is there alot of money to be made on rentacoder?

TheBigB
Feb 25th, 2008, 12:44 PM
Only if you're an advanced coder and are experienced in customer programming.

DigiRev
Feb 25th, 2008, 09:21 PM
There are a lot of smaller projects < $200. There are also those that are $500-$2,000+. There's a wide variety of different types...for every possible programming language you can imagine. Not that many for VB6. Lots for PHP/MySQL, HTML, CSS, etc.

I've been doing a lot of the smaller ones, myself. Hopefully I can land a big one soon. :D

Justin M
Mar 21st, 2008, 12:09 PM
Umm this is usually to ask, but could anyone download the free antivirus prog I made and see if they can log on.

welll maybe the code here can log on my chat server, cause alot of peeps say they can't

the IP of the server is 142.167.72.254

Justin M
Apr 22nd, 2008, 04:33 PM
I was wondering, is there a way to change the color of the text you type with and when you send a message the text will look the same in the conversation box?

TheBigB
Apr 23rd, 2008, 12:28 AM
I don't know how this app is built, but if there is a regular textbox, you need to replace it with a RichTextBox control.
With that, sending the .rtfText property (instead of the .Text), you might be able to send multiple colors, but I'm not sure though.

DigiRev
Apr 23rd, 2008, 05:35 AM
TheBigB is correct. If I remember my own project correctly, I used a standard TextBox to keep things as simple as possible.

My original plan was to make this and hope that people were able to learn from it and add in their own features as a learning experience, that's why I kept it so basic.

But I've gotten a lot of requests to modify it and so that is what I am almost done doing now (except I started a new one from scratch)...

Server setup wizard
Custom room creator with passworded rooms
User-created rooms
Rich text (using the RichTextBox control)
File transfers/folder sharing
Admin features for server (kick, ban, warn, global message)
Webcameras
Whiteboard

Finally done with all of my RentACoder projects so I have time to work on it now...stay tuned. :p

minidesigner
Apr 30th, 2008, 01:48 PM
i am ready to see the updated version of this.

Justin M
Apr 30th, 2008, 01:57 PM
Yea lets get the super version going!!
lol

psychotomus
May 2nd, 2008, 12:45 AM
Id like to see how you do the webcams. Thats one thing I havn't been able to figure out ;]

minidesigner
May 2nd, 2008, 07:22 AM
i'm having trouble getting bold italics and underline to show in the chat window. also my users are wanting to have special colors for their names, any help.

DigiRev
May 3rd, 2008, 04:43 PM
Every time I get back to work on this, something else keeps coming up. Just want to let you know that I have been working on it and there really isn't much left to do and I am finishing it up.

Edit: minidesigner, choosing colors for names is a good idea actually, never thought of that. I will put that in there also.

Genovah
May 3rd, 2008, 10:22 PM
I would just like to thank DigiRev... I downloaded your source and have started fine tuning it for what I am looking for personally. I just want to thank you for being willing to do so much work for no monetary reward. A lot of people wouldn't be willing to do such work. I like the classic version and will continue coding ontop of it.

Question though (for anyone) is it going to be OK to continue programming in Visual Basic 6.0 or is Visual Basic 2008 Express the way to go for free lance programming for personal use?

MartinLiss
May 3rd, 2008, 11:32 PM
I would just like to thank DigiRev... I downloaded your source and have started fine tuning it for what I am looking for personally. I just want to thank you for being willing to do so much work for no monetary reward. A lot of people wouldn't be willing to do such work. I like the classic version and will continue coding ontop of it.

Question though (for anyone) is it going to be OK to continue programming in Visual Basic 6.0 or is Visual Basic 2008 Express the way to go for free lance programming for personal use?http://www.vbforums.com/attachment.php?attachmentid=47243&stc=1

We like to have people create their own threads for questions like this but in any case, while VB6 will be around for several years at least, (sadly) you should probably switch over to 2008.

DigiRev
May 3rd, 2008, 11:36 PM
I would just like to thank DigiRev... I downloaded your source and have started fine tuning it for what I am looking for personally. I just want to thank you for being willing to do so much work for no monetary reward. A lot of people wouldn't be willing to do such work. I like the classic version and will continue coding ontop of it.

Question though (for anyone) is it going to be OK to continue programming in Visual Basic 6.0 or is Visual Basic 2008 Express the way to go for free lance programming for personal use?

Thanks Genovah. You're doing exactly what I was hoping most people would do. Use this as a sort of framework to build from and/or learn how to use the Winsock control. That's why I kept it so stripped-down and simple as possible.

As MartinLiss said, you may want to switch over to 2008/.NET. Personally, I've been learning C++ (which is much different) because I don't like .NET at all.

Genovah
May 4th, 2008, 12:11 AM
Thanks Genovah. You're doing exactly what I was hoping most people would do. Use this as a sort of framework to build from and/or learn how to use the Winsock control. That's why I kept it so stripped-down and simple as possible.

As MartinLiss said, you may want to switch over to 2008/.NET. Personally, I've been learning C++ (which is much different) because I don't like .NET at all.

I haven't done VB6 since I was in highschool I have mostly been working on Flash projects and things of the sort but after finding this site I have found interest in program coding. I appreciate and lookforward to more projects from you and thank you both for your opinnions on which programs are best. I know very little about C++ but I like the interface of VB so maybe I'll switch over to 2008 in the near future. DigiRev is there a way to contact you personally? I would like to show you my re-vamp of your basic program... I only worked on it for a couple hours so not a whole lot has changed but perhaps with all the requests you have recieved you will have some ideas for me (not code trying to learn that on my own ;))


Thanks Martin for the welcome! Sorry for not starting a new thread for it.

Genovah
May 4th, 2008, 03:33 AM
Sorry for the double post... Here is the compiled version with the changes I have made... If you would like the source just let me know and I can post that to.

DigiRev
May 4th, 2008, 03:47 AM
Sorry for the double post... Here is the compiled version with the changes I have made... If you would like the source just let me know and I can post that to.

Nice, looks cool. :cool: :thumb:

Genovah
May 4th, 2008, 04:04 AM
Thanks can't wait to see yours :)

minidesigner
May 5th, 2008, 08:54 AM
Genovah yours looks cool.

Genovah
May 5th, 2008, 09:12 AM
Thanks but the credit goes to DigiRev without his source I would be dazed it has tought me a lot about Winsock and now I will be incorperating it in a lot of new projects

Genovah
May 5th, 2008, 08:20 PM
I recieved a PM requesting that I post the source code to the client so here it is!

Note: The source has not changed a WHOLE lot since his there is just a few added features I am still working on the rest and not ready to release it yet.

*edit* Sorry typed up the previous message on a work computer then went to upload it and realized that the source was on my home computer (Doh!) So I logged on remotely and here it is

Genovah
May 8th, 2008, 08:22 AM
And my newest executeable if anyone is interested... Client only (haven't had enough time to work on the server portion yet still pretty basic.)

Note: Upon closing the program it will write .txt files to "C:\Program Files\ChatterBox\" to save the settings that you have chosen... just so you are aware..

I'm looking for feedback and ideas to add to the project I already have a list wrote down of some of them. Still a work in progress (Digi is so much better at this then I, haha)

Take care all.

Philly0494
May 10th, 2008, 11:45 PM
I made some changes, this has more options as well as a great logging system


Features:

Client:
Leave Room
Reconnect
Style Changes
Features - Run, Kill, Calc, Temp

Server:
Announce
Disconnect Clients
Style Changes
Save Chat
View Logs
Clear Logs
Features - Run, Kill, Calc, Temp

When you close the server, the logs are updated, so you don't need to press Save Chat everytime

If anyone wants the source code just look below.

Justin M
May 11th, 2008, 09:29 AM
Do you know if there is a way to ban or disconnect troublesome members?

TheBigB
May 11th, 2008, 09:45 AM
That would be just a matter of finding out which socket the member uses and then sck.Close.
For banning you'd get the .RemoteIP from the user before closing and put that in a 'deny connection' list in the Connection_Request event.

DigiRev
May 11th, 2008, 11:24 AM
Exactly what TheBigB said. I'll add it into the server real quick since this update is taking a little longer than I thought.

Will post back soon.

DigiRev
May 11th, 2008, 12:05 PM
Ok, this should work. I wrote it really quickly but it should not let them into the room once they are banned.

On the server, right-click the user list to ban a user.

The client also wasn't closing properly so that should be fixed also.

Philly0494
May 11th, 2008, 05:51 PM
Ok, this should work. I wrote it really quickly but it should not let them into the room once they are banned.

On the server, right-click the user list to ban a user.

The client also wasn't closing properly so that should be fixed also.

yeah i also fixed the client problem

and i just added a block user function that works both client and server sided, it ignores the user, not disconnects him.

so that will be up soon

Philly0494
May 11th, 2008, 06:50 PM
Here it is

Client:
Leave Room
Reconnect
Style Changes
*Block User*

Server:
Announce
Disconnect Clients
Style Changes
Save Chat
View Logs
Clear Logs
*Block User*
*Lock User*

I got rid of those other, unnecessary features.

you can only block 1 person at a time, same with locking
just right-click a user in the listbox

Blocking: you dont hear the selected person
Locking: nobody hears the selected person

I'll add anything else you guys want me to

minidesigner
May 12th, 2008, 08:56 AM
you both have great working models. digirev i can't wait to see your final version.

DigiRev
May 12th, 2008, 02:27 PM
you both have great working models. digirev i can't wait to see your final version.

Almost done. :D

Will be a huge improvement over the first one.

Philly0494
May 12th, 2008, 03:11 PM
are you going to put my chat logging system in you new release?

DigiRev
May 12th, 2008, 04:34 PM
are you going to put my chat logging system in you new release?

Yeah I liked your logging feature so I'll put that in there also. :)

If anyone has any more ideas, now is the time to let me know. It's getting pretty close to being done.

Philly0494
May 12th, 2008, 08:34 PM
Client:
Leave Room
Reconnect
Style Changes
Block User
*Block User Management (Max 3)*

Server:
Announce
Disconnect Clients
Style Changes
Save Chat
View Logs
Clear Logs
Block User
Lock User
*Block User Management (Max 3)*
*Lock User Management (Max 3)*

you guys can take this, but im not gonna bother making any more since digirev will do a much better job when he finishes his

Genovah
May 13th, 2008, 09:17 AM
Here is my latest I haven't finished everything (no where near going to add a few more features) There are some options in the context menu that are actually not in use yet (Ignore, Global Mute) You will notice under the console I added a 'unban' 'restart server' and 'shutdown server' feature as well as another lstbox with the user names... will finish it up tomorrow and probably work on more features.... let me know what you guys think! Can't wait to see yours digi!

zynder
May 13th, 2008, 10:13 AM
Nice one Genovah. Can you add a PM feature server/client? Great effort dude!

Genovah
May 13th, 2008, 02:44 PM
Nice one Genovah. Can you add a PM feature server/client? Great effort dude!
Thank you! I will work on private messaging once I get these other features nailed down.

Currently I am having a problem with m Global Mute feature its not saving/loading properly perhaps someone could shed some light on where I messed up? I might not be able to find it for the fact that I'm extremely tired and maybe it will be easier later but here it is:

Option Explicit

'Structure to store info about a user.
'Add your own stuff if you want.
Public Type CHAT_USER
strNickname As String 'Nickname.
strIP As String 'IP address.
strBuffer As String 'Received data buffer from this client.
'Add your own stuff like:
'strRoomName As String 'For multiple rooms.
'strTimeConnected As String 'To store what time they connected?
'All code in the server is based off the info stored here.
End Type

'An array that contains all info about every user.
'A user's index in this array corresponds to the Winsock control responsible for this connection.
Public udtUsers() As CHAT_USER

'Max integer value, therefore, max simultaneous connections.
'(Most computers can't handle anywhere near this many).
Public Const MAX_INT As Integer = 32767

'One main sub that closes the server.
'Should be called before opening the server.
Public Sub CloseServer()
'Steps:
'------
'1. Unload & close all Winsock controls.
'2. Erase udtUsers() array to clear up memory.

Dim intLoop As Integer

With frmChat
.sckServer(0).Close 'Close first control.

If .sckServer.UBound > 0 Then
'More than one Winsock control in the array.
'Loop through and close/unload all of them.
For intLoop = 1 To .sckServer.UBound
.sckServer(intLoop).Close
Unload .sckServer(intLoop)
Next intLoop
End If

End With

'Erase all current users from memory.
Erase udtUsers
End Sub

'Finds an available Winsock control to use for an incoming connection.
'You can just copy/paste this code into your chat program if you want.
'Just change "sckServer" to the name of your Winsock control (array).
'And change MAX_INT to max simultaneous connections that you want (it is at top of this module).
Public Function NextOpenSocket() As Integer
Dim intLoop As Integer, intFound As Integer

With frmChat
'First, see if there is only one Winsock control.
If .sckServer.UBound = 0 Then
'Just load #1.
Load .sckServer(1)
.sckServer(1).Close
NextOpenSocket = 1
Else
'There is more than 1.
'Loop through all of them to find one not being used.
'If it is not being used, it's state will = sckClosed (no connections).
For intLoop = 1 To .sckServer.UBound
If .sckServer(intLoop).State = sckClosed Then
'Found one not being used.
intFound = intLoop
Exit For
End If
Next intLoop

'Check if we found one.
If intFound > 0 Then
NextOpenSocket = intFound
Else
'Didn't find one.
'Load a new one.
'Unless we reached MAX_INT
'which is max number of clients.
If .sckServer.UBound + 1 < MAX_INT Then
'There is room for another one.
intFound = .sckServer.UBound + 1
Load .sckServer(intFound)
.sckServer(intFound).Close
NextOpenSocket = intFound
Else
'Server is full!
Debug.Print "CONNECTION REJECTED! MAX CLIENTS (" & MAX_INT & ") REACHED!"
End If

End If
End If
End With

End Function

'Returns the upper bounds (UBound) of udtUsers array without an error.
Public Function UBUsers() As Long
On Error GoTo ErrorHandler

UBUsers = UBound(udtUsers)

Exit Function

ErrorHandler:

End Function

'ignore a user.
Public Sub GlobalMuteUser(ByRef Username As String, Switch As Integer)
Dim l As Long, u As Long
Dim s As String, strPacket As String
Dim r As Long
' On Error GoTo ErrorHandler
If Username = "" Then Exit Sub
s = LCase$(Username)
u = UBUsers
If Switch = 1 Then
For l = 0 To u
If LCase$(udtUsers(l).strNickname) = s Then
GlobalMute_Add udtUsers(l).strIP
Mute_Save udtUsers(l).strIP, 1
r = l
Exit For
End If
Next l
AddStatusMessage frmChat.rtbChat, RGB(128, 0, 0), Username & " was muted."
Else
For l = 0 To u
If LCase$(udtUsers(l).strNickname) = s Then
GlobalMute_Add udtUsers(1).strIP
Mute_Save udtUsers(l).strIP, 0
r = l
Exit For
End If
Next l
AddStatusMessage frmChat.rtbChat, RGB(128, 0, 0), Username & " was un-muted."
End If
ErrorHandler:
End Sub

Public Sub KickUser(ByRef Username As String)
Dim l As Long, u As Long
Dim s As String, strPacket As String
Dim r As Long
On Error GoTo ErrorHandler
If Username = "" Then Exit Sub
s = LCase$(Username)
u = UBUsers
For l = 0 To u
If LCase$(udtUsers(l).strNickname) = s Then
strPacket = "KIK" & Chr$(2) & udtUsers(1).strNickname & Chr$(4)
r = l
End If
Next l

If Len(strPacket) > 0 Then
SendGlobalData strPacket
frmChat.sckServer_Close CInt(r)
AddStatusMessage frmChat.rtbChat, RGB(128, 0, 0), Username & " was kicked."
End If
ErrorHandler:
End Sub



Option Explicit
Public strMuted() As String
Public bolRestart As Boolean

Public Sub Mute_Save(ByRef IPAddress As String, Switch As Integer)
Dim intFF As Integer, l As Long, u As Long
Dim sNextLine As String
intFF = FreeFile
'On Error Resume Next
'Kill App.Path & "\muted.txt"
'On Error GoTo ErrorHandler
If Switch = 1 Then
u = Mute_Ubound
If u > -1 Then
Open App.Path & "\muted.txt" For Append As #intFF
For l = 0 To u
If Len(strMuted(l)) > 0 Then
If l < u Then
Print #intFF, strMuted(l)
Else
Print #intFF, strMuted(l);
End If
End If
Next l
Close #intFF
End If
Exit Sub
ElseIf Switch = 0 Then
u = Mute_Ubound
ReDim Preserve strMuted(0 To u)
If u > -1 Then
Open App.Path & "\muted.txt" For Input As #intFF
Erase strMuted
Do Until EOF(intFF)
Line Input #intFF, sNextLine
If Not sNextLine = "" Then
If Not sNextLine = IPAddress Then
strMuted(l) = sNextLine
Else
strMuted(l) = vbNullString
End If
End If
l = l + 1
Loop
Close #intFF
Open App.Path & "\muted.txt" For Output As #intFF
Print #intFF, vbNullString
Close #intFF
Open App.Path & "\muted.txt" For Append As #intFF
For l = 0 To u
If Len(strMuted(l)) > 0 Then
If l < u Then
If Not IPAddress = strMuted(l) Then Print #intFF, strMuted(l)
Else
If Not IPAddress = strMuted(l) Then Print #intFF, strMuted(l)
End If
End If
Next l
Close #intFF
End If
End If
ErrorHandler:
Close #intFF
Exit Sub
End Sub

Public Sub Mute_Load()
Dim intFF As Integer
intFF = FreeFile

Erase strMuted
On Error GoTo ErrorHandler
Open App.Path & "\muted.txt" For Input As #intFF
If LOF(intFF) > 0 Then strMuted = Split(Input(LOF(intFF), intFF), vbCrLf)
Close #intFF
Exit Sub
ErrorHandler:
Close #intFF
Exit Sub
End Sub

Public Sub GlobalMute_Add(ByRef IPAddress As String)
Dim u As Long
u = Mute_Ubound + 1
ReDim Preserve strMuted(0 To u) As String
strMuted(u) = IPAddress
End Sub

Public Function GlobalMute_IsMuted(ByRef IPAddress As String) As Boolean
Dim l As Long, u As Long
u = Mute_Ubound
If u > -1 Then
For l = 0 To u
If strMuted(l) = IPAddress Then
GlobalMute_IsMuted = True
Exit For
End If
Next l
End If
End Function

Public Function Mute_Ubound() As Long
On Error GoTo ErrorHandler
Mute_Ubound = UBound(strMuted)
Exit Function
ErrorHandler:
Mute_Ubound = -1
Exit Function
End Function


I am having problems in the Muted_Save portion of the code. The code is truncated so it could fit. Thanks for any help in advance!

minidesigner
May 13th, 2008, 02:49 PM
first off explain what mute is to be used for

Genovah
May 13th, 2008, 02:55 PM
It prevents the user from speaking what so ever by calling upon a sub to check and see if the user has been added to the mute list the problem is in the Mute_Save sub

Below this line of code: If switch = 0 then where muted.txt is input into the string sNextLine

sNextLine = strMuted(l) should put the text into the proper string but I get a subscript error. not sure why seeing as the dimensions are set properly as far as I can tell... but as I said earlier maybe its lack of sleep... off to take a nap

*edit* Fixed... I accidently put an Erase string in by mistake

psychotomus
May 13th, 2008, 11:04 PM
Genovah, you should really convert to a database instead of usng text files. it reduces code by a lot =)

Genovah
May 14th, 2008, 06:10 AM
I agree but the coding I have done with databases has all been in PHP/SQL... So my knowledge is limited seeing as I didn't do it too much... However if I were to go to a database setup wouldn't the server have to be running Microsoft SQL or another type of database? I am trying to make a server that can be run by any user with minimal to no set up required... once I scratch the public version and make my own I will definetly learn/convert it to DB format

psychotomus
May 14th, 2008, 02:21 PM
You can use microsoft access database .mdb files and the querys are the same as if you was using mySQL for the most part so its pretty simple to pick up. If you need an example. i'll post one =)

Genovah
May 14th, 2008, 02:28 PM
As long as you don't mind I would be interested in seeing an example

psychotomus
May 14th, 2008, 02:52 PM
http://www.vbforums.com/showthread.php?p=3228114 MULTI-USER WINSOCK CHAT USING ACCESS DATABASE

TheBigB
May 14th, 2008, 04:20 PM
I once tried to build a chatting system from scratch with databases...
I gave up :D

But that's quite usually the thing that happens when I start with things from scratch, due to lack of time/patience/coffee and the overflow of laziness/practical problems/the application.

Anyways,
@psych; that interface looks so familiar, but I don't remember where from...

Genovah
May 15th, 2008, 12:56 AM
http://www.vbforums.com/showthread.php?p=3228114 MULTI-USER WINSOCK CHAT USING ACCESS DATABASE

After reviewing the code and looking at everything I think I am going to go with an access database will make it easier to store all the colors and everything else. Thanks psycho! it was a great idea! BTW do you have groove or another type of messanging service? I would like to add you as a friend if you don't mind.

Genovah
May 16th, 2008, 06:58 AM
DB not installed yet but PM feature is complete
Note: ignore is not fully functional on the client side yet

DigiRev
May 17th, 2008, 06:12 AM
Here are a few spoiler screenshots in case you are wondering what it looks like so far...

http://www.vbforums.com/attachment.php?attachmentid=64168&d=1211022707

http://www.vbforums.com/attachment.php?attachmentid=64169&d=1211022711

http://www.vbforums.com/attachment.php?attachmentid=64170&d=1211022714

http://www.vbforums.com/attachment.php?attachmentid=64171&d=1211022717

http://www.vbforums.com/attachment.php?attachmentid=64172&d=1211022721

I have it setup so you can create different "server configurations" with different room lists and settings and load them right from the Server menu so you don't have to set it up every time.

Genovah
May 17th, 2008, 06:15 AM
Wow Digi and I thought I was getting somewhere.... *bows to DigiRev*

Good job can't wait to start parsing your code! :P

Are you using a db format or standard .txt files with VB Chat?

DigiRev
May 17th, 2008, 06:31 AM
I wanted this to be kind of like mIRC without people having to sign up so there is no db or anything.

Maybe after I release this one I'll make an IM version...

Will post more screenshots soon. File transfers are being a *****

Genovah
May 17th, 2008, 06:38 AM
Makes sense to me! Thats kind of what I was going for but then after implementing an admin feature I figure I would be best off going with a db instead of multiple strings identifying admins vs moderators vs regular clients

Justin M
May 17th, 2008, 08:35 PM
Here are a few spoiler screenshots in case you are wondering what it looks like so far...

http://www.vbforums.com/attachment.php?attachmentid=64168&d=1211022707

http://www.vbforums.com/attachment.php?attachmentid=64169&d=1211022711

http://www.vbforums.com/attachment.php?attachmentid=64170&d=1211022714

http://www.vbforums.com/attachment.php?attachmentid=64171&d=1211022717

http://www.vbforums.com/attachment.php?attachmentid=64172&d=1211022721

I have it setup so you can create different "server configurations" with different room lists and settings and load them right from the Server menu so you don't have to set it up every time.

Wow that is pretty cool, how did you get the rounded frames in vb 6?

PS: How did you ever get ti so people could change their username color?

DigiRev
May 18th, 2008, 01:53 AM
Wow that is pretty cool, how did you get the rounded frames in vb 6?

PS: How did you ever get ti so people could change their username color?

Those are normal frames. I'm just using a manifest file for XP style. ;)

I sent the color along with the nickname when they login. And store this color in the CLIENT UDT on the server side.

When the server relays a chat message to the room, it also sends this color from that user's UDT.

Then I updated the procedure that shows a chat message to set the color of the username to this value.

Sorry, that's the best I can explain it. This thing should be done pretty soon and you can see.

minidesigner
May 18th, 2008, 10:16 PM
can't waite looks great

Genovah
May 21st, 2008, 05:03 PM
If you are trying to set up a type of buddy list you are going to be better off going with a DB setup... The setup he has resets everything once the program is close I don't see how it would support friends unless everything was set to save to a text file but thats going to be a lot of text files Unless of course you dont mind that the buddy list is reset everytime... and since there is no login password anyone could potentially use that persons nickname so eventhough the person who used that name the first time might be your friend... the next person who uses it may not if you understand what I mean... there is an example if you scroll back to one of the previous pages. It has a buddy list and a DB you might want to check it out to get some ideas.

minidesigner
May 28th, 2008, 09:43 AM
actually couldn't you have all of your settings, buddy list, and all that be saved in one text file to reduce the amount. if organized properly it would work.

psychotomus
May 29th, 2008, 12:31 AM
actually couldn't you have all of your settings, buddy list, and all that be saved in one text file to reduce the amount. if organized properly it would work.

reduce the ammount of what? I would think having all info in 1 file would make it take more space, seperate txt files would work better if your d oing it that way with all those txt files in there own folder per user.

minidesigner
May 29th, 2008, 09:34 AM
actually a txt file really isn't that large of a file especially with the info we're talking about saving in it. i could be wrong on that i'll have to test the theory but we have txt files at my office, actually the extention is mdf. okay my bad after looking at them closer they are database files but still they open as text files just with a specific format. anyway my point is the largest file is 1936 lines, you could use a standard txt file but your right as it would take more code to do than using data access in vb. sorry for type o's and me not using my brain.

Genovah
May 29th, 2008, 04:48 PM
My only point is that say that Fred adds Joe as a buddy... Joe doesn't use the nickname Joe the next time he logs in and instead uses JOEY111 and a guy named Tom logs in as Joe... Unless the server is going to log all the users by IP and determine who the actual buddy is anyone could log in as your "buddy" and you wouldn't know it wasn't them unless you require a password... If you are using the basic VB chat that was created in my opinion (and maybe I am wrong) but, it seems a little silly to be using a buddy list as anyone could login as your buddy and your buddy could login as any other username... That was my only point for using a database in comparison to a text file.. and the basic client side doesn't have get IP addresses for other users from the server so you would be better off doing the buddy list portion server side anyways just like in SIM chat.

psychotomus
May 30th, 2008, 02:24 PM
other thing to think about is if you use a txt file say in sim/onlinebuddys.txt

inside that txt file is 150 online buddys. buddy number 83 sign's off. you now have to recreate that txt file everytime someone signs on or off ;]

DigiRev
May 30th, 2008, 05:01 PM
Database is the best way.

You could store account information in .txt files. And keep buddy lists/contacts in memory and never save them to file.

You could either have one big text file with all accounts (or INI file), or a separate one for each user (probably not a good idea).

A simple database makes things a lot easier though.

Milad87
Jun 1st, 2008, 04:48 AM
Very nice Job DigiRev... Im looking forward to look at ur finished project...

A nice function to ur chat would be the microphone chat to make users able to talk... Hard to make but it would be nice... good luck:)

emyztik
Jun 1st, 2008, 07:57 PM
say the users whole friends list is in a database like this: kyle,john,mark
all separated by commas.

how would you determine the users online/offline friends(how to tell which ones are online and offline) and send the online friends, then send the offline ones?

or am i thinking of this totally the wrong way?

Genovah
Jun 2nd, 2008, 03:46 PM
If you look at the Sim Chat example there is a column labeld is_online which has either a value of 0 or 1 0 being offline 1 being online that is the way i would do it, it is stored in the users table with the users username and password

Genovah
Jun 12th, 2008, 02:33 PM
Well here is a huge revamp from my previous version. Please let me know if you find any bugs or have any suggestions. Feedback is much appreciated!

If you are trying to use the e-mail feature you will need to edit the SendMail sub and enter your gmail user account information. The only thing that is not functional server side is the chatrooms feature that is still a work in progress. Ignore any foul language in the code it is mostly me talking to myself. The main server is online so feel free to connect if you have questions or want to talk.

Thanks!

DigiRev
Jun 13th, 2008, 03:28 AM
Sorry guys. 2-3 more days (on Monday/Tuesday), and that is the final deadline. If it is not done by then, you can shoot me. :)

I decided to make it IM based, with user registration, database, and contact/buddy list since a lot of people seem to wonder how that is done. I am new to databases in VB myself but I am using the ADO 2.8 library and have most of it working after reading the tutorial in the CodeBank.

The only downside is you will need to register an account for every server you connect to. But I am making the registration as simple as possible, just username/email/password and password recovery question/answer.

Only accounts, contact lists, and ignore lists will be saved in the database. The rest will be done in memory on the server (who is online, offline, etc.).

This is a big project so it might be hard to learn from like this one. I am going to try & keep things as simple as possible, but some things might be done a little harder for the sake of performance.

I hope it will be worth the wait. This will be like a Yahoo! Messenger clone with a lot of the same features. ;) No voice chat in this release, though. I may do that as an update when I can take the time to sit down with it and make it work. I will also try to post some screen shots soon before it's released.

Calaf
Jun 15th, 2008, 05:05 AM
Hello all.
I was reading the post talking about the techinque you use to ban a client. Well, your proposal was to ban the IP but I have to say that this is not such smart way to ban a client given mostly simply have a dynamic IP so that the banned one has just to disconnect his modem getting a new IP and voila.

I'm talking about this argument to preserve the server and the lobby chat from hackers attach or anyway all those people who wants to annoy or crash the environment. Then my question is: is there a better way to know exactly the source of data from a client in order to ban it definitely?
Of course I'm talking about safety problems.

DigiRev
Jun 15th, 2008, 11:19 AM
You can make your client send a hardware GUID (like hard drive # or something) and then ban that. Or ban an IP range...That is how a lot of anti-cheat software works in games (PunkBuster).

But if you plan to send a hardware GUID or any personal info like that you should warn the user before they use/install your program.

GDOG34
Jun 15th, 2008, 03:29 PM
Or you can have it where when the user "signs up" it uploads there username into a database/file and when that user gets banned you can have a ban list. This way the username cannot be used again becuase it is in the datatbase.

TheBigB
Jun 15th, 2008, 03:36 PM
But that doesn't prevent the user from creating another username

GDOG34
Jun 15th, 2008, 04:06 PM
Yes but the user can just go on a differnt computer and create a new username and get around this. The user also can use ip software that gives them new ip information that hides there orignal one. There is still many go arounds to this...

TheBigB
Jun 15th, 2008, 04:21 PM
But most people wouldn't go that far.
There is no way to make a fool proof ban system.
In most cases an IP ban will be more than enough.

Calaf
Jun 16th, 2008, 04:11 AM
You can make your client send a hardware GUID (like hard drive # or something) and then ban that. Or ban an IP range...That is how a lot of anti-cheat software works in games (PunkBuster).

But if you plan to send a hardware GUID or any personal info like that you should warn the user before they use/install your program.


ty Digirev but here my questions:

1) Why should I warn the user? I mean, do you think such actitude is under right?And if it's under right then what the users might do against me?
2) How to get those hardware informations by using Vb?
3) How a client might protect itself from being tracked that way?

ty in advance

DigiRev
Jun 16th, 2008, 10:02 AM
ty Digirev but here my questions:

1) Why should I warn the user? I mean, do you think such actitude is under right?And if it's under right then what the users might do against me?
2) How to get those hardware informations by using Vb?
3) How a client might protect itself from being tracked that way?

ty in advance

Anytime that personal information might be sent by your program, you should let the user (and may actually be required by law to tell them but I don't know). Things like PunkBuster which is an anti-cheat system for games tells the user. It is up to you, though.

There is a submission in the code bank to get hard drive serial # (and also some more on www.pscode.com/vb). Some serial #'s can be changed, but the one in the CodeBank gets the one put in there by the hard drive manufacturer which cannot be changed.

There are a few ways. If you use the # that can't be changed then I'm not aware of any way to spoof that.

If you take programs like OlyDbg into account, people can debug/reassemble your program to send off a different hardware ID, which is not actually very hard. Finding ways around that are hard, but there are some programs you can use to help.

Genovah
Jun 18th, 2008, 01:33 PM
Any updates digi? any expected completion date?

TheBigB
Jun 18th, 2008, 01:47 PM
*shoot, shoot* :p

DigiRev
Jun 18th, 2008, 05:05 PM
I finished it yesterday (Tuesday ;)). I ran across a few bugs and am fixing those now then gonna package it and upload it...

psychotomus
Jun 19th, 2008, 03:24 AM
post screen shots too =)

emyztik
Jun 21st, 2008, 05:59 PM
is it done yet?

snortop
Jun 22nd, 2008, 01:14 AM
he didnt say which Monday, tuesday it where.. lol

I hope it get done soon :)

DigiRev
Jun 25th, 2008, 12:09 AM
It is done. Hard drive went dead (I have the worst luck) but thankfully I have everything backed up on DVDs so nothing is lost (except a lot of other stuff but not vbChat).

Thanks for being so patient. It will be worth the wait, though, for sure. ;) Getting my programs re-installed now, and then I'm going to prepare an installation and make sure everything is in order then I will upload it.

minidesigner
Jun 25th, 2008, 09:06 AM
good luck

emyztik
Jun 27th, 2008, 08:09 PM
3 days later.... :lol:

Genovah
Jun 28th, 2008, 08:22 PM
Digi are you still alive? Everything going well...? Any new expected release?

emyztik
Jul 3rd, 2008, 07:04 PM
DigiRev, what's up with it??

Aphex
Jul 3rd, 2008, 09:53 PM
I just spoke to DigiRev. The whole thing is complete but he's having Computer issues (complete system crash) and cannot use it at the moment nor can he access it, obviously.

Give him a bit, guys.

Neato
Jul 4th, 2008, 02:37 PM
Sata cables + Another box = Recovery of data files :D

guitar
Jul 4th, 2008, 10:19 PM
Everything is on that old hard drive, password to my DigiRev account, e-mail address, all my programming stuff, etc. I had that computer since about 1998 so it was just a matter of time before it went wrong...but man...bad timing! I had just created a webpage for it and installation program. :mad:

It will be worth the wait, trust me. ;) Very similar to Yahoo! Messenger/Skype, etc. so if you ever wondered how a lot of the features in those work, you will get to see soon.

Thanks for being patient.

TheBigB
Jul 5th, 2008, 06:18 AM
Why don't you request a new password?

yosef_mreh
Jul 5th, 2008, 07:07 AM
hi all
how can i use vb6 to get windows password of the login username?

TheBigB
Jul 5th, 2008, 10:43 AM
hi all
how can i use vb6 to get windows password of the login username?
Only post in existing threads if your question is relevant to the thread's subject. Otherwise create a new thread.

guitar
Jul 6th, 2008, 08:55 PM
Why don't you request a new password?

Because the password to my e-mail is on that hard drive also...

psychotomus
Jul 12th, 2008, 02:21 AM
how can you not remember your password? lols.

minidesigner
Nov 17th, 2008, 09:43 AM
so has this just died or what

minidesigner
Feb 10th, 2009, 07:21 AM
so whats going on with this thread

DigiRev
Feb 11th, 2009, 01:37 AM
I'm not dead. I stopped programming for awhile.

I still have the code on a backup drive...if I remember correctly, it's basically done, there was just a bug or two that needs to be fixed.

I'll post it when I get around to it. I forgot about it entirely.

minidesigner
Feb 11th, 2009, 08:49 AM
was looking forward to seeing your final project. i've used yours and tweeked it to work with some of the programs iwe use in my office.

emyztik
Mar 13th, 2009, 12:48 AM
would be cool to see, you find it?

josh.rice
Mar 13th, 2009, 12:55 AM
I have created a chat program, I hope that you guys like it :D

josh.rice
Mar 13th, 2009, 01:02 AM
Attribute VB_Name = "modRooms"
Global frmRooms() As New frmRoomChat
Public strRoomsHide() As String

Dim roomIndex As Integer

Public Function UbRooms() As Long
On Error GoTo ErrorHandler
UbRooms = UBound(frmRooms)
Exit Function
ErrorHandler:
UbRooms = -1
Exit Function
End Function

Sub HandleUserLeavingRoom(Packet As String)
'"ULV()Uname()Room<<"
If InStr(1, Packet, Chr(2)) > 0 Then
Dim packetDetails() As String
Dim UserName As String
Dim Roomname As String
packetDetails() = Split(Packet, Chr(2))
UserName = packetDetails(1)
Roomname = packetDetails(2)
If RoomsHide_IsHiding(Roomname) = True Then ShowHiddenRoom Roomname
WriteMesssage frmRooms(roomIndex).rtbChat, vbNullChar, UserName & " has left the room.", vbMagenta
RemoveListItem frmRooms(roomIndex).lstRoomUsers, UserName, True
End If
End Sub

Sub HandleNewRoomUser(Packet As String)
'"UJN()Uname()Room<<"
If InStr(1, Packet, Chr(2)) > 0 Then
Dim packetDetails() As String
Dim UserName As String
Dim Roomname As String
packetDetails() = Split(Packet, Chr(2))
UserName = packetDetails(1)
Roomname = packetDetails(2)
If RoomsHide_IsHiding(Roomname) = True Then ShowHiddenRoom Roomname
WriteMesssage frmRooms(roomIndex).rtbChat, vbNullChar, UserName & " has entered the room.", vbMagenta
RemoveListItem frmRooms(roomIndex).lstRoomUsers, UserName, True
frmRooms(roomIndex).lstRoomUsers.AddItem UserName
End If
End Sub

Public Sub AddNewRoom()
ReDim Preserve frmRooms(UbRooms + 1)
End Sub

Sub ShowHiddenRoom(Roomname As String)
Dim x As Integer
For x = 0 To UbRooms
If frmRooms(x).Caption = Roomname Then
frmRooms(x).Show
Exit Sub
End If
Next x
End Sub

Public Sub ShowRoom(strRoomName As String)
Dim u As Integer

u = UbRooms
If u > -1 Then
For roomIndex = 0 To u
If frmRooms(roomIndex).Caption = strRoomName Then
frmRooms(roomIndex).Show
Exit For
ElseIf frmRooms(roomIndex).Caption = "" Then
frmRooms(roomIndex).Caption = strRoomName
frmRooms(roomIndex).Show
AddNewRoom
Exit For
End If
Next roomIndex
End If
End Sub

Public Function RoomsHide_IsHiding(ByRef Roomname As String) As Boolean
Dim l As Long, u As Long, s As String
u = RoomsHide_UBound
s = LCase$(Roomname)
If u > -1 Then
For l = 0 To u
If LCase$(strRoomsHide(l)) = s Then
RoomsHide_IsHiding = True
Exit For
Else
RoomsHide_IsHiding = False
End If
Next l
End If
End Function

Public Function RoomsHide_UBound()
On Error GoTo ErrorHandler
RoomsHide_UBound = UBound(strRoomsHide)
Exit Function
ErrorHandler:
RoomsHide_UBound = -1
Exit Function
End Function

Public Sub RoomsHide_Add(ByRef Roomname As String)
Dim u As Long
u = RoomsHide_UBound + 1
ReDim Preserve strRoomsHide(0 To u) As String
strRoomsHide(u) = Roomname
End Sub

Sub HandleWrongRoomPassword(Packet As String)
If InStr(1, Packet, Chr(2)) > 0 Then
Dim packetDetails() As String
packetDetails() = Split(Packet, Chr(2))
MsgBox "The password you used to enter the " & packetDetails(1) & " chat room is wrong. Please retry.", vbExclamation
WriteLog frmMain.rtbLog, "Access denied to the " & packetDetails(1) & " chat room: Wrong Password.", vbMagenta
End If
End Sub

Sub HandleJoinedRoom(Packet As String)
If InStr(1, Packet, Chr(2)) > 0 Then
Dim packetDetails() As String
packetDetails() = Split(Packet, Chr(2))
ShowRoom (packetDetails(1))
'WriteLog frmMain.rtbLog, NickName & " joined the " & packetDetails(1) & " chat room."
End If
End Sub

Sub AlreadyInRoom(Packet As String)
If InStr(1, Packet, Chr(2)) > 0 Then
Dim Roomname As String
Dim packetDetails() As String
packetDetails() = Split(Packet, Chr(2))
Roomname = packetDetails(1)
WriteLog frmMain.rtbLog, "You are already in the " & Roomname & " chat room."
If RoomsHide_IsHiding(Roomname) = True Then ShowHiddenRoom Roomname
End If
End Sub

Public Sub HandleRoomList(Packet As String)
If InStr(1, Packet, Chr(2)) > 0 Then
'Room Packet format: "RUM()RumName2-Locked-Creator-0-200-joe>
frmChatRooms.lstRooms.ListItems.Clear
Dim strRoomList() As String
Dim strPacketDetails() As String
Dim strRoomInfo() As String
Dim strRoomName As String
Dim isLocked As Boolean
Dim usersInside As Integer
Dim strCreator As String
Dim intMax As Integer
Dim strPass As String
Dim strIcon As String
Dim i As Integer
strPacketDetails() = Split(Packet, Chr(2))
strRoomList() = Split(strPacketDetails(1), vbCrLf)
For i = 0 To UBound(strRoomList()) - 1
strRoomInfo() = Split(strRoomList(i), Chr(3))
strRoomName = strRoomInfo(0)
isLocked = strRoomInfo(1)
strCreator = strRoomInfo(2)
usersInside = strRoomInfo(3)
intMax = strRoomInfo(4)
strPass = strRoomInfo(5)
If isLocked = True Then strIcon = "closed"
If isLocked = False Then strIcon = "open"
With frmChatRooms.lstRooms.ListItems.Add(, , strRoomName)
.SmallIcon = strIcon
.SubItems(1) = usersInside
.Tag = intMax & Chr(2) & strPass
If strCreator = Nickname Then
.bold = True
.ForeColor = vbBlue
End If
End With
Next i
End If
End Sub

Sub HandleRoomCreatedSuccessfully(Packet As String)
If InStr(1, Packet, Chr(2)) > 0 Then
'RCT()roomname()sender()Message<<
Dim packetDetails() As String
packetDetails() = Split(Packet, Chr(2))
MsgBox "The room " & packetDetails(1) & " has been successfully created.", vbInformation
End If
End Sub

Sub SendRoomMessage(Roomname As String, Message As String)
Dim Packet As String
Packet = "RCT" & Chr(2) & Roomname & Chr(2) & Message & Chr(4)
SendData Packet
End Sub

Sub ReceiveRoomMessage(Roomname As String, Sender As String, Message As String)
If Sender = Nickname Then Exit Sub
If CheckIfUserIsBlocked(Sender) = True Then Exit Sub
Dim i As Integer
If RoomsHide_IsHiding(Roomname) = True Then ShowHiddenRoom (Roomname)
For i = 0 To UbRooms
If frmRooms(i).Caption = Roomname Then Exit For
Next i
WriteMesssage frmRooms(i).rtbChat, Sender, Message
End Sub

Sub HandleRoomMessage(Packet As String)
If InStr(1, Packet, Chr(2)) > 0 Then
'RCT()roomname()sender()Message<<
Dim packetDetails() As String
packetDetails() = Split(Packet, Chr(2))
ReceiveRoomMessage packetDetails(1), packetDetails(2), packetDetails(3)
End If
End Sub

Sub HandleRoomUserList(Packet As String)
'On Error Resume Next
'"RUS()RoomName()User1Name>>User2Name>>User3Name<<
If InStr(1, Packet, Chr(2)) > 0 Then
Dim packetDetails() As String
Dim Roomname As String
Dim roomUsers() As String
Dim i As Integer
packetDetails() = Split(Packet, Chr(2))
Roomname = packetDetails(1)
roomUsers() = Split(packetDetails(2), vbNewLine)
For x = 0 To UbRooms
If frmRooms(x).Caption = Roomname Then Exit For
Next x
For i = 0 To UBound(roomUsers())
If Not roomUsers(i) = "" Then
RemoveListItem frmRooms(x).lstRoomUsers, roomUsers(i), True
frmRooms(x).lstRoomUsers.AddItem roomUsers(i)
End If
Next i
End If
End Sub

emyztik
Mar 17th, 2009, 05:18 PM
progress?

IcyStorm
Apr 12th, 2009, 02:13 AM
I dont know how you guys did it but for a noob like me i need to bring a whole dictionary of codes and their meanings and how they work. Any ways I Want to know if there is Any Update on this thing cause I want to examine the code a lot to know better of this codes.





And For The chat program I am thinking if you could add their profile pics when on pm.

Hoping For the finished version. Good Luck!

emyztik
Apr 17th, 2009, 07:26 PM
progress now?

even if it is not complete DigiRev, release it :p

IcyStorm
Apr 18th, 2009, 03:44 AM
Maybe his busy right now or somethings wrong with his computer...

But Dont lose Hope(not the cigarettes) he will release the final version we all are waiting for.
But please release it As soon as possible.

emyztik
May 17th, 2009, 02:44 PM
meh..

yyxc819
Jun 5th, 2009, 08:53 PM
DigiRev

Please give some news, are you OK?

DigiRev
Jun 30th, 2009, 05:18 AM
I've been really busy and had to take a long hiatus from programming all-together.

I'm updating this project (well, actually started from scratch) so it will have a lot of new features (custom chat rooms, users can be in multiple rooms, password-protected rooms, etc.). This will hopefully hold you over until I finally finish the instant messenger, which had a lot of nasty bugs so I had to rewrite most of it. :sick:

Not to sound like I'm bragging, but the instant messenger will probably be the best one released that I'm aware of in VB6, even though there are tons of good ones on www.pscode.com. There are really tons of features...

Anyway, updated project will be posted soon and following, the instant messenger. :thumb:

DigiRev
Jul 1st, 2009, 04:23 PM
Here's just a few screen shots of the client... it's going to be a tabbed-based client, and function like FireFox, where each room you're in has its own tab.

There's also file transfers, and other stuff.

GDOG34
Jul 3rd, 2009, 07:13 PM
Cool! Im intrested in seeing how this comes out!

DigiRev
Jul 4th, 2009, 10:42 PM
It's almost done. :D

I had to remove the screenshot of the file transfers window, but it looks & functions like FireFox's download manager. ;)

Also, I might have to wait for webcam features since I need to find mine to be able to test it.

Another feature I'm adding is protocol support, so you can click a link in a web browser like: vbchat://ServerIP:Port and it will automatically launch the program and connect to the server.

IcyStorm
Jul 5th, 2009, 07:42 AM
Cool!!!
More than I expected.
Never thought of something like thing. I thought it would be simple. Maybe you could add a skin feature/themes wherein you can change skins/themes that you want and also make your own.

AnDa
Aug 18th, 2009, 06:36 PM
Look like a great project
Any updates?

cinaed666
Sep 14th, 2009, 04:04 PM
Hi, I've been tracking this thread for some time now..
I'm really looking forward to the new version.. any updates?

DigiRev
Sep 17th, 2009, 06:07 PM
It's almost done now. I had to start over some time ago, but I'm still working on the version shown in the screenshots.

I lost interest in this project awhile ago but still getting it done because I promised. ;) Not sure how many updates I'll do to it once this next one is released, but that's why it's open-source, right? ;) It will have a lot of features in it anyway.

RoflItsK
Sep 21st, 2009, 07:03 AM
Hey this was a great program, I added private messages, banning, kicking and muting within a half hour, its so easy to add more functions and its very user friendly.

DigiRev
Sep 21st, 2009, 11:27 PM
Hey this was a great program, I added private messages, banning, kicking and muting within a half hour, its so easy to add more functions and its very user friendly.

Thanks. :)

That was the goal: to make it easy to add/modify.

Hopefully this update, while it has a bunch of features and is completely different, will still be easy enough to modify and change stuff.

nazmiqasem
Sep 23rd, 2009, 03:14 AM
Hey this was a great program, I added private messages, banning, kicking and muting within a half hour, its so easy to add more functions and its very user friendly.

plez upload source code server+ client


thanks

nazmiqasem
Sep 23rd, 2009, 03:23 AM
hi guys

someone can developed more mod like :

private messages + buzz
avatar
banned
ignore
smiles
fonts type+ size + color
admin can create rooms
banned words
upload files share




thanks

ohailo
Nov 30th, 2009, 06:17 PM
i think its only work in a single computer not multi...?right? just like in your attachment pictures...and tyr'd it also but it's not working if u prefer to user it on other computer to other computer..sorry but i am not perfectly sure about this..it just my theory and my expirement explanation...

Condomx
Dec 11th, 2009, 05:43 AM
lol..when you connect,you must change the ip address in the corresponding ip address and port of the server who host that thing..ok.? like if the IP ADDRESS of the server is 10.0.0.9 and the server port is 123456 then you must put that IP ADDRESS and server port to the box so that you could connect...just like what i did.

Condomx
Dec 12th, 2009, 10:02 AM
nice!,simple but full of learnings..

itzviper
Dec 18th, 2009, 01:46 PM
DigiRev you forget about this thread again!?

CodeBlackRed
Apr 19th, 2010, 08:15 PM
hey... can i ask a multi user chat using vb6 that does not use modules?? i'm working on a chat room that does not use modules... client side and server side... :)

Condomx
Apr 20th, 2010, 06:27 AM
oh jesus... when could this project will be release.?

Arispan
May 16th, 2010, 07:50 AM
Hey DigiRev,

You can can upload the project here and we will fix the bugs (those that we can). ;)

emyztik
Jun 10th, 2010, 12:38 PM
progress?

Condomx
Jun 10th, 2010, 10:37 PM
no respond from him ..as he said he is out in programming at the moment,maybe at the moment means 5 years after or forever for simplicity

Arispan
Jun 25th, 2010, 05:32 AM
Digirev?????????????? :wave: Have you forgotten how to program in vb6 ? :)

emyztik
Jun 25th, 2010, 09:54 AM
no progress yet i see

killo
Jun 27th, 2010, 05:42 AM
what if I'm using this program behind a router where I'm not allowed to change the router settings to do port forwarding, at university for example.
There must be some way to do it without changing the router settings, after all, you don't need to change your router settings when you use MSN or anything.

minidesigner
Aug 4th, 2010, 03:55 PM
you don't have to mess with theprot forwarding with msn because you are not the host. you only have to port forward if someone outside your router is going to be using your chat system.

M
Nov 12th, 2010, 12:37 PM
Great Replies
Here is Messenger Im Working on it
Webcam Support
VB Support
Room
Private IM

http://0k.012.img98.com/out.php/i389243_resaneh4.jpg

But I Just Afraid From 1Thing:(
I Think If Users Grows up to 5000! Server Cant Handle it!
Which Language is Good For Writing Server?
VB6 is Poor For Server?

danecook21
Nov 17th, 2010, 11:20 AM
Why did you hijack a thread that was created 3 years ago to post a screenshot of your program?

paki42o
Nov 22nd, 2010, 05:33 AM
i want to know how can i save chat? i mean when ppl chat with tht program all gona be save when i admin login can view all chat wat ever thy chat in day user etc... if someone can help please share

minidesigner
Nov 22nd, 2010, 08:34 AM
if i'm reading what your asking correctly when you look at the original server console you see all the chat that there has been since you have been running it..... and you have the option i believe to save the chat to a file from the console if you want it to auto save the chat if i remember correctly you will have to program that yourself. i had to tweek the program myself to make the original work for me.

paki42o
Nov 22nd, 2010, 03:59 PM
i asked a friend same q he told me i have to make data base for save chat etc... so i have to know php code:-s
i got no idea about php lol so im not gonna coded::mad:
thanks for reply

minidesigner
Nov 22nd, 2010, 04:19 PM
if i can find the code i did i will post it tomorrow

M
Dec 4th, 2010, 04:15 PM
hijack?
I Just want to Ask a Question in this post[because most of those peoples come here! Know about Multi User Chatting Problems...! And U Say Why did u hijack...?
lol
Must of Guys post Screenshot! so is it problem?

M
Dec 4th, 2010, 04:24 PM
i asked a friend same q he told me i have to make data base for save chat etc... so i have to know php code:-s
i got no idea about php lol so im not gonna coded::mad:
thanks for reply

Why u use php?
U can store ur data in db with vb
Public dB As New ADODB.Connection

Sub OpenDB()
ConnectionString = "Driver={Microsoft Access Driver (*.mdb)};Dbq=mdbAccess.mdb;DefaultDir=" & App.Path & ";UID=;PWD=" ' mdbAccess is ur database name! i save mdbAccess.mdb in my Program path

dB.ConnectionString = ConnectionString
dB.ConnectionTimeout = 10
dB.Open
End Sub


and with this code[below] u can Save ur Chat Archives... in DB
Function AddMessageArchive(Username As String, Message As String) As Boolean
Dim rs As New ADODB.Recordset
rs.Open "Ranking", dB, adOpenKeyset, adLockOptimistic 'Ranking is ur table in db file
With rs
.AddNew
!Username = Username
!Message = Message
Err = 0
.Update
If Err <> 0 Then
AddRankInfo = False
Exit Function
End If
End With
AddMessageArchive = True
End Function


I HOpe U Got What I Say:-s

BPrashanthVB
Dec 4th, 2010, 04:39 PM
Yu could use OLEDB provider for speed while archiving messages.

damselindistress
Dec 12th, 2010, 05:03 AM
Here i come.. New to vb6....
I used the pretty cool Digirev's App. Gonna need help to work on it for my Term Project :)
Digi's work was very much helpful...got the basic stuff..
Sweet proj:)

Aaron02
Feb 14th, 2011, 07:05 PM
Digi

I'm trying to test your chat project (V 1 first file), but on my client-side pc it asked for the RICHTX32.OCX.
So I installed the file, and registered it using REGSVR32. My server side on a different pc operated perfectly.

The Client side still can't find the OCX, any suggestions?

minidesigner
May 13th, 2011, 10:07 AM
copy from the server machine and place in the correct folder should work then

minidesigner
May 13th, 2011, 10:08 AM
sorry i been away

VB Client/Server
Apr 17th, 2012, 08:24 AM
Well here is a huge revamp from my previous version. Please let me know if you find any bugs or have any suggestions. Feedback is much appreciated!

If you are trying to use the e-mail feature you will need to edit the SendMail sub and enter your gmail user account information. The only thing that is not functional server side is the chatrooms feature that is still a work in progress. Ignore any foul language in the code it is mostly me talking to myself. The main server is online so feel free to connect if you have questions or want to talk.

Thanks!

I use some part of code from post 132...
My question is how to modify server side code to accept only 1 connection at time ?

So that next client will wait until first client disconnect's...