Summary design and detailed design
1.1. Overall Design Description First, in order to use the client, the IP address and port number of the server must be correctly configured. Of course, the server configuration can be modified at any time during the client's use, and re-login. Log in to the server with existing usernames and passwords. If you do not have a username, you can use the Registration New User dialog to register one; if there is no problem, the server works normally and is running, you can get the login result message. If due to various reasons, such as input password errors or servers are not properly configured, the network does not have correct configuration, the client will fail, the client will display the prompt information for "landing failed". If the login is successful, the client will display the welcome information from the server. Then the client requests the contact group information that the user owns the user. When the contact group information is returned, the client will re-establish the contact ID included in the client. Get the information summary of related contacts to display it on the client. You can modify the user's personal information stored on the server via the "Modify User Information" dialog box. During use, the user can implement the free move between the contact group through a simple drag and drop operation, and drag and drop the contact from the friend group to the blacklist or drag and drop from the stranger to the friend group. When it is obtained, the corresponding confirmation information will be obtained. When the group information is modified, the client will automatically synchronize the current user contact group data. When you don't use the software normally due to dining, you can use the software normally, you can notify all online friends by changing its contact status. When the contact is online, the lower line, and other status changes, the client can receive the corresponding prompt information, and the user can set whether these prompt information is displayed as needed. Regardless of the status of the contact, we can send a instant text message to him. When he is online, you can immediately receive these messages and responded according to the subjective need; when he is not online, you can accept it when he successfully logged in. To these messages. However, in order to mitigate the data storage pressure of the server side, we cannot send large data volume messages to offline contacts, such as file transfer. We can also find all users by searching contact features, if you enter empty lookup strings, the system returns all users' information summary and their online status. Of course, if you enter a non-empty lookup string, the system returns a matching user as well as their related data according to the regular expression rules. You can also add a search user as a friend as needed to view their details. 1.2. Flowchart 1.2.1. User registration 1.2.2. User login 1.2.3. User logout 1.2.4. Contact status change 1.2.5. Private chat 1.2.6. Text Broadcast 1.2.7. File Transfer 1.2. 8. Add a friend 1.2.9. Delete the friend 1.2.10. Search contact 1.2.11. Server status change 1.3. The overall structure of class design This project is developed by Visual Studio.Net 2003 Simplified Chinese version, with 8 sub-projects, respectively Both the core modules of the client, public module, multimedia, multimedia SDK, server, user interface, client installer, server installer, let's take a look at the core module (Common) class structure diagram : 1.4. The design of the data set is in the early stage of the project, since the data set concept is not used, but uses a custom class to implement data loading and saving. Later, the .NET Framework ADO.NET Dataset (DataSet) is used to represent, process, query, and save data, making it extremely convenient to store data directly with XML files regardless of using data stock data.
1. Online User Table Name Description Type ID User Name String 2. User Table Name Description Type Address Address String Age Int City String Country Country String Description Personal String Email Email String Face Image INT GENDER Gender (Male) true, String HomePage female false) Bool GraduateSchool graduated profile String Id user name String Mp mobile phone real name String name String nickName nickname string Occupation career String password password String phone String province fixed telephone provinces String ZipCode ZIP code String No No Int 3. Message Table Name Description Type Content Content String ID Message Number INT To Receiver User Name String Viewed Receiver Whether you have viewed BOOL 4. Contact Group Name Description Type Owner This Contact String Information Owner ID String Data Contains Data XML Document Text String 1.5. Message Definition In this system, all messages are inherited in the Org.inteliim.instantMessage class, and its attribute list is as follows: Name Description Type From Send This message String To Receives the user name String This message also defines two ways to implement serialization: Name Description Serialize () Serialization Deserialize (String Text) Anti-serialization is different according to the status of both communication, can be divided into messages between the client and the server. Org.inteliim.csinStantMessage and the message between the client and the client org.inteliim.p2pinstantMessage. Below we describe the definition of each message in accordance with the first alphabetical order:
1.5.1. Chat 1.5.1.1. Text Broadcast MessageBroadcast Name Description Type Subject Theme String Content Content String 1.5.1.2. Private Text Chat Message MessagePrivateChat Name Description Type Content Content String 1.5.2. Test Connection Messages MessageTestConnection1.5.2.2. test the connection response message MessageTestConnectionReply1.5.3. contact management 1.5.3.1. MessageContactList return messages contact list name description type contacts contacts that match the specified criteria list UserSummaryCollection 1.5.3.2. contact status change notification message MessageContactStatusChanged Name Description Type ID Status Change contact User name String Status changed contact status ContactStatus 1.5.3.3. Get contact information MessagegetContactInfo Name Description Type ID Contact User name String 1.5.3.4. Get contact information message MessagegetContactInforeSult Name Description Type Contact User Information User 1.5.3.5. Get Specify Contacts Collection Data Summary Message MessagegetContacts Name Description Type IDS Contact User Name Collection StringCollection 1.5.3.6. Get the contact list Message MessageSearchContacts Name Description Type Tosearch needs Search string string 1.5.3.7. Set contact status MessageStatus name Description Type Status contact status ContactStatus 1.5.4. File Transfer 1.5.4.1. File Transfer Data Message FileEfileTransfer Name Description Type FileName Transport file name String No sequence number INT CANCEL Whether to cancel whether BOOL BEGIN is transferred to the booth BOOL END to transfer data byte [] 1.5.4.2. Invitation file transfer message MessageInviteFileTransfer Name Description Type FileName Transport file name string 1.5.4.3. Invitation file Transfer Answer Message MessageInviteFileTransferReply Name Description Type FileName Transport file name String OK The other party accepts BOOL 1.5.5. Friend management 1.5.5.1. Add friends message MessageAddFriend name description type RequestContent request content string 1.5.5.2. Add friend result message whether MessageAddFriendResult name description type Ok success Bool FailedReason added reason for the failure of a friend AddFriendFailedReason 1.5.6. client login 1.5.6.1. client login message MessageLogin name description Type USER User Data User 1.5.6.2. Client Login Result Message MessageLoginResult Name Description Type USER server returned User information User OK Whether to log in Success Bool FaileDreason's landing failure String 1.5.7.1 Forced client logout message MessageForcelogout Name Description Type FaileDreason Cause Forcelogoutreason 1.5.7.2. Client Logout MessageLogout1.5.8. User Registration 1.5.8.1. User Request Registration MessageRegistration Name Description Type USER User User Information User 1.5 .8.2. User registration result message m
EssageRegistrationResult Name Description Type FaileDreason Registration Cause String OK Register Success Bool 1.5.9. System Maintenance and Management 1.5.9.1. MessageRroroccurred Name Description Type FaileDreason occurs when an error occurs String 1.5.9.2. Server Status Change Message MessageServerServiceStatusChangeD Name Description Type Status changed server status ServerStatus 1.5.10. User Management 1.5.10.1. Get a specific user contact message MessageTContactGroups1.5.10.2. Get a specific user Contact Result message MessageTContactGroupSResultAgeGetContactGroupsResult description type ContactGroups contact group ContactGroupCollection 1.5.10.3. modifying user data messages MessageModifyUserInfo user name description type the new user information user 1.5.10.4. modify user name description MessageModifyUserInfoResult result message returned by the server type user Profile user Ok modified successfully Bool the reason FailedReason modify the failure string 1.5.10.5. setting a specific user's contact group messages MessageSetContactGroups name description type ContactGroups contact group ContactGroupCollection 1.5.10.6. setting a specific user's contact group result message MessageSetContactGroupsResult name description type Ok if successfully set bool FailedReason Setting the reason for the failure String 1.6. The implementation system of the underlying communication uses the UDP to implement the underlying data transmission, so it can be transferred in the local area network. In order to get good scalability, we use a separate class to be responsible for the most underlying network transmission: Org.inteliim.ImCommunicator, instant messator class. This class is responsible for the sending and reception of messages, receiveMessage (), and SendMessage (InstantMessage). And Org.inteliim.immodule is responsible for launching and stopping communication services, such as start () and stop () methods, is a common instant messaging required module, server-side class, and client classes inherited in it. The server-side and clients overload the relevant methods separately to achieve the launch and stop of the relevant service and the login and logout of the client. It is worth mentioning that the process of sending instant messages in the client is like this: the client sends a message, if the message accepts the acceptor user online, then send it to the user directly, the P2P mode; otherwise send it to the server, and is saved by the server. When the recipient user logs in again, the server sends offline messages that have not yet received, so that he can see the offline message you sent; of course, you can't transfer file transfer and voice chat with offline users. At the same time online task. 1.7. Service Management In order to unify various service management, we have designed some basic methods for providing universal service management, such as load and saving. 1.7.1. User management system is almost all of the server-side implementation, org.inteliim.usermananger class implements the maintenance feature of all server-side user information, such as adding, deleting, modifying user information, user login, logout Maintain an online user list, maintaining an instant message belonging to a specific user, maintaining the contact group information of the user, and so on. It is derived from the service manager Org.inteliim.ServiceManager class. The UserManager class contains a class