01-22-2002, 08:40 AM
i really hope u guys can help me
i'm developing a chat/message (client-server program)and i'm basically having trouble with adding users to my contect list, Anyone has any idea on how to do so??? Any suggestions
Thanks in advance
01-22-2002, 09:01 AM
You're going to have to give us a lot more info than that before we can help.
01-22-2002, 09:57 AM
i'm basically designing a mutiuser chat (client server communication system) like icq each client has its own contect list stored. I'm currently having probelm figuring out how to make the program function as such. For example when i authorize the a user how do i add them into my contect list
01-22-2002, 12:42 PM
This is a huge question, and much of the answer depends on how you're implementing your system already.
Authenticating users would probly involve having them register a username and password, then storing it all in a database, which you can look up when they connect.
Adding them to your contact list depends on how you're storing the contact list. If its just a listbox then use
ListBox1.AddItem "item text"
If you're wondering how to store it in memory, I'd probly use a UDT myself, and have a linked list or an array of them, also saved on hard disk somewhere for safety.
The udt might have a structure like this:
Private Type ChatMember
Nick As String
Pass As String
Id As String
01-29-2002, 10:52 AM
Not sure if you are asking this as a high level questions or a low level. If you're talking low level then yes, all of the users contact information should be stored on the server and when they connect it gets downloaded to the client. (Therefore it is not machine dependent).
If you mean high level well the process would depend on how you are structuring your communication. This is what I did for my IM.
User1 wants to add User2.
User1 Clicks "Add" and types in User2's account name
User1's client send the request to the server which stores User2 in Users1's contancts list with the ID of "NotResolved". Meaning that User2 has not accepted this yet.
I recommend having User2 show up in User1s contact list even if the name is notresolved, and since User2 will always be offline until they accept (since updates should not be sent to User1 since they are not true contacts) you don't need to worry about User1 starting a conversation with User2 before they should!
When User2 logs in it prompts him/her to accept or deny User1 as a user.
If he accepts then:
Add User1 to User2's contact list with full rights
put in the queue a message to User1 saying that User2 accepted the request
Once User2 logs in tell him his request was accepted and change User2's status from "NotResolved" to "Resolved"
if he (User2) does not accept then:
put in the queue a message to User1 saying that User2 did not accept the request
Once user2 logs in tell him his request was rejected and remove User2 from his contact list.
Hopefully you understand what I mean, and hopefully this answers your question! :) Maybe one day I will write this up all nice and proper, until then you have to deal with my ramblings.